Currently, I am utilizing Cypress 9.5 to conduct tests on an Angular 13 application with a local PHP server as the backend.
Throughout the testing process, I have encountered successful results when running the tests in the browser multiple times. However, when switching to headless mode, the tests tend to fail randomly. It's worth noting that I utilize the built-in electron browser for both scenarios.
One specific issue arises during the test where I log in using the cy.request
command and store necessary user data in sessionStorage
. Subsequently, when attempting to visit the main page, a login dialog prompts unexpectedly.
To address this challenge, I am seeking guidance on how to effectively debug and uncover the root cause of these failures.
As a helpful hint, upon reviewing videos from the test executions, noticeable delays exist in refreshing the rendered image compared to interactions in a real browser environment.