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

breaking: no longer inject document.domain by default #30770

Open
wants to merge 88 commits into
base: release/14.0.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 73 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
5b42419
remove experimentalSkipDomainInjection, add and deprecate injectDocum…
cacieprins Oct 17, 2024
151952d
remove experimentalSkipDomainInjection, add injectDocumentDomain
cacieprins Oct 17, 2024
dc4fb0b
begin rethreading domain injection
cacieprins Oct 18, 2024
330adc4
complete document domain transition
cacieprins Oct 21, 2024
2000405
move some cookie specs to separate test run
cacieprins Oct 22, 2024
0f822b5
origin and privileged commands with default docdom inject
cacieprins Oct 23, 2024
8275e4d
fix privileged channel when injecting document domain
cacieprins Oct 23, 2024
4a52817
rm unnecessary .getOrigin abstraction in cors lib
cacieprins Oct 23, 2024
b3b60a1
move remote-states in prep for refactor Replace Conditional with Poly…
cacieprins Oct 23, 2024
a8f6406
refactor remote states to strategy pattern
cacieprins Oct 24, 2024
c54224b
cookie commands work as expected w cross origin bridge on different o…
cacieprins Oct 28, 2024
110996b
some origin tests updated
cacieprins Oct 30, 2024
4895219
run tests with document domain enabled
cacieprins Oct 30, 2024
33d33cd
run tests actually
cacieprins Oct 30, 2024
1d348c9
use correct config, swap conditional
cacieprins Oct 30, 2024
8b943d0
check-ts
cacieprins Oct 30, 2024
1166858
inject documetn domain for webkit tests
cacieprins Oct 30, 2024
25c3ac7
do not exec injectDocumetnDomain in parallel
cacieprins Oct 30, 2024
b4c0be3
fix ServerBase construction in tests to include cfg now
cacieprins Oct 31, 2024
3e613f0
pass cfg to ServerBase
cacieprins Oct 31, 2024
b6090f7
improved integration tests
cacieprins Oct 31, 2024
4da149d
remove document domain checks for all server integration specs - will…
cacieprins Nov 1, 2024
9bcc1f3
tests for injecting document domain when configured to
cacieprins Nov 1, 2024
e8ccb4d
square away server integration tests
cacieprins Nov 5, 2024
db047b7
ensure cookies are set correctly, potentially
cacieprins Nov 7, 2024
55fa5b1
errors pkg snapshots
cacieprins Nov 7, 2024
018816c
fix config tests
cacieprins Nov 8, 2024
5622cc5
fixing config tests
cacieprins Nov 8, 2024
b01df45
somewhat improves tests for cors policies in packages/network
cacieprins Nov 12, 2024
03f34bb
fix ts err in server-base
cacieprins Nov 12, 2024
c3ac388
Merge branch 'release/14.0.0' into cacie/29590/document-domain-subdom…
cacieprins Nov 12, 2024
376627b
enable injectDocumentDomain for cy in cy tests
cacieprins Nov 13, 2024
52156bf
fix Policy type ref
cacieprins Nov 13, 2024
18ae100
refactor cypress-schematic ct spec to be less prone to timeouts
cacieprins Nov 14, 2024
e66d194
run vite-dev-server tests with injectDocumentDomain
cacieprins Nov 14, 2024
19ce24e
rm document domain assertion from page_loading system test
cacieprins Nov 14, 2024
3d2a0c1
add system tests that test with injectDocumentDomain and others that …
cacieprins Nov 15, 2024
edbdb36
fix results_spec snapshot
cacieprins Nov 15, 2024
dd9a50d
update experimentalSkipDomainInjection system test
cacieprins Nov 18, 2024
70c0a8f
different behavior for certain net_stubbing tests based on injectDocu…
cacieprins Nov 19, 2024
29110af
fix ts
cacieprins Nov 19, 2024
e1e0829
extract origin key logic from remote states, for now
cacieprins Nov 21, 2024
ec669b8
move server-base and response-middleware over to new pattern
cacieprins Nov 21, 2024
e448022
WIP - reentry
cacieprins Nov 22, 2024
e19fb59
Merge branch 'release/14.0.0' into cacie/29590/document-domain-subdom…
cacieprins Dec 4, 2024
9a1c30e
fix build, remove console.log
cacieprins Dec 4, 2024
e97d548
check-ts
cacieprins Dec 4, 2024
941701f
fix spec frame injection
cacieprins Dec 5, 2024
e651ef6
remove injection for localhost
cacieprins Dec 5, 2024
0ec1b12
mostly fix vite-dev-server app integration tests
cacieprins Dec 6, 2024
5de96f0
fix codeframe in certain cases in chrome
cacieprins Dec 9, 2024
0d6b14d
drop internal stack frames from stacks intended for determining code …
cacieprins Dec 10, 2024
5afda0f
some improvements to vite ct error codeframes
cacieprins Dec 13, 2024
6cde8b9
fix proxy unit tests to use document domain injection util class
cacieprins Dec 13, 2024
69b7f6b
rm .only
cacieprins Dec 13, 2024
ddce890
fix all vite ct error specs
cacieprins Dec 13, 2024
a6b486f
rm console.log
cacieprins Dec 13, 2024
a857a38
slight refactor to util class to make easier to test
cacieprins Dec 16, 2024
ec653df
fix refactor - missing rename in files.js
cacieprins Dec 16, 2024
81cacf8
several tests do not set testingtype in config, so just check against…
cacieprins Dec 16, 2024
125b41e
revert changes to getInvocationDetails to see if that breaks tests
cacieprins Dec 17, 2024
1dcc5ab
re-enable stack stripping in invocation details for chrome
cacieprins Dec 18, 2024
7378f8e
new snapshots with more accurate invocation details
cacieprins Dec 18, 2024
af8f2a7
test for same-site cross-origin cookie behavior
cacieprins Dec 18, 2024
40ea65a
ignore window.top ts errors
cacieprins Dec 18, 2024
e4cdd85
Merge branch 'release/14.0.0' into cacie/29590/document-domain-subdom…
cacieprins Dec 18, 2024
361b066
revert forcing injectDocumentDomain in vite-dev-server cy config
cacieprins Dec 18, 2024
3de7b83
fix normalized whitespace for firefox "loading_failed" error
cacieprins Dec 18, 2024
b560617
always trim trailing wsp from stack before appending additional content
cacieprins Dec 19, 2024
3966f54
force normalization of whitespace to three \n when adding additional …
cacieprins Dec 19, 2024
b8cfc70
normalize wsp between stack and additional stack to "\n \n" in firefox
cacieprins Dec 19, 2024
0300676
remove stack_utils attempt at normalizing wsp
cacieprins Dec 19, 2024
4e090de
various cleanup: remove commented console logs, add more detailed com…
cacieprins Dec 20, 2024
58db915
add on links to error messages
cacieprins Dec 20, 2024
728e4bf
remove experimentalSkipDomainInjection from exported type defs
cacieprins Dec 20, 2024
bed8fb3
Update system-tests/test/experimental_skip_domain_injection_spec.ts
cacieprins Dec 20, 2024
a0a151a
Update packages/driver/cypress/e2e/e2e/origin/cookie_misc.cy.ts
cacieprins Dec 20, 2024
6c52c93
no need to coerce a boolean value to a booleanc
cacieprins Dec 20, 2024
34e0573
export base config from primary cypress config in driver for use in i…
cacieprins Dec 20, 2024
c03e62b
lift experimentalSkipDomainInjection breaking option to root
cacieprins Dec 20, 2024
0539a72
rollback config/options changes
cacieprins Dec 20, 2024
a8f0663
rm invalid comment
cacieprins Dec 20, 2024
fb1219c
use hostname instead of origin to create cookie from automation cookie
cacieprins Dec 20, 2024
ea57654
clarify stack regex in results_spec
cacieprins Dec 20, 2024
b86bd00
lint
cacieprins Dec 20, 2024
a20a34e
Merge branch 'release/14.0.0' into cacie/29590/document-domain-subdom…
jennifer-shehane Dec 23, 2024
1bece96
take a stab at the changelog entries for this
jennifer-shehane Dec 23, 2024
8ce3f5e
Merge branch 'cacie/29590/document-domain-subdomains' of https://gith…
jennifer-shehane Dec 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 59 additions & 3 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ mainBuildFilters: &mainBuildFilters
- 'update-v8-snapshot-cache-on-develop'
- 'chore/update_vue_test_utils'
- 'publish-binary'
- 'cacie/29590/document-domain-subdomains'

# usually we don't build Mac app - it takes a long time
# but sometimes we want to really confirm we are doing the right thing
Expand Down Expand Up @@ -573,6 +574,11 @@ commands:
description: chrome channel to install
type: string
default: ''
inject-document-domain:
description: run subset of tests with injectDocumentDomain config enabled
type: boolean
default: false

steps:
- restore_cached_workspace
- when:
Expand All @@ -594,11 +600,20 @@ commands:
echo Current working directory is $PWD
echo Total containers $CIRCLE_NODE_TOTAL


if << parameters.inject-document-domain >> ; then
YARN_CMD="cypress:run:inject-document-domain"
PARALLEL=""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can't be parallel because it ends up with the same build id but a different set of specs from the run without injectDocumentDomain

else
YARN_CMD="cypress:run"
PARALLEL="--parallel --group 5x-driver-<<parameters.browser>>"
fi

if [[ -v MAIN_RECORD_KEY ]]; then
# internal PR
CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
CYPRESS_INTERNAL_ENABLE_TELEMETRY="true" \
yarn cypress:run --record --parallel --group 5x-driver-<<parameters.browser>> --browser <<parameters.browser>> --runner-ui
yarn $YARN_CMD --record $PARALLEL --browser <<parameters.browser>> --runner-ui
else
# external PR
TESTFILES=$(circleci tests glob "cypress/e2e/**/*.cy.*" | circleci tests split --total=$CIRCLE_NODE_TOTAL)
Expand All @@ -607,7 +622,7 @@ commands:
if [[ -z "$TESTFILES" ]]; then
echo "Empty list of test files"
fi
yarn cypress:run --browser <<parameters.browser>> --spec $TESTFILES --runner-ui
yarn $YARN_CMD --browser <<parameters.browser>> --spec $TESTFILES --runner-ui
fi
working_directory: packages/driver
- verify-mocha-results
Expand Down Expand Up @@ -2002,6 +2017,16 @@ jobs:
- run-driver-integration-tests:
browser: chrome
install-chrome-channel: stable

driver-integration-tests-chrome-inject-document-domain:
<<: *defaults
parallelism: 5
resource_class: medium+
steps:
- run-driver-integration-tests:
browser: chrome
install-chrome-channel: stable
inject-document-domain: true

driver-integration-tests-chrome-beta:
<<: *defaults
Expand All @@ -2012,6 +2037,16 @@ jobs:
browser: chrome:beta
install-chrome-channel: beta

driver-integration-tests-chrome-beta-inject-document-domain:
<<: *defaults
resource_class: medium+
parallelism: 5
steps:
- run-driver-integration-tests:
browser: chrome:beta
install-chrome-channel: beta
inject-document-domain: true

driver-integration-tests-firefox:
<<: *defaults
resource_class: medium+
Expand All @@ -2034,6 +2069,8 @@ jobs:
steps:
- run-driver-integration-tests:
browser: webkit
# inject document domain must be true for webkit, as cy.origin is not supported
inject-document-domain: true

run-reporter-component-tests-chrome:
<<: *defaults
Expand Down Expand Up @@ -2816,7 +2853,8 @@ linux-x64-workflow: &linux-x64-workflow
- run-vite-dev-server-integration-tests
- driver-integration-tests-firefox
- driver-integration-tests-chrome
- driver-integration-tests-chrome-beta
- driver-integration-tests-chrome-inject-document-domain
- driver-integration-tests-chrome-beta-inject-document-domain
- driver-integration-tests-electron
- driver-integration-tests-webkit
- driver-integration-memory-tests
Expand Down Expand Up @@ -2873,10 +2911,18 @@ linux-x64-workflow: &linux-x64-workflow
context: test-runner:cypress-record-key
requires:
- build
- driver-integration-tests-chrome-inject-document-domain:
context: test-runner:cypress-record-key
requires:
- build
- driver-integration-tests-chrome-beta:
context: test-runner:cypress-record-key
requires:
- build
- driver-integration-tests-chrome-beta-inject-document-domain:
context: test-runner:cypress-record-key
requires:
- build
- driver-integration-tests-firefox:
context: test-runner:cypress-record-key
requires:
Expand Down Expand Up @@ -3000,6 +3046,8 @@ linux-x64-workflow: &linux-x64-workflow
- driver-integration-tests-firefox
- driver-integration-tests-chrome
- driver-integration-tests-chrome-beta
- driver-integration-tests-chrome-inject-document-domain
- driver-integration-tests-chrome-beta-inject-document-domain
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding firefox and electron to this mix was going to be pretty cumbersome - I'd like to refactor workflows.yml to use matrix parameters, which would make all of this so much easier.

- driver-integration-tests-electron
- driver-integration-tests-webkit
- driver-integration-memory-tests
Expand Down Expand Up @@ -3234,10 +3282,18 @@ linux-x64-contributor-workflow: &linux-x64-contributor-workflow
context: test-runner:cypress-record-key
requires:
- contributor-pr
- driver-integration-tests-chrome-inject-document-domain:
context: test-runner:cypress-record-key
requires:
- contributor-pr
- driver-integration-tests-chrome-beta:
context: test-runner:cypress-record-key
requires:
- contributor-pr
- driver-integration-tests-chrome-beta-inject-document-domain:
context: test-runner:cypress-record-key
requires:
- contributor-pr
- driver-integration-tests-firefox:
context: test-runner:cypress-record-key
requires:
Expand Down
9 changes: 7 additions & 2 deletions cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ declare namespace Cypress {
strategy: 'file' | 'http'
origin: string
fileServer: string | null
props: Record<string, any>
visiting: string
props: Record<string, any> | null
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

visiting was never used or set internally that I could find, and props not being nullable was inconsistent with the implementation. Potential improvement: import this type directly from packages/server/lib/remote_states so it stays consistent with the implementation

}

interface Backend {
Expand Down Expand Up @@ -3113,6 +3112,12 @@ declare namespace Cypress {
* @default null
*/
experimentalSkipDomainInjection: string[] | null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cacieprins This experimentalSkipDomainInjection type should be removed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks to need some adjustments in @packages.config where we need to remove the option experimentalSkipDomainInjection as well as adding an option that it was removed here and updating EXPERIMENTAL_USE_DEFAULT_DOCUMENT_DOMAIN_E2E_ONLY to the new option

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 full removal of experimentalSkipDomainInjection should be in a follow-up PR, to keep the scope of this as manageable as possible

/**
* Enables setting document.domain to the superdomain on code injection. This option is
* disabled by default. Enabling this option allows for navigating between subdomains in
* the same test without the use of cy.origin().
*/
injectDocumentDomain: boolean
/**
* Enables AST-based JS/HTML rewriting. This may fix issues caused by the existing regex-based JS/HTML replacement algorithm.
* @default false
Expand Down
63 changes: 32 additions & 31 deletions npm/cypress-schematic/src/ct.spec.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
import { describe, it } from 'vitest'
import { describe, it, beforeEach, afterEach } from 'vitest'
import Fixtures, { ProjectFixtureDir } from '@tooling/system-tests'
import * as FixturesScaffold from '@tooling/system-tests/lib/dep-installer'
import execa from 'execa'
import path from 'path'
import * as fs from 'fs-extra'

const scaffoldAngularProject = async (project: string) => {
const projectPath = Fixtures.projectPath(project)

Fixtures.removeProject(project)
await Fixtures.scaffoldProject(project)
await FixturesScaffold.scaffoldProjectNodeModules({ project })
await fs.remove(path.join(projectPath, 'cypress.config.ts'))
await fs.remove(path.join(projectPath, 'cypress'))

return projectPath
}

const runCommandInProject = (command: string, projectPath: string) => {
const [ex, ...args] = command.split(' ')

Expand All @@ -38,25 +26,38 @@ const cypressSchematicPackagePath = path.join(__dirname, '..')

const ANGULAR_PROJECTS: ProjectFixtureDir[] = ['angular-18', 'angular-19']

describe('ng add @cypress/schematic / e2e and ct', { timeout: 1000 * 60 * 5 }, function () {
for (const project of ANGULAR_PROJECTS) {
it('should install ct files with option and no component specs', async () => {
const projectPath = await scaffoldAngularProject(project)
const timeout = 1000 * 60 * 5

await runCommandInProject(`yarn add @cypress/schematic@file:${cypressSchematicPackagePath}`, projectPath)
await runCommandInProject('yarn ng add @cypress/schematic --e2e --component', projectPath)
await copyAngularMount(projectPath)
await runCommandInProject('yarn ng run angular:ct --watch false --spec src/app/app.component.cy.ts', projectPath)
})

it('should generate component alongside component spec', async () => {
const projectPath = await scaffoldAngularProject(project)

await runCommandInProject(`yarn add @cypress/schematic@file:${cypressSchematicPackagePath}`, projectPath)
await runCommandInProject('yarn ng add @cypress/schematic --e2e --component', projectPath)
await copyAngularMount(projectPath)
await runCommandInProject('yarn ng generate c foo', projectPath)
await runCommandInProject('yarn ng run angular:ct --watch false --spec src/app/foo/foo.component.cy.ts', projectPath)
describe('ng add @cypress/schematic / e2e and ct', function () {
for (const project of ANGULAR_PROJECTS) {
describe(project, () => {
const projectPath: string = Fixtures.projectPath(project)

beforeEach(async () => {
await Fixtures.scaffoldProject(project)
await FixturesScaffold.scaffoldProjectNodeModules({ project })
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moving the scaffoldAngularProject function inline into a beforeEach here keeps the DRY while improving the readability of the spec

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we consider moving these changes into its own PR for a quick review and to reduce changeset here?

Copy link
Contributor Author

@cacieprins cacieprins Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so - This refactor was done to help understand why the tests were failing, and don't actually change the nature of the tests other than clarification of stdout.

await fs.remove(path.join(projectPath, 'cypress.config.ts'))
await fs.remove(path.join(projectPath, 'cypress'))

await runCommandInProject(`yarn add @cypress/schematic@file:${cypressSchematicPackagePath}`, projectPath)
}, timeout)

afterEach(() => {
Fixtures.removeProject(project)
}, timeout)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving the cleanup to an afterEach ensures that the project is removed after the last it(), rather than left in place


it('should install ct files with option and no component specs', async () => {
await runCommandInProject('yarn ng add @cypress/schematic --e2e --component', projectPath)
await copyAngularMount(projectPath)
await runCommandInProject('yarn ng run angular:ct --watch false --spec src/app/app.component.cy.ts', projectPath)
}, timeout)

it('should generate component alongside component spec', async () => {
await runCommandInProject('yarn ng add @cypress/schematic --e2e --component', projectPath)
await copyAngularMount(projectPath)
await runCommandInProject('yarn ng generate c foo', projectPath)
await runCommandInProject('yarn ng run angular:ct --watch false --spec src/app/foo/foo.component.cy.ts', projectPath)
}, timeout)
})
}
})
8 changes: 1 addition & 7 deletions npm/vite-dev-server/src/plugins/cypress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,7 @@ export const Cypress = (
},
configureServer: async (server: ViteDevServer) => {
server.middlewares.use(`${base}index.html`, async (req, res) => {
let transformedIndexHtml = await server.transformIndexHtml(base, '')
const viteImport = `<script type="module" src="${options.cypressConfig.devServerPublicPathRoute}/@vite/client"></script>`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because document.domain is no longer injected by default in cy, it doesn't need to be set in vite-dev-server for the sake of cy-in-cy tests!


// If we're doing cy-in-cy, we need to be able to access the Cypress instance from the parent frame.
if (process.env.CYPRESS_INTERNAL_VITE_OPEN_MODE_TESTING) {
transformedIndexHtml = transformedIndexHtml.replace(viteImport, `<script>document.domain = 'localhost';</script>${viteImport}`)
}
const transformedIndexHtml = await server.transformIndexHtml(base, '')

return res.end(transformedIndexHtml)
})
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -278,5 +278,6 @@
"devtools-protocol": "0.0.1346313",
"sharp": "0.29.3",
"vue-template-compiler": "2.6.12"
}
},
"packageManager": "[email protected]+sha512.ff4579ab459bb25aa7c0ff75b62acebe576f6084b36aa842971cf250a5d8c6cd3bc9420b22ce63c7f93a0857bc6ef29291db39c3e7a23aab5adfd5a4dd6c5d71"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using yarn in conjunction with corepack added this line

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think develop is on 1.22.22 which gets set via yarn set version. We might need to merge develop into 14 which I can look into shortly

}
3 changes: 3 additions & 0 deletions packages/config/__snapshots__/index.spec.ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ exports['config/src/index .getDefaultValues returns list of public config keys 1
'experimentalRunAllSpecs': false,
'experimentalMemoryManagement': false,
'experimentalModifyObstructiveThirdPartyCode': false,
'injectDocumentDomain': false,
'experimentalSkipDomainInjection': null,
'experimentalOriginDependencies': false,
'experimentalSourceRewriting': false,
Expand Down Expand Up @@ -131,6 +132,7 @@ exports['config/src/index .getDefaultValues returns list of public config keys f
'experimentalRunAllSpecs': false,
'experimentalMemoryManagement': false,
'experimentalModifyObstructiveThirdPartyCode': false,
'injectDocumentDomain': false,
'experimentalSkipDomainInjection': null,
'experimentalOriginDependencies': false,
'experimentalSourceRewriting': false,
Expand Down Expand Up @@ -218,6 +220,7 @@ exports['config/src/index .getPublicConfigKeys returns list of public config key
'experimentalRunAllSpecs',
'experimentalMemoryManagement',
'experimentalModifyObstructiveThirdPartyCode',
'injectDocumentDomain',
'experimentalSkipDomainInjection',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be removed from the snapshots

Suggested change
'experimentalSkipDomainInjection',
'',

'experimentalOriginDependencies',
'experimentalSourceRewriting',
Expand Down
21 changes: 21 additions & 0 deletions packages/config/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,12 @@ const driverConfigOptions: Array<DriverConfigOption> = [
isExperimental: true,
requireRestartOnChange: 'server',
}, {
name: 'injectDocumentDomain',
defaultValue: false,
validation: validate.isBoolean,
requireRestartOnChange: 'server',
},
{
name: 'experimentalSkipDomainInjection',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't need this anymore as well

defaultValue: null,
validation: validate.isNullOrArrayOfStrings,
Expand Down Expand Up @@ -768,6 +774,16 @@ export const testingTypeBreakingOptions: { e2e: Array<BreakingOption>, component
errorKey: 'JIT_COMPONENT_TESTING',
isWarning: false,
},
{
name: 'experimentalSkipDomainInjection',
errorKey: 'EXPERIMENTAL_SKIP_DOMAIN_INJECTION',
isWarning: false,
},
{
name: 'injectDocumentDomain',
errorKey: 'INJECT_DOCUMENT_DOMAIN_DEPRECATION',
isWarning: true,
},
],
component: [
{
Expand Down Expand Up @@ -800,5 +816,10 @@ export const testingTypeBreakingOptions: { e2e: Array<BreakingOption>, component
errorKey: 'EXPERIMENTAL_USE_DEFAULT_DOCUMENT_DOMAIN_E2E_ONLY',
isWarning: false,
},
{
name: 'injectDocumentDomain',
errorKey: 'INJECT_DOCUMENT_DOMAIN_E2E_ONLY',
isWarning: false,
},
],
}
7 changes: 5 additions & 2 deletions packages/config/test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,12 @@ describe('config/src/index', () => {

describe('.validateNeedToRestartOnChange', () => {
it('returns the need to restart if given key has changed', () => {
const result = configUtil.validateNeedToRestartOnChange({ blockHosts: [] }, { blockHosts: ['https://example.com'] })
expect(configUtil.validateNeedToRestartOnChange({ blockHosts: [] }, { blockHosts: ['https://example.com'] })).to.eql({
server: true,
browser: false,
})

expect(result).to.eql({
expect(configUtil.validateNeedToRestartOnChange({ injectDocumentDomain: true }, {})).to.eql({
server: true,
browser: false,
})
Expand Down
2 changes: 2 additions & 0 deletions packages/config/test/project/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,7 @@ describe('config/src/project/utils', () => {
fixturesFolder: { value: 'cypress/fixtures', from: 'default' },
hosts: { value: null, from: 'default' },
includeShadowDom: { value: false, from: 'default' },
injectDocumentDomain: { value: false, from: 'default' },
justInTimeCompile: { value: true, from: 'default' },
isInteractive: { value: true, from: 'default' },
keystrokeDelay: { value: 0, from: 'default' },
Expand Down Expand Up @@ -1204,6 +1205,7 @@ describe('config/src/project/utils', () => {
fixturesFolder: { value: 'cypress/fixtures', from: 'default' },
hosts: { value: null, from: 'default' },
includeShadowDom: { value: false, from: 'default' },
injectDocumentDomain: { value: false, from: 'default' },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can remove experimentalSkipDomainInjection from the spec

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'd like to separate out the full removal of experimentalSkipDomainInjection into a follow-up

justInTimeCompile: { value: true, from: 'default' },
isInteractive: { value: true, from: 'default' },
keystrokeDelay: { value: 0, from: 'default' },
Expand Down
Loading
Loading