-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chore: add experimentalSkipDomainInjection option #4955
Chore: add experimentalSkipDomainInjection option #4955
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…into feature/experimentalUseDefaultDocumentDomain
The base branch will need to be updated to the release version this should merge into once the code changes are close. |
| `experimentalStudio` | `false` | Generate and save commands directly to your test suite by interacting with your app as an end user would. | | ||
| `experimentalRunAllSpecs` | `false` | Enables the "Run All Specs" UI feature, allowing the execution of multiple specs sequentially. | | ||
| `experimentalOriginDependencies` | `false` | Enables support for `require`/`import` within `cy.origin`. | | ||
| `experimentalUseDefaultDocumentDomain` | `null` | Disables injecting `document.domain` into `text/html` pages. The `document.domain` configuration has been known to cause issues with certain sites, including Google and Salesforce. Enabling this option no longer allows for default sub domain navigations, and will require the use of `cy.origin()`. This option takes an array of strings/minimatch globs. Our recommended configuration is `['*.salesforce.com', '*.force.com', '*.google.com', 'google.com']`. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have expected more documentation for this experiment. If we know why google doesn't work and give our high-level understanding of salesforce it'll help people understand if they should enable this. I think we probably only want users to turn this on if absolutely necessary right?
Also an example of what changes might be needed where it worked without origin then needed origin might help users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we probably only want users to turn this on if absolutely necessary right?
I would say so, or we leverage as a diagnostic tool.
Do we have a place where we can further document the experiment to add some more verbosity? Right now the column already looks bloated and is a bit hard to read. I'd almost like to trim this down, and have a link to more details about the experiment that users can discover. Otherwise, we'd have to mostly guide through GitHub which I am not a big fan of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emilyrohrbough I took a stab at this in 09e859c and removed the reference in the web security page. I figured since this is a pretty small sample size, mentioning in the experiments and cross origin testing guide at the end should suffice
@@ -17,6 +17,8 @@ a navigation occurs that does not meet the same superdomain rule, the | |||
[`cy.origin()`](/api/commands/origin) command must be used to execute Cypress | |||
commands inside the newly navigated origin. | |||
|
|||
::include{file=partials/document-domain-workaround.md} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this plug should be at the end of the doc as an FAQ not the beginning since it should be an edge case. I also think additional context of why this might be useful could be helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does feel awkward. Going to see if I can get something to flow as an FAQ at the end
@@ -129,6 +129,8 @@ specific test when it runs. For more information on this, please see our Web | |||
Security page regarding | |||
[Different superdomain per test requires cy.origin command](/guides/guides/web-security#Different-superdomain-per-test-requires-cy-origin-command). | |||
|
|||
::include{file=partials/document-domain-workaround.md} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this mean to be under Other Workarounds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put it here because I feel like it is a work around, but it kind of feels thrown in there. Should we maybe dedicate a paragraph or something without the partial which makes more sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I might add some context on why its there and indicate it's type of work-around
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I did was just moved this up in cross origin testing in 3d4fb3e since we describe there why we do document.domain injection and it seems like the appropriate place to plug this. Not sure if this was there before but Revisiting I think it makes sense:
…into feature/experimentalUseDefaultDocumentDomain
….com:cypress-io/cypress-documentation into feature/experimentalUseDefaultDocumentDomain
#### Experimental Skip Domain Injection | ||
|
||
Under the hood, Cypress | ||
[injects document.domain](/guides/guides/web-security#Examples-of-what-Cypress-does-under-the-hood) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just read the Examples-of-what-Cypress-does-under-the-hood section. It doesn't state WHY we set document.domain. This is primarily to allow sub-domain navigation correct? maybe call that out here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a spot for this in the cross origin testing guide. I think I can move the workaround up there and it will fit fairly well
just to put a note ad the bottom that this PR needs to be rebased off v12.4 |
* Chore: add experimentalSkipDomainInjection option (#4955) * chore: add documentation for new experimentalUseDefaultDocumentDomain option * chore: give more in depth look at experiment and why it is necessary * chore: address comments from code review * move disabling document.domain disclaimer up to discussion of injection * chore: rework the experiment section * chore: apply suggestions from code review * Adding documentation for experimentalMemoryManagement (#4991) * chore: initial commit of 12.4.0 changelog * chore: add .as() changes to changelog * chore: fix formatting in changelog * chore: address comments from review * chore: cut over changelog to use issue references instead of pull requests for source of issue * fix: cut over document-domain-workaround to mdx component * chore: lint document * chore: fix absolute link reference * chore: add space to changelog * chore: add space to changelog * Update docs/guides/references/_changelogs/12.4.0.md Co-authored-by: Mark Noonan <mark@cypress.io> * Update docs/guides/references/_changelogs/12.4.0.md Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com> * Update docs/guides/references/_changelogs/12.4.0.md Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com> * copy/pasta changelog suggestions into main doc * Update docs/guides/references/_changelogs/12.4.0.md Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com> * Update docs/guides/references/_changelogs/12.4.0.md Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com> * chore: update PR with suggestions * chore: update suggestions from code review * chore: run prettier Co-authored-by: Matt Schile <mschile@cypress.io> Co-authored-by: Mark Noonan <mark@cypress.io> Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
documents the disabling experimental option of
document.domain