Created
February 27, 2022 19:25
-
-
Save NilukaSripalim/a1d3235a28a62852ba9e1ecabe4cbf55 to your computer and use it in GitHub Desktop.
Asgardeo Sign in Cypress Test
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
describe('Successfully Sign-in to Asgardeo ', () => { | |
before(() => { | |
cy.window().then((win) => { | |
win.onbeforeunload = null; | |
}); | |
// Visit Asgardeo console | |
cy.visit("https://dev.console.asgardeo.io/", { | |
onBeforeLoad: (win) => { | |
win.sessionStorage.clear(); | |
} | |
}); | |
}); | |
it("User try to successfully Sign-in", () => { | |
//Provide username & press Enter. | |
cy.get("#usernameUserInput").type("<username>{enter}", { log: false }); | |
//Provide Password & Press Enter | |
cy.get("[data-testid=\"login-page-password-input\"]").type("<password>{enter}", { log: false }); | |
// Validate whether user able to successfully sign-in. | |
cy.get("[data-testid=\"welcome-greeting-header\"]").should("contain", "Welcome") | |
}); | |
}); | |
/** | |
* returning false here prevents Cypress from failing the test | |
* expect(err.message).to.include('Ignoring error for now'); | |
*/ | |
Cypress.on("uncaught:exception", (err, runnable) => { | |
console.log("Cypress detected uncaught exception", err); | |
return false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment