Skip to content
Permalink
7dd4b5d5d8
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
jgiwinski update favicon
Latest commit 7dd4b5d Jan 29, 2024 History
0 contributors

Users who have contributed to this file

62 lines (44 sloc) 1.76 KB
context('SACDS', () => {
beforeEach(() => {
cy.visit('http://localhost:3000/')
})
describe('Page display', () => {
it('Displays Incommon logo', () => {
cy.get('img')
.should('be.visible')
.should('have.class', 'logo')
})
it('Displays information text', () => {
})
it('Displays Seamless Action button on page', () => {
cy.get('a.sa-button')
.should('be.visible')
.and('have.attr', 'href')
.then((hrefAttribute) => {
// Extract entityID and returnUrl from the href attribute
const urlParams = new URLSearchParams(hrefAttribute);
const entityID = urlParams.get('entityID');
const returnUrl = urlParams.get('return');
// Assert that entityID and returnUrl are present and not empty
expect(entityID).to.be.a('string').and.not.empty;
expect(returnUrl).to.be.a('string').and.not.empty;
cy.get('.sa-button-logo').should('be.visible');
cy.get('.sa-button-text').should('be.visible').and('contain.text', 'Access through your institution');
});
})
it('Hides SA button and displays error message and wiki link if entityID or returnUrl are missing', () => {
cy.get('.sa-button').should('not.exist');
cy.get('h1').should('be.visible').and('contain.text', 'Both Entity ID and return URL are required.');
cy.get('p a')
.should('be.visible')
.and('have.attr', 'href', 'LINK_FROM_I2');
cy.get('p a').should('contain.text', 'Click Here for more information.');
})
})
describe('SA button functionality', () => {
it('Takes in entityID and returnUrl from URL and feeds to SA button', () => {
})
it('Routes user to their entity after clicking SA button', () => {
})
})
})