Skip to content

Instantly share code, notes, and snippets.

@oimtrust
Last active September 9, 2023 23:49
Show Gist options
  • Save oimtrust/cfe1f380456f18e69b526603902e8a5c to your computer and use it in GitHub Desktop.
Save oimtrust/cfe1f380456f18e69b526603902e8a5c to your computer and use it in GitHub Desktop.
Cypress.Commands.add('loginAdmin', () => {
cy.request({
method: 'POST',
url: 'https://api.pama.dot.co.id/api/v1/login',
body: {
email: '[email protected]',
password: 'rahasia123',
}
})
.then((resp) => {
window.localStorage.setItem('token', resp.body.data.token)
window.localStorage.setItem('supplier_no', JSON.stringify(resp.body.data.supplier_no[0]))
window.localStorage.setItem('profile', JSON.stringify(resp.body.data))
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment