Skip to content

Commit 9e8adec

Browse files
committed
Merge branch '10.0-release' into tgriesser/feat/UNIFY-1206
* 10.0-release: (92 commits) chore: remove dependency-tree dep (#20905) chore(launchpad): work on infra for scaffold tests (#20818) fix: build mjs in the cli (#20889) fix(unify): Cypress version link should point to Cypress doc's changelog (#20869) fix: windows build (#20854) fix: add index.mjs to the published files of cli (#20884) refactor: lift indexHtmlFile up to component, add validation (#20870) fix: allow migration of pluginsFile using `env` properties (#20770) fix: viewport from CLI on CT (#20849) Don't communicate if process isn't connected Remove config.get Update packages/data-context/src/data/ProjectLifecycleManager.ts fix: git data source unit test failure (#20875) add comment for autoBindDebug fix: Ensuring current browser is synchronized between app and launchpad (#20830) Fix missed await on merge conflict resolution test(unification): move record keys to contexts (#20860) test: move record keys to contexts (#20859) PR comments Fix tests that visit app without a configured testing type ...
2 parents 788b156 + 2909c93 commit 9e8adec

File tree

260 files changed

+4663
-4248
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

260 files changed

+4663
-4248
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,5 @@ system-tests/projects/nuxtjs-vue2-unconfigured/**/*
9191
system-tests/projects/nuxtjs-vue2-configured/**/*
9292

9393
system-tests/projects/react-app-webpack-5-unconfigured/**/*
94+
95+
system-tests/projects/**/*/expected-cypress*/**/*

browser-versions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"chrome:beta": "100.0.4896.46",
3-
"chrome:stable": "99.0.4844.82"
2+
"chrome:beta": "100.0.4896.60",
3+
"chrome:stable": "100.0.4896.60"
44
}

circle.yml

Lines changed: 41 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ mainBuildFilters: &mainBuildFilters
2929
only:
3030
- develop
3131
- 10.0-release
32+
- 10.0-use-contexts
3233

3334
# usually we don't build Mac app - it takes a long time
3435
# but sometimes we want to really confirm we are doing the right thing
@@ -38,6 +39,7 @@ macWorkflowFilters: &mac-workflow-filters
3839
or:
3940
- equal: [ develop, << pipeline.git.branch >> ]
4041
- equal: [ '10.0-release', << pipeline.git.branch >> ]
42+
- equal: [ 10.0-use-contexts, << pipeline.git.branch >> ]
4143
- matches:
4244
pattern: "-release$"
4345
value: << pipeline.git.branch >>
@@ -47,6 +49,7 @@ windowsWorkflowFilters: &windows-workflow-filters
4749
or:
4850
- equal: [ develop, << pipeline.git.branch >> ]
4951
- equal: [ '10.0-release', << pipeline.git.branch >> ]
52+
- equal: [ 10.0-use-contexts, << pipeline.git.branch >> ]
5053
- matches:
5154
pattern: "-release$"
5255
value: << pipeline.git.branch >>
@@ -419,9 +422,9 @@ commands:
419422
echo Current working directory is $PWD
420423
echo Total containers $CIRCLE_NODE_TOTAL
421424
422-
if [[ -v PACKAGES_RECORD_KEY ]]; then
425+
if [[ -v MAIN_RECORD_KEY ]]; then
423426
# internal PR
424-
CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
427+
CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
425428
yarn cypress:run --record --parallel --group 5x-driver-<<parameters.browser>> --browser <<parameters.browser>>
426429
else
427430
# external PR
@@ -1416,7 +1419,7 @@ jobs:
14161419
- run:
14171420
command: |
14181421
CYPRESS_KONFIG_ENV=production \
1419-
CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
1422+
CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
14201423
PERCY_PARALLEL_NONCE=$CIRCLE_SHA1 \
14211424
PERCY_ENABLE=${PERCY_TOKEN:-0} \
14221425
PERCY_PARALLEL_TOTAL=-1 \
@@ -1440,7 +1443,7 @@ jobs:
14401443
- run:
14411444
command: |
14421445
CYPRESS_KONFIG_ENV=production \
1443-
CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
1446+
CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
14441447
yarn cypress:run --record --parallel --group ui-components
14451448
working_directory: packages/ui-components
14461449
- verify-mocha-results
@@ -1553,7 +1556,6 @@ jobs:
15531556
- run:
15541557
name: Run tests
15551558
# will use PERCY_TOKEN environment variable if available
1556-
#
15571559
command: |
15581560
CYPRESS_KONFIG_ENV=production \
15591561
PERCY_PARALLEL_NONCE=$CIRCLE_SHA1 \
@@ -1629,26 +1631,26 @@ jobs:
16291631
command: yarn workspace @cypress/eslint-plugin-dev test
16301632

16311633
npm-cypress-schematic:
1632-
<<: *defaults
1633-
resource_class: small
1634-
steps:
1635-
- restore_cached_workspace
1636-
- run:
1637-
name: Build + Install
1638-
command: |
1639-
yarn workspace @cypress/schematic build:all
1640-
working_directory: npm/cypress-schematic
1641-
- run:
1642-
name: Launch
1643-
command: |
1644-
yarn launch:test
1645-
working_directory: npm/cypress-schematic
1646-
- run:
1647-
name: Run unit tests
1648-
command: |
1649-
yarn test
1650-
working_directory: npm/cypress-schematic
1651-
- store-npm-logs
1634+
<<: *defaults
1635+
resource_class: small
1636+
steps:
1637+
- restore_cached_workspace
1638+
- run:
1639+
name: Build + Install
1640+
command: |
1641+
yarn workspace @cypress/schematic build:all
1642+
working_directory: npm/cypress-schematic
1643+
- run:
1644+
name: Launch
1645+
command: |
1646+
yarn launch:test
1647+
working_directory: npm/cypress-schematic
1648+
- run:
1649+
name: Run unit tests
1650+
command: |
1651+
yarn test
1652+
working_directory: npm/cypress-schematic
1653+
- store-npm-logs
16521654

16531655
npm-release:
16541656
<<: *defaults
@@ -1675,7 +1677,7 @@ jobs:
16751677
- run:
16761678
name: Check current branch to persist artifacts
16771679
command: |
1678-
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "marktnoonan/backmerge-develop-3-8-22" && "$CIRCLE_BRANCH" != "10.0-release" ]]; then
1680+
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "10.0-use-contexts" && "$CIRCLE_BRANCH" != "10.0-release" ]]; then
16791681
echo "Not uploading artifacts or posting install comment for this branch."
16801682
circleci-agent step halt
16811683
fi
@@ -2148,6 +2150,7 @@ linux-workflow: &linux-workflow
21482150
- build
21492151
# unit, integration and e2e tests
21502152
- cli-visual-tests:
2153+
context: test-runner:percy
21512154
requires:
21522155
- build
21532156
- unit-tests:
@@ -2188,46 +2191,52 @@ linux-workflow: &linux-workflow
21882191
requires:
21892192
- system-tests-node-modules-install
21902193
- driver-integration-tests-chrome:
2194+
context: test-runner:cypress-record-key
21912195
requires:
21922196
- build
21932197
- driver-integration-tests-chrome-beta:
2198+
context: test-runner:cypress-record-key
21942199
requires:
21952200
- build
21962201
- driver-integration-tests-firefox:
2202+
context: test-runner:cypress-record-key
21972203
requires:
21982204
- build
21992205
- driver-integration-tests-electron:
2206+
context: test-runner:cypress-record-key
22002207
requires:
22012208
- build
22022209
- run-frontend-shared-component-tests-chrome:
2203-
context: test-runner:launchpad-tests
2210+
context: [test-runner:launchpad-tests, test-runner:percy]
22042211
percy: true
22052212
requires:
22062213
- build
22072214
- run-launchpad-integration-tests-chrome:
2208-
context: test-runner:launchpad-tests
2215+
context: [test-runner:launchpad-tests, test-runner:percy]
22092216
percy: true
22102217
requires:
22112218
- build
22122219
- run-launchpad-component-tests-chrome:
2213-
context: test-runner:launchpad-tests
2220+
context: [test-runner:launchpad-tests, test-runner:percy]
22142221
percy: true
22152222
requires:
22162223
- build
22172224
- run-app-integration-tests-chrome:
2218-
context: test-runner:launchpad-tests
2225+
context: [test-runner:launchpad-tests, test-runner:percy]
22192226
percy: true
22202227
requires:
22212228
- build
22222229
- run-app-component-tests-chrome:
2223-
context: test-runner:launchpad-tests
2230+
context: [test-runner:launchpad-tests, test-runner:percy]
22242231
percy: true
22252232
requires:
22262233
- build
22272234
- reporter-integration-tests:
2235+
context: [test-runner:cypress-record-key, test-runner:percy]
22282236
requires:
22292237
- build
22302238
- ui-components-integration-tests:
2239+
context: test-runner:cypress-record-key
22312240
requires:
22322241
- build
22332242
- npm-webpack-dev-server:
@@ -2243,6 +2252,7 @@ linux-workflow: &linux-workflow
22432252
requires:
22442253
- build
22452254
- npm-design-system:
2255+
context: test-runner:percy
22462256
requires:
22472257
- build
22482258
- npm-vue:

cli/__snapshots__/download_spec.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,15 @@ https://download.cypress.io/desktop/0.20.2?platform=OS&arch=ARCH
4444
exports['desktop url from template'] = `
4545
https://download.cypress.io/desktop/0.20.2/darwin-x64/cypress.zip
4646
`
47+
48+
exports['desktop url from template with escaped dollar sign'] = `
49+
https://download.cypress.io/desktop/0.20.2/darwin-x64/cypress.zip
50+
`
51+
52+
exports['desktop url from template wrapped in quote'] = `
53+
https://download.cypress.io/desktop/0.20.2/darwin-x64/cypress.zip
54+
`
55+
56+
exports['desktop url from template with escaped dollar sign wrapped in quote'] = `
57+
https://download.cypress.io/desktop/0.20.2/darwin-x64/cypress.zip
58+
`

cli/lib/tasks/download.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,15 @@ const getCA = () => {
6464
const prepend = (urlPath) => {
6565
const endpoint = url.resolve(getBaseUrl(), urlPath)
6666
const platform = os.platform()
67-
const pathTemplate = util.getEnv('CYPRESS_DOWNLOAD_PATH_TEMPLATE')
67+
const pathTemplate = util.getEnv('CYPRESS_DOWNLOAD_PATH_TEMPLATE', true)
6868

6969
return pathTemplate
70-
? pathTemplate.replace('${endpoint}', endpoint).replace('${platform}', platform).replace('${arch}', arch())
70+
? (
71+
pathTemplate
72+
.replace(/\\?\$\{endpoint\}/, endpoint)
73+
.replace(/\\?\$\{platform\}/, platform)
74+
.replace(/\\?\$\{arch\}/, arch())
75+
)
7176
: `${endpoint}?platform=${platform}&arch=${arch()}`
7277
}
7378

cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
"bin",
102102
"lib",
103103
"index.js",
104+
"index.mjs",
104105
"types/**/*.d.ts",
105106
"types/net-stubbing.ts"
106107
],

cli/scripts/start-build.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ includeTypes.forEach((folder) => {
2424

2525
shell.exec('babel lib -d build/lib')
2626
shell.exec('babel index.js -o build/index.js')
27+
shell.cp('index.mjs', 'build/index.mjs')

cli/test/lib/tasks/download_spec.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,27 @@ describe('lib/tasks/download', function () {
7272
snapshot('desktop url from template', normalize(url))
7373
})
7474

75+
it('returns custom url from template with escaped dollar sign', () => {
76+
process.env.CYPRESS_DOWNLOAD_PATH_TEMPLATE = '\\${endpoint}/\\${platform}-\\${arch}/cypress.zip'
77+
const url = download.getUrl('0.20.2')
78+
79+
snapshot('desktop url from template with escaped dollar sign', normalize(url))
80+
})
81+
82+
it('returns custom url from template wrapped in quote', () => {
83+
process.env.CYPRESS_DOWNLOAD_PATH_TEMPLATE = '"${endpoint}/${platform}-${arch}/cypress.zip"'
84+
const url = download.getUrl('0.20.2')
85+
86+
snapshot('desktop url from template wrapped in quote', normalize(url))
87+
})
88+
89+
it('returns custom url from template with escaped dollar sign wrapped in quote', () => {
90+
process.env.CYPRESS_DOWNLOAD_PATH_TEMPLATE = '"\\${endpoint}/\\${platform}-\\${arch}/cypress.zip"'
91+
const url = download.getUrl('0.20.2')
92+
93+
snapshot('desktop url from template with escaped dollar sign wrapped in quote', normalize(url))
94+
})
95+
7596
it('returns input if it is already an https link', () => {
7697
const url = 'https://somewhere.com'
7798
const result = download.getUrl(url)

cli/types/cypress.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2858,7 +2858,7 @@ declare namespace Cypress {
28582858
* Override default config options for E2E Testing runner.
28592859
* @default {}
28602860
*/
2861-
e2e: CoreConfigOptions
2861+
e2e: Omit<CoreConfigOptions, 'indexHtmlFile'>
28622862

28632863
/**
28642864
* An array of objects defining the certificates
@@ -2869,6 +2869,8 @@ declare namespace Cypress {
28692869
* Handle Cypress plugins
28702870
*/
28712871
setupNodeEvents: (on: PluginEvents, config: PluginConfigOptions) => Promise<PluginConfigOptions> | PluginConfigOptions
2872+
2873+
indexHtmlFile: string
28722874
}
28732875

28742876
/**
@@ -2971,7 +2973,7 @@ declare namespace Cypress {
29712973
/**
29722974
* Config options that can be assigned on cypress.config.{ts|js} file
29732975
*/
2974-
type UserConfigOptions<ComponentDevServerOpts = any> = Omit<ResolvedConfigOptions<ComponentDevServerOpts>, 'baseUrl' | 'excludeSpecPattern' | 'supportFile' | 'specPattern'>
2976+
type UserConfigOptions<ComponentDevServerOpts = any> = Omit<ResolvedConfigOptions<ComponentDevServerOpts>, 'baseUrl' | 'excludeSpecPattern' | 'supportFile' | 'specPattern' | 'indexHtmlFile'>
29752977

29762978
/**
29772979
* Takes ComponentDevServerOpts to track the signature of the devServerConfig for the provided `devServer`,

cli/types/tests/cypress-tests.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ namespace CypressConfigTests {
3737
Cypress.config({ e2e: { baseUrl: null }}) // $ExpectType void
3838
Cypress.config({ e2e: { baseUrl: '.', }}) // $ExpectType void
3939
Cypress.config({ component: { baseUrl: '.', devServer: () => ({} as any) } }) // $ExpectError
40+
Cypress.config({ e2e: { indexHtmlFile: 'index.html' } }) // $ExpectError
4041

4142
Cypress.config('taskTimeout') // $ExpectType number
4243
Cypress.config('includeShadowDom') // $ExpectType boolean

0 commit comments

Comments
 (0)