mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-07 15:52:47 +01:00
29 lines
852 B
JavaScript
29 lines
852 B
JavaScript
// ***********************************************************
|
|
// global configuration
|
|
// https://on.cypress.io/configuration
|
|
// ***********************************************************
|
|
|
|
import './commands'
|
|
|
|
Cypress.Cookies.defaults({
|
|
preserve: 'user',
|
|
})
|
|
|
|
Cypress.on('uncaught:exception', (err, runnable) => {
|
|
return false
|
|
})
|
|
|
|
Cypress.Commands.add('login', (options = {}) => {
|
|
if (Cypress.env('AUTH') === 'simple') {
|
|
cy.contains("Name").click({force: true});
|
|
cy.get("#username").type("tom");
|
|
cy.contains("Password").click({force: true});
|
|
cy.get("#password").type("tom");
|
|
cy.get("button").contains("Login").click();
|
|
} else if (Cypress.env('AUTH') === 'keycloak') {
|
|
cy.get("#username").type("bob");
|
|
cy.get("#password").type("bob");
|
|
cy.get("#kc-login").click();
|
|
}
|
|
})
|