Skip to content

Instantly share code, notes, and snippets.

@NilukaSripalim
Created February 27, 2022 19:25
Show Gist options
  • Save NilukaSripalim/a1d3235a28a62852ba9e1ecabe4cbf55 to your computer and use it in GitHub Desktop.
Save NilukaSripalim/a1d3235a28a62852ba9e1ecabe4cbf55 to your computer and use it in GitHub Desktop.
Asgardeo Sign in Cypress Test
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