Skip to content

Commit 6c0869c

Browse files
authored
Fix "cy.visit() succeeded, but commands are timing out" error example (#6157)
1 parent 8027153 commit 6c0869c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/app/references/error-messages.mdx

+6-6
Original file line numberDiff line numberDiff line change
@@ -498,18 +498,18 @@ as-is:
498498
```javascript
499499
it('navigates to docs.cypress.io', () => {
500500
cy.visit('http://localhost:3000')
501-
cy.visit('https://docs.cypress.io') // visit a different superdomain
501+
cy.visit('https://docs.cypress.io') // visit a different domain
502502
})
503503
```
504504

505-
However, when the newly visited URL is not considered the same superdomain, the
505+
However, when the newly visited URL is not considered the same domain, the
506506
[`cy.origin()`](/api/commands/origin) command **must** be used to interact with
507507
the newly visited domain. The following test is incorrect:
508508

509509
```javascript
510510
it('navigates to docs.cypress.io and runs additional commands', () => {
511511
cy.visit('http://localhost:3000')
512-
cy.visit('https://docs.cypress.io') // visit a different superdomain
512+
cy.visit('https://docs.cypress.io') // visit a different domain
513513
cy.get('h1').should('contain', 'Why Cypress?') // fails
514514
})
515515
```
@@ -525,10 +525,10 @@ In order to fix this, our `cy.get()` command **must** be wrapped with the
525525
[`cy.origin()`](/api/commands/origin) command, like so:
526526

527527
```javascript
528-
it('navigates to example.cypress.io and runs additional commands', () => {
528+
it('navigates to docs.cypress.io and runs additional commands', () => {
529529
cy.visit('http://localhost:3000')
530-
cy.visit('https://example.cypress.io') // visit a different superdomain
531-
cy.origin('https://example.cypress.io', () => {
530+
cy.visit('https://docs.cypress.io') // visit a different domain
531+
cy.origin('https://docs.cypress.io', () => {
532532
cy.get('h1').should('contain', 'Why Cypress?') // now succeeds!
533533
})
534534
})

0 commit comments

Comments
 (0)