@@ -498,18 +498,18 @@ as-is:
498
498
``` javascript
499
499
it (' navigates to docs.cypress.io' , () => {
500
500
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
502
502
})
503
503
```
504
504
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
506
506
[ ` cy.origin() ` ] ( /api/commands/origin ) command ** must** be used to interact with
507
507
the newly visited domain. The following test is incorrect:
508
508
509
509
``` javascript
510
510
it (' navigates to docs.cypress.io and runs additional commands' , () => {
511
511
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
513
513
cy .get (' h1' ).should (' contain' , ' Why Cypress?' ) // fails
514
514
})
515
515
```
@@ -525,10 +525,10 @@ In order to fix this, our `cy.get()` command **must** be wrapped with the
525
525
[ ` cy.origin() ` ] ( /api/commands/origin ) command, like so:
526
526
527
527
``` javascript
528
- it (' navigates to example .cypress.io and runs additional commands' , () => {
528
+ it (' navigates to docs .cypress.io and runs additional commands' , () => {
529
529
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' , () => {
532
532
cy .get (' h1' ).should (' contain' , ' Why Cypress?' ) // now succeeds!
533
533
})
534
534
})
0 commit comments