Mark
Mark

Reputation: 1551

Cypress test ran with browser vs head-lessly

How can I debug a test that is failing when ran headlessly but passing when ran with a opened browser ?

below is the error I'm getting when running the test without opened browser:

AssertionError: Timed out retrying: Expected to find content: 'Logout' within the element: [ <a.navbar-item>, 2 more... ] but never did.

Meaning ... the test passes locally but fails within CI tool. Please ask if you need to know any details.

enter image description here

Upvotes: 1

Views: 665

Answers (1)

John Brandli
John Brandli

Reputation: 110

I would suggest recording a video and using console.log statements in your test. https://docs.cypress.io/guides/guides/screenshots-and-videos.html#Screenshots

Upvotes: 1

Related Questions