Created
January 21, 2019 20:35
-
-
Save yagudaev/8cdac81749f16ba28e2745f0925c43f9 to your computer and use it in GitHub Desktop.
Testing Your Frontend with Cypress.io Framework
This file contains hidden or 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/support/commands.js | |
Cypress.Commands.add('login', (email, password) => { | |
cy.request({ | |
method: 'POST', | |
url: 'http://localhost:300/api/v1/users/login', | |
body: { | |
user: { | |
email, | |
password | |
} | |
} | |
}) | |
.then((res) => { | |
window.localStorage.setItem('jwt', res.body.user.token) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment