Cypress it.skip fails
See original GitHub issueWhere to find the issue
Cypress tests under development in cypress/e2e.
Describe the issue
If a Cypress test is changed from it
to it.skip
for debugging purposes, other tests which do not have the skip
attribute applied do not run and the following error is produced:
TypeError
The following error originated from your test code, not from Cypress.
> Cannot set properties of undefined (setting 'body')
This is a development issue only. It does not affect the website itself.
-
It is related to the open issue https://github.com/corona-warn-app/cwa-website/issues/3010
-
The issue occurs following the migration PR https://github.com/corona-warn-app/cwa-website/pull/3197 which updated cwa-website to use Cypress 10.11.0 instead of Cypress 9.7.0.
Steps to reproduce
Create a new test spec test.skip.cy.js
in cypress/e2e/
with the following contents:
it("test 1 - run this", () => {
cy.log("test 1 log")
});
it.skip("test 2 - skip this", () => {
cy.log("test 2 log")
});
Execute npm run test:open
Select test.skip.cy.js
This produces the error > Cannot set properties of undefined (setting 'body')
and no tests are executed.
Regression with Cypress 10.11.0
Going back one minor version from Cypress 10.11.0 to 10.10.0 removes the issue:
Execute:
npm install cypress@10.10.0
Repeat the above test.
test 1 runs, test 2 is skipped. This is correct.
Regression with monkey-patch
npm install cypress@latest
Edit cypress/support/e2e.js
and remove all code starting with the comment line
// soft assert for finding broken links, see also check_links.js
to the end of the file.
Repeat the test.
test 1 runs, test 2 is skipped. This is correct.
Code issue
contains the code
that modifies the standard behaviour of Cypress / mocha.
- It was introduced through PR https://github.com/corona-warn-app/cwa-website/pull/1786
Without this code, it.skip
works as expected.
Reference
Cypress documentation
“To skip a specified suite or test, append .skip()
to the function. All nested suites will also be skipped.”
Suggestion
Since this is a minor development issue only, I suggest no change at this time.
Internal Tracking ID: EXPOSUREAPP-14292
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
@MikeMcC399
Great, thank you! I wasn’t aware there is already activity from cypress’s side. Then we will monitor how things go and come back to the issue when there is a fix.
@brianebeling
I wouldn’t want to downgrade Cypress to 10.10.0 and it wouldn’t solve the related it.only issue. In the meantime a community member who already proposed a solution for the
it.only
issue said that they would look at solving theit.skip
issue as well (see https://github.com/cypress-io/cypress/discussions/23280#discussioncomment-4056067), so I would hold back.I agree that this is not high impact or urgency and I have only shared it for completeness.
Thanks anyway for your attention!