Skip to content

Commit 3bbd333

Browse files
committed
Merge branch 'unified-desktop-gui' into tgriesser/unify/ui-data-push
* unified-desktop-gui: (40 commits) feat: index.html configurability and storybook support (#18242) fix: remove .json check from require_async, prevent child_process spawn (#18416) percy snapshot the tooltip visually, prevent it from being hidden fix: failing tests from #18372 (#18414) fix: `everyNthFrame` should only be applied for Chrome 89+ (#18392) feat(app): render spec list, command log, iframe (#18372) fix: drag and drop to be correct directory (#18400) refactor: Add GitDataSource, FileDataSource, toast for errors (#18385) docs: General updates to contributing guide (#18283) Add shorter --ct alias for --component Add --e2e and --component CLI options chore: Update Chrome (beta) to 95.0.4638.40 (#18389) chore: use circleci timings split for e2e tests (#18367) fix: fixed title (#18370) chore(deps): update dependency electron to v14 🌟 (#18384) chore(server): share client route (#18215) fix: Prevent Cypress from crashing when argument parsing "spec: {}" (#18312) chore: update husky dev dependency to v7 (#18345) feat: add defineConfig function to help type config (#18302) chore: Update Chrome (stable) to 94.0.4606.71 (#18324) ...
2 parents eaa6f93 + 0fede06 commit 3bbd333

File tree

279 files changed

+13440
-748
lines changed

Some content is hidden

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

279 files changed

+13440
-748
lines changed

CONTRIBUTING.md

+63-57
Large diffs are not rendered by default.

browser-versions.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"chrome:beta": "95.0.4638.32",
2+
"chrome:beta": "95.0.4638.40",
33
"chrome:stable": "94.0.4606.71"
44
}

circle.yml

+22-5
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,16 @@ commands:
398398
description: ct or e2e
399399
type: enum
400400
enum: ['ct', 'e2e']
401+
debug:
402+
description: debug option
403+
type: string
404+
default: ''
401405
steps:
402406
- restore_cached_workspace
403407
- run:
404408
command: |
409+
DEBUG=<<parameters.debug>> \
410+
CYPRESS_INTERNAL_FORCE_BROWSER_RELAUNCH='true' \
405411
CYPRESS_KONFIG_ENV=production \
406412
CYPRESS_RECORD_KEY=$TEST_LAUNCHPAD_RECORD_KEY \
407413
yarn workspace @packages/<<parameters.package>> cypress:run:<<parameters.type>> --browser <<parameters.browser>> --record --parallel --group <<parameters.package>>-<<parameters.type>>
@@ -454,7 +460,20 @@ commands:
454460
steps:
455461
- restore_cached_workspace
456462
- run:
457-
command: yarn workspace @packages/server test ./test/e2e/$(( $CIRCLE_NODE_INDEX ))_*spec* --browser <<parameters.browser>>
463+
command: |
464+
ALL_SPECS=`circleci tests glob "/root/cypress/packages/server/test/e2e/*spec*"`
465+
SPECS=
466+
for file in $ALL_SPECS; do
467+
# filter out non_root tests, they have their own stage
468+
if [[ "$file" == *"non_root"* ]]; then
469+
echo "Skipping $file"
470+
continue
471+
fi
472+
SPECS="$SPECS $file"
473+
done
474+
SPECS=`echo $SPECS | xargs -n 1 | circleci tests split --split-by=timings`
475+
echo SPECS=$SPECS
476+
yarn workspace @packages/server test $SPECS --browser <<parameters.browser>>
458477
- verify-mocha-results
459478
- store_test_results:
460479
path: /tmp/cypress
@@ -1032,9 +1051,6 @@ jobs:
10321051
- run: yarn test
10331052
# run type checking for each individual package
10341053
- run: yarn lerna run types
1035-
# check for compile errors with the releaserc scripts
1036-
- run: yarn test-npm-package-release-script
1037-
10381054
- verify-mocha-results:
10391055
expectedResultCount: 9
10401056
- store_test_results:
@@ -1184,12 +1200,13 @@ jobs:
11841200

11851201
run-launchpad-component-tests-chrome:
11861202
<<: *defaults
1187-
parallelism: 3
1203+
parallelism: 7
11881204
steps:
11891205
- run-new-ui-tests:
11901206
browser: chrome
11911207
package: launchpad
11921208
type: ct
1209+
# debug: cypress:*,engine:socket
11931210

11941211
run-launchpad-integration-tests-chrome:
11951212
<<: *defaults

cli/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ yarn test-watch --scope cypress
2929
yarn test-debug --scope cypress
3030
```
3131

32-
### Updating snaphots
32+
### Updating snapshots
3333

3434
Prepend `SNAPSHOT_UPDATE=1` to any test command. See [`snap-shot-it` instructions](https://github.com/bahmutov/snap-shot-it#advanced-use) for more info.
3535

cli/__snapshots__/cli_spec.js

+4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ exports['shows help for open --foo 1'] = `
2121
-c, --config <config> sets configuration values. separate multiple
2222
values with a comma. overrides any value in
2323
cypress.json.
24+
--ct, --component runs component tests
2425
-C, --config-file <config-file> path to JSON file where configuration values
2526
are set. defaults to "cypress.json". pass
2627
"false" to disable.
2728
-d, --detached [bool] runs Cypress application in detached mode
29+
--e2e runs end to end tests
2830
-e, --env <env> sets environment variables. separate
2931
multiple values with a comma. overrides any
3032
value in cypress.json or cypress.env.json
@@ -64,8 +66,10 @@ exports['shows help for run --foo 1'] = `
6466
Options:
6567
-b, --browser <browser-name-or-path> runs Cypress in the browser with the given name. if a filesystem path is supplied, Cypress will attempt to use the browser at that path.
6668
--ci-build-id <id> the unique identifier for a run on your CI provider. typically a "BUILD_ID" env var. this value is automatically detected for most CI providers
69+
--ct, --component runs component tests
6770
-c, --config <config> sets configuration values. separate multiple values with a comma. overrides any value in cypress.json.
6871
-C, --config-file <config-file> path to JSON file where configuration values are set. defaults to "cypress.json". pass "false" to disable.
72+
--e2e runs end to end tests
6973
-e, --env <env> sets environment variables. separate multiple values with a comma. overrides any value in cypress.json or cypress.env.json
7074
--group <name> a named group for recorded runs in the Cypress Dashboard
7175
-k, --key <record-key> your secret Record Key. you can omit this if you set a CYPRESS_RECORD_KEY environment variable.

cli/lib/cli.js

+6
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,12 @@ const descriptions = {
106106
cachePath: 'print the path to the binary cache',
107107
cacheSize: 'Used with the list command to show the sizes of the cached folders',
108108
ciBuildId: 'the unique identifier for a run on your CI provider. typically a "BUILD_ID" env var. this value is automatically detected for most CI providers',
109+
component: 'runs component tests',
109110
config: 'sets configuration values. separate multiple values with a comma. overrides any value in cypress.json.',
110111
configFile: 'path to JSON file where configuration values are set. defaults to "cypress.json". pass "false" to disable.',
111112
detached: 'runs Cypress application in detached mode',
112113
dev: 'runs cypress in development and bypasses binary check',
114+
e2e: 'runs end to end tests',
113115
env: 'sets environment variables. separate multiple values with a comma. overrides any value in cypress.json or cypress.env.json',
114116
exit: 'keep the browser open after tests finish',
115117
forceInstall: 'force install the Cypress binary',
@@ -248,8 +250,10 @@ const addCypressRunCommand = (program) => {
248250
.description('Runs Cypress tests from the CLI without the GUI')
249251
.option('-b, --browser <browser-name-or-path>', text('browserRunMode'))
250252
.option('--ci-build-id <id>', text('ciBuildId'))
253+
.option('--ct, --component', text('component'))
251254
.option('-c, --config <config>', text('config'))
252255
.option('-C, --config-file <config-file>', text('configFile'))
256+
.option('--e2e', text('e2e'))
253257
.option('-e, --env <env>', text('env'))
254258
.option('--group <name>', text('group'))
255259
.option('-k, --key <record-key>', text('key'))
@@ -386,8 +390,10 @@ module.exports = {
386390
.description('Opens Cypress in the interactive GUI.')
387391
.option('-b, --browser <browser-path>', text('browserOpenMode'))
388392
.option('-c, --config <config>', text('config'))
393+
.option('--ct, --component', text('component'))
389394
.option('-C, --config-file <config-file>', text('configFile'))
390395
.option('-d, --detached [bool]', text('detached'), coerceFalse)
396+
.option('--e2e', text('e2e'))
391397
.option('-e, --env <env>', text('env'))
392398
.option('--global', text('global'))
393399
.option('-p, --port <port>', text('port'))

cli/lib/exec/open.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module.exports = {
3636
args.push('--project', options.project)
3737
}
3838

39-
args.push(...processTestingType(options.testingType))
39+
args.push(...processTestingType(options))
4040

4141
debug('opening from options %j', options)
4242
debug('command line arguments %j', args)

cli/lib/exec/run.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ const processRunOptions = (options = {}) => {
137137
args.push('--tag', options.tag)
138138
}
139139

140-
args.push(...processTestingType(options.testingType))
140+
args.push(...processTestingType(options))
141141

142142
return args
143143
}

cli/lib/exec/shared.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ const throwInvalidOptionError = (details) => {
2323
* @param {string} testingType The type of tests being executed
2424
* @returns {string[]} The array of new exec arguments
2525
*/
26-
const processTestingType = (testingType) => {
27-
if (testingType) {
28-
if (testingType === 'e2e') {
29-
return ['--testing-type', 'e2e']
30-
}
26+
const processTestingType = (options) => {
27+
if (options.testingType === 'component' || options.component || options.ct) {
28+
return ['--testing-type', 'component']
29+
}
3130

32-
if (testingType === 'component') {
33-
return ['--testing-type', 'component']
34-
}
31+
if (options.testingType === 'e2e' || options.e2e) {
32+
return ['--testing-type', 'e2e']
33+
}
3534

35+
if (options.testingType) {
3636
return throwInvalidOptionError(errors.invalidTestingType)
3737
}
3838

cli/lib/util.js

+3
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,15 @@ const parseOpts = (opts) => {
197197
'cacheClear',
198198
'cachePrune',
199199
'ciBuildId',
200+
'ct',
201+
'component',
200202
'config',
201203
'configFile',
202204
'cypressVersion',
203205
'destination',
204206
'detached',
205207
'dev',
208+
'e2e',
206209
'exit',
207210
'env',
208211
'force',

cli/test/lib/exec/run_spec.js

+14
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,20 @@ describe('exec run', function () {
190190
})
191191
})
192192

193+
it('spawns with --testing-type e2e when given --e2e', function () {
194+
return run.start({ e2e: true })
195+
.then(() => {
196+
expect(spawn.start).to.be.calledWith(['--run-project', process.cwd(), '--testing-type', 'e2e'])
197+
})
198+
})
199+
200+
it('spawns with --testing-type component when given --ct', function () {
201+
return run.start({ ct: true })
202+
.then(() => {
203+
expect(spawn.start).to.be.calledWith(['--run-project', process.cwd(), '--testing-type', 'component'])
204+
})
205+
})
206+
193207
it('spawns with --tag value', function () {
194208
return run.start({ tag: 'nightly' })
195209
.then(() => {

npm/react/examples/react-scripts-typescript/package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@
55
"start": "react-scripts start",
66
"test": "node ../../../../scripts/cypress run-ct"
77
},
8+
"dependencies": {
9+
"react": "^17.0.1",
10+
"react-dom": "^17.0.1",
11+
"react-scripts": "4.0.3"
12+
},
813
"devDependencies": {
914
"@cypress/react": "file:../../dist",
1015
"@types/react": "^17.0.0",
1116
"@types/react-dom": "^17.0.0",
1217
"mocha-junit-reporter": "^2.0.0",
1318
"mocha-multi-reporters": "^1.5.1",
14-
"react": "^17.0.1",
15-
"react-dom": "^17.0.1",
16-
"react-scripts": "4.0.3",
1719
"typescript": "^4.2.3"
1820
}
1921
}

0 commit comments

Comments
 (0)