Skip to content

Cypress error outputs dead link #6096

@crfrolik

Description

@crfrolik

Description

When a command fails with a cy.origin error (see description), it outputs a URL that is a dead link

URL of Issue(s)

https://on.cypress.io/cy-visit-succeeded-but-commands-fail%1B[0m%1B[90m

Steps to replicate

2025-01-30 11:16:39         CypressError: The command was expected to run against origin `<my-url-1>`/ but the application is at origin `<my-url-2>`/.
2025-01-30 11:16:39    
2025-01-30 11:16:39    This commonly happens when you have either not navigated to the expected origin or have navigated away unexpectedly.
2025-01-30 11:16:39    
2025-01-30 11:16:39    Using `cy.origin()` to wrap the commands run on `<my-url-2>`/ will likely fix this issue.
2025-01-30 11:16:39    
2025-01-30 11:16:39    `cy.origin('<my-url-2>', () => {`
2025-01-30 11:16:39    `  <commands targeting my-url-2/ go here>`
2025-01-30 11:16:39    `})`
2025-01-30 11:16:39    
2025-01-30 11:16:39    This error occurred while creating the session. Because the session setup failed, we failed the test.
2025-01-30 11:16:39    
2025-01-30 11:16:39    [https://on.cypress.io/cy-visit-succeeded-but-commands-fail](https://on.cypress.io/cy-visit-succeeded-but-commands-fail%1B[0m%1B[90m)
2025-01-30 11:16:39          at cy.session.cacheAcrossSpecs.cacheAcrossSpecs [as setup] (webpack:///../cpf-page-objects/signin.po.ts:102:0)
2025-01-30 11:16:39          at Context.<anonymous> (https://redacted/__cypress/runner/cypress_runner.js:132889:38)
2025-01-30 11:16:39          at getRet (https://redacted/__cypress/runner/cypress_runner.js:118338:20)
2025-01-30 11:16:39          at tryCatcher (https://redacted/__cypress/runner/cypress_runner.js:1777:23)
2025-01-30 11:16:39          at Promise.attempt.Promise.try (https://redacted/__cypress/runner/cypress_runner.js:4285:29)
2025-01-30 11:16:39          at Context.thenFn (https://redacted/__cypress/runner/cypress_runner.js:118349:66)
2025-01-30 11:16:39          at Context.then (https://redacted/__cypress/runner/cypress_runner.js:118600:21)
2025-01-30 11:16:39          at wrapped (https://redacted/__cypress/runner/cypress_runner.js:137883:19)
2025-01-30 11:16:39      From Your Spec Code:
2025-01-30 11:16:39          at cy.session.cacheAcrossSpecs.cacheAcrossSpecs [as setup] (webpack:///../cpf-page-objects/signin.po.ts:102:0)
2025-01-30 11:16:39          at Context.<anonymous> (https://redacted/__cypress/runner/cypress_runner.js:132889:38)
2025-01-30 11:16:39          at getRet (https://redacted/__cypress/runner/cypress_runner.js:118338:20)
2025-01-30 11:16:39          at tryCatcher (https://redacted/__cypress/runner/cypress_runner.js:1777:23)
2025-01-30 11:16:39          at Promise.attempt.Promise.try (https://redacted/__cypress/runner/cypress_runner.js:4285:29)
2025-01-30 11:16:39          at Context.thenFn (https://redacted/__cypress/runner/cypress_runner.js:118349:66)
2025-01-30 11:16:39          at Context.then (https://redacted/__cypress/runner/cypress_runner.js:118600:21)
2025-01-30 11:16:39          at wrapped (https://redacted/__cypress/runner/cypress_runner.js:137883:19)

The link it gives results in a 404.

The hyperlink seems to have some weird escape sequences:

https://on.cypress.io/cy-visit-succeeded-but-commands-fail%1B[0m%1B[90m

Browser

No response

Device

  • PC
  • Mac
  • iPhone
  • iPad
  • Android Phone
  • Android Tablet

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions