cypress fails tests randomly in headless mode but all passes all tests in real browse

Viewed 875

I use Cypress 9.5 to test application in Angular 13. As a backend I have local server in PHP.

I have bunch of tests. When I run them in browser they all pass several times. When I run in headless mode they fail quite randomly. In both cases I use built-in electron browser.

In my tests I have log in as command using cy.request and storing required user data in sessionStorage. Then when I want to visit main page - login dialog appears.

How can I debug this to find a root cause?

Hint: watching videos from tests I can observe big lags in refreshing rendered image comparing to real browser.

1 Answers

We had a similar issue, and after disabled the video, the ghost is gone.

Related