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

Fails to run under Cypress 12.12.0 #288

Closed
guspower opened this issue May 16, 2023 · 2 comments · Fixed by #321
Closed

Fails to run under Cypress 12.12.0 #288

guspower opened this issue May 16, 2023 · 2 comments · Fixed by #321
Assignees
Labels
Priority: high Type: bug Something isn't working

Comments

@guspower
Copy link

Description
The cypress har generator fails to run under Cypress 12.12.0. It works fine with versions up to 12.11.0.

Stack trace
$ NODE_DEBUG=cypress-har-generator pnpm test

ELECTRON_EXTRA_LAUNCH_ARGS=--remote-debugging-port=9222 cypress run

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        12.12.0                                                                        │
  │ Browser:        Electron 106 (headless)                                                        │
  │ Node Version:   v20.1.0 (/home/dev/tools/node-v20.1.0-linux-x64/bin/node)                         │
  │ Specs:          2 found (login.cy.js, navigation.cy.js)                                        │
  │ Searched:       cypress/e2e/**/*.cy.{js,jsx,ts,tsx}                                            │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

CypressError: `cy.task('recordHar')` failed with the following error:

> Failed to connect to Chrome Debugging Protocol

Possible reasons for failure:
  - Chrome not running in headless mode
  - Using Chrome version 58 or earlier
  - Inconsistent RDP configuration settings.
  
The stack trace for this error is:

https://on.cypress.io/api/task

Because this error occurred during a `before all` hook we are skipping the remaining tests in the current suite: `Spider Navigation`
      at <unknown> (http://172.17.0.6/__cypress/runner/cypress_runner.js:150983:78)
      at tryCatcher (http://172.17.0.6/__cypress/runner/cypress_runner.js:18744:23)
      at Promise._settlePromiseFromHandler (http://172.17.0.6/__cypress/runner/cypress_runner.js:16679:31)
      at Promise._settlePromise (http://172.17.0.6/__cypress/runner/cypress_runner.js:16736:18)
      at Promise._settlePromise0 (http://172.17.0.6/__cypress/runner/cypress_runner.js:16781:10)
      at Promise._settlePromises (http://172.17.0.6/__cypress/runner/cypress_runner.js:16857:18)
      at _drainQueueStep (http://172.17.0.6/__cypress/runner/cypress_runner.js:13451:12)
      at _drainQueue (http://172.17.0.6/__cypress/runner/cypress_runner.js:13444:9)
      at ../../node_modules/bluebird/js/release/async.js.Async._drainQueues (http://172.17.0.6/__cypress/runner/cypress_runner.js:13460:5)
      at Async.drainQueues (http://172.17.0.6/__cypress/runner/cypress_runner.js:13330:14)
  From Your Spec Code:
      at Context.eval (webpack:////home/dev/pnpm-virtual/@neuralegion+cypress-har-generator@5.16.4_cypress@12.12.0/node_modules/@neuralegion/cypress-har-generator/commands.js:1:1260)

Steps to reproduce

  1. Upgrade an existing project to use Cypress 12.12.0
  2. Run tests

Expected behavior
I expected Cypress to run through successfully as before.

Actual behavior
Cypress fails on recordHar citing that it cannot connect to the Chrome Debugging Protocol

Additional information
Commenting out the har references in the tests allows the tests to run through and complete successfully:

    before(() => { cy.recordHar() })
    after(() => { cy.saveHar() })
@guspower guspower added the Type: bug Something isn't working label May 16, 2023
@derevnjuk
Copy link
Member

derevnjuk commented May 18, 2023

Thanks for the report, @guspower! 👍🏾 The issue you encountered has already been reported in the cypress-io/cypress repository (cypress-io/cypress#26711) and appears to be related to cypress-io/cypress#15932. Let's see what I can do.

@derevnjuk
Copy link
Member

The problem has been resolved in Cypress version 12.17.0. To prevent any misunderstandings and potential future problems, I have set a supported version range for Cypress as follows: >=4.4.1 <12.12.0 || >=12.17.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: high Type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants