Created
November 13, 2018 19:30
-
-
Save danlourenco/7fd970ac8c0f9599608c1588828edae9 to your computer and use it in GitHub Desktop.
Using Cypress commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cypress.Commands.add('login', (overrides = {}) => { | |
Cypress.log({ | |
name: 'loginViaAuth0', | |
}); | |
const options = { | |
method: 'POST', | |
url: Cypress.env('auth_url'), | |
body: { | |
grant_type: 'password', | |
username: Cypress.env('auth_username'), | |
password: Cypress.env('auth_password'), | |
audience: Cypress.env('auth_audience'), | |
scope: 'openid profile email', | |
client_id: Cypress.env('auth_client_id'), | |
client_secret: Cypress.env('auth_client_secret'), | |
}, | |
}; | |
cy.request(options); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment