Last active
September 9, 2023 23:49
-
-
Save oimtrust/cfe1f380456f18e69b526603902e8a5c to your computer and use it in GitHub Desktop.
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.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