I'm testing the user settings with cypress, I want to reset the password in before block so that even if the test change the password, before running it must be able to reset the password to default.
I have implemented the reset password spec and the login command
(cy) .login( Cypress.env("GATEWAY_URL") + "auth/get_token/", "prashidi174@gmail.com", "aeropass" ) .then(function(token: string) { authToken = token; if (authToken !== "") { return cy.request({ url: ("some url"), headers: { Authorization: authToken } }); } else { (cy) .login( url, "prashidi174@gmail.com", "aeropass" ) .then(function(token: string) { authToken = token; return cy.request({, headers: { Authorization: authToken } }); }); } }) .then(function(response) { cy.visit("aeroview"); });
I want to be able to catch the if the login fails with the wrong credential then try to login with other creadential
Aucun commentaire:
Enregistrer un commentaire