Skip to content

Commit

Permalink
Merge branch 'unified-desktop-gui' into tgriesser/unify/rename-and-mo…
Browse files Browse the repository at this point in the history
…ve-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)
  ...
  • Loading branch information
tgriesser committed Nov 4, 2021
2 parents 2bcf65f + 0422ede commit 68e2adf
Show file tree
Hide file tree
Showing 700 changed files with 9,231 additions and 4,933 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ packages/example/cypress/integration

# from frontend-shared
packages/frontend-shared/cypress/e2e/.projects
packages/frontend-shared/src/public/shiki/themes/cypress.theme.json

# from server
packages/server/.cy
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,8 @@ Independent packages are automatically released when code is merged into `master
![Select release for PR](https://user-images.githubusercontent.com/1271364/135139641-657015d6-2dca-42d4-a4fb-16478f61d63f.png)
- 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.
![Allow edits from maintainers checkbox](https://user-images.githubusercontent.com/1271181/31393427-b3105d44-ada9-11e7-80f2-0dac51e3919e.png)
- After the PR is approved, the original contributor can merge the PR (if the original contributor has access).
- 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.*

### Dependencies

Expand Down
2 changes: 1 addition & 1 deletion apollo.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ module.exports = {
localSchemaFile: path.join(__dirname, 'packages/graphql/schemas/schema.graphql'),
},
tagName: 'gql',
includes: [path.join(__dirname, 'packages/{launchpad,app}/src/**/*.vue')],
includes: [path.join(__dirname, 'packages/{launchpad,app,frontend-shared}/src/**/*.vue')],
},
}
1 change: 1 addition & 0 deletions autobarrel.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"packages/data-context/src/**/*"
],
"ignore": [
"packages/data-context/src/gen",
"packages/graphql/src/stitching",
"packages/graphql/src/testing",
"packages/graphql/src/gen"
Expand Down
4 changes: 2 additions & 2 deletions browser-versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"chrome:beta": "95.0.4638.54",
"chrome:stable": "95.0.4638.54"
"chrome:beta": "96.0.4664.27",
"chrome:stable": "95.0.4638.69"
}
92 changes: 69 additions & 23 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,10 @@ commands:
CYPRESS_INTERNAL_FORCE_BROWSER_RELAUNCH='true' \
CYPRESS_KONFIG_ENV=production \
CYPRESS_RECORD_KEY=$TEST_LAUNCHPAD_RECORD_KEY \
PERCY_PARALLEL_NONCE=$CIRCLE_WORKFLOW_ID \
PERCY_ENABLE=${PERCY_TOKEN:-0} \
PERCY_PARALLEL_TOTAL=-1 \
yarn percy exec --parallel -- -- \
yarn workspace @packages/<<parameters.package>> cypress:run:<<parameters.type>> --browser <<parameters.browser>> --record --parallel --group <<parameters.package>>-<<parameters.type>>
- store_test_results:
path: /tmp/cypress
Expand Down Expand Up @@ -516,20 +520,34 @@ commands:
steps:
- run: yarn verify:mocha:results <<parameters.expectedResultCount>>

clone-repo-and-checkout-release-branch:
clone-repo-and-checkout-branch:
description: |
Clones an external repo and then checks out the branch that matches the next version otherwise uses 'master' branch.
parameters:
repo:
description: "Name of the github repo to clone like: cypress-example-kitchensink"
type: string
pull_request_id:
description: Pull request number to check out before installing and testing
type: integer
default: 0
steps:
- restore_cached_binary
- run:
name: "Cloning test project: <<parameters.repo>>"
command: |
git clone --depth 1 --no-single-branch https://github.com/cypress-io/<<parameters.repo>>.git /tmp/<<parameters.repo>>
cd /tmp/<<parameters.repo>> && (git checkout $(node ./scripts/get-next-version) || true)
- when:
condition: <<parameters.pull_request_id>>
steps:
- run:
name: Check out PR <<parameters.pull_request_id>>
working_directory: /tmp/<<parameters.repo>>
command: |
git fetch origin pull/<<parameters.pull_request_id>>/head:pr-<<parameters.pull_request_id>>
git checkout pr-<<parameters.pull_request_id>>
git log -n 2
test-binary-against-rwa:
description: |
Expand Down Expand Up @@ -571,7 +589,7 @@ commands:
type: string
default: "CI=true yarn start"
steps:
- clone-repo-and-checkout-release-branch:
- clone-repo-and-checkout-branch:
repo: <<parameters.repo>>
- when:
condition: <<parameters.pull_request_id>>
Expand Down Expand Up @@ -701,18 +719,9 @@ commands:
type: string
default: "npm start --if-present"
steps:
- clone-repo-and-checkout-release-branch:
- clone-repo-and-checkout-branch:
repo: <<parameters.repo>>
- when:
condition: <<parameters.pull_request_id>>
steps:
- run:
name: Check out PR <<parameters.pull_request_id>>
working_directory: /tmp/<<parameters.repo>>
command: |
git fetch origin pull/<<parameters.pull_request_id>>/head:pr-<<parameters.pull_request_id>>
git checkout pr-<<parameters.pull_request_id>>
git log -n 2
pull_request_id: <<parameters.pull_request_id>>
- run:
# Install deps + Cypress binary with yarn if yarn.lock present
command: |
Expand All @@ -724,6 +733,16 @@ commands:
CYPRESS_INSTALL_BINARY=~/cypress/cypress.zip npm install ~/cypress/cypress.tgz
fi
working_directory: /tmp/<<parameters.repo>>
- run:
name: Scaffold new config file
working_directory: /tmp/<<parameters.repo>>
environment:
CYPRESS_INTERNAL_FORCE_SCAFFOLD: "1"
command: |
if [[ -f cypress.json ]]; then
rm -rf cypress.json
echo 'module.exports = {}' > cypress.config.js
fi
- run:
name: Print Cypress version
working_directory: /tmp/<<parameters.repo>>
Expand Down Expand Up @@ -1005,7 +1024,7 @@ jobs:
fi
- wait-on-circle-jobs:
job-names: >
desktop-gui-integration-tests-2x,
desktop-gui-integration-tests-7x,
desktop-gui-component-tests,
cli-visual-tests,
runner-integration-tests-chrome,
Expand Down Expand Up @@ -1283,9 +1302,9 @@ jobs:
- run-driver-integration-tests:
browser: electron

desktop-gui-integration-tests-2x:
desktop-gui-integration-tests-7x:
<<: *defaults
parallelism: 2
parallelism: 7
steps:
- restore_cached_workspace
- run:
Expand Down Expand Up @@ -1610,9 +1629,17 @@ jobs:
test-kitchensink:
<<: *defaults
steps:
- clone-repo-and-checkout-release-branch:
- clone-repo-and-checkout-branch:
repo: cypress-example-kitchensink
pull_request_id: 510
- install-required-node
- run:
name: Remove cypress.json
description: Remove cypress.json in case it exists
working_directory: /tmp/cypress-example-kitchensink
environment:
CYPRESS_INTERNAL_FORCE_SCAFFOLD: "1"
command: rm -rf cypress.json
- run:
name: Install prod dependencies
command: yarn --production
Expand All @@ -1637,7 +1664,7 @@ jobs:
<<: *defaults
resource_class: medium
steps:
- clone-repo-and-checkout-release-branch:
- clone-repo-and-checkout-branch:
repo: cypress-example-kitchensink
- run:
name: Install prod dependencies
Expand All @@ -1662,7 +1689,7 @@ jobs:
<<: *defaults
resource_class: medium
steps:
- clone-repo-and-checkout-release-branch:
- clone-repo-and-checkout-branch:
repo: cypress-test-tiny
- run:
name: Run test project
Expand Down Expand Up @@ -1846,7 +1873,7 @@ jobs:
environment:
CYPRESS_INTERNAL_FORCE_SCAFFOLD: "1"
command: |
echo '{}' > cypress.json
echo 'module.exports = {}' > cypress.config.js
npx cypress run
test-full-typescript-project:
Expand Down Expand Up @@ -1878,6 +1905,14 @@ jobs:
name: Scaffold full TypeScript project 🏗
working_directory: <<parameters.wd>>
command: npx @bahmutov/cly@1 init --typescript
- run:
name: Scaffold new config file
working_directory: <<parameters.wd>>
environment:
CYPRESS_INTERNAL_FORCE_SCAFFOLD: "1"
command: |
rm -rf cypress.json
echo 'export default {}' > cypress.config.ts
- run:
name: Run project tests 🗳
working_directory: <<parameters.wd>>
Expand All @@ -1888,7 +1923,7 @@ jobs:
<<: *defaults
steps:
- restore_workspace_binaries
- clone-repo-and-checkout-release-branch:
- clone-repo-and-checkout-branch:
repo: cypress-test-tiny
- run:
name: Install Cypress
Expand Down Expand Up @@ -1940,6 +1975,7 @@ jobs:
- test-binary-against-repo:
repo: cypress-example-kitchensink
browser: "electron"
pull_request_id: 510

test-binary-against-awesome-typescript-loader:
<<: *defaults
Expand All @@ -1955,6 +1991,7 @@ jobs:
- test-binary-against-repo:
repo: cypress-example-kitchensink
browser: firefox
pull_request_id: 510

"test-binary-against-kitchensink-chrome":
<<: *defaults
Expand All @@ -1963,6 +2000,7 @@ jobs:
- test-binary-against-repo:
repo: cypress-example-kitchensink
browser: chrome
pull_request_id: 510

"test-binary-against-todomvc-firefox":
<<: *defaults
Expand Down Expand Up @@ -2056,6 +2094,14 @@ jobs:
name: Add Cypress demo
working_directory: test-binary
command: npx @bahmutov/cly init
- run:
name: Scaffold new config file
working_directory: test-binary
environment:
CYPRESS_INTERNAL_FORCE_SCAFFOLD: "1"
command: |
rm -rf cypress.json
echo 'module.exports = {}' > cypress.config.js
- run:
name: Verify Cypress binary
working_directory: test-binary
Expand Down Expand Up @@ -2166,7 +2212,7 @@ linux-workflow: &linux-workflow
# context: test-runner:launchpad-tests
# requires:
# - build
- desktop-gui-integration-tests-2x:
- desktop-gui-integration-tests-7x:
requires:
- build
- desktop-gui-component-tests:
Expand Down Expand Up @@ -2237,7 +2283,7 @@ linux-workflow: &linux-workflow
- reporter-integration-tests
- Linux lint
- desktop-gui-component-tests
- desktop-gui-integration-tests-2x
- desktop-gui-integration-tests-7x
- runner-ct-integration-tests-chrome
- runner-integration-tests-firefox
- runner-integration-tests-chrome
Expand Down
20 changes: 11 additions & 9 deletions cli/__snapshots__/cli_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,21 @@ exports['shows help for open --foo 1'] = `
--component runs component tests
-c, --config <config> sets configuration values. separate multiple
values with a comma. overrides any value in
cypress.json.
cypress.config.{ts|js}.
-C, --config-file <config-file> path to JSON file where configuration values
are set. defaults to "cypress.json". pass
"false" to disable.
are set. defaults to
"cypress.config.{ts|js}". pass "false" to
disable.
-d, --detached [bool] runs Cypress application in detached mode
--e2e runs end to end tests
-e, --env <env> sets environment variables. separate
multiple values with a comma. overrides any
value in cypress.json or cypress.env.json
value in cypress.config.{ts|js} or
cypress.env.json
--global force Cypress into global mode as if its
globally installed
-p, --port <port> runs Cypress on a specific port. overrides
any value in cypress.json.
any value in cypress.config.{ts|js}.
-P, --project <project-path> path to the project
--dev runs cypress in development and bypasses
binary check
Expand Down Expand Up @@ -67,17 +69,17 @@ exports['shows help for run --foo 1'] = `
-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.
--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
--component runs component tests
-c, --config <config> sets configuration values. separate multiple values with a comma. overrides any value in cypress.json.
-C, --config-file <config-file> path to JSON file where configuration values are set. defaults to "cypress.json". pass "false" to disable.
-c, --config <config> sets configuration values. separate multiple values with a comma. overrides any value in cypress.config.{ts|js}.
-C, --config-file <config-file> path to JSON file where configuration values are set. defaults to "cypress.config.{ts|js}". pass "false" to disable.
--e2e runs end to end tests
-e, --env <env> sets environment variables. separate multiple values with a comma. overrides any value in cypress.json or cypress.env.json
-e, --env <env> sets environment variables. separate multiple values with a comma. overrides any value in cypress.config.{ts|js} or cypress.env.json
--group <name> a named group for recorded runs in the Cypress Dashboard
-k, --key <record-key> your secret Record Key. you can omit this if you set a CYPRESS_RECORD_KEY environment variable.
--headed displays the browser instead of running headlessly
--headless hide the browser instead of running headed (default for cypress run)
--no-exit keep the browser open after tests finish
--parallel enables concurrent runs and automatic load balancing of specs across multiple machines or processes
-p, --port <port> runs Cypress on a specific port. overrides any value in cypress.json.
-p, --port <port> runs Cypress on a specific port. overrides any value in cypress.config.{ts|js}.
-P, --project <project-path> path to the project
-q, --quiet run quietly, using only the configured reporter
--record [bool] records the run. sends test results, screenshots and videos to your Cypress Dashboard.
Expand Down
24 changes: 14 additions & 10 deletions cli/lib/cli.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @ts-check
const _ = require('lodash')
const R = require('ramda')
const commander = require('commander')
const { stripIndent } = require('common-tags')
const logSymbols = require('log-symbols')
Expand Down Expand Up @@ -107,12 +106,12 @@ const descriptions = {
cacheSize: 'Used with the list command to show the sizes of the cached folders',
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',
component: 'runs component tests',
config: 'sets configuration values. separate multiple values with a comma. overrides any value in cypress.json.',
configFile: 'path to JSON file where configuration values are set. defaults to "cypress.json". pass "false" to disable.',
config: 'sets configuration values. separate multiple values with a comma. overrides any value in cypress.config.{ts|js}.',
configFile: 'path to JSON file where configuration values are set. defaults to "cypress.config.{ts|js}". pass "false" to disable.',
detached: 'runs Cypress application in detached mode',
dev: 'runs cypress in development and bypasses binary check',
e2e: 'runs end to end tests',
env: 'sets environment variables. separate multiple values with a comma. overrides any value in cypress.json or cypress.env.json',
env: 'sets environment variables. separate multiple values with a comma. overrides any value in cypress.config.{ts|js} or cypress.env.json',
exit: 'keep the browser open after tests finish',
forceInstall: 'force install the Cypress binary',
global: 'force Cypress into global mode as if its globally installed',
Expand All @@ -121,7 +120,7 @@ const descriptions = {
headless: 'hide the browser instead of running headed (default for cypress run)',
key: 'your secret Record Key. you can omit this if you set a CYPRESS_RECORD_KEY environment variable.',
parallel: 'enables concurrent runs and automatic load balancing of specs across multiple machines or processes',
port: 'runs Cypress on a specific port. overrides any value in cypress.json.',
port: 'runs Cypress on a specific port. overrides any value in cypress.config.{ts|js}.',
project: 'path to the project',
quiet: 'run quietly, using only the configured reporter',
record: 'records the run. sends test results, screenshots and videos to your Cypress Dashboard.',
Expand Down Expand Up @@ -283,12 +282,17 @@ const castCypressRunOptions = (opts) => {
// only properties that have type "string | false" in our TS definition
// require special handling, because CLI parsing takes care of purely
// boolean arguments
const result = R.evolve({
port: coerceAnyStringToInt,
configFile: coerceFalseOrString,
})(opts)
const castOpts = { ...opts }

return result
if (_.has(opts, 'port')) {
castOpts.port = coerceAnyStringToInt(opts.port)
}

if (_.has(opts, 'configFile')) {
castOpts.configFile = coerceFalseOrString(opts.configFile)
}

return castOpts
}

module.exports = {
Expand Down

0 comments on commit 68e2adf

Please sign in to comment.