add cypress login commands
This commit is contained in:
parent
95f7f1cb78
commit
49c5ed49b0
1 changed files with 15 additions and 25 deletions
|
|
@ -1,25 +1,15 @@
|
||||||
// ***********************************************
|
Cypress.Commands.add('login', (email, password) => {
|
||||||
// This example commands.js shows you how to
|
cy.request({
|
||||||
// create various custom commands and overwrite
|
method: 'POST',
|
||||||
// existing commands.
|
url: '/api/auth/login',
|
||||||
//
|
body: { email, password },
|
||||||
// For more comprehensive examples of custom
|
})
|
||||||
// commands please read more here:
|
})
|
||||||
// https://on.cypress.io/custom-commands
|
|
||||||
// ***********************************************
|
Cypress.Commands.add('loginAsAdmin', () => {
|
||||||
//
|
cy.login('admin@example.com', 'admin1234')
|
||||||
//
|
})
|
||||||
// -- This is a parent command --
|
|
||||||
// Cypress.Commands.add('login', (email, password) => { ... })
|
Cypress.Commands.add('loginAsUser', () => {
|
||||||
//
|
cy.login('user@example.com', 'password1')
|
||||||
//
|
})
|
||||||
// -- This is a child command --
|
|
||||||
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// -- This is a dual command --
|
|
||||||
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// -- This will overwrite an existing command --
|
|
||||||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue