Skip to content
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