vendredi 17 janvier 2020

CYPRESS - How to get a user's token to acess other tab in the same Cypress window, putting cy.visist(URL + TOKEN)

Node.js and Cypress

I have a system that I do a login and password. After I did a login I have one funcionality the I need to click and go to new another Browser Tab. I tried to get a botton click and go to this tab, but the Cypress lose the control of the aplication and open a new window, don't opening the tab on the same Cypress window. When I tried to put the tab url on cy.visit to open manual the tab, the system no open this tab, return to login page, because the user's token is shown on url of the new tab that I want to acess. For this reason I can't visit this tab from cy.visit, because this url can be dinamic.

How I can get the token to try visit 'url + token' from website and open this tabe on the same Cypress widown? Or is there some different way to open this new tab on crypress test.

Aucun commentaire:

Enregistrer un commentaire