Skip to content

Commit

Permalink
Merge branch 'develop' into feature-multidomain
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbreiding committed Oct 19, 2021
2 parents 8f11635 + a045e4f commit 516100b
Show file tree
Hide file tree
Showing 870 changed files with 48,029 additions and 1,176 deletions.
21 changes: 16 additions & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@
**/support/fixtures/projects/**/static/*
**/support/fixtures/projects/**/*.jsx
**/support/fixtures/projects/**/fail.js

system-tests/fixtures/*
!system-tests/projects
system-tests/projects/**/_fixtures/*
system-tests/projects/**/static/*
system-tests/projects/**/*.jsx
system-tests/projects/**/fail.js
system-tests/lib/scaffold/plugins/index.js
system-tests/lib/scaffold/support/index.js
system-tests/lib/scaffold/support/commands.js
system-tests/test/support/projects/e2e/cypress/
system-tests/projects/e2e/cypress/integration/stdout_exit_early_failing_spec.js
system-tests/projects/e2e/cypress/integration/typescript_syntax_error_spec.ts


**/test/fixtures
**/vendor

Expand All @@ -23,11 +38,7 @@ cli/types
packages/example

packages/extension/test/helpers/background.js
packages/server/lib/scaffold/plugins/index.js
packages/server/lib/scaffold/support/index.js
packages/server/lib/scaffold/support/commands.js
packages/server/test/support/fixtures/projects/e2e/cypress/integration/stdout_exit_early_failing_spec.js
packages/server/test/support/fixtures/projects/e2e/cypress/integration/typescript_syntax_error_spec.ts
integration/stdout_exit_early_failing_spec.js

npm/webpack-preprocessor/cypress/tests/e2e/compile-error.js
npm/webpack-preprocessor/examples/use-babelrc/cypress/integration/spec.js
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ packages/server/support
packages/server/test/support/fixtures/server/imgs
packages/server/test/support/fixtures/server/libs

# from system-tests
system-tests/.projects
system-tests/fixtures/large-img

# from npm/react
/npm/react/bin/*
/npm/react/cypress/videos
Expand Down Expand Up @@ -335,7 +339,6 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

/npm/react/bin/*
# End of https://www.gitignore.io/api/osx,git,node,windows,intellij,linux

# Circle cache artifacts
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
35 changes: 35 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
// To see these extensions in VS Code:
// 1. Open the Command Palette (Ctrl+Shift+P)
// 2. Select "Extensions: Show Recommended Extensions"

// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.

// List of extensions which are recommended for Cypress contributors using VS Code:
"recommendations": [
// Name: ESLint
// Description: Integrates ESLint JavaScript into VS Code.
"dbaeumer.vscode-eslint",
// Name: GitHub linker
// Description: Create links to fragments of code in GitHub
"gimenete.github-linker",
// Name: GitLens — Git supercharged
// Description: Supercharge the Git capabilities built into Visual Studio Code — Visualize code authorship at a glance via Git blame annotations and code lens, seamlessly navigate and explore Git repositories, gain valuable insights via powerful comparison commands, and so much more
"eamodio.gitlens",
// Name: Terminals Manager
// Description: An extension for setting-up multiple terminals at once, or just running some commands
// There are several Terminals defined in `.vscode/terminals.json` that can be used via this plugin.
"fabiospampinato.vscode-terminals",
// Name: Test Utils
// Description: Add, remove, and move .only in tests
"chrisbreiding.test-utils",
// Name: Toggle Quotes
// Description: Toggle cycle " -> ' -> `
"britesnow.vscode-toggle-quotes",
],

// List of extensions recommended by VS Code that should not be recommended for Cypress contributors using VS Code:
"unwantedRecommendations": [

]
}
14 changes: 11 additions & 3 deletions .vscode/terminals.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,20 @@
"command": "yarn cypress:run --project ../project"
},
{
"name": "packages/server test-e2e",
"name": "cypress open (CT)",
"focus": true,
"onlySingle": true,
"execute": true,
"cwd": "[cwd]/packages/server-ct",
"command": "yarn cypress:open"
},
{
"name": "system-tests test",
"focus": true,
"onlySingle": true,
"execute": false,
"cwd": "[cwd]/packages/server",
"command": "yarn test-e2e [fileBasename]"
"cwd": "[cwd]/system-tests",
"command": "yarn test [fileBasename]"
},
{
"name": "packages/server test-watch",
Expand Down
128 changes: 67 additions & 61 deletions CONTRIBUTING.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src="https://cloud.githubusercontent.com/assets/1268976/20607953/d7ae489c-b24a-11e6-9cc4-91c6c74c5e88.png"/>
<a href="https://www.cypress.io"><img src="https://cloud.githubusercontent.com/assets/1268976/20607953/d7ae489c-b24a-11e6-9cc4-91c6c74c5e88.png"/></a>
</p>
<p align="center">
<a href="https://on.cypress.io">Documentation</a> |
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.32",
"chrome:stable": "94.0.4606.71"
"chrome:beta": "95.0.4638.49",
"chrome:stable": "94.0.4606.81"
}
53 changes: 35 additions & 18 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ commands:
mkdir -p /tmp/node_modules_cache
mv ~/cypress/node_modules /tmp/node_modules_cache/root_node_modules
mv ~/cypress/cli/node_modules /tmp/node_modules_cache/cli_node_modules
mv ~/cypress/system-tests/node_modules /tmp/node_modules_cache/system-tests_node_modules
mv ~/cypress/globbed_node_modules /tmp/node_modules_cache/globbed_node_modules
build-and-persist:
Expand Down Expand Up @@ -142,6 +143,7 @@ commands:
if [[ -d "/tmp/node_modules_cache" ]]; then
mv /tmp/node_modules_cache/root_node_modules ~/cypress/node_modules
mv /tmp/node_modules_cache/cli_node_modules ~/cypress/cli/node_modules
mv /tmp/node_modules_cache/system-tests_node_modules ~/cypress/system-tests/node_modules
mv /tmp/node_modules_cache/globbed_node_modules ~/cypress/globbed_node_modules
rm -rf /tmp/node_modules_cache
fi
Expand Down Expand Up @@ -194,6 +196,7 @@ commands:
paths:
- node_modules
- cli/node_modules
- system-tests/node_modules
- globbed_node_modules
- unless:
condition: <<parameters.is-mac>>
Expand Down Expand Up @@ -417,15 +420,29 @@ commands:
path: ./packages/runner-ct/cypress/videos
- store-npm-logs

run-e2e-tests:
run-system-tests:
parameters:
browser:
description: browser shortname to target
type: string
steps:
- restore_cached_workspace
- run:
command: yarn workspace @packages/server test ./test/e2e/$(( $CIRCLE_NODE_INDEX ))_*spec* --browser <<parameters.browser>>
name: Run system tests
command: |
ALL_SPECS=`circleci tests glob "/root/cypress/system-tests/test/*spec*"`
SPECS=
for file in $ALL_SPECS; do
# filter out non_root tests, they have their own stage
if [[ "$file" == *"non_root"* ]]; then
echo "Skipping $file"
continue
fi
SPECS="$SPECS $file"
done
SPECS=`echo $SPECS | xargs -n 1 | circleci tests split --split-by=timings`
echo SPECS=$SPECS
yarn workspace @tooling/system-tests test:ci $SPECS --browser <<parameters.browser>>
- verify-mocha-results
- store_test_results:
path: /tmp/cypress
Expand Down Expand Up @@ -1067,37 +1084,37 @@ jobs:
path: /tmp/artifacts
- store-npm-logs

server-e2e-tests-chrome:
system-tests-chrome:
<<: *defaults
resource_class: medium
parallelism: 8
steps:
- run-e2e-tests:
- run-system-tests:
browser: chrome

server-e2e-tests-electron:
system-tests-electron:
<<: *defaults
resource_class: medium
parallelism: 8
steps:
- run-e2e-tests:
- run-system-tests:
browser: electron

server-e2e-tests-firefox:
system-tests-firefox:
<<: *defaults
resource_class: medium
parallelism: 8
steps:
- run-e2e-tests:
- run-system-tests:
browser: firefox

server-e2e-tests-non-root:
system-tests-non-root:
<<: *defaults
resource_class: medium
steps:
- restore_cached_workspace
- run:
command: yarn workspace @packages/server test ./test/e2e/non_root*spec* --browser electron
command: yarn workspace @tooling/system-tests test:ci "test/non_root*spec*" --browser electron
- verify-mocha-results
- store_test_results:
path: /tmp/cypress
Expand Down Expand Up @@ -1994,16 +2011,16 @@ linux-workflow: &linux-workflow
- server-performance-tests:
requires:
- build
- server-e2e-tests-chrome:
- system-tests-chrome:
requires:
- build
- server-e2e-tests-electron:
- system-tests-electron:
requires:
- build
- server-e2e-tests-firefox:
- system-tests-firefox:
requires:
- build
- server-e2e-tests-non-root:
- system-tests-non-root:
executor: non-root-docker-user
requires:
- build
Expand Down Expand Up @@ -2110,10 +2127,10 @@ linux-workflow: &linux-workflow
- driver-integration-tests-firefox
- driver-integration-tests-chrome
- driver-integration-tests-electron
- server-e2e-tests-non-root
- server-e2e-tests-firefox
- server-e2e-tests-electron
- server-e2e-tests-chrome
- system-tests-non-root
- system-tests-firefox
- system-tests-electron
- system-tests-chrome
- server-performance-tests
- server-integration-tests
- server-unit-tests
Expand Down
2 changes: 1 addition & 1 deletion cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ yarn test-watch --scope cypress
yarn test-debug --scope cypress
```

### Updating snaphots
### Updating snapshots

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.

Expand Down
17 changes: 17 additions & 0 deletions cli/lib/cypress.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,23 @@ const cypressModuleApi = {
return cli.parseRunCommand(args)
},
},

/**
* Provides automatic code completion for configuration in many popular code editors.
* While it's not strictly necessary for Cypress to parse your configuration, we
* recommend wrapping your config object with `defineConfig()`
* @example
* module.exports = defineConfig({
* viewportWith: 400
* })
*
* @see ../types/cypress-npm-api.d.ts
* @param {Cypress.ConfigOptions} config
* @returns {Cypress.ConfigOptions} the configuration passed in parameter
*/
defineConfig (config) {
return config
},
}

module.exports = cypressModuleApi
2 changes: 1 addition & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"@types/jquery": "3.3.31",
"@types/lodash": "4.14.168",
"@types/minimatch": "3.0.3",
"@types/mocha": "5.2.7",
"@types/mocha": "8.0.3",
"@types/sinon": "7.5.1",
"@types/sinon-chai": "3.2.5",
"chai": "3.5.0",
Expand Down
21 changes: 21 additions & 0 deletions cli/scripts/post-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

const { includeTypes } = require('./utils')
const shell = require('shelljs')
const fs = require('fs')
const { join } = require('path')
const resolvePkg = require('resolve-pkg')

Expand Down Expand Up @@ -72,3 +73,23 @@ shell.sed('-i', 'from \'sinon\';', 'from \'../sinon\';', sinonChaiFilename)
// copy experimental network stubbing type definitions
// so users can import: `import 'cypress/types/net-stubbing'`
shell.cp(resolvePkg('@packages/net-stubbing/lib/external-types.ts'), 'types/net-stubbing.ts')

// https://github.com/cypress-io/cypress/issues/18069
// To avoid type clashes, some files should be commented out entirely by patch-package
// and uncommented here.

const filesToUncomment = [
'mocha/index.d.ts',
'jquery/JQuery.d.ts',
'jquery/legacy.d.ts',
'jquery/misc.d.ts',
]

filesToUncomment.forEach((file) => {
const filePath = join(__dirname, '../types', file)
const str = fs.readFileSync(filePath).toString()

const result = str.split('\n').map((line) => line.substring(3)).join('\n')

fs.writeFileSync(filePath, result)
})
5 changes: 3 additions & 2 deletions cli/types/cy-bluebird.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Shim definition to export a namespace. Cypress is actually a global module
// so import/export isn't allowed there. We import here and define a global module
// so that Cypress can get and use the Blob type
import BluebirdStatic = require('./bluebird')
import ImportedBluebird = require('./bluebird')

export = Bluebird
export as namespace Bluebird

declare namespace Bluebird {
type BluebirdStatic = typeof BluebirdStatic
type BluebirdStatic = typeof ImportedBluebird
interface Promise<T> extends ImportedBluebird<T> {}
}
15 changes: 15 additions & 0 deletions cli/types/cypress-npm-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,21 @@ declare module 'cypress' {
* Cypress does
*/
cli: CypressCommandLine.CypressCliParser

/**
* Provides automatic code completion for configuration in many popular code editors.
* While it's not strictly necessary for Cypress to parse your configuration, we
* recommend wrapping your config object with `defineConfig()`
* @example
* module.exports = defineConfig({
* viewportWith: 400
* })
*
* @see ../types/cypress-npm-api.d.ts
* @param {Cypress.ConfigOptions} config
* @returns {Cypress.ConfigOptions} the configuration passed in parameter
*/
defineConfig(config: Cypress.ConfigOptions): Cypress.ConfigOptions
}

// export Cypress NPM module interface
Expand Down
Loading

0 comments on commit 516100b

Please sign in to comment.