Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running test with all steps skipped causes error with cy.wait() outside of it() block #116

Closed
wintrell523 opened this issue Aug 18, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@wintrell523
Copy link

Hello. I ran into a problem - I have a test, which needs to be skipped because of bugs present in the app.
What I did is mark all it() blocks with .skip.
When I run the test in CLI following error appears:

Running:  businessCase/TQA-569-BC-Buying-OnStock-UndeductibleVehicle-Cash.ts             (5 of 16)
  TQA-569: BC Buying | On Stock | Undeductible Vehicle | Cash
    - Step 1 - List
    - Step 2 - Create customer
    1) "before all" hook in "TQA-569: BC Buying | On Stock | Undeductible Vehicle | Cash"
  0 passing (750ms)
  2 pending
  1 failing
  1) TQA-569: BC Buying | On Stock | Undeductible Vehicle | Cash
       "before all" hook in "TQA-569: BC Buying | On Stock | Undeductible Vehicle | Cash":
     CypressError: Cannot call `cy.wait()` outside a running test.
This usually happens when you accidentally write commands outside an `it(...)` test.
If that is the case, just move these commands inside an `it(...)` test.
Check your test file for errors.
Because this error occurred during a `before all` hook we are skipping the remaining tests in the current suite: `TQA-569: BC Buying | On Sto...`
      at Object.ensureRunnable (http://localhost:3000/__cypress/runner/cypress_runner.js:143964:24)
      at $Cy.cy.<computed> [as wait] (http://localhost:3000/__cypress/runner/cypress_runner.js:153381:17)
      at Runner.emit (http://localhost:3000/__cypress/runner/cypress_runner.js:19033:7)
      at next (http://localhost:3000/__cypress/runner/cypress_runner.js:110124:14)
      at next (http://localhost:3000/__cypress/runner/cypress_runner.js:110127:14)
      at next (http://localhost:3000/__cypress/runner/cypress_runner.js:110127:14)
      at Runner.../driver/node_modules/mocha/lib/runner.js.Runner.runTests (http://localhost:3000/__cypress/runner/cypress_runner.js:110197:3)
      at Runner.runTests (http://localhost:3000/__cypress/runner/cypress_runner.js:157809:32)
      at http://localhost:3000/__cypress/runner/cypress_runner.js:110277:10
      at next (http://localhost:3000/__cypress/runner/cypress_runner.js:109850:14)
      at Hook.<anonymous> (http://localhost:3000/__cypress/runner/cypress_runner.js:109911:7)
      at next (http://localhost:3000/__cypress/runner/cypress_runner.js:159559:22)
      at http://localhost:3000/__cypress/runner/cypress_runner.js:159586:11
      at tryCatcher (http://localhost:3000/__cypress/runner/cypress_runner.js:10798:23)
      at Promise._settlePromiseFromHandler (http://localhost:3000/__cypress/runner/cypress_runner.js:8733:31)
      at Promise._settlePromise (http://localhost:3000/__cypress/runner/cypress_runner.js:8790:18)

Problem is I don't have any cy.wait() outside of it() block. When I disable the plugin, everything runs OK and this test is marked as skipped.

I tried to remove the .skip at it() block level and move it to describe() block instead. When I run that, the test hangs and doesn't run at all. Again, works OK when the plugin is disabled.

Cypress: 8.0.0
Node: 14.15.1 (bundled)
cypress-terminal-report: 3.3.0

I had the plugin set to default, no custom config (so to 'onFail').

@archfz archfz added the bug Something isn't working label Aug 18, 2021
@archfz archfz self-assigned this Aug 18, 2021
archfz added a commit that referenced this issue Aug 18, 2021
#113 #114 #116: Fix for skip tests and collect logs validation.
@archfz
Copy link
Owner

archfz commented Aug 18, 2021

Released in 3.3.1

@archfz archfz closed this as completed Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants