You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following error originated from your test code, not from Cypress. It was caused by an unhandled promise rejection.
> Oops, it looks like you are trying to call a child command before running a parent command.
You wrote code that looks like this:
cy.as("getAppSettings")
A child command must be chained after a parent because it operates on a previous subject.
Clearly something else is going on because I am not doing what the error says I'm doing. It seems like an unhandled exception occurring in the prior test causing an error to be misidentified. If I skip the prior test, this does not occur.
Desired behavior
Cypress should show the actual unhandled exception
Test code to reproduce
I cannot reproduce in a minimal enough way to share the full code.
Cypress Version
13.15.1
Node version
20.18.0
Operating System
Ubuntu 22.04.4 LTS
Debug Logs
I didn't see any debug output relating to this issue.
Other
I think the uncaught exception is due to an error being thrown in the browser after a previous test has completed, and that is being caught by the next test and erroneously associated with the currently executing command.
The text was updated successfully, but these errors were encountered:
Actually, this may be even simpler. It looks like in this test suite, someone erroneously made their test block an async function which I know is incorrect. Changing that fixes the issue. Maybe Cypress can detect if a Promise is returned when running a test and tell the user that they should not be using an an async function.
Current behavior
I'm occasionally getting an error in my test suite. I have a
beforeEach
hook like this:...and sometimes I get a failure like this:
Clearly something else is going on because I am not doing what the error says I'm doing. It seems like an unhandled exception occurring in the prior test causing an error to be misidentified. If I skip the prior test, this does not occur.
Desired behavior
Cypress should show the actual unhandled exception
Test code to reproduce
I cannot reproduce in a minimal enough way to share the full code.
Cypress Version
13.15.1
Node version
20.18.0
Operating System
Ubuntu 22.04.4 LTS
Debug Logs
I didn't see any debug output relating to this issue.
Other
I think the uncaught exception is due to an error being thrown in the browser after a previous test has completed, and that is being caught by the next test and erroneously associated with the currently executing command.
The text was updated successfully, but these errors were encountered: