Skip to content

Commit 50f59b3

Browse files
authored
Cross-link cy.origin and injectDocumentDomain (#6156)
1 parent 6c0869c commit 50f59b3

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

docs/api/commands/origin.mdx

+5-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ doc.
4040

4141
Cypress no longer injects `document.domain` by default, which means `cy.origin()`
4242
must now be used to navigate between any two origins in the same test, even if
43-
the two origins are in the same superdomain. This behavior can be disabled by setting
44-
the `injectDocumentDomain` configuration option to `true`, to allow a smooth transition
45-
of tests to the new behavior. This configuration option will be removed in a future version of Cypress.
43+
the two origins are in the same superdomain.
44+
This behavior can be disabled by setting the
45+
[injectDocumentDomain](/app/references/configuration#injectDocumentDomain) configuration option to `true`,
46+
to allow a smooth transition of tests to the new behavior.
47+
This configuration option will be removed in a future version of Cypress.
4648

4749
:::
4850

docs/app/references/configuration.mdx

+6-5
Original file line numberDiff line numberDiff line change
@@ -603,17 +603,18 @@ This option is <Badge type="caution">deprecated</Badge>, and will be removed in
603603

604604
Set this configuration option to `true` to instruct Cypress to
605605
[inject document.domain](/app/guides/cross-origin-testing#What-Cypress-does-under-the-hood)
606-
into your test application. This can reduce the need for `cy.origin()` when [navigating
607-
between subdomains](/app/guides/cross-origin-testing), but comes with compatibility
608-
caveats for some sites.
606+
into your test application.
607+
This can reduce the need for [`cy.origin()`](/api/commands/origin)
608+
when [navigating between subdomains](/app/guides/cross-origin-testing),
609+
but comes with compatibility caveats for some sites.
609610

610-
This configuration option is provided to ease the transition between `cy.origin()`'s behavior
611+
This configuration option is provided to ease the transition between [`cy.origin()`](/api/commands/origin)'s behavior
611612
in Cypress 13 and the default behavior in Cypress 14.
612613
[Read the Cypress 14 migration guide](/app/references/migration-guide#Migrating-to-Cypress-140) to understand how to update your tests to remove
613614
the need to set this flag.
614615

615616
This configuration value _must_ be set to true if you are running tests with experimental
616-
WebKit support, as `cy.origin` is not yet supported in WebKit.
617+
WebKit support, as [`cy.origin()`](/api/commands/origin) is not yet supported in WebKit.
617618

618619
:::caution
619620

docs/partials/_document-domain-workaround.mdx

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ This means you must now use `cy.origin()` when navigating between different _ori
99
in the same test. Previously, `cy.origin()` was only necessary when navigating between
1010
different [superdomains](/app/guides/cross-origin-testing#Parts-of-a-URL) in the same test.
1111

12-
By setting the `injectDocumentDomain` configuration option to `true`, Cypress will
13-
attempt to inject `document.domain` into `text/html` pages.
12+
By setting the
13+
[injectDocumentDomain](/app/references/configuration#injectDocumentDomain) configuration option to `true`,
14+
Cypress will attempt to inject `document.domain` into `text/html` pages.
1415

1516
A superdomain is comprised of the trailing two elements of the hostname, delimited by
1617
a `.` (period). Given `https://www.cypress.io`, the superdomain is determined to be

0 commit comments

Comments
 (0)