NeuraLegion / cypress-har-generator

Cypress plugin for generating HTTP Archive (HAR) files captures network requests during Cypress tests.
https://www.npmjs.com/package/@neuralegion/cypress-har-generator
MIT License
84 stars 19 forks source link

🛈 Attempting to connect to CDP / 🛈 Connected to CDP logging multiple times #18

Closed jennifer-shehane closed 4 years ago

jennifer-shehane commented 4 years ago

I get multiple logs of attempts to connect to CDP. Just looks a little unsettling that it has to connect multiple times, not sure what it going on there or why/where this needs logging at all. Just seems distracting in the test logout.

Ran this specfile with my server running: https://github.com/cypress-io/cypress-example-kitchensink/blob/master/cypress/integration/examples/network_requests.spec.js

Screen Shot 2019-12-16 at 11 04 32 AM
cypress run --browser chrome --spec cypress/integration/examples/network_requests.spec.js

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:    3.8.0                                                                              │
  │ Browser:    Chrome 78                                                                          │
  │ Specs:      1 found (examples/network_requests.spec.js)                                        │
  │ Searched:   cypress/integration/examples/network_requests.spec.js                              │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

────────────────────────────────────────────────────────────────────────────────────────────────────

  Running:  examples/network_requests.spec.js                                               (1 of 1)

🛈 Attempting to connect to Chrome Debugging Protocol
🛈 Connected to Chrome Debugging Protocol
  Network Requests
🛈 Attempting to connect to Chrome Debugging Protocol
🛈 Connected to Chrome Debugging Protocol
    ✓ cy.server() - control behavior of network requests and responses (270ms)
    ✓ cy.request() - make an XHR request (1393ms)
    ✓ cy.request() - verify response using BDD syntax (1077ms)
    ✓ cy.request() with query parameters (792ms)
    ✓ cy.request() - pass result to the second request (1316ms)
    ✓ cy.request() - save response in the shared test context (1071ms)
    ✓ cy.route() - route responses to matching requests (2069ms)

  7 passing (10s)

  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        7                                                                                │
  │ Passing:      7                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     9 seconds                                                                        │
  │ Spec Ran:     examples/network_requests.spec.js                                                │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

🛈 Chrome Debugging Protocol disconnected
🛈 Chrome Debugging Protocol disconnected

  (Video)

  -  Started processing:  Compressing to 32 CRF
  -  Finished processing: /Users/jennifer/Dev/cypress-example-kitchensink/cypress/vid     (1 second)
                          eos/examples/network_requests.spec.js.mp4

====================================================================================================

  (Run Finished)

       Spec                                              Tests  Passing  Failing  Pending  Skipped
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  examples/network_requests.spec.js        00:09        7        7        -        -        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        00:09        7        7        -        -        -
derevnjuk commented 4 years ago

@jennifer-shehane In general, I can agree with you. I propose to clear output of redundant messages and inform a user only when the plugin has exhausted all attempts. What do you think?

jennifer-shehane commented 4 years ago

Yah that would probably be better, we do something similar. We only log when we cannot connect to the CDP and log retry attempts, unless you have DEBUG on which would log all attempts.

github-actions[bot] commented 4 years ago

:tada: This issue has been resolved in version 2.0.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: