many-needle-50240
02/24/2023, 3:17 PMdescribe("Cypress", () => {
it("opens the app", () => {
cy.visit("http://localhost:3000")
})
it("opens the app and clicks on a hotel", () => {
//cy.visit("http://localhost:3000")
cy.get("a").first().click()
cy.location("pathname").should("include", "hotel")
})
it("navigates to the form to add a review", () => {
//cy.visit("http://localhost:3000")
//cy.get("a").first().click()
cy.get("button").contains("+ Add Review").click()
cy.location("pathname").should("include", "new")
})
})bitter-fountain-36713
02/24/2023, 3:19 PMmany-needle-50240
02/24/2023, 3:20 PMmany-needle-50240
02/24/2023, 3:20 PMlate-planet-4481
02/24/2023, 3:29 PMlate-planet-4481
02/24/2023, 3:31 PMmany-needle-50240
02/24/2023, 3:31 PMmany-needle-50240
02/24/2023, 3:32 PMlate-planet-4481
02/24/2023, 3:33 PMmany-needle-50240
02/24/2023, 3:34 PMthis test builds upon the previous test and is therefore already at the correct pagemany-needle-50240
02/24/2023, 3:34 PMlate-planet-4481
02/24/2023, 3:35 PMmany-needle-50240
02/24/2023, 3:35 PMenough-truck-68085
02/24/2023, 3:36 PMTest Isolation to false but it's also not recommended due to previously mentioned best practices.
I would say the book you are reading is likely out-of-date and not the ideal source material.....
https://docs.cypress.io/guides/core-concepts/test-isolationenough-truck-68085
02/24/2023, 3:36 PMmany-needle-50240
02/24/2023, 3:38 PMmany-needle-50240
02/24/2023, 3:38 PMmany-needle-50240
02/24/2023, 3:47 PM