Permalink
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?
wayfinder/cypress/e2e/spec.cy.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
62 lines (44 sloc)
1.76 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', () => { | |
}) | |
}) | |
}) | |