Skip to content

Commit 68e2adf

Browse files
committed
Merge branch 'unified-desktop-gui' into tgriesser/unify/rename-and-move-activeProject
* unified-desktop-gui: (57 commits) chore: Add e2e tests for global mode (#18719) chore: add percy to app and launchpad package (#18781) chore: update test refactor: move settings in app (#18729) feat: setup launchpad lifecycle (#18734) feat(app): decouple event manager from driver (#18695) chore: Force single resolution for core modules, infinite loop guard (#18764) fix(driver): Sticky elements within a fixed container will not prevent an element from being scrolled to (#18441) chore: cleaning up the runner container pattern (#18741) feat: Use .config files (#18578) chore(app): basic style and example to stop scrollIntoView bug (#18736) chore: make `create` function on server.ts obsolete (#18615) feat: add codegen utility (#18708) docs: Add instructions to squash commits to develop in Contributing (#18728) fix(@cypress/react): throw if using Next.js swc-loader without nodeVersion=system (#18686) refactor: remove Ramda (#18723) fix: support using create-cypress-tests as part of build process (#18714) chore: Increase paralleled machines for desktop-gui tests (#18725) fix(app): do not cache graphql (#18716) chore: Update Chrome (stable) to 95.0.4638.69 (#18696) ...
2 parents 2bcf65f + 0422ede commit 68e2adf

File tree

700 files changed

+9231
-4933
lines changed

Some content is hidden

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

700 files changed

+9231
-4933
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ packages/example/cypress/integration
5252

5353
# from frontend-shared
5454
packages/frontend-shared/cypress/e2e/.projects
55+
packages/frontend-shared/src/public/shiki/themes/cypress.theme.json
5556

5657
# from server
5758
packages/server/.cy

CONTRIBUTING.md

+2
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,8 @@ Independent packages are automatically released when code is merged into `master
573573
![Select release for PR](https://user-images.githubusercontent.com/1271364/135139641-657015d6-2dca-42d4-a4fb-16478f61d63f.png)
574574
- Please check the "Allow edits from maintainers" checkbox when submitting your PR. This will make it easier for the maintainers to make minor adjustments, to help with tests or any other changes we may need.
575575
![Allow edits from maintainers checkbox](https://user-images.githubusercontent.com/1271181/31393427-b3105d44-ada9-11e7-80f2-0dac51e3919e.png)
576+
- After the PR is approved, the original contributor can merge the PR (if the original contributor has access).
577+
- When you merge a PR into `develop`, select [**Squash and merge**](https://docs.github.com/en/github/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-pull-request-commits). This will squash all commits into a single commit. *The only exception to squashing is when converting files to another language and there is a clear commit history needed to maintain from the file conversion.*
576578
577579
### Dependencies
578580

apollo.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ module.exports = {
99
localSchemaFile: path.join(__dirname, 'packages/graphql/schemas/schema.graphql'),
1010
},
1111
tagName: 'gql',
12-
includes: [path.join(__dirname, 'packages/{launchpad,app}/src/**/*.vue')],
12+
includes: [path.join(__dirname, 'packages/{launchpad,app,frontend-shared}/src/**/*.vue')],
1313
},
1414
}

autobarrel.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"packages/data-context/src/**/*"
66
],
77
"ignore": [
8+
"packages/data-context/src/gen",
89
"packages/graphql/src/stitching",
910
"packages/graphql/src/testing",
1011
"packages/graphql/src/gen"

browser-versions.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"chrome:beta": "95.0.4638.54",
3-
"chrome:stable": "95.0.4638.54"
2+
"chrome:beta": "96.0.4664.27",
3+
"chrome:stable": "95.0.4638.69"
44
}

circle.yml

+69-23
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,10 @@ commands:
413413
CYPRESS_INTERNAL_FORCE_BROWSER_RELAUNCH='true' \
414414
CYPRESS_KONFIG_ENV=production \
415415
CYPRESS_RECORD_KEY=$TEST_LAUNCHPAD_RECORD_KEY \
416+
PERCY_PARALLEL_NONCE=$CIRCLE_WORKFLOW_ID \
417+
PERCY_ENABLE=${PERCY_TOKEN:-0} \
418+
PERCY_PARALLEL_TOTAL=-1 \
419+
yarn percy exec --parallel -- -- \
416420
yarn workspace @packages/<<parameters.package>> cypress:run:<<parameters.type>> --browser <<parameters.browser>> --record --parallel --group <<parameters.package>>-<<parameters.type>>
417421
- store_test_results:
418422
path: /tmp/cypress
@@ -516,20 +520,34 @@ commands:
516520
steps:
517521
- run: yarn verify:mocha:results <<parameters.expectedResultCount>>
518522

519-
clone-repo-and-checkout-release-branch:
523+
clone-repo-and-checkout-branch:
520524
description: |
521525
Clones an external repo and then checks out the branch that matches the next version otherwise uses 'master' branch.
522526
parameters:
523527
repo:
524528
description: "Name of the github repo to clone like: cypress-example-kitchensink"
525529
type: string
530+
pull_request_id:
531+
description: Pull request number to check out before installing and testing
532+
type: integer
533+
default: 0
526534
steps:
527535
- restore_cached_binary
528536
- run:
529537
name: "Cloning test project: <<parameters.repo>>"
530538
command: |
531539
git clone --depth 1 --no-single-branch https://github.com/cypress-io/<<parameters.repo>>.git /tmp/<<parameters.repo>>
532540
cd /tmp/<<parameters.repo>> && (git checkout $(node ./scripts/get-next-version) || true)
541+
- when:
542+
condition: <<parameters.pull_request_id>>
543+
steps:
544+
- run:
545+
name: Check out PR <<parameters.pull_request_id>>
546+
working_directory: /tmp/<<parameters.repo>>
547+
command: |
548+
git fetch origin pull/<<parameters.pull_request_id>>/head:pr-<<parameters.pull_request_id>>
549+
git checkout pr-<<parameters.pull_request_id>>
550+
git log -n 2
533551
534552
test-binary-against-rwa:
535553
description: |
@@ -571,7 +589,7 @@ commands:
571589
type: string
572590
default: "CI=true yarn start"
573591
steps:
574-
- clone-repo-and-checkout-release-branch:
592+
- clone-repo-and-checkout-branch:
575593
repo: <<parameters.repo>>
576594
- when:
577595
condition: <<parameters.pull_request_id>>
@@ -701,18 +719,9 @@ commands:
701719
type: string
702720
default: "npm start --if-present"
703721
steps:
704-
- clone-repo-and-checkout-release-branch:
722+
- clone-repo-and-checkout-branch:
705723
repo: <<parameters.repo>>
706-
- when:
707-
condition: <<parameters.pull_request_id>>
708-
steps:
709-
- run:
710-
name: Check out PR <<parameters.pull_request_id>>
711-
working_directory: /tmp/<<parameters.repo>>
712-
command: |
713-
git fetch origin pull/<<parameters.pull_request_id>>/head:pr-<<parameters.pull_request_id>>
714-
git checkout pr-<<parameters.pull_request_id>>
715-
git log -n 2
724+
pull_request_id: <<parameters.pull_request_id>>
716725
- run:
717726
# Install deps + Cypress binary with yarn if yarn.lock present
718727
command: |
@@ -724,6 +733,16 @@ commands:
724733
CYPRESS_INSTALL_BINARY=~/cypress/cypress.zip npm install ~/cypress/cypress.tgz
725734
fi
726735
working_directory: /tmp/<<parameters.repo>>
736+
- run:
737+
name: Scaffold new config file
738+
working_directory: /tmp/<<parameters.repo>>
739+
environment:
740+
CYPRESS_INTERNAL_FORCE_SCAFFOLD: "1"
741+
command: |
742+
if [[ -f cypress.json ]]; then
743+
rm -rf cypress.json
744+
echo 'module.exports = {}' > cypress.config.js
745+
fi
727746
- run:
728747
name: Print Cypress version
729748
working_directory: /tmp/<<parameters.repo>>
@@ -1005,7 +1024,7 @@ jobs:
10051024
fi
10061025
- wait-on-circle-jobs:
10071026
job-names: >
1008-
desktop-gui-integration-tests-2x,
1027+
desktop-gui-integration-tests-7x,
10091028
desktop-gui-component-tests,
10101029
cli-visual-tests,
10111030
runner-integration-tests-chrome,
@@ -1283,9 +1302,9 @@ jobs:
12831302
- run-driver-integration-tests:
12841303
browser: electron
12851304

1286-
desktop-gui-integration-tests-2x:
1305+
desktop-gui-integration-tests-7x:
12871306
<<: *defaults
1288-
parallelism: 2
1307+
parallelism: 7
12891308
steps:
12901309
- restore_cached_workspace
12911310
- run:
@@ -1610,9 +1629,17 @@ jobs:
16101629
test-kitchensink:
16111630
<<: *defaults
16121631
steps:
1613-
- clone-repo-and-checkout-release-branch:
1632+
- clone-repo-and-checkout-branch:
16141633
repo: cypress-example-kitchensink
1634+
pull_request_id: 510
16151635
- install-required-node
1636+
- run:
1637+
name: Remove cypress.json
1638+
description: Remove cypress.json in case it exists
1639+
working_directory: /tmp/cypress-example-kitchensink
1640+
environment:
1641+
CYPRESS_INTERNAL_FORCE_SCAFFOLD: "1"
1642+
command: rm -rf cypress.json
16161643
- run:
16171644
name: Install prod dependencies
16181645
command: yarn --production
@@ -1637,7 +1664,7 @@ jobs:
16371664
<<: *defaults
16381665
resource_class: medium
16391666
steps:
1640-
- clone-repo-and-checkout-release-branch:
1667+
- clone-repo-and-checkout-branch:
16411668
repo: cypress-example-kitchensink
16421669
- run:
16431670
name: Install prod dependencies
@@ -1662,7 +1689,7 @@ jobs:
16621689
<<: *defaults
16631690
resource_class: medium
16641691
steps:
1665-
- clone-repo-and-checkout-release-branch:
1692+
- clone-repo-and-checkout-branch:
16661693
repo: cypress-test-tiny
16671694
- run:
16681695
name: Run test project
@@ -1846,7 +1873,7 @@ jobs:
18461873
environment:
18471874
CYPRESS_INTERNAL_FORCE_SCAFFOLD: "1"
18481875
command: |
1849-
echo '{}' > cypress.json
1876+
echo 'module.exports = {}' > cypress.config.js
18501877
npx cypress run
18511878
18521879
test-full-typescript-project:
@@ -1878,6 +1905,14 @@ jobs:
18781905
name: Scaffold full TypeScript project 🏗
18791906
working_directory: <<parameters.wd>>
18801907
command: npx @bahmutov/cly@1 init --typescript
1908+
- run:
1909+
name: Scaffold new config file
1910+
working_directory: <<parameters.wd>>
1911+
environment:
1912+
CYPRESS_INTERNAL_FORCE_SCAFFOLD: "1"
1913+
command: |
1914+
rm -rf cypress.json
1915+
echo 'export default {}' > cypress.config.ts
18811916
- run:
18821917
name: Run project tests 🗳
18831918
working_directory: <<parameters.wd>>
@@ -1888,7 +1923,7 @@ jobs:
18881923
<<: *defaults
18891924
steps:
18901925
- restore_workspace_binaries
1891-
- clone-repo-and-checkout-release-branch:
1926+
- clone-repo-and-checkout-branch:
18921927
repo: cypress-test-tiny
18931928
- run:
18941929
name: Install Cypress
@@ -1940,6 +1975,7 @@ jobs:
19401975
- test-binary-against-repo:
19411976
repo: cypress-example-kitchensink
19421977
browser: "electron"
1978+
pull_request_id: 510
19431979

19441980
test-binary-against-awesome-typescript-loader:
19451981
<<: *defaults
@@ -1955,6 +1991,7 @@ jobs:
19551991
- test-binary-against-repo:
19561992
repo: cypress-example-kitchensink
19571993
browser: firefox
1994+
pull_request_id: 510
19581995

19591996
"test-binary-against-kitchensink-chrome":
19601997
<<: *defaults
@@ -1963,6 +2000,7 @@ jobs:
19632000
- test-binary-against-repo:
19642001
repo: cypress-example-kitchensink
19652002
browser: chrome
2003+
pull_request_id: 510
19662004

19672005
"test-binary-against-todomvc-firefox":
19682006
<<: *defaults
@@ -2056,6 +2094,14 @@ jobs:
20562094
name: Add Cypress demo
20572095
working_directory: test-binary
20582096
command: npx @bahmutov/cly init
2097+
- run:
2098+
name: Scaffold new config file
2099+
working_directory: test-binary
2100+
environment:
2101+
CYPRESS_INTERNAL_FORCE_SCAFFOLD: "1"
2102+
command: |
2103+
rm -rf cypress.json
2104+
echo 'module.exports = {}' > cypress.config.js
20592105
- run:
20602106
name: Verify Cypress binary
20612107
working_directory: test-binary
@@ -2166,7 +2212,7 @@ linux-workflow: &linux-workflow
21662212
# context: test-runner:launchpad-tests
21672213
# requires:
21682214
# - build
2169-
- desktop-gui-integration-tests-2x:
2215+
- desktop-gui-integration-tests-7x:
21702216
requires:
21712217
- build
21722218
- desktop-gui-component-tests:
@@ -2237,7 +2283,7 @@ linux-workflow: &linux-workflow
22372283
- reporter-integration-tests
22382284
- Linux lint
22392285
- desktop-gui-component-tests
2240-
- desktop-gui-integration-tests-2x
2286+
- desktop-gui-integration-tests-7x
22412287
- runner-ct-integration-tests-chrome
22422288
- runner-integration-tests-firefox
22432289
- runner-integration-tests-chrome

cli/__snapshots__/cli_spec.js

+11-9
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,21 @@ exports['shows help for open --foo 1'] = `
2121
--component runs component tests
2222
-c, --config <config> sets configuration values. separate multiple
2323
values with a comma. overrides any value in
24-
cypress.json.
24+
cypress.config.{ts|js}.
2525
-C, --config-file <config-file> path to JSON file where configuration values
26-
are set. defaults to "cypress.json". pass
27-
"false" to disable.
26+
are set. defaults to
27+
"cypress.config.{ts|js}". pass "false" to
28+
disable.
2829
-d, --detached [bool] runs Cypress application in detached mode
2930
--e2e runs end to end tests
3031
-e, --env <env> sets environment variables. separate
3132
multiple values with a comma. overrides any
32-
value in cypress.json or cypress.env.json
33+
value in cypress.config.{ts|js} or
34+
cypress.env.json
3335
--global force Cypress into global mode as if its
3436
globally installed
3537
-p, --port <port> runs Cypress on a specific port. overrides
36-
any value in cypress.json.
38+
any value in cypress.config.{ts|js}.
3739
-P, --project <project-path> path to the project
3840
--dev runs cypress in development and bypasses
3941
binary check
@@ -67,17 +69,17 @@ exports['shows help for run --foo 1'] = `
6769
-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.
6870
--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
6971
--component runs component tests
70-
-c, --config <config> sets configuration values. separate multiple values with a comma. overrides any value in cypress.json.
71-
-C, --config-file <config-file> path to JSON file where configuration values are set. defaults to "cypress.json". pass "false" to disable.
72+
-c, --config <config> sets configuration values. separate multiple values with a comma. overrides any value in cypress.config.{ts|js}.
73+
-C, --config-file <config-file> path to JSON file where configuration values are set. defaults to "cypress.config.{ts|js}". pass "false" to disable.
7274
--e2e runs end to end tests
73-
-e, --env <env> sets environment variables. separate multiple values with a comma. overrides any value in cypress.json or cypress.env.json
75+
-e, --env <env> sets environment variables. separate multiple values with a comma. overrides any value in cypress.config.{ts|js} or cypress.env.json
7476
--group <name> a named group for recorded runs in the Cypress Dashboard
7577
-k, --key <record-key> your secret Record Key. you can omit this if you set a CYPRESS_RECORD_KEY environment variable.
7678
--headed displays the browser instead of running headlessly
7779
--headless hide the browser instead of running headed (default for cypress run)
7880
--no-exit keep the browser open after tests finish
7981
--parallel enables concurrent runs and automatic load balancing of specs across multiple machines or processes
80-
-p, --port <port> runs Cypress on a specific port. overrides any value in cypress.json.
82+
-p, --port <port> runs Cypress on a specific port. overrides any value in cypress.config.{ts|js}.
8183
-P, --project <project-path> path to the project
8284
-q, --quiet run quietly, using only the configured reporter
8385
--record [bool] records the run. sends test results, screenshots and videos to your Cypress Dashboard.

cli/lib/cli.js

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @ts-check
22
const _ = require('lodash')
3-
const R = require('ramda')
43
const commander = require('commander')
54
const { stripIndent } = require('common-tags')
65
const logSymbols = require('log-symbols')
@@ -107,12 +106,12 @@ const descriptions = {
107106
cacheSize: 'Used with the list command to show the sizes of the cached folders',
108107
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',
109108
component: 'runs component tests',
110-
config: 'sets configuration values. separate multiple values with a comma. overrides any value in cypress.json.',
111-
configFile: 'path to JSON file where configuration values are set. defaults to "cypress.json". pass "false" to disable.',
109+
config: 'sets configuration values. separate multiple values with a comma. overrides any value in cypress.config.{ts|js}.',
110+
configFile: 'path to JSON file where configuration values are set. defaults to "cypress.config.{ts|js}". pass "false" to disable.',
112111
detached: 'runs Cypress application in detached mode',
113112
dev: 'runs cypress in development and bypasses binary check',
114113
e2e: 'runs end to end tests',
115-
env: 'sets environment variables. separate multiple values with a comma. overrides any value in cypress.json or cypress.env.json',
114+
env: 'sets environment variables. separate multiple values with a comma. overrides any value in cypress.config.{ts|js} or cypress.env.json',
116115
exit: 'keep the browser open after tests finish',
117116
forceInstall: 'force install the Cypress binary',
118117
global: 'force Cypress into global mode as if its globally installed',
@@ -121,7 +120,7 @@ const descriptions = {
121120
headless: 'hide the browser instead of running headed (default for cypress run)',
122121
key: 'your secret Record Key. you can omit this if you set a CYPRESS_RECORD_KEY environment variable.',
123122
parallel: 'enables concurrent runs and automatic load balancing of specs across multiple machines or processes',
124-
port: 'runs Cypress on a specific port. overrides any value in cypress.json.',
123+
port: 'runs Cypress on a specific port. overrides any value in cypress.config.{ts|js}.',
125124
project: 'path to the project',
126125
quiet: 'run quietly, using only the configured reporter',
127126
record: 'records the run. sends test results, screenshots and videos to your Cypress Dashboard.',
@@ -283,12 +282,17 @@ const castCypressRunOptions = (opts) => {
283282
// only properties that have type "string | false" in our TS definition
284283
// require special handling, because CLI parsing takes care of purely
285284
// boolean arguments
286-
const result = R.evolve({
287-
port: coerceAnyStringToInt,
288-
configFile: coerceFalseOrString,
289-
})(opts)
285+
const castOpts = { ...opts }
290286

291-
return result
287+
if (_.has(opts, 'port')) {
288+
castOpts.port = coerceAnyStringToInt(opts.port)
289+
}
290+
291+
if (_.has(opts, 'configFile')) {
292+
castOpts.configFile = coerceFalseOrString(opts.configFile)
293+
}
294+
295+
return castOpts
292296
}
293297

294298
module.exports = {

0 commit comments

Comments
 (0)