79275531

Date: 2024-12-12 14:50:33
Score: 0.5
Natty:
Report link

I want to load my webpage once and then run several tests on it without it reloading between tests.

This is the core of what is causing your issues, as it is conflict with Cypress' Test Isolation.

As stated in our mission, we hold ourselves accountable to champion a testing process that actually works, and have built Cypress to guide developers towards writing independent tests from the start.

We do this by cleaning up test state and the browser context before each test to ensure that the operation of one test does not affect another test later on. The goal for each test should be to reliably pass whether run in isolation or consecutively with other tests. Having tests that depend on the state of an earlier test can potentially cause nondeterministic test failures which makes debugging challenging.

So, with the default value for Test Isolation (enabled), Cypress will clean up the browser context, which includes "shutting down" the browser. While it is possible to disable Test Isolation, I would strongly encourage you not to do that and instead look at the reasons why you feel that you should only launch the webpage once and then run several tests on it.

Could you use cy.session() to expedite setting data on launching the webpage? If there are network calls that are slowing down navigating to the page that could be mocked out via cy.intercept()?

Reasons:
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-1):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • High reputation (-1):
Posted by: agoff