dimanche 7 juin 2020

How can I inject data to the react state with cypress?

My application needs the user data that is obtained when the user logs in. Now I am trying to test the login with cypress but I don't know how to make it save in the state what I receive in the request that is executed when we click on login

it('button', () => {
      const input0 = "Lorena"
      const input1= "insuaregueiro3r"
      cy.get('.form-control').eq(0).type(input0)
      .get('.form-control').eq(1).type(input1)
      .get('.btn').click().then(() => {
        cy.visit('http://localhost:3000/')
});

The test is ok but doesn't enter in home

Aucun commentaire:

Enregistrer un commentaire