IO-2327 tests for login and reset password
This commit is contained in:
@@ -22,4 +22,30 @@
|
||||
//
|
||||
//
|
||||
// -- This will overwrite an existing command --
|
||||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
|
||||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
|
||||
|
||||
Cypress.Commands.add("goToSignInPage", () => {
|
||||
cy.visit("/");
|
||||
cy.contains("Sign In").click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add("login", (username, password) => {
|
||||
cy.goToSignInPage();
|
||||
|
||||
cy.get('[data-cy="username"]').type(username);
|
||||
cy.get('[data-cy="password"]').type(password);
|
||||
cy.get('[data-cy="sign-in-button"]', { timeout: 2000 }).click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add("passwordReset", (email) => {
|
||||
cy.goToSignInPage();
|
||||
cy.get('[data-cy="reset-password"]').click();
|
||||
cy.get('[data-cy="reset-password-email-input"]').type(email);
|
||||
cy.get('[data-cy="reset-password-button"]').click();
|
||||
});
|
||||
|
||||
Cypress.on("uncaught:exception", (err, runnable) => {
|
||||
// returning false here prevents Cypress from
|
||||
// failing the test
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// ***********************************************************
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import './commands'
|
||||
import "./commands";
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
||||
// require('./commands')
|
||||
|
||||
Reference in New Issue
Block a user