I have tests in which i used the cypress-promise library. I have included promisify in that to wait until my commands are executed and give response. in my file i have 3 it's block when i ran individually it executes properly but when i run all at once first it and second it's api's aborted when url changes or url updated and last one's test are executed properly.
it("visit particular employee", async ()=>{
cy.visit("/")
const id = 12
const updatedEmployeeData = await cy.uploadEmployeeData().promisify();
cy.visit(`/all-employess/${updatedEmployeeData[id].employeeCode}`);
cy.get('.input').type(updatedEmployeeData[id].name);
})
it("visit particular employee 2", async ()=>{
cy.visit("/")
const id = 13
const updatedEmployeeData = await cy.uploadEmployeeData().promisify();
cy.visit(`/all-employess/${updatedEmployeeData[id].employeeCode}`);
cy.get('.input').type(updatedEmployeeData[id].name)
})
it("visit particular employee", async ()=>{
cy.visit("/")
const id = 14
const updatedEmployeeData = await cy.uploadEmployeeData().promisify();
cy.visit(`/all-employess/${updatedEmployeeData[id].employeeCode}`);
cy.get('.input').type(updatedEmployeeData[id].name)
})
in first it and second it after cy.visit(`/all-employess/${updatedEmployeeData[id].employeeCode}`); it stops executing and in third it properly executes.
I don't understand with this approach;