Skip to content

Instantly share code, notes, and snippets.

@oimtrust
Last active September 9, 2023 23:49
Show Gist options
  • Save oimtrust/0b42f1510276990cb86811c5f2ef850b to your computer and use it in GitHub Desktop.
Save oimtrust/0b42f1510276990cb86811c5f2ef850b to your computer and use it in GitHub Desktop.
import cookies from 'js-cookie'
Cypress.Commands.add('login', () => {
cy.request({
method: 'POST',
url: 'https://mercury.gelora.id/users/login',
body: {
credential: 'Ansley94',
password: '12345678',
}
})
.then((resp) => {
// window.localStorage.setItem('jwt', resp.body.data.token)
cookies.set('__token__', resp.body.data.token)
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment