Skip to content

Commit

Permalink
chore: make sure prettier doesnt run on these lines as things look qu…
Browse files Browse the repository at this point in the history
…ite odd (#6081)
  • Loading branch information
AtofStryker authored Jan 16, 2025
1 parent 9828ea7 commit 6ea5dc5
Showing 1 changed file with 19 additions and 9 deletions.
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

0 comments on commit 6ea5dc5

Please sign in to comment.