Skip to content

Commit d2dd400

Browse files
committed
Small update to cy.origin API docs for v12
1 parent de07b87 commit d2dd400

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

content/api/commands/origin.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ cy.get('h1').contains('My cool site under test')
6363
```js
6464
const hits = getHits()
6565
cy.visit('https://www.acme.com/history/founder')
66-
// to interact with cross-origin content, move this inside cy.origin() callback
66+
// To interact with cross-origin content, move this inside cy.origin() callback
6767
cy.get('h1').contains('About our Founder, Marvin Acme')
68-
cy.origin('https://www.acme.com', () => {
68+
// Domain must be a precise match including subdomain, i.e. www.acme.com
69+
cy.origin('acme.com', () => {
6970
cy.visit('/history/founder')
7071
cy.get('h1').contains('About our Founder, Marvin Acme')
7172
// Fails because hits is not passed in via args
@@ -81,7 +82,8 @@ cy.get('h1').contains('My cool site under test')
8182

8283
A URL specifying the secondary origin in which the callback is to be executed.
8384
This should at the very least contain a hostname, and may also include the
84-
protocol, port number & path. Query params are not supported.
85+
protocol, port number & path. The hostname must precisely match that of the
86+
secondary origin, including all subdomains. Query params are not supported.
8587

8688
This argument will be used in two ways:
8789

0 commit comments

Comments
 (0)