-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
weskubo-cgi
authored and
weskubo-cgi
committed
Oct 16, 2024
1 parent
488c104
commit d5861d4
Showing
1 changed file
with
29 additions
and
29 deletions.
There are no files selected for viewing
58 changes: 29 additions & 29 deletions
58
testing/cypress/e2e/1-portal-and-crm-login-and-security/portal_login.cy.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
const USERNAME = Cypress.env("PORTAL_USERNAME"); | ||
const PASSWORD = Cypress.env("PORTAL_PASSWORD"); | ||
const PORTAL_URL = Cypress.env("PORTAL_URL"); | ||
const USERNAME = Cypress.env('PORTAL_USERNAME') | ||
const PASSWORD = Cypress.env('PORTAL_PASSWORD') | ||
const PORTAL_URL = Cypress.env('PORTAL_URL') | ||
|
||
describe("Login to Portal", () => { | ||
it("system messages", () => { | ||
cy.visit(PORTAL_URL); | ||
cy.get('div[role="alert"]').contains("Test Message"); | ||
}); | ||
it("successful login", () => { | ||
cy.loginToPortal(USERNAME, PASSWORD, PORTAL_URL); | ||
cy.visit(PORTAL_URL); | ||
describe('Login to Portal', () => { | ||
it('system messages', () => { | ||
cy.visit(PORTAL_URL) | ||
cy.get('div[role="alert"]').contains('Test Message') | ||
}) | ||
it('successful login', () => { | ||
cy.loginToPortal(USERNAME, PASSWORD, PORTAL_URL) | ||
cy.visit(PORTAL_URL) | ||
|
||
// Facility is hidden in Org header | ||
cy.get("#changeFacility").should("not.exist"); | ||
cy.get('#changeFacility').should('not.exist') | ||
|
||
// All cards are available to Account Manager | ||
cy.get("#reporting-card").should("exist"); | ||
cy.get("#funding-card").should("exist"); | ||
cy.get("#assistance-card").should("exist"); | ||
cy.get("#applications-card").should("exist"); | ||
cy.get("#account-mgmt-card").should("exist"); | ||
cy.get("#help-card").should("exist"); | ||
}); | ||
cy.get('#reporting-card').should('exist') | ||
cy.get('#funding-card').should('exist') | ||
cy.get('#assistance-card').should('exist') | ||
cy.get('#applications-card').should('exist') | ||
cy.get('#account-mgmt-card').should('exist') | ||
cy.get('#help-card').should('exist') | ||
}) | ||
|
||
it("failed login", () => { | ||
it('failed login', () => { | ||
// SSO has error in application code on failed login | ||
cy.on("uncaught:exception", (e) => { | ||
return false; | ||
}); | ||
cy.loginToPortalNoSession("doesnotexist", "password", PORTAL_URL); | ||
cy.visit(PORTAL_URL); | ||
cy.on('uncaught:exception', (e) => { | ||
return false | ||
}) | ||
cy.loginToPortalNoSession('doesnotexist', 'password', PORTAL_URL) | ||
cy.visit(PORTAL_URL) | ||
// Should be back on Login screen | ||
cy.get("a[id=bceid-login").should("exist"); | ||
cy.get("#reporting-card").should("not.exist"); | ||
}); | ||
}); | ||
cy.get('a[id=bceid-login').should('exist') | ||
cy.get('#reporting-card').should('not.exist') | ||
}) | ||
}) |