Firefox Cross Origin Error Causing False-Positives / Unusual Errors #26484
Labels
browser: firefox
E2E
Issue related to end-to-end testing
Triaged
Issue has been routed to backlog. This is not a commitment to have it prioritized by the team.
type: bug
type: unexpected behavior
User expected result, but got another
Current behavior
In Cypress <12, test would fail with the following error:
In Cypress 12+
This error occurs ONLY in Firefox.
Findings
Issue: Chrome is working as expect by showing the correct error, where Firefox is showing this weird TypeError instead of the expected Cypress command error.
Findings: I have gone down quite the rabbit hole with this issue & I have narrowed down what is likely causing this issue to present itself.
cy.get('.template-grid-item-title').should('be.visible')
tocy.get('.template-grid-item-title')
(I reduced this because get will verify existence for the use).cross-origin script error
surfacing in the second test from the first test’s fetch requests bleeding over (known issue but can’t find it 😕 )cy.get('.template-grid-item-title')
command to incorrectly “pass” when it doesn't existcy.get('.template-grid-item-title').should('be.visible')
to report the weirdTypeError: $el.css is not a function
error because the subject never successfully queried and is undefined.cy.wait(7000)
(arbitrary timeout) to the first test, I am no longer seeing thecross origin script error
and see no issues with querying the page in the second testbeforeEach
hook and move callingcy.session()
into the test body of each test, I am getting a false-positive passing test when no cypress commands actually executing at all 😰Seem like this is an issue combination with test isolation + hanging xhr requests bleeding into the next test + Cypress doing something funky when it sees that error and providing false-positives when running in Firefox.
Desired behavior
Cypress correctly fails when
cross-script
error occurs in Cypress instead of false-reporting and/or skipping hooks in the queue.Test code to reproduce
Cypress Version
12.9.0
Node version
16.16.0
Operating System
MacOS 12.5.1
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: