Skip to content
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

Merged

Conversation

AtofStryker
Copy link
Contributor

documents the disabling experimental option of document.domain

@vercel
Copy link

vercel bot commented Jan 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
cypress-documentation ✅ Ready (Inspect) Visit Preview Jan 9, 2023 at 4:27PM (UTC)

…into feature/experimentalUseDefaultDocumentDomain
@emilyrohrbough
Copy link
Member

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']`. |
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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}
Copy link
Member

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.

Copy link
Contributor Author

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}
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Member

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

Copy link
Contributor Author

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:
Screenshot 2023-01-06 at 5 08 33 PM

…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)
Copy link
Member

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?

Copy link
Contributor Author

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

@AtofStryker AtofStryker changed the title Chore: add experimentalUseDefaultDocumentDomain option Chore: add experimentalSkipDomainInjection option Jan 6, 2023
@AtofStryker
Copy link
Contributor Author

just to put a note ad the bottom that this PR needs to be rebased off v12.4

@emilyrohrbough emilyrohrbough changed the base branch from master to release-12.4.0 January 6, 2023 22:42
@AtofStryker AtofStryker merged commit 3999260 into release-12.4.0 Jan 9, 2023
@AtofStryker AtofStryker deleted the feature/experimentalUseDefaultDocumentDomain branch January 9, 2023 20:18
AtofStryker added a commit that referenced this pull request Jan 24, 2023
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants