zitadel/e2e/cypress/support/commands.ts
Max Peintner fc4f4096e0
chore(e2e): formatting with prettier (#4385)
* prettier in e2e

* format

* typescript as dev dependency

* ci all, check linting

* resolve liniting issues

* fix wait-on

* fix package-lock.json

Co-authored-by: Elio Bischof <eliobischof@gmail.com>
2022-09-19 19:49:46 +02:00

27 lines
790 B
TypeScript

/*
namespace Cypress {
interface Chainable {
*/
/**
* Custom command that authenticates a user.
*
* @example cy.consolelogin('hodor', 'hodor1234')
*/
/* consolelogin(username: string, password: string): void
}
}
Cypress.Commands.add('consolelogin', { prevSubject: false }, (username: string, password: string) => {
window.sessionStorage.removeItem("zitadel:access_token")
cy.visit(Cypress.config('baseUrl')/ui/console).then(() => {
// fill the fields and push button
cy.get('#loginName').type(username, { log: false })
cy.get('#submit-button').click()
cy.get('#password').type(password, { log: false })
cy.get('#submit-button').click()
cy.location('pathname', {timeout: 5 * 1000}).should('eq', '/');
})
})
*/