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
I have a simple test where I do a log in and next I send a http request. What happens is that before() function is executed twice (is doubled) before two tests in this test suite - so overall it runs 4 times.
Observation:
When I run this test from Cypress runner (UI), it fails ALWAYS for the first time after opening the runner, next runs are fine
Because first runs always fail - in the pipeline or when running from cli it always fails
In the second test in this test suite I log in in UI and despite the fact that the domain is the same as baseUrl, test is restarted and state is lost, e.g. variables "lose" it's values! - this is causing test to fail
The fact that before is executed twice per test seems to be irrelevant with the fact that it's being executed in two tests in this test suite because even if I run the test for the second time (so it passes and test doesn't restart) before is executed twice before first test
screenshot on first run:
next run:
Desired behavior
before executed only once and before one test
test not restarted
state not lost
Test code to reproduce
due to company policy I can't paste the code but it's pretty simple:
test suite:
test 1: send some API requests
test 2: log in in UI and next send API request
in e2e.ts I defined common before() function
Cypress Version
13.17.0
Node version
v20.14.0
Operating System
Microsoft Windows 10 Enterprise - 10.0.19045 Build 19045
Debug Logs
Other
No response
The text was updated successfully, but these errors were encountered:
Current behavior
I have a simple test where I do a log in and next I send a http request. What happens is that
before()
function is executed twice (is doubled) before two tests in this test suite - so overall it runs 4 times.Observation:
before
is executed twice per test seems to be irrelevant with the fact that it's being executed in two tests in this test suite because even if I run the test for the second time (so it passes and test doesn't restart)before
is executed twice before first testscreenshot on first run:
next run:
Desired behavior
before
executed only once and before one testTest code to reproduce
due to company policy I can't paste the code but it's pretty simple:
test suite:
in e2e.ts I defined common
before()
functionCypress Version
13.17.0
Node version
v20.14.0
Operating System
Microsoft Windows 10 Enterprise - 10.0.19045 Build 19045
Debug Logs
Other
No response
The text was updated successfully, but these errors were encountered: