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

chore: make sure prettier doesnt run on these lines #6081

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions docs/app/references/migration-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,25 @@ Because of this, tests that visit more than one origin (defined as a composite o
Without `cy.origin()`, interacting with a second origin in the same test will cause the test to fail, even if the two origins
are in the same superdomain. This means you must now use `cy.origin()` in more situations than before.

<Icon name="exclamation-triangle" color="red" /> **Failing Test** ```js cy.visit('https://www.cypress.io')
cy.visit('https://docs.cypress.io') cy.get('[role="banner"]').should('be.visible')
// Cypress will not be able to interact with the page, causing the test to fail ```

<Icon name="check-circle" color="green" /> **Fixed Test** ```js cy.visit('https://www.cypress.io')
cy.visit('https://docs.cypress.io') cy.origin('https://docs.cypress.io', () => {cy
.get('[role="banner"]')
.should('be.visible')}
) ```
{/* prettier-ignore-start */}
<Icon name="exclamation-triangle" color="red" /> **Failing Test**
```js
cy.visit('https://www.cypress.io')
cy.visit('https://docs.cypress.io')
// Cypress will not be able to interact with the page, causing the test to fail
cy.get('[role="banner"]').should('be.visible')
```

<Icon name="check-circle" color="green" /> **Fixed Test**

```js
cy.visit('https://www.cypress.io')
cy.visit('https://docs.cypress.io')
cy.origin('https://docs.cypress.io', () => {
cy.get('[role="banner"]').should('be.visible')
})
```
{/* prettier-ignore-end */}

:::info

Expand Down
Loading