Skip to content

Commit

Permalink
Merge pull request #4892 from cypress-io/content/final-origin-changes…
Browse files Browse the repository at this point in the history
…-for-v12

Small update to cy.origin API docs for v12
  • Loading branch information
debrisapron authored Dec 5, 2022
2 parents 6a3f8fd + 7ca54c0 commit 7cacb1d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions content/api/commands/origin.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ cy.get('h1').contains('My cool site under test')
```js
const hits = getHits()
cy.visit('https://www.acme.com/history/founder')
// to interact with cross-origin content, move this inside cy.origin() callback
// To interact with cross-origin content, move this inside cy.origin() callback
cy.get('h1').contains('About our Founder, Marvin Acme')
cy.origin('https://www.acme.com', () => {
// Domain must be a precise match including subdomain, i.e. www.acme.com
cy.origin('acme.com', () => {
cy.visit('/history/founder')
cy.get('h1').contains('About our Founder, Marvin Acme')
// Fails because hits is not passed in via args
Expand All @@ -81,7 +82,8 @@ cy.get('h1').contains('My cool site under test')

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

This argument will be used in two ways:

Expand Down

0 comments on commit 7cacb1d

Please sign in to comment.