Skip to content

cy.request failures are not obvious #134

@brian-mann

Description

@brian-mann

When cy.request fails we get a stack trace that looks like this:

2) Todo MVC "before each" hook:
     CypressError: Error: connect ECONNREFUSED 127.0.0.1:9002
      at Object.$Cypress.Utils._.cypressError (http://localhost:2020/__cypress/static/js/cypress.js:4377:15)
      at $Cypress.Cy.extend.cypressErr (http://localhost:2020/__cypress/static/js/cypress.js:5027:31)
      at $Cypress.Cy.extend.throwErr (http://localhost:2020/__cypress/static/js/cypress.js:5032:22)
      at http://localhost:2020/__cypress/static/js/cypress.js:9092:21
      at i (http://localhost:2020/__cypress/static/js/vendor.js:588:27)
      at e._settlePromiseFromHandler (http://localhost:2020/__cypress/static/js/vendor.js:587:5260)
      at e._settlePromiseAt (http://localhost:2020/__cypress/static/js/vendor.js:587:6529)
      at e._settlePromises (http://localhost:2020/__cypress/static/js/vendor.js:587:8394)
      at i._drainQueue (http://localhost:2020/__cypress/static/js/vendor.js:586:3183)
      at i._drainQueues (http://localhost:2020/__cypress/static/js/vendor.js:586:3244)
      at MutationObserver.drainQueues (http://localhost:2020/__cypress/static/js/vendor.js:586:1186)

We should at explain that it was caused by the cy.request and additionally print out request data and/or response data as a nicely formatted (truncated) object.

This will help users debug cy.request failures.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions