diff --git a/.circleci/cache-version.txt b/.circleci/cache-version.txt
new file mode 100644
index 00000000000..6b1d4c8dee4
--- /dev/null
+++ b/.circleci/cache-version.txt
@@ -0,0 +1,3 @@
+# Bump this version to force CI to re-create the cache from scratch.
+
+07-02-24
diff --git a/.circleci/config.yml b/.circleci/config.yml
new file mode 100644
index 00000000000..5639d07f702
--- /dev/null
+++ b/.circleci/config.yml
@@ -0,0 +1,71 @@
+version: 2.1
+setup: true
+
+orbs:
+ continuation: circleci/continuation@0.3.1
+
+jobs:
+ verify-ci-should-run:
+ resource_class: small
+ docker:
+ - image: cimg/node:current
+ steps:
+ - run:
+ name: Verify CI should run
+ command: |
+ # run CI when manually triggers via CircleCi Dashboard
+ if [ <> == 'api' ]; then
+ echo "Always run CI when manually triggered from the UI."
+ exit 0
+ fi
+
+ if [[ "$CIRCLE_BRANCH" == "develop" || "$CIRCLE_BRANCH" == "release/"* ]]; then
+ echo "Always run CI for develop and for release candidate branches."
+ exit 0
+ fi
+
+ LAST_COMMIT_MESSAGE=$(curl --silent "https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/commits/${CIRCLE_BRANCH}" | jq '.commit.message')
+
+ if [[ "$LAST_COMMIT_MESSAGE" =~ "run ci" ]]; then
+ echo "Always run CI when the commit message includes 'run ci'."
+ exit 0
+ fi
+
+ cancel_build () {
+ echo "Canceling the CI build..."
+ circleci-agent step halt
+ }
+
+ TRIGGER_INSTRUCTIONS="to trigger CI , include 'run ci' in the commit message or click the 'Trigger Pipeline' button in the CircleCI UI."
+
+ if [ ! -z "${CIRCLE_PULL_REQUEST##*/}" ]; then
+ DRAFT=$(curl --silent "https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${CIRCLE_PULL_REQUEST##*/}" | jq '.draft')
+
+ if [[ "${DRAFT}" == true ]]; then
+ echo "Skipping CI; PR is in draft - $TRIGGER_INSTRUCTIONS"
+ cancel_build
+ fi
+
+ echo "Always run CI for PR that is ready for review."
+ exit 0
+ fi
+
+ echo "Skipping CI; branch in progress - $TRIGGER_INSTRUCTIONS"
+ cancel_build
+
+ - run:
+ name: Download .circleci/workflows.yaml
+ command: |
+ if [[ "$CIRCLE_BRANCH" == "pull/"* ]]; then
+ curl -o workflows.yml https://raw.githubusercontent.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/develop/.circleci/workflows.yml
+ else
+ curl -o workflows.yml https://raw.githubusercontent.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}/.circleci/workflows.yml
+ fi
+ - continuation/continue:
+ configuration_path: workflows.yml
+
+workflows:
+ # the setup-workflow workflow is always triggered.
+ setup-workflow:
+ jobs:
+ - verify-ci-should-run
diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml
new file mode 100644
index 00000000000..85be15842a0
--- /dev/null
+++ b/.circleci/workflows.yml
@@ -0,0 +1,3569 @@
+version: 2.1
+
+defaults: &defaults
+ parallelism: 1
+ working_directory: ~/cypress
+ parameters: &defaultsParameters
+ executor:
+ type: executor
+ default: cy-doc
+ only-cache-for-root-user:
+ type: boolean
+ default: false
+ executor: <>
+ environment: &defaultsEnvironment
+ ## set specific timezone
+ TZ: "/usr/share/zoneinfo/America/New_York"
+
+ ## store artifacts here
+ CIRCLE_ARTIFACTS: /tmp/artifacts
+
+ ## set so that e2e tests are consistent
+ COLUMNS: 100
+ LINES: 24
+
+mainBuildFilters: &mainBuildFilters
+ filters:
+ branches:
+ only:
+ - develop
+ - /^release\/\d+\.\d+\.\d+$/
+ # use the following branch as well to ensure that v8 snapshot cache updates are fully tested
+ - 'update-v8-snapshot-cache-on-develop'
+ - 'investigate/darwin-ci-build-order'
+ - 'publish-binary'
+ - 'angular-signals-ct-harness'
+
+# usually we don't build Mac app - it takes a long time
+# but sometimes we want to really confirm we are doing the right thing
+# so just add your branch to the list here to build and test on Mac
+macWorkflowFilters: &darwin-workflow-filters
+ when:
+ or:
+ - equal: [ develop, << pipeline.git.branch >> ]
+ # use the following branch as well to ensure that v8 snapshot cache updates are fully tested
+ - equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
+ - equal: [ 'angular-signals-ct-harness', << pipeline.git.branch >> ]
+ - equal: [ 'investigate/darwin-ci-build-order', << pipeline.git.branch >> ]
+ - matches:
+ pattern: /^release\/\d+\.\d+\.\d+$/
+ value: << pipeline.git.branch >>
+
+linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
+ when:
+ or:
+ - equal: [ develop, << pipeline.git.branch >> ]
+ # use the following branch as well to ensure that v8 snapshot cache updates are fully tested
+ - equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
+ - equal: [ 'chore/fix_kitchensink_against_staging_job', << pipeline.git.branch >> ]
+ - matches:
+ pattern: /^release\/\d+\.\d+\.\d+$/
+ value: << pipeline.git.branch >>
+
+# uncomment & add to the branch conditions below to disable the main linux
+# flow if we don't want to test it for a certain branch
+linuxWorkflowExcludeFilters: &linux-x64-workflow-exclude-filters
+ unless:
+ or:
+ - matches:
+ pattern: /^pull\/[0-9]+/
+ value: << pipeline.git.branch >>
+ - false
+
+# windows is slow and expensive in CI, so it normally only runs on main branches
+# add your branch to this list to run the full Windows build on your PR
+windowsWorkflowFilters: &windows-workflow-filters
+ when:
+ or:
+ - equal: [ develop, << pipeline.git.branch >> ]
+ # use the following branch as well to ensure that v8 snapshot cache updates are fully tested
+ - equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
+ - equal: [ 'angular-signals-ct-harness', << pipeline.git.branch >> ]
+ - matches:
+ pattern: /^release\/\d+\.\d+\.\d+$/
+ value: << pipeline.git.branch >>
+
+executors:
+ # the Docker image with Cypress dependencies and Chrome browser
+ cy-doc:
+ docker:
+ - image: cypress/browsers-internal:node18.17.1-chrome124-ff125
+ # by default, we use "medium" to balance performance + CI costs. bump or reduce on a per-job basis if needed.
+ resource_class: medium
+ environment:
+ PLATFORM: linux
+ CI_DOCKER: "true"
+
+ kitchensink-executor:
+ docker:
+ - image: cypress/browsers-internal:node20.15.0-chrome126-ff127
+ # by default, we use "medium" to balance performance + CI costs. bump or reduce on a per-job basis if needed.
+ resource_class: medium
+ environment:
+ PLATFORM: linux
+ CI_DOCKER: "true"
+
+ # Docker image with non-root "node" user
+ non-root-docker-user:
+ docker:
+ - image: cypress/browsers-internal:node18.17.1-chrome124-ff125
+ user: node
+ environment:
+ PLATFORM: linux
+
+ # executor to run on Mac OS
+ # https://circleci.com/docs/2.0/executor-types/#using-macos
+ # https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions
+ darwin-amd64:
+ machine: true
+ environment:
+ PLATFORM: darwin
+
+ # executor to run on Windows - based off of the windows-orb default executor since it is
+ # not customizable enough to align with our existing setup.
+ # https://github.com/CircleCI-Public/windows-orb/blob/master/src/executors/default.yml
+ # https://circleci.com/docs/2.0/hello-world-windows/#software-pre-installed-in-the-windows-image
+ windows: &windows-executor
+ machine:
+ image: windows-server-2022-gui:stable
+ shell: bash.exe -eo pipefail
+ resource_class: windows.large
+ environment:
+ PLATFORM: windows
+
+ darwin-arm64: &darwin-arm64-executor
+ machine: true
+ environment:
+ PLATFORM: darwin
+
+ linux-arm64: &linux-arm64-executor
+ machine:
+ image: ubuntu-2004:2023.07.1
+ resource_class: arm.medium
+ environment:
+ PLATFORM: linux
+ # TODO: Disabling snapshots for now on Linux Arm 64 architectures. Will revisit with https://github.com/cypress-io/cypress/issues/23557
+ DISABLE_SNAPSHOT_REQUIRE: 1
+
+commands:
+ # This command inserts SHOULD_PERSIST_ARTIFACTS into BASH_ENV. This way, we can define the variable in one place and use it in multiple steps.
+ # Run this command in a job before you want to use the SHOULD_PERSIST_ARTIFACTS variable.
+ setup_should_persist_artifacts:
+ steps:
+ - run:
+ name: Set environment variable to determine whether or not to persist artifacts
+ command: |
+ echo "Setting SHOULD_PERSIST_ARTIFACTS variable"
+ echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "chore/fix_kitchensink_against_staging_job" ]]; then
+ export SHOULD_PERSIST_ARTIFACTS=true
+ fi' >> "$BASH_ENV"
+ # You must run `setup_should_persist_artifacts` command and be using bash before running this command
+ verify_should_persist_artifacts:
+ steps:
+ - run:
+ name: Check current branch to persist artifacts
+ command: |
+ if [[ -z "$SHOULD_PERSIST_ARTIFACTS" ]]; then
+ echo "Not uploading artifacts or posting install comment for this branch."
+ circleci-agent step halt
+ fi
+
+ maybe_skip_binary_jobs:
+ steps:
+ - run:
+ name: Skip binary job if external PR
+ command: |
+ if [[ -z "$CIRCLE_TOKEN" ]]; then
+ echo "There is no CIRCLE_TOKEN set for this job. Cannot trigger binary build. Skipping job."
+ circleci-agent step halt
+ fi
+
+ restore_workspace_binaries:
+ steps:
+ - attach_workspace:
+ at: ~/
+ # make sure we have cypress.zip received
+ - run: ls -l
+ - run: ls -l cypress.zip cypress.tgz
+ - run: node --version
+ - run: npm --version
+
+ restore_cached_workspace:
+ steps:
+ - attach_workspace:
+ at: ~/
+ - install-required-node
+ - unpack-dependencies
+
+ restore_cached_binary:
+ steps:
+ - attach_workspace:
+ at: ~/
+
+ prepare-modules-cache:
+ parameters:
+ dont-move:
+ type: boolean
+ default: false
+ steps:
+ - run: node scripts/circle-cache.js --action prepare
+ - unless:
+ condition: << parameters.dont-move >>
+ steps:
+ - run:
+ name: Move to /tmp dir for consistent caching across root/non-root users
+ command: |
+ 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
+
+ install-webkit-deps:
+ steps:
+ - run:
+ name: Install WebKit dependencies
+ command: |
+ npx playwright install webkit
+ npx playwright install-deps webkit
+
+ build-and-persist:
+ description: Save entire folder as artifact for other jobs to run without reinstalling
+ steps:
+ - run:
+ name: Sync Cloud Validations
+ command: |
+ source ./scripts/ensure-node.sh
+ yarn gulp syncCloudValidations
+ - run:
+ name: Build packages
+ command: |
+ source ./scripts/ensure-node.sh
+ yarn build
+ - run:
+ name: Generate v8 snapshot
+ command: |
+ source ./scripts/ensure-node.sh
+ # Minification takes some time. We only really need to do that for the binary (and we regenerate snapshots separately there)
+ V8_SNAPSHOT_DISABLE_MINIFY=1 yarn build-v8-snapshot-prod
+ - prepare-modules-cache # So we don't throw these in the workspace cache
+ - persist_to_workspace:
+ root: ~/
+ paths:
+ - cypress
+
+ install_cache_helpers_dependencies:
+ steps:
+ - run:
+ # Dependencies needed by circle-cache.js, before we "yarn" or unpack cached node_modules
+ name: Cache Helper Dependencies
+ working_directory: ~/
+ command: npm i glob@7.1.6 fs-extra@10.0.0 minimist@1.2.5 fast-json-stable-stringify@2.1.0
+
+ unpack-dependencies:
+ description: 'Unpacks dependencies associated with the current workflow'
+ steps:
+ - install_cache_helpers_dependencies
+ - run:
+ name: Generate Circle Cache Key
+ command: node scripts/circle-cache.js --action cacheKey > circle_cache_key
+ - run:
+ name: Generate platform key
+ command: node ./scripts/get-platform-key.js > platform_key
+ - restore_cache:
+ name: Restore cache state, to check for known modules cache existence
+ key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-node-modules-cache-{{ checksum "circle_cache_key" }}
+ - run:
+ name: Move node_modules back from /tmp
+ command: |
+ 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
+ - run:
+ name: Restore all node_modules to proper workspace folders
+ command: node scripts/circle-cache.js --action unpack
+
+ restore_cached_system_tests_deps:
+ description: 'Restore the cached node_modules for projects in "system-tests/projects/**"'
+ steps:
+ - run:
+ name: Generate Circle Cache key for system tests
+ command: ./system-tests/scripts/cache-key.sh > system_tests_cache_key
+ - run:
+ name: Generate platform key
+ command: node ./scripts/get-platform-key.js > platform_key
+ - restore_cache:
+ name: Restore system tests node_modules cache
+ keys:
+ - v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-system-tests-projects-node-modules-cache-{{ checksum "system_tests_cache_key" }}
+
+ update_cached_system_tests_deps:
+ description: 'Update the cached node_modules for projects in "system-tests/projects/**"'
+ steps:
+ - run:
+ name: Generate Circle Cache key for system tests
+ command: ./system-tests/scripts/cache-key.sh > system_tests_cache_key
+ - run:
+ name: Generate platform key
+ command: node ./scripts/get-platform-key.js > platform_key
+ - restore_cache:
+ name: Restore cache state, to check for known modules cache existence
+ keys:
+ - v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-state-of-system-tests-projects-node-modules-cache-{{ checksum "system_tests_cache_key" }}
+ - run:
+ name: Bail if specific cache exists
+ command: |
+ if [[ -f "/tmp/system_tests_node_modules_installed" ]]; then
+ echo "No updates to system tests node modules, exiting"
+ circleci-agent step halt
+ fi
+ - restore_cache:
+ name: Restore system tests node_modules cache
+ keys:
+ - v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-system-tests-projects-node-modules-cache-{{ checksum "system_tests_cache_key" }}
+ - v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-system-tests-projects-node-modules-cache-
+ - run:
+ name: Update system-tests node_modules cache
+ command: yarn workspace @tooling/system-tests projects:yarn:install
+ - save_cache:
+ name: Save system tests node_modules cache
+ key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-system-tests-projects-node-modules-cache-{{ checksum "system_tests_cache_key" }}
+ paths:
+ - /tmp/cy-system-tests-node-modules
+ - run: touch /tmp/system_tests_node_modules_installed
+ - save_cache:
+ name: Save system tests node_modules cache state key
+ key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-state-of-system-tests-projects-node-modules-cache-{{ checksum "system_tests_cache_key" }}
+ paths:
+ - /tmp/system_tests_node_modules_installed
+
+ caching-dependency-installer:
+ description: 'Installs & caches the dependencies based on yarn lock & package json dependencies'
+ parameters:
+ only-cache-for-root-user:
+ type: boolean
+ default: false
+ build-better-sqlite3:
+ type: boolean
+ default: false
+ steps:
+ - install_cache_helpers_dependencies
+ - run:
+ name: Generate Circle Cache Key
+ command: node scripts/circle-cache.js --action cacheKey > circle_cache_key
+ - run:
+ name: Generate platform key
+ command: node ./scripts/get-platform-key.js > platform_key
+ - when:
+ condition: <>
+ steps:
+ - restore_cache:
+ name: Restore cache state, to check for known modules cache existence
+ key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-state-of-node-modules-cache-{{ checksum "circle_cache_key" }}-{{ checksum "centos7-builder.Dockerfile" }}
+ - unless:
+ condition: <>
+ steps:
+ - restore_cache:
+ name: Restore cache state, to check for known modules cache existence
+ key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-state-of-node-modules-cache-{{ checksum "circle_cache_key" }}
+ - run:
+ name: Bail if cache exists
+ command: |
+ if [[ -f "node_modules_installed" ]]; then
+ echo "Node modules already cached for dependencies, exiting"
+ circleci-agent step halt
+ fi
+ - run: date +%Y-%U > cache_date
+ - restore_cache:
+ name: Restore weekly yarn cache
+ keys:
+ - v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-deps-root-weekly-{{ checksum "cache_date" }}
+ - run:
+ name: Install Node Modules
+ command: |
+ source ./scripts/ensure-node.sh
+ # avoid installing Percy's Chromium every time we use @percy/cli
+ # https://docs.percy.io/docs/caching-asset-discovery-browser-in-ci
+ PERCY_POSTINSTALL_BROWSER=true \
+ yarn --prefer-offline --frozen-lockfile --cache-folder ~/.yarn
+ no_output_timeout: 20m
+ - when:
+ condition: <>
+ steps:
+ - build-better-sqlite3
+ - prepare-modules-cache:
+ dont-move: <> # we don't move, so we don't hit any issues unpacking symlinks
+ - when:
+ condition: <> # we don't move to /tmp since we don't need to worry about different users
+ steps:
+ - save_cache:
+ name: Saving node modules for root, cli, and all globbed workspace packages
+ key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-node-modules-cache-{{ checksum "circle_cache_key" }}
+ paths:
+ - node_modules
+ - cli/node_modules
+ - system-tests/node_modules
+ - globbed_node_modules
+ - unless:
+ condition: <>
+ steps:
+ - save_cache:
+ name: Saving node modules for root, cli, and all globbed workspace packages
+ key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-node-modules-cache-{{ checksum "circle_cache_key" }}
+ paths:
+ - /tmp/node_modules_cache
+ - run: touch node_modules_installed
+ - when:
+ condition: <>
+ steps:
+ - save_cache:
+ name: Saving node-modules cache state key
+ key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-state-of-node-modules-cache-{{ checksum "circle_cache_key" }}-{{ checksum "centos7-builder.Dockerfile" }}
+ paths:
+ - node_modules_installed
+ - unless:
+ condition: <>
+ steps:
+ - save_cache:
+ name: Saving node-modules cache state key
+ key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-state-of-node-modules-cache-{{ checksum "circle_cache_key" }}
+ paths:
+ - node_modules_installed
+ - save_cache:
+ name: Save weekly yarn cache
+ key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-deps-root-weekly-{{ checksum "cache_date" }}
+ paths:
+ - ~/.yarn
+ - ~/.cy-npm-cache
+
+ verify-build-setup:
+ description: Common commands run when setting up for build or yarn install
+ parameters:
+ executor:
+ type: executor
+ default: cy-doc
+ steps:
+ - run: pwd
+ - run:
+ name: print global yarn cache path
+ command: echo $(yarn global bin)
+ - run:
+ name: print yarn version
+ command: yarn versions
+ - unless:
+ condition:
+ # stop-only does not correctly match on windows: https://github.com/bahmutov/stop-only/issues/78
+ equal: [ *windows-executor, << parameters.executor >> ]
+ steps:
+ - run:
+ name: Stop .only
+ # this will catch ".only"s in js/coffee as well
+ command: |
+ source ./scripts/ensure-node.sh
+ yarn stop-only-all
+ - run:
+ name: Check terminal variables
+ ## make sure the TERM is set to 'xterm' in node (Linux only)
+ ## else colors (and tests) will fail
+ ## See the following information
+ ## * http://andykdocs.de/development/Docker/Fixing+the+Docker+TERM+variable+issue
+ ## * https://unix.stackexchange.com/questions/43945/whats-the-difference-between-various-term-variables
+ command: |
+ source ./scripts/ensure-node.sh
+ yarn check-terminal
+
+ install-required-node:
+ # https://discuss.circleci.com/t/switch-nodejs-version-on-machine-executor-solved/26675/2
+ description: Install Node version matching .node-version
+ steps:
+ - run:
+ name: Install Node
+ command: |
+ source ./scripts/ensure-node.sh
+ echo "Installing Yarn"
+ npm install yarn --location=global # ensure yarn is installed with the correct node engine
+ yarn check-node-version
+ - run:
+ name: Check Node
+ command: |
+ source ./scripts/ensure-node.sh
+ yarn check-node-version
+
+ install-chrome:
+ description: Install Google Chrome
+ parameters:
+ channel:
+ description: browser channel to install
+ type: string
+ version:
+ description: browser version to install
+ type: string
+ steps:
+ - run:
+ name: Install Google Chrome (<>)
+ command: |
+ echo "Installing Chrome (<>) v<>"
+ wget -O /usr/src/google-chrome-<>_<>_amd64.deb "http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-<>/google-chrome-<>_<>-1_amd64.deb" && \
+ dpkg -i /usr/src/google-chrome-<>_<>_amd64.deb ; \
+ apt-get install -f -y && \
+ rm -f /usr/src/google-chrome-<>_<>_amd64.deb
+ which google-chrome-<> || (printf "\n\033[0;31mChrome was not successfully downloaded - bailing\033[0m\n\n" && exit 1)
+ echo "Location of Google Chrome Installation: `which google-chrome-<>`"
+ echo "Google Chrome Version: `google-chrome-<> --version`"
+
+ # This code builds better-sqlite3 on CentOS 7. This is necessary because CentOS 7 has the oldest glibc version
+ # that we support. The script checks for the existence of the Centos7-builder image tar file, and skips if it already
+ # exists. If you want to rebuild the image, set the REBUILD_CENTOS_BUILDER_IMAGE environment variable to any value.
+ # Since this is running Docker remote, we need to copy the project into the container, and copy the built plugin out
+ # of the container because the host running docker does not have access to the project directory so volume mounts are
+ # not possible. The built plugin is copied to the project directory so it can be injected into the final binary.
+ build-better-sqlite3:
+ description: Build better-sqlite3 for CentOS 7
+ steps:
+ - setup_remote_docker
+ - restore_cache:
+ keys:
+ - cypress-centos7-builder-{{ checksum "centos7-builder.Dockerfile" }}
+ - restore_cache:
+ keys:
+ - better-sqlite3-{{ checksum "node_modules/better-sqlite3/package.json" }}-{{ checksum "node_modules/electron/package.json" }}-{{ checksum "centos7-builder.Dockerfile" }}
+ - run:
+ name: Build or load centos7-builder image
+ command: |
+ if [[ ! -f better_sqlite3.node ]]; then
+ set -x
+ apt update && apt install -y docker.io
+ if [[ ! -f centos7-builder.tar || -n $REBUILD_CENTOS_BUILDER_IMAGE ]]; then
+ echo "*" > .dockerignore
+ docker build -t centos7-builder -f centos7-builder.Dockerfile .
+ docker save centos7-builder > centos7-builder.tar
+ rm .dockerignore
+ else
+ docker load < centos7-builder.tar
+ fi
+ fi
+ - save_cache:
+ key: cypress-centos7-builder-{{ checksum "centos7-builder.Dockerfile" }}
+ paths:
+ - centos7-builder.tar
+ - run:
+ name: Build better-sqlite3 for CentOS 7
+ command: |
+ if [[ ! -f better_sqlite3.node ]]; then
+ docker run -d --name centos7-builder centos7-builder /bin/bash -c "sleep 1000000000"
+ docker cp ~/cypress/node_modules/better-sqlite3 centos7-builder:/better-sqlite3
+ docker exec -it centos7-builder /bin/bash -c "cd /better-sqlite3 && source /root/.bashrc && chown -R root:root . && npm install --ignore-scripts && npx --no-install prebuild -r electron -t 27.1.3 --include-regex 'better_sqlite3.node$'"
+ docker cp centos7-builder:/better-sqlite3/build/Release/better_sqlite3.node ~/cypress/node_modules/better-sqlite3/build/Release/better_sqlite3.node
+ docker rm -f centos7-builder
+ cp ~/cypress/node_modules/better-sqlite3/build/Release/better_sqlite3.node ~/cypress/better_sqlite3.node
+ else
+ cp ~/cypress/better_sqlite3.node ~/cypress/node_modules/better-sqlite3/build/Release/better_sqlite3.node
+ fi
+ - save_cache:
+ key: better-sqlite3-{{ checksum "node_modules/better-sqlite3/package.json" }}-{{ checksum "node_modules/electron/package.json" }}-{{ checksum "centos7-builder.Dockerfile" }}
+ paths:
+ - better_sqlite3.node
+ - run:
+ name: Clean up top level better-sqlite3 file
+ command: |
+ rm ~/cypress/better_sqlite3.node
+
+ run-driver-integration-tests:
+ parameters:
+ browser:
+ description: browser shortname to target
+ type: string
+ install-chrome-channel:
+ description: chrome channel to install
+ type: string
+ default: ''
+ steps:
+ - restore_cached_workspace
+ - when:
+ condition: <>
+ steps:
+ - install-chrome:
+ channel: <>
+ version: $(node ./scripts/get-browser-version.js chrome:<>)
+ - when:
+ condition:
+ equal: [ webkit, << parameters.browser >> ]
+ steps:
+ - install-webkit-deps
+ - run:
+ name: Run driver tests in Cypress
+ environment:
+ CYPRESS_CONFIG_ENV: production
+ command: |
+ echo Current working directory is $PWD
+ echo Total containers $CIRCLE_NODE_TOTAL
+
+ if [[ -v MAIN_RECORD_KEY ]]; then
+ # internal PR
+ CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
+ CYPRESS_INTERNAL_ENABLE_TELEMETRY="true" \
+ yarn cypress:run --record --parallel --group 5x-driver-<> --browser <> --runner-ui
+ else
+ # external PR
+ TESTFILES=$(circleci tests glob "cypress/e2e/**/*.cy.*" | circleci tests split --total=$CIRCLE_NODE_TOTAL)
+ echo "Test files for this machine are $TESTFILES"
+
+ if [[ -z "$TESTFILES" ]]; then
+ echo "Empty list of test files"
+ fi
+ yarn cypress:run --browser <> --spec $TESTFILES --runner-ui
+ fi
+ working_directory: packages/driver
+ - verify-mocha-results
+ - store_test_results:
+ path: /tmp/cypress
+ - store_artifacts:
+ path: /tmp/artifacts
+ - store-npm-logs
+
+ windows-install-chrome:
+ parameters:
+ browser:
+ description: browser shortname to target
+ type: string
+ steps:
+ - run:
+ # TODO: How can we have preinstalled browsers on CircleCI?
+ name: 'Install Chrome on Windows'
+ command: |
+ # install with `--ignore-checksums` to avoid checksum error
+ # https://www.gep13.co.uk/blog/chocolatey-error-hashes-do-not-match
+ [[ $PLATFORM == 'windows' && '<>' == 'chrome' ]] && choco install googlechrome -y --ignore-checksums || [[ $PLATFORM != 'windows' ]]
+
+ run-new-ui-tests:
+ parameters:
+ package:
+ description: package to target
+ type: enum
+ enum: ['frontend-shared', 'launchpad', 'app', 'reporter']
+ browser:
+ description: browser shortname to target
+ type: string
+ percy:
+ description: enable percy
+ type: boolean
+ default: false
+ type:
+ description: ct or e2e
+ type: enum
+ enum: ['ct', 'e2e']
+ debug:
+ description: debug option
+ type: string
+ default: ''
+ steps:
+ - restore_cached_workspace
+ - windows-install-chrome:
+ browser: <>
+ - run:
+ command: |
+ echo Current working directory is $PWD
+ echo Total containers $CIRCLE_NODE_TOTAL
+
+ if [[ -v MAIN_RECORD_KEY ]]; then
+ # internal PR
+ cmd=$([[ <> == 'true' ]] && echo 'yarn percy exec --parallel -- --') || true
+
+ DEBUG=<> \
+ CYPRESS_CONFIG_ENV=production \
+ CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
+ PERCY_PARALLEL_NONCE=$CIRCLE_WORKFLOW_WORKSPACE_ID \
+ PERCY_ENABLE=${PERCY_TOKEN:-0} \
+ PERCY_PARALLEL_TOTAL=-1 \
+ CYPRESS_INTERNAL_ENABLE_TELEMETRY="true" \
+ $cmd yarn workspace @packages/<> cypress:run:<> --browser <> --record --parallel --group <>-<>
+ else
+ # external PR
+
+ # To make `circleci tests` work correctly, we need to step into the package folder.
+ cd packages/<>
+
+ if [[ <> == 'ct' ]]; then
+ # component tests are located side by side with the source codes.
+ # for the app component tests, ignore specs that are known to cause failures on contributor PRs (see https://discuss.circleci.com/t/how-to-exclude-certain-files-from-circleci-test-globbing/41028)
+ TESTFILES=$(find src -regextype posix-extended -name '*.cy.*' -not -regex '.*(FileMatch|PromoAction|SelectorPlayground|useDurationFormat|useTestingType|SpecPatterns).cy.*' | circleci tests split --total=$CIRCLE_NODE_TOTAL)
+ else
+ GLOB="cypress/e2e/**/*cy.*"
+ TESTFILES=$(circleci tests glob "$GLOB" | circleci tests split --total=$CIRCLE_NODE_TOTAL)
+ fi
+
+ echo "Test files for this machine are $TESTFILES"
+
+ # To run the `yarn` command, we need to walk out of the package folder.
+ cd ../..
+
+ DEBUG=<> \
+ CYPRESS_CONFIG_ENV=production \
+ PERCY_PARALLEL_NONCE=$CIRCLE_WORKFLOW_WORKSPACE_ID \
+ PERCY_ENABLE=${PERCY_TOKEN:-0} \
+ PERCY_PARALLEL_TOTAL=-1 \
+ yarn workspace @packages/<> cypress:run:<> --browser <> --spec $TESTFILES
+ fi
+ - run:
+ command: |
+ if [[ <> == 'app' && <> == 'true' && -d "packages/app/cypress/screenshots/runner/screenshot/screenshot.cy.tsx/percy" ]]; then
+ PERCY_PARALLEL_NONCE=$CIRCLE_WORKFLOW_WORKSPACE_ID \
+ PERCY_ENABLE=${PERCY_TOKEN:-0} \
+ PERCY_PARALLEL_TOTAL=-1 \
+ yarn percy upload packages/app/cypress/screenshots/runner/screenshot/screenshot.cy.tsx/percy
+ else
+ echo "skipping percy screenshots uploading"
+ fi
+ - store_test_results:
+ path: /tmp/cypress
+ - store-npm-logs
+
+ run-system-tests:
+ parameters:
+ browser:
+ description: browser shortname to target
+ type: string
+ steps:
+ - restore_cached_workspace
+ - restore_cached_system_tests_deps
+ - when:
+ condition:
+ equal: [ webkit, << parameters.browser >> ]
+ steps:
+ - install-webkit-deps
+ - run:
+ name: Run system tests
+ environment:
+ CYPRESS_COMMERCIAL_RECOMMENDATIONS: '0'
+ 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 <>
+ - verify-mocha-results
+ - store_test_results:
+ path: /tmp/cypress
+ - store_artifacts:
+ path: /tmp/artifacts
+ - store-npm-logs
+
+ run-binary-system-tests:
+ steps:
+ - restore_cached_workspace
+ - restore_cached_system_tests_deps
+ - run:
+ name: Run system tests
+ environment:
+ CYPRESS_COMMERCIAL_RECOMMENDATIONS: '0'
+ command: |
+ ALL_SPECS=`circleci tests glob "$HOME/cypress/system-tests/test-binary/*spec*"`
+ SPECS=`echo $ALL_SPECS | xargs -n 1 | circleci tests split --split-by=timings`
+ echo SPECS=$SPECS
+ yarn workspace @tooling/system-tests test:ci $SPECS
+ - verify-mocha-results
+ - store_test_results:
+ path: /tmp/cypress
+ - store_artifacts:
+ path: /tmp/artifacts
+ - store-npm-logs
+
+ store-npm-logs:
+ description: Saves any NPM debug logs as artifacts in case there is a problem
+ steps:
+ - store_artifacts:
+ path: ~/.npm/_logs
+
+ post-install-comment:
+ parameters:
+ package_url_path:
+ type: string
+ default: npm-package-url.json
+ binary_url_path:
+ type: string
+ default: binary-url.json
+ description: Post GitHub comment with a blurb on how to install pre-release version
+ steps:
+ - run:
+ name: Post pre-release install comment
+ command: |
+ node scripts/add-install-comment.js \
+ --npm << parameters.package_url_path >> \
+ --binary << parameters.binary_url_path >>
+
+ verify-mocha-results:
+ description: Double-check that Mocha tests ran as expected.
+ parameters:
+ expectedResultCount:
+ description: The number of result files to expect, ie, the number of Mocha test suites that ran.
+ type: integer
+ ## by default, assert that at least 1 test ran
+ default: 0
+ steps:
+ - run:
+ name: 'Verify Mocha Results'
+ command: |
+ source ./scripts/ensure-node.sh
+ yarn verify:mocha:results <>
+
+ 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 and checking out release branch: <>"
+ working_directory: /tmp/<>
+ command: |
+ git clone --depth 1 --no-single-branch https://github.com/cypress-io/<>.git .
+
+ cd ~/cypress/..
+ # install some deps for get-next-version
+ npm i semver@7.3.2 conventional-recommended-bump@6.1.0 conventional-changelog-angular@5.0.12 minimist@1.2.5
+ NEXT_VERSION=$(node ./cypress/scripts/get-next-version.js)
+ cd -
+
+ git checkout $NEXT_VERSION || true
+ - when:
+ condition: <>
+ steps:
+ - run:
+ name: Check out PR <>
+ working_directory: /tmp/<>
+ command: |
+ git fetch origin pull/<>/head:pr-<>
+ git checkout pr-<>
+
+ test-binary-against-rwa:
+ description: |
+ Takes the built binary and NPM package, clones the RWA repo
+ and runs the new version of Cypress against it.
+ parameters:
+ repo:
+ description: "Name of the github repo to clone like"
+ type: string
+ default: "cypress-realworld-app"
+ browser:
+ description: Name of the browser to use, like "electron", "chrome", "firefox"
+ type: enum
+ enum: ["", "electron", "chrome", "firefox"]
+ default: ""
+ command:
+ description: Test command to run to start Cypress tests
+ type: string
+ default: "CYPRESS_INTERNAL_ENABLE_TELEMETRY=1 CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY CYPRESS_PROJECT_ID=ypt4pf yarn cypress:run"
+ # if the repo to clone and test is a monorepo, you can
+ # run tests inside a specific subfolder
+ folder:
+ description: Subfolder to test in
+ type: string
+ default: ""
+ # you can test new features in the test runner against recipes or other repos
+ # by opening a pull request in those repos and running this test job
+ # against a pull request number in the example repo
+ pull_request_id:
+ description: Pull request number to check out before installing and testing
+ type: integer
+ default: 0
+ wait-on:
+ description: Whether to use wait-on to wait on a server to be booted
+ type: string
+ default: ""
+ server-start-command:
+ description: Server start command for repo
+ type: string
+ default: "CI=true yarn start"
+ steps:
+ - clone-repo-and-checkout-branch:
+ repo: <>
+ - when:
+ condition: <>
+ steps:
+ - run:
+ name: Check out PR <>
+ working_directory: /tmp/<>
+ command: |
+ git fetch origin pull/<>/head:pr-<>
+ git checkout pr-<>
+ git log -n 2
+ - run:
+ command: yarn
+ working_directory: /tmp/<>
+ - run:
+ name: Install Cypress
+ working_directory: /tmp/<>
+ # force installing the freshly built binary
+ command: |
+ CYPRESS_INSTALL_BINARY=~/cypress/cypress.zip npm i --legacy-peer-deps ~/cypress/cypress.tgz && [[ -f yarn.lock ]] && yarn
+ - run:
+ name: Print Cypress version
+ working_directory: /tmp/<>
+ command: npx cypress version
+ - run:
+ name: Types check 🧩 (maybe)
+ working_directory: /tmp/<>
+ command: yarn types
+ - run:
+ # NOTE: we do not need to wait for the vite dev server to start
+ working_directory: /tmp/<>
+ command: <>
+ background: true
+ - when:
+ condition: <>
+ steps:
+ - when:
+ condition: <>
+ steps:
+ - run:
+ name: Run tests using browser "<>"
+ working_directory: /tmp/<>/<>
+ command: |
+ <> --browser <> --record false
+ - unless:
+ condition: <>
+ steps:
+ - run:
+ name: Run tests using command
+ working_directory: /tmp/<>/<>
+ command: <>
+ - unless:
+ condition: <>
+ steps:
+ - when:
+ condition: <>
+ steps:
+ - run:
+ name: Run tests using browser "<>"
+ working_directory: /tmp/<>
+ command: <> --browser <> --record false
+ - unless:
+ condition: <>
+ steps:
+ - run:
+ name: Run tests using command
+ working_directory: /tmp/<>
+ command: <>
+ - store-npm-logs
+
+ test-binary-against-repo:
+ description: |
+ Takes the built binary and NPM package, clones given example repo
+ and runs the new version of Cypress against it.
+ parameters:
+ repo:
+ description: "Name of the github repo to clone like: cypress-example-kitchensink"
+ type: string
+ browser:
+ description: Name of the browser to use, like "electron", "chrome", "firefox"
+ type: enum
+ enum: ["", "electron", "chrome", "firefox"]
+ default: ""
+ command:
+ description: Test command to run to start Cypress tests
+ type: string
+ default: "npm run e2e"
+ build-project:
+ description: Should the project build script be executed
+ type: boolean
+ default: true
+ # if the repo to clone and test is a monorepo, you can
+ # run tests inside a specific subfolder
+ folder:
+ description: Subfolder to test in
+ type: string
+ default: ""
+ # you can test new features in the test runner against recipes or other repos
+ # by opening a pull request in those repos and running this test job
+ # against a pull request number in the example repo
+ pull_request_id:
+ description: Pull request number to check out before installing and testing
+ type: integer
+ default: 0
+ wait-on:
+ description: Whether to use wait-on to wait on a server to be booted
+ type: string
+ default: ""
+ server-start-command:
+ description: Server start command for repo
+ type: string
+ default: "npm start --if-present"
+ steps:
+ - run:
+ name: Install yarn if not already installed
+ command: |
+ yarn --version || npm i -g yarn
+ - clone-repo-and-checkout-branch:
+ repo: <>
+ pull_request_id: <>
+ - run:
+ # Ensure we're installing the node-version for the cloned repo
+ command: |
+ if [[ -f .node-version ]]; then
+ branch="<< pipeline.git.branch >>"
+
+ externalBranchPattern='^pull\/[0-9]+'
+ if [[ $branch =~ $externalBranchPattern ]]; then
+ # We are unable to curl from the external PR branch location
+ # so we fall back to develop
+ branch="develop"
+ fi
+
+ curl -L https://raw.githubusercontent.com/cypress-io/cypress/$branch/scripts/ensure-node.sh --output ci-ensure-node.sh
+ else
+ # if no .node-version file exists, we no-op the node script and use the global yarn
+ echo '' > ci-ensure-node.sh
+ fi
+ working_directory: /tmp/<>
+ - run:
+ # Install deps + Cypress binary with yarn if yarn.lock present
+ command: |
+ source ./ci-ensure-node.sh
+ if [[ -f yarn.lock ]]; then
+ yarn --frozen-lockfile
+ CYPRESS_INSTALL_BINARY=~/cypress/cypress.zip yarn add -D ~/cypress/cypress.tgz
+ else
+ npm install
+ CYPRESS_INSTALL_BINARY=~/cypress/cypress.zip npm install --legacy-peer-deps ~/cypress/cypress.tgz
+ fi
+ working_directory: /tmp/<>
+ - run:
+ name: Scaffold new config file
+ working_directory: /tmp/<>
+ environment:
+ CYPRESS_INTERNAL_FORCE_SCAFFOLD: "1"
+ command: |
+ if [[ -f cypress.json ]]; then
+ rm -rf cypress.json
+ echo 'module.exports = { e2e: {} }' > cypress.config.js
+ fi
+ - run:
+ name: Rename support file
+ working_directory: /tmp/<>
+ command: |
+ if [[ -f cypress/support/index.js ]]; then
+ mv cypress/support/index.js cypress/support/e2e.js
+ fi
+ - run:
+ name: Print Cypress version
+ working_directory: /tmp/<>
+ command: |
+ source ./ci-ensure-node.sh
+ npx cypress version
+ - run:
+ name: Types check 🧩 (maybe)
+ working_directory: /tmp/<>
+ command: |
+ source ./ci-ensure-node.sh
+ [[ -f yarn.lock ]] && yarn types || npm run types --if-present
+ - when:
+ condition: <>
+ steps:
+ - run:
+ name: Build 🏗 (maybe)
+ working_directory: /tmp/<>
+ command: |
+ source ./ci-ensure-node.sh
+ [[ -f yarn.lock ]] && yarn build || npm run build --if-present
+ - run:
+ working_directory: /tmp/<>
+ command: |
+ source ./ci-ensure-node.sh
+ <>
+ background: true
+ - run:
+ condition: <>
+ name: "Waiting on server to boot: <>"
+ command: |
+ npx wait-on <> --timeout 120000
+ - windows-install-chrome:
+ browser: <>
+ - when:
+ condition: <>
+ steps:
+ - when:
+ condition: <>
+ steps:
+ - run:
+ name: Run tests using browser "<>"
+ working_directory: /tmp/<>/<>
+ command: |
+ <> -- --browser <>
+ - unless:
+ condition: <>
+ steps:
+ - run:
+ name: Run tests using command
+ working_directory: /tmp/<>/<>
+ command: <>
+ - unless:
+ condition: <>
+ steps:
+ - when:
+ condition: <>
+ steps:
+ - run:
+ name: Run tests using browser "<>"
+ working_directory: /tmp/<>
+ command: |
+ source ./ci-ensure-node.sh
+ <> -- --browser <>
+ - unless:
+ condition: <>
+ steps:
+ - run:
+ name: Run tests using command
+ working_directory: /tmp/<>
+ command: |
+ source ./ci-ensure-node.sh
+ <>
+ - store-npm-logs
+
+ check-if-binary-exists:
+ steps:
+ - run:
+ name: Check if binary exists, exit if it does
+ command: |
+ source ./scripts/ensure-node.sh
+ yarn gulp e2eTestScaffold
+ yarn check-binary-on-cdn --version $(node ./scripts/get-next-version.js) --type binary --file cypress.zip
+
+ build-and-package-binary:
+ steps:
+ - run:
+ name: Check environment variables before code sign (if on Mac/Windows)
+ # NOTE
+ # our code sign works via electron-builder
+ # by default, electron-builder will NOT sign app built in a pull request
+ # even our internal one (!)
+ # Usually this is not a problem, since we only build and test binary
+ # built on the "develop" branch
+ # but if you need to really build and sign a binary in a PR
+ # set variable CSC_FOR_PULL_REQUEST=true
+ command: |
+ set -e
+ NEEDS_CODE_SIGNING_WINDOWS=`node -p 'process.platform === "win32"'`
+ NEEDS_CODE_SIGNING_MAC=`node -p 'process.platform === "darwin"'`
+
+ if [[ "$NEEDS_CODE_SIGNING_MAC" == "true" ]]; then
+ echo "Checking for required environment variables..."
+ if [ -z "$CSC_LINK" ]; then
+ echo "Need to provide environment variable CSC_LINK"
+ echo "with base64 encoded certificate .p12 file"
+ exit 1
+ fi
+ if [ -z "$CSC_KEY_PASSWORD" ]; then
+ echo "Need to provide environment variable CSC_KEY_PASSWORD"
+ echo "with password for unlocking certificate .p12 file"
+ exit 1
+ fi
+ echo "Succeeded."
+ elif [[ "$NEEDS_CODE_SIGNING_WINDOWS" == "true" ]]; then
+ echo "Checking for required environment variables..."
+ if [ -z "$WINDOWS_SIGN_USER_NAME" ]; then
+ echo "Need to provide environment variable WINDOWS_SIGN_USER_NAME"
+ echo "with password for fetching and signing certificate"
+ exit 1
+ fi
+ if [ -z "$WINDOWS_SIGN_USER_PASSWORD" ]; then
+ echo "Need to provide environment variable WINDOWS_SIGN_USER_PASSWORD"
+ echo "for fetching and signing certificate"
+ exit 1
+ fi
+ if [ -z "$WINDOWS_SIGN_CREDENTIAL_ID" ]; then
+ echo "Need to provide environment variable WINDOWS_SIGN_CREDENTIAL_ID"
+ echo "for identifying certificate"
+ exit 1
+ fi
+ if [ -z "$WINDOWS_SIGN_USER_TOTP" ]; then
+ echo "Need to provide environment variable WINDOWS_SIGN_USER_TOTP"
+ echo "for signing certificate"
+ exit 1
+ fi
+ echo "Succeeded."
+ else
+ echo "Not code signing for this platform"
+ fi
+ - run:
+ name: Build the Cypress binary
+ no_output_timeout: "45m"
+ command: |
+ source ./scripts/ensure-node.sh
+ node --version
+ if [[ `node ./scripts/get-platform-key.js` == 'linux-arm64' ]]; then
+ # these are missing on Circle and there is no way to pre-install them on Arm
+ sudo apt-get update
+ sudo apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
+ DISABLE_SNAPSHOT_REQUIRE=1 yarn binary-build --version $(node ./scripts/get-next-version.js)
+ else
+ yarn binary-build --version $(node ./scripts/get-next-version.js)
+ fi
+ - run:
+ name: Package the Cypress binary
+ environment:
+ DEBUG: electron-builder,electron-osx-sign*,electron-notarize*
+ # notarization on Mac can take a while
+ no_output_timeout: "45m"
+ command: |
+ source ./scripts/ensure-node.sh
+ node --version
+ if [[ `node ./scripts/get-platform-key.js` == 'linux-arm64' ]]; then
+ # these are missing on Circle and there is no way to pre-install them on Arm
+ sudo apt-get update
+ sudo apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
+ DISABLE_SNAPSHOT_REQUIRE=1 yarn binary-package --version $(node ./scripts/get-next-version.js)
+ else
+ yarn binary-package --version $(node ./scripts/get-next-version.js)
+ fi
+ - run:
+ name: Smoke Test the Cypress binary
+ command: |
+ source ./scripts/ensure-node.sh
+ node --version
+ yarn binary-smoke-test --version $(node ./scripts/get-next-version.js)
+ - run:
+ name: Zip the binary
+ command: |
+ if [[ $PLATFORM == 'linux' ]]; then
+ # on Arm, CI runs as non-root, on x64 CI runs as root but there is no sudo binary
+ if [[ `whoami` == 'root' ]]; then
+ apt-get update && apt-get install -y zip
+ else
+ sudo apt-get update && sudo apt-get install -y zip
+ fi
+ fi
+ source ./scripts/ensure-node.sh
+ yarn binary-zip
+ - store-npm-logs
+ - persist_to_workspace:
+ root: ~/
+ paths:
+ - cypress/cypress.zip
+
+ trigger-publish-binary-pipeline:
+ steps:
+ - run:
+ name: "Trigger publish-binary pipeline"
+ command: |
+ source ./scripts/ensure-node.sh
+ echo $SHOULD_PERSIST_ARTIFACTS
+ node ./scripts/binary/trigger-publish-binary-pipeline.js
+ - persist_to_workspace:
+ root: ~/
+ paths:
+ - triggered_pipeline.json
+
+ build-cypress-npm-package:
+ parameters:
+ executor:
+ type: executor
+ default: cy-doc
+ steps:
+ - run:
+ name: Bump NPM version
+ command: |
+ source ./scripts/ensure-node.sh
+ yarn get-next-version --npm
+ - run:
+ name: Build NPM package
+ command: |
+ source ./scripts/ensure-node.sh
+ yarn lerna run build-cli
+ - run:
+ command: ls -la types
+ working_directory: cli/build
+ - run:
+ command: ls -la vue vue2 mount-utils react
+ working_directory: cli/build
+ - unless:
+ condition:
+ equal: [ *windows-executor, << parameters.executor >> ]
+ steps:
+ - run:
+ name: list NPM package contents
+ command: |
+ source ./scripts/ensure-node.sh
+ yarn workspace cypress size
+ - run:
+ name: pack NPM package
+ working_directory: cli/build
+ command: yarn pack --filename ../../cypress.tgz
+ - run:
+ name: list created NPM package
+ command: ls -l
+ - store-npm-logs
+ - persist_to_workspace:
+ root: ~/
+ paths:
+ - cypress/cypress.tgz
+
+ upload-build-artifacts:
+ steps:
+ - run: ls -l
+ - run:
+ name: Upload unique binary to S3
+ command: |
+ node scripts/binary.js upload-build-artifact \
+ --type binary \
+ --file cypress.zip \
+ --version $(node -p "require('./package.json').version")
+ - run:
+ name: Upload NPM package to S3
+ command: |
+ node scripts/binary.js upload-build-artifact \
+ --type npm-package \
+ --file cypress.tgz \
+ --version $(node -p "require('./package.json').version")
+ - store-npm-logs
+ - run: ls -l
+ - run: cat binary-url.json
+ - run: cat npm-package-url.json
+ - persist_to_workspace:
+ root: ~/
+ paths:
+ - cypress/binary-url.json
+ - cypress/npm-package-url.json
+
+ update_known_hosts:
+ description: Ensures that we have the latest Git public keys to prevent git+ssh from failing.
+ steps:
+ - run:
+ name: Update known_hosts with github.com keys
+ command: |
+ mkdir -p ~/.ssh
+ ssh-keyscan github.com >> ~/.ssh/known_hosts
+
+jobs:
+ ## Checks if we already have a valid cache for the node_modules_install and if it has,
+ ## skips ahead to the build step, otherwise installs and caches the node_modules
+ node_modules_install:
+ <<: *defaults
+ parameters:
+ <<: *defaultsParameters
+ resource_class:
+ type: string
+ default: medium
+ build-better-sqlite3:
+ type: boolean
+ default: false
+ resource_class: << parameters.resource_class >>
+ steps:
+ - update_known_hosts
+ - checkout
+ - install-required-node
+ - verify-build-setup:
+ executor: << parameters.executor >>
+ - persist_to_workspace:
+ root: ~/
+ paths:
+ - cypress
+ - .ssh
+ - .nvm # mac / linux
+ - ProgramData/nvm # windows
+ - caching-dependency-installer:
+ only-cache-for-root-user: <>
+ build-better-sqlite3: <>
+ - store-npm-logs
+
+ ## restores node_modules from previous step & builds if first step skipped
+ build:
+ <<: *defaults
+ parameters:
+ <<: *defaultsParameters
+ resource_class:
+ type: string
+ default: large
+ resource_class: << parameters.resource_class >>
+ steps:
+ - restore_cached_workspace
+ - run:
+ name: Top level packages
+ command: yarn list --depth=0 || true
+ - run:
+ name: Check env canaries on Linux
+ command: |
+ # only Docker has the required env data for this
+ if [[ $CI_DOCKER == 'true' ]]; then
+ node ./scripts/circle-env.js --check-canaries
+ fi
+ - build-and-persist
+ - store-npm-logs
+
+ lint:
+ <<: *defaults
+ steps:
+ - restore_cached_workspace
+ - run:
+ name: Linting 🧹
+ command: |
+ yarn clean
+ git clean -df
+ yarn lint
+ - run:
+ name: cypress info (dev)
+ command: node cli/bin/cypress info --dev
+ - store-npm-logs
+
+ check-ts:
+ <<: *defaults
+ steps:
+ - restore_cached_workspace
+ - install-required-node
+ - run:
+ name: Check TS Types
+ command: NODE_OPTIONS=--max_old_space_size=4096 yarn check-ts --concurrency=1
+
+ # a special job that closes the Percy build started by the required jobs
+ percy-finalize:
+ <<: *defaults
+ resource_class: small
+ parameters:
+ <<: *defaultsParameters
+ required_env_var:
+ type: env_var_name
+ steps:
+ - restore_cached_workspace
+ - run:
+ # if this is an external pull request, the environment variables
+ # are NOT set for security reasons, thus no need to to finalize Percy,
+ # since there will be no visual tests
+ name: Check if <> is set
+ command: |
+ if [[ -v <> ]]; then
+ echo "Internal PR, good to go"
+ else
+ echo "This is an external PR, cannot access other services"
+ circleci-agent step halt
+ fi
+ - run:
+ # Sometimes, even though all the circle jobs have finished, Percy times out during `build:finalize`
+ # If all other jobs finish but `build:finalize` fails, we retry it once
+ name: Finalize percy build - allows single retry
+ command: |
+ PERCY_PARALLEL_NONCE=$CIRCLE_WORKFLOW_WORKSPACE_ID \
+ yarn percy build:finalize || yarn percy build:finalize
+
+ ready-to-release:
+ <<: *defaults
+ resource_class: small
+ parameters:
+ <<: *defaultsParameters
+ steps:
+ - run:
+ name: Ready to release
+ command: echo 'Ready to release'
+
+ cli-visual-tests:
+ <<: *defaults
+ resource_class: small
+ steps:
+ - restore_cached_workspace
+ - run: mkdir -p cli/visual-snapshots
+ - run:
+ command: node cli/bin/cypress info --dev | yarn --silent term-to-html | node scripts/sanitize --type cli-info > cli/visual-snapshots/cypress-info.html
+ environment:
+ FORCE_COLOR: 2
+ - run:
+ command: node cli/bin/cypress help | yarn --silent term-to-html > cli/visual-snapshots/cypress-help.html
+ environment:
+ FORCE_COLOR: 2
+ - store_artifacts:
+ path: cli/visual-snapshots
+ - run:
+ name: Upload CLI snapshots for diffing
+ command: |
+ PERCY_PARALLEL_NONCE=$CIRCLE_WORKFLOW_WORKSPACE_ID \
+ PERCY_ENABLE=${PERCY_TOKEN:-0} \
+ PERCY_PARALLEL_TOTAL=-1 \
+ yarn percy snapshot ./cli/visual-snapshots
+
+ v8-integration-tests:
+ <<: *defaults
+ parameters:
+ <<: *defaultsParameters
+ resource_class:
+ type: string
+ default: medium
+ resource_class: << parameters.resource_class >>
+ parallelism: 1
+ steps:
+ - restore_cached_workspace
+ - restore_cached_system_tests_deps
+ # TODO: Remove this once we switch off self-hosted M1 runners
+ - when:
+ condition:
+ equal: [ *darwin-arm64-executor, << parameters.executor >> ]
+ steps:
+ - run: rm -f /tmp/cypress/junit/*
+ - unless:
+ condition:
+ or:
+ - equal: [ *linux-arm64-executor, << parameters.executor >> ] # TODO: Figure out how to support linux-arm64 when we get to linux arm64 build: https://github.com/cypress-io/cypress/issues/23557
+ steps:
+ - run:
+ name: Run v8 integration tests
+ command: |
+ source ./scripts/ensure-node.sh
+ yarn test-integration --scope "'@tooling/{packherd,v8-snapshot,electron-mksnapshot}'"
+ - verify-mocha-results:
+ expectedResultCount: 3
+ - when:
+ condition:
+ or:
+ - equal: [ *linux-arm64-executor, << parameters.executor >> ]
+ steps:
+ - run:
+ name: Run v8 integration tests
+ command: |
+ source ./scripts/ensure-node.sh
+ yarn test-integration --scope "'@tooling/packherd'"
+ - verify-mocha-results:
+ expectedResultCount: 1
+ - store_test_results:
+ path: /tmp/cypress
+ - store-npm-logs
+
+ driver-integration-memory-tests:
+ <<: *defaults
+ parameters:
+ <<: *defaultsParameters
+ resource_class:
+ type: string
+ default: medium
+ resource_class: << parameters.resource_class >>
+ parallelism: 1
+ steps:
+ - restore_cached_workspace
+ - run:
+ name: Driver memory tests in Electron
+ environment:
+ CYPRESS_CONFIG_ENV: production
+ command: |
+ echo Current working directory is $PWD
+ node --version
+ if [[ `node ../../scripts/get-platform-key.js` == 'linux-arm64' ]]; then
+ # these are missing on Circle and there is no way to pre-install them on Arm
+ sudo apt-get update
+ sudo apt-get install -y libgbm-dev
+ fi
+
+ CYPRESS_INTERNAL_MEMORY_SAVE_STATS=true \
+ DEBUG=cypress*memory \
+ yarn cypress:run --browser electron --spec "cypress/e2e/memory/*.cy.*"
+ working_directory: packages/driver
+ - store_test_results:
+ path: /tmp/cypress
+ - store-npm-logs
+ - store_artifacts:
+ path: packages/driver/cypress/logs/memory
+
+ unit-tests:
+ <<: *defaults
+ parameters:
+ <<: *defaultsParameters
+ resource_class:
+ type: string
+ default: medium
+ resource_class: << parameters.resource_class >>
+ parallelism: 1
+ steps:
+ - restore_cached_workspace
+ - when:
+ condition:
+ # several snapshots fails for windows due to paths.
+ # until these are fixed, run the tests that are working.
+ equal: [ *windows-executor, << parameters.executor >> ]
+ steps:
+ - run: yarn test-scripts scripts/**/*spec.js
+ - unless:
+ condition:
+ equal: [ *windows-executor, << parameters.executor >> ]
+ steps:
+ - run: yarn test-scripts
+ # run unit tests from each individual package
+ - run: yarn test
+ # run type checking for each individual package
+ - run: yarn lerna run types
+ - verify-mocha-results:
+ expectedResultCount: 19
+ - store_test_results:
+ path: /tmp/cypress
+ # CLI tests generate HTML files with sample CLI command output
+ - store_artifacts:
+ path: cli/test/html
+ - store_artifacts:
+ path: packages/errors/__snapshot-images__
+ - store-npm-logs
+
+ verify-release-readiness:
+ <<: *defaults
+ resource_class: small
+ parallelism: 1
+ environment:
+ GITHUB_TOKEN: $GH_TOKEN
+ steps:
+ - restore_cached_workspace
+ - update_known_hosts
+ - run: yarn test-npm-package-release-script
+ - run: node ./scripts/semantic-commits/validate-binary-changelog.js
+ - store_artifacts:
+ path: /tmp/releaseData
+
+ lint-types:
+ <<: *defaults
+ parallelism: 1
+ steps:
+ - restore_cached_workspace
+ - run:
+ command: ls -la types
+ working_directory: cli
+ - run:
+ command: ls -la chai
+ working_directory: cli/types
+ - run:
+ name: "Lint types 🧹"
+ command: yarn workspace cypress dtslint
+ - store-npm-logs
+
+ server-unit-tests:
+ <<: *defaults
+ parallelism: 1
+ steps:
+ - restore_cached_workspace
+ - run: yarn test-unit --scope @packages/server
+ - verify-mocha-results:
+ expectedResultCount: 1
+ - store_test_results:
+ path: /tmp/cypress
+ - store-npm-logs
+
+ server-unit-tests-cloud-environment:
+ <<: *defaults
+ parameters:
+ <<: *defaultsParameters
+ resource_class:
+ type: string
+ default: medium
+ resource_class: << parameters.resource_class >>
+ parallelism: 1
+ steps:
+ - restore_cached_workspace
+ # TODO: Remove this once we switch off self-hosted M1 runners
+ - when:
+ condition:
+ equal: [ *darwin-arm64-executor, << parameters.executor >> ]
+ steps:
+ - run: rm -f /tmp/cypress/junit/*
+ - run: yarn workspace @packages/server test-unit cloud/environment_spec.ts
+ - verify-mocha-results:
+ expectedResultCount: 1
+ - store_test_results:
+ path: /tmp/cypress
+ - store-npm-logs
+
+ server-integration-tests:
+ <<: *defaults
+ parallelism: 1
+ steps:
+ - restore_cached_workspace
+ - run: yarn test-integration --scope @packages/server
+ - verify-mocha-results:
+ expectedResultCount: 1
+ - store_test_results:
+ path: /tmp/cypress
+ - store-npm-logs
+
+ server-performance-tests:
+ <<: *defaults
+ steps:
+ - restore_cached_workspace
+ - run:
+ command: yarn workspace @packages/server test-performance
+ - verify-mocha-results:
+ expectedResultCount: 1
+ - store_test_results:
+ path: /tmp/cypress
+ - store_artifacts:
+ path: /tmp/artifacts
+ - store-npm-logs
+
+ system-tests-node-modules-install:
+ <<: *defaults
+ steps:
+ - restore_cached_workspace
+ - update_cached_system_tests_deps
+
+ binary-system-tests:
+ parallelism: 2
+ working_directory: ~/cypress
+ environment:
+ <<: *defaultsEnvironment
+ PLATFORM: linux
+ machine:
+ # using `machine` gives us a Linux VM that can run Docker
+ image: ubuntu-2004:202111-02
+ docker_layer_caching: true
+ resource_class: medium
+ steps:
+ - maybe_skip_binary_jobs
+ - run-binary-system-tests
+
+ system-tests-chrome:
+ <<: *defaults
+ resource_class: medium+
+ parallelism: 8
+ steps:
+ - run-system-tests:
+ browser: chrome
+
+ system-tests-electron:
+ <<: *defaults
+ resource_class: medium+
+ parallelism: 8
+ steps:
+ - run-system-tests:
+ browser: electron
+
+ system-tests-firefox:
+ <<: *defaults
+ resource_class: medium+
+ parallelism: 8
+ steps:
+ - run-system-tests:
+ browser: firefox
+
+ system-tests-webkit:
+ <<: *defaults
+ resource_class: medium+
+ parallelism: 8
+ steps:
+ - run-system-tests:
+ browser: webkit
+
+ system-tests-non-root:
+ <<: *defaults
+ steps:
+ - restore_cached_workspace
+ - run:
+ environment:
+ CYPRESS_COMMERCIAL_RECOMMENDATIONS: '0'
+ command: yarn workspace @tooling/system-tests test:ci "test/non_root*spec*" --browser electron
+ - verify-mocha-results
+ - store_test_results:
+ path: /tmp/cypress
+ - store_artifacts:
+ path: /tmp/artifacts
+ - store-npm-logs
+
+ run-frontend-shared-component-tests-chrome:
+ <<: *defaults
+ parameters:
+ <<: *defaultsParameters
+ percy:
+ type: boolean
+ default: false
+ parallelism: 3
+ steps:
+ - run-new-ui-tests:
+ browser: chrome
+ percy: << parameters.percy >>
+ package: frontend-shared
+ type: ct
+
+ run-launchpad-component-tests-chrome:
+ <<: *defaults
+ parameters:
+ <<: *defaultsParameters
+ percy:
+ type: boolean
+ default: false
+ parallelism: 7
+ steps:
+ - run-new-ui-tests:
+ browser: chrome
+ percy: << parameters.percy >>
+ package: launchpad
+ type: ct
+ # debug: cypress:*,engine:socket
+
+ run-launchpad-integration-tests-chrome:
+ <<: *defaults
+ parameters:
+ <<: *defaultsParameters
+ resource_class:
+ type: string
+ default: large
+ percy:
+ type: boolean
+ default: false
+ resource_class: << parameters.resource_class >>
+ parallelism: 3
+ steps:
+ - run-new-ui-tests:
+ browser: chrome
+ percy: << parameters.percy >>
+ package: launchpad
+ type: e2e
+
+ run-app-component-tests-chrome:
+ <<: *defaults
+ parameters:
+ <<: *defaultsParameters
+ resource_class:
+ type: string
+ default: medium+
+ percy:
+ type: boolean
+ default: false
+ parallelism: 7
+ steps:
+ - run-new-ui-tests:
+ browser: chrome
+ percy: << parameters.percy >>
+ package: app
+ type: ct
+
+ run-app-integration-tests-chrome:
+ <<: *defaults
+ parameters:
+ <<: *defaultsParameters
+ resource_class:
+ type: string
+ default: large
+ percy:
+ type: boolean
+ default: false
+ resource_class: << parameters.resource_class >>
+ parallelism: 8
+ steps:
+ - run-new-ui-tests:
+ browser: chrome
+ percy: << parameters.percy >>
+ package: app
+ type: e2e
+
+ driver-integration-tests-chrome:
+ <<: *defaults
+ parallelism: 5
+ resource_class: medium+
+ steps:
+ - run-driver-integration-tests:
+ browser: chrome
+ install-chrome-channel: stable
+
+ driver-integration-tests-chrome-beta:
+ <<: *defaults
+ resource_class: medium+
+ parallelism: 5
+ steps:
+ - run-driver-integration-tests:
+ browser: chrome:beta
+ install-chrome-channel: beta
+
+ driver-integration-tests-firefox:
+ <<: *defaults
+ resource_class: medium+
+ parallelism: 5
+ steps:
+ - run-driver-integration-tests:
+ browser: firefox
+
+ driver-integration-tests-electron:
+ <<: *defaults
+ parallelism: 5
+ steps:
+ - run-driver-integration-tests:
+ browser: electron
+
+ driver-integration-tests-webkit:
+ <<: *defaults
+ resource_class: large
+ parallelism: 5
+ steps:
+ - run-driver-integration-tests:
+ browser: webkit
+
+ run-reporter-component-tests-chrome:
+ <<: *defaults
+ parameters:
+ <<: *defaultsParameters
+ percy:
+ type: boolean
+ default: false
+ parallelism: 2
+ steps:
+ - run-new-ui-tests:
+ browser: chrome
+ percy: << parameters.percy >>
+ package: reporter
+ type: ct
+
+ reporter-integration-tests:
+ <<: *defaults
+ resource_class: medium+
+ parallelism: 3
+ steps:
+ - restore_cached_workspace
+ - run:
+ command: yarn build-for-tests
+ working_directory: packages/reporter
+ - run:
+ command: |
+ CYPRESS_CONFIG_ENV=production \
+ CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
+ PERCY_PARALLEL_NONCE=$CIRCLE_WORKFLOW_WORKSPACE_ID \
+ PERCY_ENABLE=${PERCY_TOKEN:-0} \
+ PERCY_PARALLEL_TOTAL=-1 \
+ yarn percy exec --parallel -- -- \
+ yarn cypress:run --record --parallel --group reporter --runner-ui
+ working_directory: packages/reporter
+ - verify-mocha-results
+ - store_test_results:
+ path: /tmp/cypress
+ - store_artifacts:
+ path: /tmp/artifacts
+ - store-npm-logs
+
+ run-webpack-dev-server-integration-tests:
+ <<: *defaults
+ resource_class: medium+
+ parallelism: 2
+ steps:
+ - restore_cached_workspace
+ - restore_cached_system_tests_deps
+ - run:
+ command: |
+ CYPRESS_CONFIG_ENV=production \
+ CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
+ PERCY_PARALLEL_NONCE=$CIRCLE_WORKFLOW_WORKSPACE_ID \
+ PERCY_ENABLE=${PERCY_TOKEN:-0} \
+ PERCY_PARALLEL_TOTAL=-1 \
+ yarn percy exec --parallel -- -- \
+ yarn cypress:run --record --parallel --group webpack-dev-server
+ working_directory: npm/webpack-dev-server
+ - store_test_results:
+ path: /tmp/cypress
+ - store_artifacts:
+ path: /tmp/artifacts
+ - store-npm-logs
+
+ run-vite-dev-server-integration-tests:
+ <<: *defaults
+ # parallelism: 3 TODO: Add parallelism once we have more specs
+ steps:
+ - restore_cached_workspace
+ - restore_cached_system_tests_deps
+ - run:
+ command: |
+ CYPRESS_CONFIG_ENV=production \
+ CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
+ PERCY_PARALLEL_NONCE=$CIRCLE_WORKFLOW_WORKSPACE_ID \
+ PERCY_ENABLE=${PERCY_TOKEN:-0} \
+ PERCY_PARALLEL_TOTAL=-1 \
+ yarn percy exec --parallel -- -- \
+ yarn cypress:run --record --parallel --group vite-dev-server
+ working_directory: npm/vite-dev-server
+ - store_test_results:
+ path: /tmp/cypress
+ - store_artifacts:
+ path: /tmp/artifacts
+ - store-npm-logs
+
+ npm-webpack-preprocessor:
+ <<: *defaults
+ steps:
+ - restore_cached_workspace
+ - run:
+ name: Build
+ command: yarn lerna run build --scope @cypress/webpack-preprocessor
+ - run:
+ name: Run tests
+ command: yarn workspace @cypress/webpack-preprocessor test
+ - store-npm-logs
+
+ npm-webpack-dev-server:
+ <<: *defaults
+ steps:
+ - restore_cached_workspace
+ - restore_cached_system_tests_deps
+ - run:
+ name: Run tests
+ command: yarn workspace @cypress/webpack-dev-server test
+ - run:
+ name: Run tests
+ command: yarn workspace @cypress/webpack-dev-server test
+
+ npm-vite-dev-server:
+ <<: *defaults
+ steps:
+ - restore_cached_workspace
+ - run:
+ name: Run tests
+ command: yarn test
+ working_directory: npm/vite-dev-server
+ - store_test_results:
+ path: npm/vite-dev-server/test_results
+ - store-npm-logs
+
+ npm-webpack-batteries-included-preprocessor:
+ <<: *defaults
+ resource_class: small
+ steps:
+ - restore_cached_workspace
+ - run:
+ name: Run tests
+ command: yarn workspace @cypress/webpack-batteries-included-preprocessor test
+
+ npm-vue:
+ <<: *defaults
+ steps:
+ - restore_cached_workspace
+ - run:
+ name: Build
+ command: yarn lerna run build --scope @cypress/vue
+ - store_test_results:
+ path: npm/vue/test_results
+ - store_artifacts:
+ path: npm/vue/test_results
+ - store-npm-logs
+
+ npm-angular:
+ <<: *defaults
+ steps:
+ - restore_cached_workspace
+ - run:
+ name: Build
+ command: yarn lerna run build --scope @cypress/angular
+ - store-npm-logs
+
+ npm-angular-signals:
+ <<: *defaults
+ steps:
+ - restore_cached_workspace
+ - run:
+ name: Build
+ command: yarn lerna run build --scope @cypress/angular-signals
+ - store-npm-logs
+
+ npm-puppeteer-unit-tests:
+ <<: *defaults
+ steps:
+ - restore_cached_workspace
+ - run:
+ name: Build
+ command: yarn lerna run build --scope @cypress/puppeteer
+ - run:
+ name: Run tests
+ command: yarn test
+ working_directory: npm/puppeteer
+ - store_test_results:
+ path: npm/puppeteer/test_results
+ - store_artifacts:
+ path: npm/puppeteer/test_results
+ - store-npm-logs
+
+ npm-puppeteer-cypress-tests:
+ <<: *defaults
+ resource_class: small
+ steps:
+ - restore_cached_workspace
+ - restore_cached_system_tests_deps
+ - run:
+ command: yarn cypress:run
+ working_directory: npm/puppeteer
+ - store_test_results:
+ path: /tmp/cypress
+ - store_artifacts:
+ path: /tmp/artifacts
+ - store-npm-logs
+
+ npm-react:
+ <<: *defaults
+ steps:
+ - restore_cached_workspace
+ - run:
+ name: Build
+ command: yarn lerna run build --scope @cypress/react
+ - run:
+ name: Run tests
+ command: yarn test
+ working_directory: npm/react
+ - store_test_results:
+ path: npm/react/test_results
+ - store_artifacts:
+ path: npm/react/test_results
+ - store-npm-logs
+
+ npm-vite-plugin-cypress-esm:
+ <<: *defaults
+ steps:
+ - restore_cached_workspace
+ - run:
+ name: Build
+ command: yarn lerna run build --scope @cypress/vite-plugin-cypress-esm
+ - run:
+ name: Run tests
+ command: yarn test
+ working_directory: npm/vite-plugin-cypress-esm
+ - store_test_results:
+ path: npm/vite-plugin-cypress-esm/test_results
+ - store_artifacts:
+ path: npm/vite-plugin-cypress-esm/test_results
+ - store-npm-logs
+
+ npm-mount-utils:
+ <<: *defaults
+ steps:
+ - restore_cached_workspace
+ - run:
+ name: Build
+ command: yarn lerna run build --scope @cypress/mount-utils
+ - store-npm-logs
+
+ npm-grep:
+ <<: *defaults
+ resource_class: small
+ steps:
+ - restore_cached_workspace
+ - run:
+ name: Run tests
+ command: yarn workspace @cypress/grep cy:run
+ - store_test_results:
+ path: npm/grep/test_results
+ - store_artifacts:
+ path: npm/grep/test_results
+ - store-npm-logs
+
+ npm-eslint-plugin-dev:
+ <<: *defaults
+ steps:
+ - restore_cached_workspace
+ - run:
+ name: Run tests
+ command: yarn workspace @cypress/eslint-plugin-dev test
+
+ npm-cypress-schematic:
+ <<: *defaults
+ steps:
+ - restore_cached_workspace
+ - run:
+ name: Build + Install
+ command: |
+ yarn lerna run build --scope @cypress/schematic
+ - run:
+ name: Run unit tests
+ command: |
+ yarn test
+ working_directory: npm/cypress-schematic
+ - store-npm-logs
+
+ npm-release:
+ <<: *defaults
+ resource_class: medium+
+ steps:
+ - restore_cached_workspace
+ - run:
+ name: Release packages after all jobs pass
+ command: yarn npm-release
+
+ create-build-artifacts:
+ <<: *defaults
+ parameters:
+ <<: *defaultsParameters
+ resource_class:
+ type: string
+ default: xlarge
+ resource_class: << parameters.resource_class >>
+ steps:
+ - restore_cached_workspace
+ - check-if-binary-exists
+ - build-and-package-binary
+ - build-cypress-npm-package:
+ executor: << parameters.executor >>
+ - setup_should_persist_artifacts
+ - verify_should_persist_artifacts
+ - upload-build-artifacts
+ - post-install-comment
+
+ create-and-trigger-packaging-artifacts:
+ <<: *defaults
+ parameters:
+ <<: *defaultsParameters
+ resource_class:
+ type: string
+ default: small
+ resource_class: << parameters.resource_class >>
+ steps:
+ - maybe_skip_binary_jobs
+ - restore_cached_workspace
+ - check-if-binary-exists
+ - setup_should_persist_artifacts
+ - trigger-publish-binary-pipeline
+
+ get-published-artifacts:
+ <<: *defaults
+ parameters:
+ <<: *defaultsParameters
+ resource_class:
+ type: string
+ default: medium
+ resource_class: << parameters.resource_class >>
+ steps:
+ - maybe_skip_binary_jobs
+ - restore_cached_workspace
+ - run:
+ name: Check pipeline info
+ command: cat ~/triggered_pipeline.json
+ - setup_should_persist_artifacts
+ - run:
+ name: Download binary artifacts
+ command: |
+ source ./scripts/ensure-node.sh
+ node ./scripts/binary/get-published-artifacts.js --pipelineInfo ~/triggered_pipeline.json --platformKey $(node ./scripts/get-platform-key.js)
+ - persist_to_workspace:
+ root: ~/
+ paths:
+ - cypress/cypress.zip
+ - cypress/cypress.tgz
+ - verify_should_persist_artifacts
+ - persist_to_workspace:
+ root: ~/
+ paths:
+ - cypress/binary-url.json
+ - cypress/npm-package-url.json
+ - post-install-comment:
+ package_url_path: ~/cypress/npm-package-url.json
+ binary_url_path: ~/cypress/binary-url.json
+
+ test-kitchensink:
+ <<: *defaults
+ parameters:
+ <<: *defaultsParameters
+ resource_class:
+ type: string
+ default: medium+
+ resource_class: << parameters.resource_class >>
+ steps:
+ - restore_cached_workspace
+ - clone-repo-and-checkout-branch:
+ repo: cypress-example-kitchensink
+ - install-required-node
+ - run:
+ name: Install prod dependencies
+ command: yarn --production --ignore-engines
+ working_directory: /tmp/cypress-example-kitchensink
+ - run:
+ name: Example server
+ command: yarn start
+ working_directory: /tmp/cypress-example-kitchensink
+ background: true
+ - run:
+ name: Run Kitchensink example project
+ command: |
+ yarn cypress:run --project /tmp/cypress-example-kitchensink
+ - store-npm-logs
+
+ test-kitchensink-against-staging:
+ <<: *defaults
+ steps:
+ - restore_cached_workspace
+ - clone-repo-and-checkout-branch:
+ repo: cypress-example-kitchensink
+ - install-required-node
+ - run:
+ name: Install prod dependencies
+ command: yarn --production
+ working_directory: /tmp/cypress-example-kitchensink
+ - run:
+ name: Example server
+ command: yarn start
+ working_directory: /tmp/cypress-example-kitchensink
+ background: true
+ - run:
+ name: Run Kitchensink example project
+ command: |
+ CYPRESS_PROJECT_ID=$TEST_KITCHENSINK_PROJECT_ID \
+ CYPRESS_RECORD_KEY=$TEST_KITCHENSINK_RECORD_KEY \
+ CYPRESS_INTERNAL_ENV=staging \
+ yarn cypress:run --project /tmp/cypress-example-kitchensink --record
+ - store-npm-logs
+
+ test-against-staging:
+ <<: *defaults
+ steps:
+ - restore_cached_workspace
+ - clone-repo-and-checkout-branch:
+ repo: cypress-test-tiny
+ - run:
+ name: Run test project
+ command: |
+ CYPRESS_PROJECT_ID=$TEST_TINY_PROJECT_ID \
+ CYPRESS_RECORD_KEY=$TEST_TINY_RECORD_KEY \
+ CYPRESS_INTERNAL_ENV=staging \
+ yarn cypress:run --project /tmp/cypress-test-tiny --record
+ - store-npm-logs
+
+ test-npm-module-and-verify-binary:
+ <<: *defaults
+ resource_class: small
+ steps:
+ - restore_cached_workspace
+ # make sure we have cypress.zip received
+ - run: ls -l
+ - run: ls -l cypress.zip cypress.tgz
+ - run: mkdir test-binary
+ - run:
+ name: Create new NPM package
+ working_directory: test-binary
+ command: npm init -y
+ - run:
+ # install NPM from built NPM package folder
+ name: Install Cypress
+ working_directory: test-binary
+ # force installing the freshly built binary
+ command: CYPRESS_INSTALL_BINARY=/root/cypress/cypress.zip npm i /root/cypress/cypress.tgz
+ - run:
+ name: Cypress version
+ working_directory: test-binary
+ command: $(yarn bin cypress) version
+ - run:
+ name: Verify Cypress binary
+ working_directory: test-binary
+ command: $(yarn bin cypress) verify
+ - run:
+ name: Cypress help
+ working_directory: test-binary
+ command: $(yarn bin cypress) help
+ - run:
+ name: Cypress info
+ working_directory: test-binary
+ command: $(yarn bin cypress) info
+ - store-npm-logs
+
+ test-npm-module-on-minimum-node-version:
+ <<: *defaults
+ resource_class: small
+ docker:
+ - image: cypress/base-internal:18.17.1
+ steps:
+ - maybe_skip_binary_jobs
+ - restore_workspace_binaries
+ - run: mkdir test-binary
+ - run:
+ name: Create new NPM package
+ working_directory: test-binary
+ command: npm init -y
+ - run:
+ name: Install Cypress
+ working_directory: test-binary
+ command: CYPRESS_INSTALL_BINARY=/root/cypress/cypress.zip npm install /root/cypress/cypress.tgz
+ - run:
+ name: Verify Cypress binary
+ working_directory: test-binary
+ command: npx cypress verify
+ - run:
+ name: Print Cypress version
+ working_directory: test-binary
+ command: npx cypress version
+ - run:
+ name: Cypress info
+ working_directory: test-binary
+ command: npx cypress info
+
+ test-types-cypress-and-jest:
+ parameters:
+ executor:
+ description: Executor name to use
+ type: executor
+ default: cy-doc
+ wd:
+ description: Working directory, should be OUTSIDE cypress monorepo folder
+ type: string
+ default: /root/test-cypress-and-jest
+ <<: *defaults
+ resource_class: small
+ steps:
+ - maybe_skip_binary_jobs
+ - restore_workspace_binaries
+ - run: mkdir <>
+ - run:
+ name: Create new NPM package ⚗️
+ working_directory: <>
+ command: npm init -y
+ - run:
+ name: Install dependencies 📦
+ working_directory: <>
+ environment:
+ CYPRESS_INSTALL_BINARY: /root/cypress/cypress.zip
+ # let's install Cypress, Jest and any other package that might conflict
+ # https://github.com/cypress-io/cypress/issues/6690
+
+ # Todo: Add `jest` back into the list once https://github.com/yargs/yargs-parser/issues/452
+ # is resolved.
+ command: |
+ npm install /root/cypress/cypress.tgz \
+ typescript @types/jest enzyme @types/enzyme
+ - run:
+ name: Test types clash ⚔️
+ working_directory: <>
+ command: |
+ echo "console.log('hello world')" > hello.ts
+ npx tsc hello.ts --noEmit
+
+ test-full-typescript-project:
+ parameters:
+ executor:
+ description: Executor name to use
+ type: executor
+ default: cy-doc
+ <<: *defaults
+ resource_class: small
+ steps:
+ - maybe_skip_binary_jobs
+ - restore_workspace_binaries
+ - clone-repo-and-checkout-branch:
+ repo: cypress-test-tiny
+ - run:
+ name: Checkout Typescript Example
+ working_directory: /tmp/cypress-test-tiny
+ command: |
+ git checkout full-typescript
+ - run:
+ name: Install dependencies 📦
+ working_directory: /tmp/cypress-test-tiny
+ environment:
+ CYPRESS_INSTALL_BINARY: /root/cypress/cypress.zip
+ command: |
+ npm install /root/cypress/cypress.tgz typescript
+ - run:
+ name: Run project tests 🗳
+ working_directory: /tmp/cypress-test-tiny
+ command: npm run cypress:run
+
+ # install NPM + binary zip and run against staging API
+ test-binary-against-staging:
+ <<: *defaults
+ steps:
+ - restore_workspace_binaries
+ - clone-repo-and-checkout-branch:
+ repo: cypress-test-tiny
+ - run:
+ name: Install Cypress
+ working_directory: /tmp/cypress-test-tiny
+ # force installing the freshly built binary
+ command: CYPRESS_INSTALL_BINARY=~/cypress/cypress.zip npm i --legacy-peer-deps ~/cypress/cypress.tgz
+ - run:
+ name: Run test project
+ working_directory: /tmp/cypress-test-tiny
+ command: |
+ CYPRESS_PROJECT_ID=$TEST_TINY_PROJECT_ID \
+ CYPRESS_RECORD_KEY=$TEST_TINY_RECORD_KEY \
+ CYPRESS_INTERNAL_ENV=staging \
+ $(yarn bin cypress) run --record
+ - store-npm-logs
+
+ test-binary-against-recipes-firefox:
+ <<: *defaults
+ steps:
+ - test-binary-against-repo:
+ repo: cypress-example-recipes
+ command: npm run test:ci:firefox
+ browser: firefox
+
+ test-binary-against-recipes-chrome:
+ <<: *defaults
+ steps:
+ - test-binary-against-repo:
+ repo: cypress-example-recipes
+ command: npm run test:ci:chrome
+ browser: chrome
+
+ test-binary-against-recipes:
+ <<: *defaults
+ parallelism: 4
+ steps:
+ - test-binary-against-repo:
+ repo: cypress-example-recipes
+ # Split the specs up across 4 different machines to run in parallel
+ command: npm run test:ci -- --chunk $CIRCLE_NODE_INDEX --total-chunks $CIRCLE_NODE_TOTAL
+ browser: electron
+
+ # This is a special job. It allows you to test the current
+ # built test runner against a pull request in the repo
+ # cypress-example-recipes.
+ # Imagine you are working on a feature and want to show / test a recipe
+ # You would need to run the built test runner before release
+ # against a PR that cannot be merged until the new version
+ # of the test runner is released.
+ # Use:
+ # specify pull request number
+ # and the recipe folder
+
+ # test-binary-against-recipe-pull-request:
+ # <<: *defaults
+ # steps:
+ # # test a specific pull request by number from cypress-example-recipes
+ # - test-binary-against-repo:
+ # repo: cypress-example-recipes
+ # command: npm run test:ci
+ # pull_request_id: 515
+ # folder: examples/fundamentals__typescript
+
+ test-binary-against-kitchensink:
+ <<: *defaults
+ steps:
+ - maybe_skip_binary_jobs
+ - test-binary-against-repo:
+ repo: cypress-example-kitchensink
+ browser: electron
+
+ test-binary-against-kitchensink-firefox:
+ <<: *defaults
+ steps:
+ - test-binary-against-repo:
+ repo: cypress-example-kitchensink
+ browser: firefox
+
+ test-binary-against-kitchensink-chrome:
+ <<: *defaults
+ steps:
+ - test-binary-against-repo:
+ repo: cypress-example-kitchensink
+ browser: chrome
+
+ test-binary-against-todomvc-firefox:
+ <<: *defaults
+ steps:
+ - test-binary-against-repo:
+ repo: cypress-example-todomvc
+ browser: firefox
+
+ test-binary-against-conduit-chrome:
+ <<: *defaults
+ steps:
+ - test-binary-against-repo:
+ repo: cypress-example-conduit-app
+ browser: chrome
+ command: "npm run cypress:run"
+ wait-on: http://localhost:3000
+
+ test-binary-against-api-testing-firefox:
+ <<: *defaults
+ steps:
+ - test-binary-against-repo:
+ repo: cypress-example-api-testing
+ browser: firefox
+ command: "npm run cy:run"
+
+ test-binary-against-piechopper-firefox:
+ <<: *defaults
+ steps:
+ - test-binary-against-repo:
+ repo: cypress-example-piechopper
+ browser: firefox
+ command: "npm run cypress:run"
+
+ test-binary-against-cypress-realworld-app:
+ <<: *defaults
+ resource_class: medium+
+ steps:
+ - test-binary-against-rwa:
+ repo: cypress-realworld-app
+ browser: chrome
+ wait-on: http://localhost:3000
+
+ test-binary-as-specific-user:
+ <<: *defaults
+ steps:
+ - maybe_skip_binary_jobs
+ - restore_workspace_binaries
+ - clone-repo-and-checkout-branch:
+ repo: cypress-test-tiny
+ # the user should be "node"
+ - run: whoami
+ - run: pwd
+ # prints the current user's effective user id
+ # for root it is 0
+ # for other users it is a positive integer
+ - run: node -e 'console.log(process.geteuid())'
+ # make sure the binary and NPM package files are present
+ - run: ls -l
+ - run: ls -l cypress.zip cypress.tgz
+ - run:
+ # install NPM from built NPM package folder
+ name: Install Cypress
+ working_directory: /tmp/cypress-test-tiny
+ # force installing the freshly built binary
+ command: CYPRESS_INSTALL_BINARY=~/cypress/cypress.zip npm i ~/cypress/cypress.tgz
+ - run:
+ name: Cypress help
+ working_directory: /tmp/cypress-test-tiny
+ command: $(yarn bin cypress) help
+ - run:
+ name: Cypress info
+ working_directory: /tmp/cypress-test-tiny
+ command: $(yarn bin cypress) info
+ - run:
+ name: Verify Cypress binary
+ working_directory: /tmp/cypress-test-tiny
+ command: DEBUG=cypress:cli $(yarn bin cypress) verify
+ - run:
+ name: Run Cypress binary
+ working_directory: /tmp/cypress-test-tiny
+ command: DEBUG=cypress:cli $(yarn bin cypress) run
+ - store-npm-logs
+
+linux-x64-workflow: &linux-x64-workflow
+ jobs:
+ - node_modules_install:
+ # NOTE: Centos reached EOL on July 1st, 2024. The centos7-builder.Dockerfile no longer works in the manner in which we are using to rebuild better-sqlite3, so for now to unblock
+ # develop we will not be rebuilding better-sqlite3. However, a solution to this is likely needed as it can be considered a breaking change due to centos 7 extended support.
+ build-better-sqlite3: false
+ - build:
+ context: test-runner:env-canary
+ requires:
+ - node_modules_install
+ - check-ts:
+ requires:
+ - build
+ - lint:
+ name: linux-lint
+ requires:
+ - build
+ - percy-finalize:
+ context: test-runner:percy
+ required_env_var: PERCY_TOKEN
+ requires:
+ - cli-visual-tests
+ - reporter-integration-tests
+ - run-app-component-tests-chrome
+ - run-app-integration-tests-chrome
+ - run-frontend-shared-component-tests-chrome
+ - run-launchpad-component-tests-chrome
+ - run-launchpad-integration-tests-chrome
+ - run-reporter-component-tests-chrome
+ - run-webpack-dev-server-integration-tests
+ - run-vite-dev-server-integration-tests
+ - lint-types:
+ requires:
+ - build
+ # unit, integration and e2e tests
+ - cli-visual-tests:
+ context: test-runner:percy
+ requires:
+ - build
+ - unit-tests:
+ requires:
+ - build
+ - verify-release-readiness:
+ context: test-runner:npm-release
+ requires:
+ - build
+ - server-unit-tests:
+ requires:
+ - build
+ - server-integration-tests:
+ requires:
+ - build
+ - server-performance-tests:
+ requires:
+ - build
+ - system-tests-node-modules-install:
+ context: test-runner:performance-tracking
+ requires:
+ - build
+ - system-tests-chrome:
+ context: test-runner:performance-tracking
+ requires:
+ - system-tests-node-modules-install
+ - system-tests-electron:
+ context: test-runner:performance-tracking
+ requires:
+ - system-tests-node-modules-install
+ - system-tests-firefox:
+ context: test-runner:performance-tracking
+ requires:
+ - system-tests-node-modules-install
+ - system-tests-webkit:
+ context: test-runner:performance-tracking
+ requires:
+ - system-tests-node-modules-install
+ - system-tests-non-root:
+ context: test-runner:performance-tracking
+ executor: non-root-docker-user
+ requires:
+ - system-tests-node-modules-install
+ - driver-integration-tests-chrome:
+ context: test-runner:cypress-record-key
+ requires:
+ - build
+ - driver-integration-tests-chrome-beta:
+ context: test-runner:cypress-record-key
+ requires:
+ - build
+ - driver-integration-tests-firefox:
+ context: test-runner:cypress-record-key
+ requires:
+ - build
+ - driver-integration-tests-electron:
+ context: test-runner:cypress-record-key
+ requires:
+ - build
+ - driver-integration-tests-webkit:
+ context: test-runner:cypress-record-key
+ requires:
+ - build
+ - driver-integration-memory-tests:
+ requires:
+ - build
+ - run-frontend-shared-component-tests-chrome:
+ context: [test-runner:cypress-record-key, test-runner:launchpad-tests, test-runner:percy]
+ percy: true
+ requires:
+ - build
+ - run-launchpad-integration-tests-chrome:
+ context: [test-runner:cypress-record-key, test-runner:launchpad-tests, test-runner:percy]
+ percy: true
+ requires:
+ - build
+ - run-launchpad-component-tests-chrome:
+ context: [test-runner:cypress-record-key, test-runner:launchpad-tests, test-runner:percy]
+ percy: true
+ requires:
+ - build
+ - run-app-integration-tests-chrome:
+ context: [test-runner:cypress-record-key, test-runner:launchpad-tests, test-runner:percy]
+ percy: true
+ requires:
+ - build
+ - run-webpack-dev-server-integration-tests:
+ context: [test-runner:cypress-record-key, test-runner:percy]
+ requires:
+ - system-tests-node-modules-install
+ - run-vite-dev-server-integration-tests:
+ context: [test-runner:cypress-record-key, test-runner:percy]
+ requires:
+ - system-tests-node-modules-install
+ - run-app-component-tests-chrome:
+ context: [test-runner:cypress-record-key, test-runner:launchpad-tests, test-runner:percy]
+ percy: true
+ requires:
+ - build
+ - run-reporter-component-tests-chrome:
+ context: [test-runner:cypress-record-key, test-runner:percy]
+ percy: true
+ requires:
+ - build
+ - reporter-integration-tests:
+ context: [test-runner:cypress-record-key, test-runner:percy]
+ requires:
+ - build
+ - npm-webpack-dev-server:
+ requires:
+ - system-tests-node-modules-install
+ - npm-vite-dev-server:
+ requires:
+ - build
+ - npm-vite-plugin-cypress-esm:
+ requires:
+ - build
+ - npm-webpack-preprocessor:
+ requires:
+ - build
+ - npm-webpack-batteries-included-preprocessor:
+ requires:
+ - build
+ - npm-vue:
+ requires:
+ - build
+ - npm-puppeteer-unit-tests:
+ requires:
+ - build
+ - npm-puppeteer-cypress-tests:
+ requires:
+ - build
+ - npm-react:
+ requires:
+ - build
+ - npm-angular:
+ requires:
+ - build
+ - npm-angular-signals:
+ requires:
+ - build
+ - npm-mount-utils:
+ requires:
+ - build
+ - npm-eslint-plugin-dev:
+ requires:
+ - build
+ - npm-cypress-schematic:
+ requires:
+ - build
+ - v8-integration-tests:
+ requires:
+ - system-tests-node-modules-install
+
+ - ready-to-release:
+ # <<: *mainBuildFilters
+ requires:
+ - check-ts
+ - npm-angular
+ - npm-angular-signals
+ - npm-eslint-plugin-dev
+ - npm-puppeteer-unit-tests
+ - npm-puppeteer-cypress-tests
+ - npm-react
+ - npm-mount-utils
+ - npm-vue
+ - npm-webpack-batteries-included-preprocessor
+ - npm-webpack-preprocessor
+ - npm-vite-dev-server
+ - npm-vite-plugin-cypress-esm
+ - npm-webpack-dev-server
+ - npm-cypress-schematic
+ - lint-types
+ - linux-lint
+ - percy-finalize
+ - driver-integration-tests-firefox
+ - driver-integration-tests-chrome
+ - driver-integration-tests-chrome-beta
+ - driver-integration-tests-electron
+ - driver-integration-tests-webkit
+ - driver-integration-memory-tests
+ - system-tests-non-root
+ - system-tests-firefox
+ - system-tests-electron
+ - system-tests-chrome
+ - system-tests-webkit
+ - server-performance-tests
+ - server-integration-tests
+ - server-unit-tests
+ - "test binary as a non-root user"
+ - "test binary as a root user"
+ - test-types-cypress-and-jest
+ - test-full-typescript-project
+ - test-binary-against-kitchensink
+ - test-npm-module-on-minimum-node-version
+ - binary-system-tests
+ - test-kitchensink
+ - unit-tests
+ - verify-release-readiness
+ - v8-integration-tests
+
+ - npm-release:
+ <<: *mainBuildFilters
+ context: test-runner:npm-release
+ requires:
+ - ready-to-release
+
+ - create-and-trigger-packaging-artifacts:
+ context:
+ - test-runner:upload
+ - test-runner:build-binary
+ - publish-binary
+ requires:
+ - node_modules_install
+ - wait-for-binary-publish:
+ type: approval
+ requires:
+ - create-and-trigger-packaging-artifacts
+ - get-published-artifacts:
+ context:
+ - publish-binary
+ - test-runner:commit-status-checks
+ requires:
+ - wait-for-binary-publish
+ # various testing scenarios, like building full binary
+ # and testing it on a real project
+ - test-against-staging:
+ context: test-runner:record-tests
+ <<: *mainBuildFilters
+ requires:
+ - build
+ - test-kitchensink:
+ requires:
+ - build
+ - test-kitchensink-against-staging:
+ executor: kitchensink-executor
+ context: test-runner:record-tests
+ <<: *mainBuildFilters
+ requires:
+ - build
+ - test-npm-module-on-minimum-node-version:
+ context: publish-binary
+ requires:
+ - get-published-artifacts
+ - test-types-cypress-and-jest:
+ context: publish-binary
+ requires:
+ - get-published-artifacts
+ - test-full-typescript-project:
+ context: publish-binary
+ requires:
+ - get-published-artifacts
+ - test-binary-against-kitchensink:
+ context: publish-binary
+ requires:
+ - get-published-artifacts
+ - test-npm-module-and-verify-binary:
+ <<: *mainBuildFilters
+ requires:
+ - get-published-artifacts
+ - test-binary-against-staging:
+ context: test-runner:record-tests
+ <<: *mainBuildFilters
+ requires:
+ - get-published-artifacts
+ - test-binary-against-kitchensink-chrome:
+ <<: *mainBuildFilters
+ requires:
+ - get-published-artifacts
+ - test-binary-against-recipes-firefox:
+ <<: *mainBuildFilters
+ requires:
+ - get-published-artifacts
+ - test-binary-against-recipes-chrome:
+ <<: *mainBuildFilters
+ requires:
+ - get-published-artifacts
+ - test-binary-against-recipes:
+ <<: *mainBuildFilters
+ requires:
+ - get-published-artifacts
+ - test-binary-against-kitchensink-firefox:
+ <<: *mainBuildFilters
+ requires:
+ - get-published-artifacts
+ - test-binary-against-todomvc-firefox:
+ <<: *mainBuildFilters
+ requires:
+ - get-published-artifacts
+ - test-binary-against-cypress-realworld-app:
+ context: test-runner:cypress-record-key
+ <<: *mainBuildFilters
+ requires:
+ - get-published-artifacts
+ - test-binary-as-specific-user:
+ name: "test binary as a non-root user"
+ executor: non-root-docker-user
+ context: publish-binary
+ requires:
+ - get-published-artifacts
+ - test-binary-as-specific-user:
+ name: "test binary as a root user"
+ context: publish-binary
+ requires:
+ - get-published-artifacts
+ - binary-system-tests:
+ context: publish-binary
+ requires:
+ - get-published-artifacts
+ - system-tests-node-modules-install
+
+linux-x64-contributor-workflow: &linux-x64-contributor-workflow
+ jobs:
+ - node_modules_install
+ - build:
+ requires:
+ - node_modules_install
+ # In subsequent jobs, we use some contexts that are restricted to members of the Cypress organization.
+ # This job will allow for a Cypress member to approve and run the rest of the restricted jobs in the pipeline after the contributor code has been reviewed.
+ - contributor-pr:
+ type: approval
+ requires:
+ - build
+
+ - check-ts:
+ requires:
+ - build
+ - lint:
+ name: linux-lint
+ requires:
+ - build
+ - percy-finalize:
+ context: test-runner:percy
+ required_env_var: PERCY_TOKEN # skips job if not defined (external PR)
+ requires:
+ - cli-visual-tests
+ - reporter-integration-tests
+ - run-app-component-tests-chrome
+ - run-app-integration-tests-chrome
+ - run-frontend-shared-component-tests-chrome
+ - run-launchpad-component-tests-chrome
+ - run-launchpad-integration-tests-chrome
+ - run-reporter-component-tests-chrome
+ - run-webpack-dev-server-integration-tests
+ - run-vite-dev-server-integration-tests
+ - lint-types:
+ requires:
+ - build
+ # unit, integration and e2e tests
+ - cli-visual-tests:
+ context: test-runner:percy
+ requires:
+ - contributor-pr
+ - unit-tests:
+ requires:
+ - build
+ - verify-release-readiness:
+ context: test-runner:npm-release
+ requires:
+ - contributor-pr
+ - server-unit-tests:
+ requires:
+ - build
+ - server-integration-tests:
+ requires:
+ - build
+ - server-performance-tests:
+ requires:
+ - build
+ - system-tests-node-modules-install:
+ context: test-runner:performance-tracking
+ requires:
+ - contributor-pr
+ - system-tests-chrome:
+ context: test-runner:performance-tracking
+ requires:
+ - system-tests-node-modules-install
+ - system-tests-electron:
+ context: test-runner:performance-tracking
+ requires:
+ - system-tests-node-modules-install
+ - system-tests-firefox:
+ context: test-runner:performance-tracking
+ requires:
+ - system-tests-node-modules-install
+ - system-tests-webkit:
+ context: test-runner:performance-tracking
+ requires:
+ - system-tests-node-modules-install
+ - system-tests-non-root:
+ context: test-runner:performance-tracking
+ executor: non-root-docker-user
+ requires:
+ - system-tests-node-modules-install
+ - driver-integration-tests-chrome:
+ context: test-runner:cypress-record-key
+ requires:
+ - contributor-pr
+ - driver-integration-tests-chrome-beta:
+ context: test-runner:cypress-record-key
+ requires:
+ - contributor-pr
+ - driver-integration-tests-firefox:
+ context: test-runner:cypress-record-key
+ requires:
+ - contributor-pr
+ - driver-integration-tests-electron:
+ context: test-runner:cypress-record-key
+ requires:
+ - contributor-pr
+ - driver-integration-tests-webkit:
+ context: test-runner:cypress-record-key
+ requires:
+ - contributor-pr
+ - driver-integration-memory-tests:
+ requires:
+ - build
+ - run-frontend-shared-component-tests-chrome:
+ context: [test-runner:cypress-record-key, test-runner:launchpad-tests, test-runner:percy]
+ percy: true
+ requires:
+ - contributor-pr
+ - run-launchpad-integration-tests-chrome:
+ context: [test-runner:cypress-record-key, test-runner:launchpad-tests, test-runner:percy]
+ percy: true
+ requires:
+ - contributor-pr
+ - run-launchpad-component-tests-chrome:
+ context: [test-runner:cypress-record-key, test-runner:launchpad-tests, test-runner:percy]
+ percy: true
+ requires:
+ - contributor-pr
+ - run-app-integration-tests-chrome:
+ context: [test-runner:cypress-record-key, test-runner:launchpad-tests, test-runner:percy]
+ percy: true
+ requires:
+ - contributor-pr
+ - run-webpack-dev-server-integration-tests:
+ context: [test-runner:cypress-record-key, test-runner:percy]
+ requires:
+ - system-tests-node-modules-install
+ - run-vite-dev-server-integration-tests:
+ context: [test-runner:cypress-record-key, test-runner:percy]
+ requires:
+ - system-tests-node-modules-install
+ - run-app-component-tests-chrome:
+ context: [test-runner:cypress-record-key, test-runner:launchpad-tests, test-runner:percy]
+ percy: true
+ requires:
+ - contributor-pr
+ - run-reporter-component-tests-chrome:
+ context: [test-runner:cypress-record-key, test-runner:percy]
+ percy: true
+ requires:
+ - contributor-pr
+ - reporter-integration-tests:
+ context: [test-runner:cypress-record-key, test-runner:percy]
+ requires:
+ - contributor-pr
+ - npm-webpack-dev-server:
+ requires:
+ - system-tests-node-modules-install
+ - npm-vite-dev-server:
+ requires:
+ - build
+ - npm-vite-plugin-cypress-esm:
+ requires:
+ - build
+ - npm-webpack-preprocessor:
+ requires:
+ - build
+ - npm-webpack-batteries-included-preprocessor:
+ requires:
+ - build
+ - npm-vue:
+ requires:
+ - build
+ - npm-puppeteer-unit-tests:
+ requires:
+ - build
+ - npm-puppeteer-cypress-tests:
+ requires:
+ - build
+ - npm-react:
+ requires:
+ - build
+ - npm-angular:
+ requires:
+ - build
+ - npm-angular-signals:
+ requires:
+ - build
+ - npm-mount-utils:
+ requires:
+ - build
+ - npm-eslint-plugin-dev:
+ requires:
+ - build
+ - npm-cypress-schematic:
+ requires:
+ - build
+ - v8-integration-tests:
+ requires:
+ - system-tests-node-modules-install
+
+ - ready-to-release:
+ requires:
+ - check-ts
+ - npm-angular
+ - npm-angular-signals
+ - npm-eslint-plugin-dev
+ - npm-puppeteer-unit-tests
+ - npm-puppeteer-cypress-tests
+ - npm-react
+ - npm-mount-utils
+ - npm-vue
+ - npm-webpack-batteries-included-preprocessor
+ - npm-webpack-preprocessor
+ - npm-vite-dev-server
+ - npm-vite-plugin-cypress-esm
+ - npm-webpack-dev-server
+ - npm-cypress-schematic
+ - lint-types
+ - linux-lint
+ - percy-finalize
+ - driver-integration-tests-firefox
+ - driver-integration-tests-chrome
+ - driver-integration-tests-chrome-beta
+ - driver-integration-tests-electron
+ - driver-integration-tests-webkit
+ - driver-integration-memory-tests
+ - system-tests-non-root
+ - system-tests-firefox
+ - system-tests-electron
+ - system-tests-chrome
+ - system-tests-webkit
+ - server-performance-tests
+ - server-integration-tests
+ - server-unit-tests
+ - "test binary as a non-root user"
+ - "test binary as a root user"
+ - test-types-cypress-and-jest
+ - test-full-typescript-project
+ - test-binary-against-kitchensink
+ - test-npm-module-on-minimum-node-version
+ - binary-system-tests
+ - test-kitchensink
+ - unit-tests
+ - verify-release-readiness
+ - v8-integration-tests
+
+ - npm-release:
+ context: test-runner:npm-release
+ requires:
+ - ready-to-release
+
+ - create-and-trigger-packaging-artifacts:
+ context: [test-runner:upload, test-runner:build-binary, publish-binary]
+ requires:
+ - contributor-pr
+ - get-published-artifacts:
+ context: [publish-binary, test-runner:commit-status-checks]
+ requires:
+ - create-and-trigger-packaging-artifacts
+ # various testing scenarios, like building full binary
+ # and testing it on a real project
+ - test-against-staging:
+ context: test-runner:record-tests
+ <<: *mainBuildFilters
+ requires:
+ - build
+ - test-kitchensink:
+ requires:
+ - build
+ - test-kitchensink-against-staging:
+ executor: kitchensink-executor
+ context: test-runner:record-tests
+ <<: *mainBuildFilters
+ requires:
+ - build
+ - test-npm-module-on-minimum-node-version:
+ context: publish-binary
+ requires:
+ - get-published-artifacts
+ - test-types-cypress-and-jest:
+ context: publish-binary
+ requires:
+ - get-published-artifacts
+ - test-full-typescript-project:
+ context: publish-binary
+ requires:
+ - get-published-artifacts
+ - test-binary-against-kitchensink:
+ context: publish-binary
+ requires:
+ - get-published-artifacts
+ - test-npm-module-and-verify-binary:
+ <<: *mainBuildFilters
+ requires:
+ - get-published-artifacts
+ - test-binary-against-staging:
+ context: test-runner:record-tests
+ <<: *mainBuildFilters
+ requires:
+ - get-published-artifacts
+ - test-binary-against-kitchensink-chrome:
+ <<: *mainBuildFilters
+ requires:
+ - get-published-artifacts
+ - test-binary-against-recipes-firefox:
+ <<: *mainBuildFilters
+ requires:
+ - get-published-artifacts
+ - test-binary-against-recipes-chrome:
+ <<: *mainBuildFilters
+ requires:
+ - get-published-artifacts
+ - test-binary-against-recipes:
+ <<: *mainBuildFilters
+ requires:
+ - get-published-artifacts
+ - test-binary-against-kitchensink-firefox:
+ <<: *mainBuildFilters
+ requires:
+ - get-published-artifacts
+ - test-binary-against-todomvc-firefox:
+ <<: *mainBuildFilters
+ requires:
+ - get-published-artifacts
+ - test-binary-against-cypress-realworld-app:
+ context: test-runner:cypress-record-key
+ <<: *mainBuildFilters
+ requires:
+ - get-published-artifacts
+ - test-binary-as-specific-user:
+ name: "test binary as a non-root user"
+ executor: non-root-docker-user
+ context: publish-binary
+ requires:
+ - get-published-artifacts
+ - test-binary-as-specific-user:
+ name: "test binary as a root user"
+ context: publish-binary
+ requires:
+ - get-published-artifacts
+ - binary-system-tests:
+ context: publish-binary
+ requires:
+ - get-published-artifacts
+ - system-tests-node-modules-install
+
+linux-arm64-workflow: &linux-arm64-workflow
+ jobs:
+ - node_modules_install:
+ name: linux-arm64-node-modules-install
+ executor: linux-arm64
+ resource_class: arm.medium
+ only-cache-for-root-user: true
+
+ - build:
+ name: linux-arm64-build
+ executor: linux-arm64
+ resource_class: arm.medium
+ requires:
+ - linux-arm64-node-modules-install
+
+ - create-and-trigger-packaging-artifacts:
+ name: linux-arm64-create-and-trigger-packaging-artifacts
+ context: [test-runner:upload, test-runner:commit-status-checks, test-runner:build-binary, publish-binary]
+ executor: linux-arm64
+ resource_class: arm.medium
+ requires:
+ - linux-arm64-node-modules-install
+
+ - wait-for-binary-publish:
+ name: linux-arm64-wait-for-binary-publish
+ type: approval
+ requires:
+ - linux-arm64-create-and-trigger-packaging-artifacts
+
+ - get-published-artifacts:
+ name: linux-arm64-get-published-artifacts
+ context: [publish-binary, test-runner:commit-status-checks]
+ executor: linux-arm64
+ resource_class: arm.medium
+ requires:
+ - linux-arm64-wait-for-binary-publish
+
+ - v8-integration-tests:
+ executor: linux-arm64
+ resource_class: arm.medium
+ requires:
+ - linux-arm64-build
+ - driver-integration-memory-tests:
+ executor: linux-arm64
+ resource_class: arm.medium
+ requires:
+ - linux-arm64-build
+ - server-unit-tests-cloud-environment:
+ executor: linux-arm64
+ resource_class: arm.medium
+ requires:
+ - linux-arm64-build
+
+darwin-x64-workflow: &darwin-x64-workflow
+ jobs:
+ - node_modules_install:
+ name: darwin-x64-node-modules-install
+ executor: darwin-amd64
+ resource_class: cypress-io/intel-macstadium
+ only-cache-for-root-user: true
+
+ - build:
+ name: darwin-x64-build
+ context: test-runner:env-canary
+ executor: darwin-amd64
+ resource_class: cypress-io/intel-macstadium
+ requires:
+ - darwin-x64-node-modules-install
+
+ - create-build-artifacts:
+ name: darwin-x64-create-build-artifacts
+ context:
+ - test-runner:sign-mac-binary
+ - test-runner:upload
+ - test-runner:commit-status-checks
+ - test-runner:build-binary
+ executor: darwin-amd64
+ resource_class: cypress-io/intel-macstadium
+ requires:
+ - darwin-x64-build
+
+ - v8-integration-tests:
+ name: darwin-x64-v8-integration-tests
+ executor: darwin-amd64
+ resource_class: cypress-io/intel-macstadium
+ requires:
+ - darwin-x64-build
+
+ - driver-integration-memory-tests:
+ name: darwin-x64-driver-integration-memory-tests
+ executor: darwin-amd64
+ resource_class: cypress-io/intel-macstadium
+ requires:
+ - darwin-x64-build
+
+ - server-unit-tests-cloud-environment:
+ name: darwin-x64-driver-server-unit-tests-cloud-environment
+ executor: darwin-amd64
+ resource_class: cypress-io/intel-macstadium
+ requires:
+ - darwin-x64-build
+
+darwin-arm64-workflow: &darwin-arm64-workflow
+ jobs:
+ - node_modules_install:
+ name: darwin-arm64-node-modules-install
+ executor: darwin-arm64
+ resource_class: cypress-io/m1-macstadium
+ only-cache-for-root-user: true
+
+ - build:
+ name: darwin-arm64-build
+ executor: darwin-arm64
+ resource_class: cypress-io/m1-macstadium
+ requires:
+ - darwin-arm64-node-modules-install
+
+ - create-build-artifacts:
+ name: darwin-arm64-create-build-artifacts
+ context:
+ - test-runner:sign-mac-binary
+ - test-runner:upload
+ - test-runner:commit-status-checks
+ - test-runner:build-binary
+ executor: darwin-arm64
+ resource_class: cypress-io/m1-macstadium
+ requires:
+ - darwin-arm64-build
+
+ - v8-integration-tests:
+ name: darwin-arm64-v8-integration-tests
+ executor: darwin-arm64
+ resource_class: cypress-io/m1-macstadium
+ requires:
+ - darwin-arm64-build
+ - driver-integration-memory-tests:
+ name: darwin-arm64-driver-integration-memory-tests
+ executor: darwin-arm64
+ resource_class: cypress-io/m1-macstadium
+ requires:
+ - darwin-arm64-build
+ - server-unit-tests-cloud-environment:
+ name: darwin-arm64-server-unit-tests-cloud-environment
+ executor: darwin-arm64
+ resource_class: cypress-io/m1-macstadium
+ requires:
+ - darwin-arm64-build
+
+windows-workflow: &windows-workflow
+ jobs:
+ - node_modules_install:
+ name: windows-node-modules-install
+ executor: windows
+ resource_class: windows.medium
+ only-cache-for-root-user: true
+
+ - build:
+ name: windows-build
+ context: test-runner:env-canary
+ executor: windows
+ resource_class: windows.large
+ requires:
+ - windows-node-modules-install
+
+ - run-app-integration-tests-chrome:
+ name: windows-run-app-integration-tests-chrome
+ executor: windows
+ resource_class: windows.large
+ context: [test-runner:cypress-record-key, test-runner:launchpad-tests]
+ requires:
+ - windows-build
+
+ - run-launchpad-integration-tests-chrome:
+ name: windows-run-launchpad-integration-tests-chrome
+ executor: windows
+ resource_class: windows.large
+ context: [test-runner:cypress-record-key, test-runner:launchpad-tests]
+ requires:
+ - windows-build
+
+ - unit-tests:
+ name: windows-unit-tests
+ executor: windows
+ resource_class: windows.medium
+ requires:
+ - windows-build
+
+ - server-unit-tests-cloud-environment:
+ name: windows-server-unit-tests-cloud-environment
+ executor: windows
+ resource_class: windows.medium
+ requires:
+ - windows-build
+
+ - create-build-artifacts:
+ name: windows-create-build-artifacts
+ executor: windows
+ resource_class: windows.large
+ context:
+ - test-runner:sign-windows-binary
+ - test-runner:upload
+ - test-runner:commit-status-checks
+ - test-runner:build-binary
+ requires:
+ - windows-build
+
+ - test-binary-against-kitchensink-chrome:
+ name: windows-test-binary-against-kitchensink-chrome
+ executor: windows
+ requires:
+ - windows-create-build-artifacts
+
+ - v8-integration-tests:
+ name: windows-v8-integration-tests
+ executor: windows
+ resource_class: windows.medium
+ requires:
+ - windows-build
+ - driver-integration-memory-tests:
+ name: windows-driver-integration-memory-tests
+ executor: windows
+ resource_class: windows.medium
+ requires:
+ - windows-build
+
+workflows:
+ linux-x64:
+ <<: *linux-x64-workflow
+ <<: *linux-x64-workflow-exclude-filters
+ linux-x64-contributor:
+ <<: *linux-x64-contributor-workflow
+ when:
+ matches:
+ pattern: /^pull\/[0-9]+/
+ value: << pipeline.git.branch >>
+ linux-arm64:
+ <<: *linux-arm64-workflow
+ <<: *linux-arm64-workflow-filters
+ darwin-x64:
+ <<: *darwin-x64-workflow
+ <<: *darwin-workflow-filters
+ darwin-arm64:
+ <<: *darwin-arm64-workflow
+ <<: *darwin-workflow-filters
+ windows:
+ <<: *windows-workflow
+ <<: *windows-workflow-filters
diff --git a/.eslintignore b/.eslintignore
deleted file mode 100644
index 6247d1b9cb8..00000000000
--- a/.eslintignore
+++ /dev/null
@@ -1,113 +0,0 @@
-# unignore hidden files
-!.*
-
-**/__snapshots__
-**/_test-output
-**/build
-**/cypress/fixtures
-**/dist
-**/dist-*
-**/node_modules
-**/support/fixtures/*
-!**/support/fixtures/projects
-**/support/fixtures/projects/**/_fixtures/*
-**/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/e2e.js
-system-tests/lib/scaffold/support/component.js
-system-tests/lib/scaffold/support/commands.js
-system-tests/test/support/projects/e2e/cypress/
-system-tests/projects/e2e/cypress/e2e/stdout_exit_early_failing.cy.js
-system-tests/projects/e2e/cypress/e2e/typescript_syntax_error.cy.ts
-system-tests/projects/config-with-ts-syntax-error/**
-system-tests/projects/config-with-ts-module-error/**
-system-tests/projects/no-specs-vue-2/**
-
-
-**/test/fixtures
-**/vendor
-
-# cli/types is linted by tslint/dtslint
-cli/types
-
-# cli/react, cli/vue, and cli/mount-utils are all copied from dist'd builds
-cli/react
-cli/vue
-cli/vue2
-cli/mount-utils
-
-# packages/example is not linted (think about changing this)
-packages/example
-
-packages/extension/test/helpers/background.js
-e2e/stdout_exit_early_failing_spec.js
-
-npm/webpack-preprocessor/cypress/tests/e2e/compile-error.js
-npm/webpack-preprocessor/examples/use-babelrc/cypress/e2e/spec.cy.js
-
-npm/cypress-schematic/src/**/*.js
-
-**/.projects
-**/*.d.ts
-**/package-lock.json
-**/tsconfig.json
-**/.vscode
-**/.history
-**/.cy
-**/.git
-
-/npm/react/bin/*
-/npm/react/**/coverage
-**/.next/**
-/npm/create-cypress-tests/initial-template
-/npm/create-cypress-tests/**/*.template.*
-
-# The global eslint configuration is not set up to parse vue@2 files
-/npm/vue2/**/*.vue
-
-packages/data-context/test/unit/codegen/files
-packages/config/test/__fixtures__/**/*
-packages/config/test/__babel_fixtures__/**/*
-
-# community templates we test against, no need to lint
-system-tests/projects/cra-4/**/*
-system-tests/projects/cra-5/**/*
-system-tests/projects/cra-ejected/**/*
-system-tests/projects/create-react-app-configured/**/*
-system-tests/projects/create-react-app-unconfigured/**/*
-system-tests/projects/create-react-app-custom-index-html
-
-system-tests/projects/vueclivue2-unconfigured/**/*
-system-tests/projects/vueclivue2-configured/**/*
-system-tests/projects/outdated-deps-vuecli3/**/*
-
-system-tests/projects/vueclivue3-unconfigured/**/*
-system-tests/projects/vueclivue3-configured/**/*
-system-tests/projects/vueclivue3-custom-index-html
-
-system-tests/projects/vuecli5vue3-unconfigured/**/*
-system-tests/projects/vuecli5vue3-configured/**/*
-
-system-tests/projects/vue3-vite-ts-unconfigured/**/*
-system-tests/projects/vue3-vite-ts-configured/**/*
-system-tests/projects/vue3-vite-ts-custom-index-html
-
-system-tests/projects/nextjs-unconfigured/**/*
-system-tests/projects/nextjs-configured/**/*
-
-system-tests/projects/nuxtjs-vue2-unconfigured/**/*
-system-tests/projects/nuxtjs-vue2-configured/**/*
-
-system-tests/projects/react-app-webpack-5-unconfigured/**/*
-
-system-tests/project-fixtures/**
-system-tests/projects/**/*/expected-cypress*/**/*
diff --git a/.eslintrc.js b/.eslintrc.js
index 7abb027d019..94dcd6358b3 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -25,6 +25,7 @@ const validators = specifiedRules
)
module.exports = {
+ root: true,
plugins: [
'@cypress/dev',
'graphql',
@@ -34,6 +35,14 @@ module.exports = {
'plugin:@cypress/dev/tests',
],
parser: '@typescript-eslint/parser',
+ ignorePatterns: [
+ // cli types are checked by dtslint
+ 'cli/types/**',
+ // these fixtures are supposed to fail linting
+ 'npm/eslint-plugin-dev/test/fixtures/**',
+ // Cloud generated
+ 'system-tests/lib/validations/**',
+ ],
overrides: [
{
files: [
@@ -41,23 +50,23 @@ module.exports = {
'**/scripts/**',
'**/test/**',
'**/system-tests/**',
+ 'tooling/**',
'packages/{app,driver,frontend-shared,launchpad}/cypress/**',
'*.test.ts',
- // ignore in packages that don't run in the Cypress process
- 'npm/create-cypress-tests/**',
],
rules: {
'no-restricted-properties': 'off',
'no-restricted-syntax': 'off',
},
},
+ {
+ files: ['*.json'],
+ extends: 'plugin:@cypress/dev/general',
+ },
],
rules: {
'no-duplicate-imports': 'off',
- 'import/no-duplicates': 'off',
- '@typescript-eslint/no-duplicate-imports': [
- 'error',
- ],
+ 'import/no-duplicates': 'error',
'prefer-spread': 'off',
'prefer-rest-params': 'off',
'no-useless-constructor': 'off',
diff --git a/.gitattributes b/.gitattributes
index ebbd9782ff0..4a597b0345e 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2,4 +2,7 @@
*.json text eol=lf
-packages/errors/__snapshot-html__/** linguist-generated=true
\ No newline at end of file
+**/.eslintrc text eol=lf
+
+packages/errors/__snapshot-html__/** linguist-generated=true
+system-tests/lib/validations/** linguist-generated=true
\ No newline at end of file
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644
index 00000000000..21255064a7d
--- /dev/null
+++ b/.github/CODEOWNERS
@@ -0,0 +1,5 @@
+# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
+#
+# Changes to the Module API, after:run, or after:spec results should be
+# reviewed by Brian and/or Jennifer
+/system-tests/__snapshots__/results_spec.ts.js @brian-mann @jennifer-shehane
diff --git a/.github/ISSUE_TEMPLATE/1-bug-report.yml b/.github/ISSUE_TEMPLATE/1-bug-report.yml
index d345678e364..2f269318a1d 100644
--- a/.github/ISSUE_TEMPLATE/1-bug-report.yml
+++ b/.github/ISSUE_TEMPLATE/1-bug-report.yml
@@ -4,7 +4,10 @@ body:
- type: markdown
attributes:
value: |
- Have a question? 👉 [Start a new discussion](https://github.com/cypress-io/cypress/discussions) or [ask in chat](https://on.cypress.io/discord).
+ ## If you are a customer of Cypress Cloud please utilize our [Support Portal](https://www.cypress.io/support/) for our fastest support!
+
+ ### Have a question? 👉 [Ask in chat](https://on.cypress.io/discord) or [start a new discussion](https://github.com/cypress-io/cypress/discussions).
+ Issues in the Cypress repo are reserved for bugs and feature requests only. Questions on how to use Cypress will be closed.
- type: textarea
id: current-behavior
attributes:
@@ -40,7 +43,7 @@ body:
attributes:
label: Node version
description: What version of node.js are you using to run Cypress?
- placeholder: ex. v16.16.0
+ placeholder: ex. v18.17.0
validations:
required: true
- type: input
diff --git a/.github/ISSUE_TEMPLATE/2-install-issue.yml b/.github/ISSUE_TEMPLATE/2-install-issue.yml
deleted file mode 100644
index 99eb13e5b07..00000000000
--- a/.github/ISSUE_TEMPLATE/2-install-issue.yml
+++ /dev/null
@@ -1,84 +0,0 @@
-name: "⬇️ Issue during install"
-description: Report an issue while downloading Cypress.
-labels: ['topic: installation']
-body:
- - type: markdown
- attributes:
- value: |
- Have a question? 👉 [Start a new discussion](https://github.com/cypress-io/cypress/discussions) or [ask in chat](https://on.cypress.io/discord).
-
- If you're behind a corporate proxy, make sure to [configure it properly](https://on.cypress.io/proxy-configuration) before install.
- - type: textarea
- id: current-behavior
- attributes:
- label: Current behavior
- description: Please provide a description including screenshots, stack traces, DEBUG logs, etc. [Troubleshooting tips](https://on.cypress.io/troubleshooting)
- placeholder: When I try to download Cypress...
- validations:
- required: true
- - type: textarea
- id: debug-logs
- attributes:
- label: Debug logs
- description: Include DEBUG logs setting [`DEBUG=cypress:*`](https://on.cypress.io/troubleshooting#Print-DEBUG-logs/). Include npm/yarn logs if applicable.
- placeholder: Debug logs
- render: Text
- - type: input
- id: version
- attributes:
- label: Cypress Version
- description: What version of Cypress are you trying to install?
- placeholder: ex. 10.3.1
- validations:
- required: true
- - type: input
- id: node-version
- attributes:
- label: Node version
- description: What version of node.js are you using to run Cypress?
- placeholder: ex. v16.16.0
- validations:
- required: true
- - type: dropdown
- id: package-manager
- attributes:
- label: Package Manager
- options:
- - npm
- - yarn
- - Direct download
- - pnpm
- - other
- validations:
- required: true
- - type: input
- id: package-manager-version
- attributes:
- label: Package Manager Version
- description: What is the version of your chosen package manager?
- validations:
- required: true
- - type: dropdown
- id: operating-system
- attributes:
- label: Operating system
- options:
- - Linux
- - Mac
- - Windows
- - other
- validations:
- required: true
- - type: input
- id: os-version
- attributes:
- label: Operating System Version
- description: What is the version of the operating system you are running Cypress on?
- placeholder: ex 12.4
- validations:
- required: true
- - type: textarea
- id: other
- attributes:
- label: Other
- placeholder: Any other details?
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/2-memory-issue.yml b/.github/ISSUE_TEMPLATE/2-memory-issue.yml
new file mode 100644
index 00000000000..28e5bbabb1a
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/2-memory-issue.yml
@@ -0,0 +1,81 @@
+name: "💾 Memory issue report"
+description: Report a memory issue found while using Cypress.
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Have a question? 👉 [Ask in chat](https://on.cypress.io/discord) or [start a new discussion](https://github.com/cypress-io/cypress/discussions).
+
+ Prior to logging a memory issue, please make sure you are running the latest version of Cypress and have enabled [`experimentalMemoryManagement`](https://on.cypress.io/experiments) for Chromium-based browsers (introduced in Cypress 12.4.0).
+
+ If you are running in `cypress open` mode, you can also try lowering [`numTestsKeptInMemory`](https://docs.cypress.io/guides/references/configuration#Options) in your config file.
+
+ If you are still experiencing the issue, please fill out the following information.
+ - type: textarea
+ id: reproduction
+ attributes:
+ label: Test code to reproduce
+ description: Please provide a failing test or repo we can run. You can fork [this repo](https://github.com/cypress-io/cypress-test-tiny), set up a failing test, then link to your fork. If you have never done this before, watch [this video](https://youtu.be/NnriKHmj5T8) for example.
+ placeholder: Here is my failing test code and the app code to run the tests on...
+ validations:
+ required: true
+ - type: dropdown
+ id: mode
+ attributes:
+ label: Cypress Mode
+ description: What mode of Cypress are you running?
+ options:
+ - cypress run
+ - cypress open
+ - both modes
+ validations:
+ required: true
+ - type: input
+ id: version
+ attributes:
+ label: Cypress Version
+ description: What version of Cypress are you running? Run `cypress version` to see your current version. If possible, please update Cypress to the latest version first.
+ placeholder: ex. 10.3.1
+ validations:
+ required: true
+ - type: input
+ id: browser
+ attributes:
+ label: Browser Version
+ description: What browser(s) is Cypress running against when you are encountering your problem? The more specific the better. ie Chrome 109.0.5414.87 or Firefox 107.0
+ placeholder: ex. Chrome 109.0.5414.87
+ validations:
+ required: true
+ - type: input
+ id: node-version
+ attributes:
+ label: Node version
+ description: What version of node.js are you using to run Cypress?
+ placeholder: ex. v18.17.0
+ validations:
+ required: true
+ - type: input
+ id: os
+ attributes:
+ label: Operating System
+ description: What operating system is Cypress running on when you are encountering your problem? The more specific the better. ie macOS 12.4 or Windows 10.0.19044.1889
+ placeholder: ex. macOS 12.4
+ validations:
+ required: true
+ - type: textarea
+ id: debug-logs
+ attributes:
+ label: Memory Debug Logs
+ description: |
+ If running a Chromium-based browser, please set the `CYPRESS_INTERNAL_MEMORY_SAVE_STATS` environment variable to `1` or `true` and include the `cypress\logs\memory\.json` file here.
+
+ Alternatively, you can run Cypress in [debug mode](https://docs.cypress.io/guides/references/troubleshooting#Print-DEBUG-logs) setting `DEBUG=cypress*memory` and include the entire set of logs here.
+ placeholder: Debug logging output
+ render: shell
+ validations:
+ required: false
+ - type: textarea
+ id: other
+ attributes:
+ label: Other
+ placeholder: Any other details?
diff --git a/.github/ISSUE_TEMPLATE/3-feature.yml b/.github/ISSUE_TEMPLATE/3-feature.yml
deleted file mode 100644
index 48d7a366701..00000000000
--- a/.github/ISSUE_TEMPLATE/3-feature.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-name: "✨ Feature"
-description: Suggest a feature or enhancement to improve Cypress.
-body:
- - type: markdown
- attributes:
- value: |
- Have a question? 👉 [Start a new discussion](https://github.com/cypress-io/cypress/discussions) or [ask in chat](https://on.cypress.io/discord).
- - type: textarea
- id: feature
- attributes:
- label: What would you like?
- description: A clear description of the feature or enhancement wanted in Cypress.
- placeholder: I'd like to be able to...
- validations:
- required: true
- - type: textarea
- id: reason
- attributes:
- label: Why is this needed?
- description: Remember, we're not familiar with the app you're testing, so please provide a clear description of why this would be useful to your project.
- placeholder: I want this because...
- - type: textarea
- id: other
- attributes:
- label: Other
- placeholder: Any other details?
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/3-install-issue.yml b/.github/ISSUE_TEMPLATE/3-install-issue.yml
new file mode 100644
index 00000000000..6e513901e5f
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/3-install-issue.yml
@@ -0,0 +1,86 @@
+name: "⬇️ Issue during install"
+description: Report an issue while downloading Cypress.
+labels: ['topic: installation']
+body:
+ - type: markdown
+ attributes:
+ value: |
+ ## If you are a customer of Cypress Cloud please utilize our [Support Portal](https://www.cypress.io/support/) for our fastest support!
+
+ ### Have a question? 👉 [Ask in chat](https://on.cypress.io/discord) or [start a new discussion](https://github.com/cypress-io/cypress/discussions).
+
+ If you're behind a corporate proxy, make sure to [configure it properly](https://on.cypress.io/proxy-configuration) before install.
+ - type: textarea
+ id: current-behavior
+ attributes:
+ label: Current behavior
+ description: Please provide a description including screenshots, stack traces, DEBUG logs, etc. [Troubleshooting tips](https://on.cypress.io/troubleshooting)
+ placeholder: When I try to download Cypress...
+ validations:
+ required: true
+ - type: textarea
+ id: debug-logs
+ attributes:
+ label: Debug logs
+ description: Include DEBUG logs setting [`DEBUG=cypress:*`](https://on.cypress.io/troubleshooting#Print-DEBUG-logs/). Include npm/yarn logs if applicable.
+ placeholder: Debug logs
+ render: Text
+ - type: input
+ id: version
+ attributes:
+ label: Cypress Version
+ description: What version of Cypress are you trying to install?
+ placeholder: ex. 10.3.1
+ validations:
+ required: true
+ - type: input
+ id: node-version
+ attributes:
+ label: Node version
+ description: What version of node.js are you using to run Cypress?
+ placeholder: ex. v18.17.0
+ validations:
+ required: true
+ - type: dropdown
+ id: package-manager
+ attributes:
+ label: Package Manager
+ options:
+ - npm
+ - yarn
+ - Direct download
+ - pnpm
+ - other
+ validations:
+ required: true
+ - type: input
+ id: package-manager-version
+ attributes:
+ label: Package Manager Version
+ description: What is the version of your chosen package manager?
+ validations:
+ required: true
+ - type: dropdown
+ id: operating-system
+ attributes:
+ label: Operating system
+ options:
+ - Linux
+ - Mac
+ - Windows
+ - other
+ validations:
+ required: true
+ - type: input
+ id: os-version
+ attributes:
+ label: Operating System Version
+ description: What is the version of the operating system you are running Cypress on?
+ placeholder: ex 12.4
+ validations:
+ required: true
+ - type: textarea
+ id: other
+ attributes:
+ label: Other
+ placeholder: Any other details?
diff --git a/.github/ISSUE_TEMPLATE/4-feature.yml b/.github/ISSUE_TEMPLATE/4-feature.yml
new file mode 100644
index 00000000000..f69e48523d8
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/4-feature.yml
@@ -0,0 +1,28 @@
+name: "✨ Feature"
+description: Suggest a feature or enhancement to improve Cypress.
+body:
+ - type: markdown
+ attributes:
+ value: |
+ ## If you are a customer of Cypress Cloud please utilize our [Support Portal](https://www.cypress.io/support/) for our fastest support!
+
+ ### Have a question? 👉 [Ask in chat](https://on.cypress.io/discord) or [start a new discussion](https://github.com/cypress-io/cypress/discussions).
+ - type: textarea
+ id: feature
+ attributes:
+ label: What would you like?
+ description: A clear description of the feature or enhancement wanted in Cypress.
+ placeholder: I'd like to be able to...
+ validations:
+ required: true
+ - type: textarea
+ id: reason
+ attributes:
+ label: Why is this needed?
+ description: Remember, we're not familiar with the app you're testing, so please provide a clear description of why this would be useful to your project.
+ placeholder: I want this because...
+ - type: textarea
+ id: other
+ attributes:
+ label: Other
+ placeholder: Any other details?
diff --git a/.github/ISSUE_TEMPLATE/4-flaky-test.yml b/.github/ISSUE_TEMPLATE/4-flaky-test.yml
deleted file mode 100644
index abcc4baa955..00000000000
--- a/.github/ISSUE_TEMPLATE/4-flaky-test.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-name: "❄️ Flaky test in `cypress-io/cypress` repository"
-title: "Flaky test: "
-labels: ["topic: flake ❄️", "stage: fire watch"]
-description: Report a flaky test in the Cypress open-source repository.
-body:
- - type: markdown
- attributes:
- value: |
- Have a question? 👉 [Start a new discussion](https://github.com/cypress-io/cypress/discussions) or [ask in chat](https://on.cypress.io/discord).
- - type: textarea
- id: dashboard
- attributes:
- label: Link to dashboard or CircleCI failure
- description: Please include a link to the failure in the Cypress Dashboard or in CircleCI.
- validations:
- required: true
- - type: textarea
- id: github-link
- attributes:
- label: Link to failing test in GitHub
- description: Provide the GitHub link to the failing test with the line number.
- validations:
- required: true
- - type: textarea
- id: analysis
- attributes:
- label: Analysis
- description: If you can, provide a quick analysis of why this test is flaky.
- placeholder: ex. The test appears to be flaky because...
- validations:
- required: true
- - type: input
- id: version
- attributes:
- label: Cypress Version
- description: Provide the version of Cypress where the flake is occurring.
- placeholder: ex. 10.4.0
- validations:
- required: true
- - type: textarea
- id: other
- attributes:
- label: Other
- placeholder: Any other details?
diff --git a/.github/ISSUE_TEMPLATE/5-flaky-test.yml b/.github/ISSUE_TEMPLATE/5-flaky-test.yml
new file mode 100644
index 00000000000..da406ba8106
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/5-flaky-test.yml
@@ -0,0 +1,44 @@
+name: "❄️ Flaky test in `cypress-io/cypress` repository"
+title: "Flaky test: "
+labels: ["topic: flake ❄️", "stage: fire watch"]
+description: Report a flaky test in the Cypress open-source repository.
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Have a question? 👉 [Ask in chat](https://on.cypress.io/discord) or [start a new discussion](https://github.com/cypress-io/cypress/discussions).
+ - type: textarea
+ id: dashboard
+ attributes:
+ label: Link to Cypress Cloud or CircleCI failure
+ description: Please include a link to the failure in Cypress Cloud or in CircleCI.
+ validations:
+ required: true
+ - type: textarea
+ id: github-link
+ attributes:
+ label: Link to failing test in GitHub
+ description: Provide the GitHub link to the failing test with the line number.
+ validations:
+ required: true
+ - type: textarea
+ id: analysis
+ attributes:
+ label: Analysis
+ description: If you can, provide a quick analysis of why this test is flaky.
+ placeholder: ex. The test appears to be flaky because...
+ validations:
+ required: true
+ - type: input
+ id: version
+ attributes:
+ label: Cypress Version
+ description: Provide the version of Cypress where the flake is occurring.
+ placeholder: ex. 10.4.0
+ validations:
+ required: true
+ - type: textarea
+ id: other
+ attributes:
+ label: Other
+ placeholder: Any other details?
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 242ecd78299..ff1b1ac51f3 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -7,12 +7,6 @@
- Closes
-### User facing changelog
-
-
### Additional details
- [ ] Have tests been added/updated?
-- [ ] Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
- [ ] Has a PR for user-facing changes been opened in [`cypress-documentation`](https://github.com/cypress-io/cypress-documentation)?
- [ ] Have API changes been updated in the [`type definitions`](https://github.com/cypress-io/cypress/blob/develop/cli/types/cypress.d.ts)?
diff --git a/.github/workflows/merge-master-into-develop.yml b/.github/workflows/merge-master-into-develop.yml
deleted file mode 100644
index 2b15adabc19..00000000000
--- a/.github/workflows/merge-master-into-develop.yml
+++ /dev/null
@@ -1,79 +0,0 @@
-name: Merge master into develop
-on:
- push:
- branches:
- - master
-jobs:
- merge-master-into-develop:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- with:
- fetch-depth: 0
- # the default `GITHUB_TOKEN` cannot push to protected branches, so use `cypress-app-bot`'s token instead
- token: ${{ secrets.BOT_GITHUB_TOKEN }}
- - name: Set committer info
- run: |
- git config --local user.email "$(git log --format='%ae' HEAD^!)"
- git config --local user.name "$(git log --format='%an' HEAD^!)"
- - name: Checkout develop branch
- run: git checkout develop
- - name: Check for merge conflict
- id: check-conflict
- run: echo "::set-output name=merge_conflict::$(git merge-tree $(git merge-base HEAD master) master HEAD | egrep '<<<<<<<')"
- - name: Merge master into develop
- id: merge-master
- run: git merge master
- if: ${{ !steps.check-conflict.outputs.merge_conflict }}
- - name: Failed merge, set merged status as failed
- run: echo "::set-output name=merge_conflict::'failed merge'"
- if: ${{ steps.merge-master.outcome != 'success' }}
- - name: Push
- run: git push
- if: ${{ !steps.check-conflict.outputs.merge_conflict }}
- - name: Checkout master
- run: git checkout master
- if: ${{ steps.check-conflict.outputs.merge_conflict }}
- - name: Determine name of new branch
- id: gen-names
- run: |
- echo "::set-output name=sha::$(git rev-parse --short HEAD)"
- echo "::set-output name=branch_name::$(git rev-parse --short HEAD)-master-into-develop"
- if: ${{ steps.check-conflict.outputs.merge_conflict }}
- - name: Create a copy of master on a new branch
- run: git checkout -b ${{ steps.gen-names.outputs.branch_name }} master
- if: ${{ steps.check-conflict.outputs.merge_conflict }}
- - name: Push branch to remote
- run: git push origin ${{ steps.gen-names.outputs.branch_name }}
- if: ${{ steps.check-conflict.outputs.merge_conflict }}
- - name: Create Pull Request
- uses: actions/github-script@v3
- with:
- script: |
- const pull = await github.pulls.create({
- owner: context.repo.owner,
- repo: context.repo.repo,
- base: 'develop',
- head: '${{ steps.gen-names.outputs.branch_name }}',
- title: 'chore: merge master (${{ steps.gen-names.outputs.sha }}) into develop',
- body: `There was a merge conflict when trying to automatically merge master into develop. Please resolve the conflict and complete the merge.
-
- DO NOT SQUASH AND MERGE
-
- @${context.actor}`,
- maintainer_can_modify: true,
- })
- await github.pulls.requestReviewers({
- owner: context.repo.owner,
- repo: context.repo.repo,
- pull_number: pull.data.number,
- reviewers: [context.actor],
- })
- await github.issues.addLabels({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: pull.data.number,
- labels: ['auto-merge'],
- })
- if: ${{ steps.check-conflict.outputs.merge_conflict }}
diff --git a/.github/workflows/semantic-pull-request.yml b/.github/workflows/semantic-pull-request.yml
index 469b50ef547..e54d669634c 100644
--- a/.github/workflows/semantic-pull-request.yml
+++ b/.github/workflows/semantic-pull-request.yml
@@ -1,5 +1,21 @@
name: "Semantic Pull Request"
-
+# @see https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
+permissions:
+ actions: none
+ checks: none
+ # to check out & read the repository
+ contents: read
+ deployments: none
+ id-token: none
+ issues: none
+ discussions: none
+ packages: none
+ pages: none
+ # to read pull-request data, including commits/issues linked
+ pull-requests: read
+ repository-projects: none
+ security-events: none
+ statuses: none
on:
pull_request_target:
types:
@@ -9,13 +25,21 @@ on:
jobs:
main:
- name: Lint Title
+ name: Semantic Pull Request
runs-on: ubuntu-latest
steps:
- # use a fork of the GitHub action - we cannot pull in untrusted third party actions
- # see https://github.com/cypress-io/cypress/pull/20091#discussion_r801799647
- - uses: cypress-io/action-semantic-pull-request@v4
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ ref: ${{ github.event.pull_request.head.ref }}
+ repository: ${{ github.event.pull_request.head.repo.full_name }}
+ - run: npm install
+ working-directory: scripts/github-actions/semantic-pull-request/
+ - name: Lint PR Title and Cypress Changelog Entry
+ if: github.event_name == 'pull_request_target'
+ uses: actions/github-script@v7
with:
- validateSingleCommit: true
\ No newline at end of file
+ script: |
+ const verifyPullRequest = require('./scripts/github-actions/semantic-pull-request')
+
+ await verifyPullRequest({ context, core, github })
diff --git a/.github/workflows/snyk_sca_scan.yaml b/.github/workflows/snyk_sca_scan.yaml
index d9b21b0ab8e..45f504bf3a4 100644
--- a/.github/workflows/snyk_sca_scan.yaml
+++ b/.github/workflows/snyk_sca_scan.yaml
@@ -1,33 +1,45 @@
name: Snyk Software Composition Analysis Scan
-# This git workflow leverages Snyk actions to perform a Software Composition
-# Analysis scan on our Opensource libraries upon Pull Requests to Master &
-# Develop branches. We use this as a control to prevent vulnerable packages
-# from being introduced into the codebase.
+# This git workflow leverages Snyk actions to perform a Software Composition
+# Analysis scan on our Opensource libraries upon Pull Requests to the
+# "develop" branch. We use this as a control to prevent vulnerable packages
+# from being introduced into the codebase.
+# Enhancements were made to this action to build the yarn packages to reduce
+# Snyk scan errors that were complaining about the yarn.locks etc. Also
+# implemented PAT token for actions to resolve an issue with the action not
+# running and reporting back to the PR status checks
on:
- pull_request_target:
- types:
- - opened
- branches:
- - master
+ pull_request:
+ branches:
- develop
jobs:
Snyk_SCA_Scan:
+ # Skip this job on PRs from forks
+ if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
strategy:
matrix:
- node-version: [16.x]
+ node-version: [18.x]
steps:
- - uses: actions/checkout@v2
- - name: Setting up Node
- uses: actions/setup-node@v1
+ - name: Checkout
+ uses: actions/checkout@v4
with:
- node-version: ${{ matrix.node-version }}
+ fetch-depth: 0
+ token: ${{ secrets.BOT_GITHUB_ACTION_TOKEN }}
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 18
+ cache: 'yarn'
+ - name: Run yarn
+ run: yarn
+ - name: Run build
+ run: yarn build
- name: Installing snyk-delta and dependencies
run: npm i -g snyk-delta
- uses: snyk/actions/setup@master
- name: Perform SCA Scan
continue-on-error: false
run: |
- snyk test --yarn-workspaces --strict-out-of-sync=false --detection-depth=6 --exclude=docker,Dockerfile --severity-threshold=critical
+ snyk test --all-projects --strict-out-of-sync=false --detection-depth=6 --exclude=system-tests,tooling,docker,Dockerfile --severity-threshold=critical
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
diff --git a/.github/workflows/snyk_static_analysis_scan.yaml b/.github/workflows/snyk_static_analysis_scan.yaml
index f34b3de41e1..58596a407c8 100644
--- a/.github/workflows/snyk_static_analysis_scan.yaml
+++ b/.github/workflows/snyk_static_analysis_scan.yaml
@@ -1,20 +1,32 @@
name: Snyk Static Analysis Scan
-# This git workflow leverages Snyk actions to perform a Static Application
-# Testing scan (SAST) on our first-party code upon Pull Requests to Master &
-# Develop branches. We use this as a control to prevent vulnerabilities
-# from being introduced into the codebase.
+# This git workflow leverages Snyk actions to perform a Static Application
+# Testing scan (SAST) on our first-party code upon Pull Requests to the
+# "develop" branch. We use this as a control to prevent vulnerabilities
+# from being introduced into the codebase.
on:
- pull_request_target:
- types:
- - opened
- branches:
- - master
+ pull_request:
+ branches:
- develop
jobs:
- Snyk_SAST_Scan :
+ Snyk_SAST_Scan:
+ # Skip this job on PRs from forks
+ if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ token: ${{ secrets.BOT_GITHUB_ACTION_TOKEN }}
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 18
+ cache: 'yarn'
+ - name: Run yarn
+ run: yarn
+ - name: Run build
+ run: yarn build
- uses: snyk/actions/setup@master
- name: Perform Static Analysis Test
continue-on-error: true
diff --git a/.github/workflows/stale_issues_and_pr_cleanup.yml b/.github/workflows/stale_issues_and_pr_cleanup.yml
new file mode 100644
index 00000000000..ece421f0aad
--- /dev/null
+++ b/.github/workflows/stale_issues_and_pr_cleanup.yml
@@ -0,0 +1,60 @@
+name: 'Close stale issues and PRs'
+on:
+ workflow_dispatch:
+ inputs:
+ debug-only:
+ description: 'debug-only'
+ required: false
+ default: false
+ max-operations-per-run:
+ description: 'max operations per run'
+ required: false
+ default: 3000
+ days-before-stale:
+ description: 'days-before-stale'
+ required: false
+ default: 180
+ days-before-close:
+ description: 'days-before-close'
+ required: false
+ default: 14
+ exempt-issue-labels:
+ description: 'exempt-issue-labels'
+ required: false
+ default: 'type: feature,type: enhancement,routed-to-e2e,routed-to-ct,routed-to-tools,routed-to-cloud,prevent-stale,triaged'
+ exempt-pr-labels:
+ description: 'exempt-pr-labels'
+ required: false
+ default: 'type: feature,type: enhancement,prevent-stale,triaged'
+ schedule:
+ - cron: '30 1 * * *'
+permissions:
+ issues: write
+ pull-requests: write
+env:
+ DEFAULT_DEBUG_ONLY: false
+ DEFAULT_MAX_OPS: 3000
+ DEFAULT_DAYS_BEFORE_STALE: 180
+ DEFAULT_DAYS_BEFORE_CLOSE: 14
+ DEFAULT_EXEMPT_ISSUE_LABELS: 'type: feature,type: enhancement,routed-to-e2e,routed-to-ct,routed-to-tools,routed-to-cloud,prevent-stale,triaged'
+ DEFAULT_EXEMPT_PR_LABELS: 'type: feature,type: enhancement,prevent-stale,triaged'
+jobs:
+ stale:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/stale@v8
+ with:
+ days-before-stale: ${{ github.event.inputs.days-before-stale || env.DEFAULT_DAYS_BEFORE_STALE }}
+ days-before-close: ${{ github.event.inputs.days-before-close || env.DEFAULT_DAYS_BEFORE_CLOSE }}
+ stale-issue-message: 'This issue has not had any activity in ${{ github.event.inputs.days-before-stale || env.DEFAULT_DAYS_BEFORE_STALE }} days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in ${{ github.event.inputs.days-before-close || env.DEFAULT_DAYS_BEFORE_CLOSE }} days if no updates are provided.'
+ stale-pr-message: 'This PR has not had any activity in ${{ github.event.inputs.days-before-stale || env.DEFAULT_DAYS_BEFORE_STALE }} days. If no activity is detected in the next ${{ github.event.inputs.days-before-close || env.DEFAULT_DAYS_BEFORE_CLOSE }} days, this PR will be closed.'
+ stale-issue-label: 'stale'
+ stale-pr-label: 'stale'
+ close-issue-message: 'This issue has been closed due to inactivity.'
+ close-pr-message: 'This PR has been closed due to inactivity'
+ exempt-issue-labels: ${{ github.event.inputs.exempt-issue-labels || env.DEFAULT_EXEMPT_ISSUE_LABELS }}
+ exempt-pr-labels: ${{ github.event.inputs.exempt-pr-labels || env.DEFAULT_EXEMPT_PR_LABELS }}
+ exempt-all-milestones: true
+ operations-per-run: ${{ github.event.inputs.max-operations-per-run || env.DEFAULT_MAX_OPS }} #keeping this a bit higher because it processes newest tickets to oldest
+ debug-only: ${{ github.event.inputs.debug-only || env.DEFAULT_DEBUG_ONLY }}
+ repo-token: ${{ secrets.TRIAGE_BOARD_TOKEN }}
diff --git a/.github/workflows/triage_add_to_project.yml b/.github/workflows/triage_add_to_project.yml
index 4dcf519a2a1..846c5c2df94 100644
--- a/.github/workflows/triage_add_to_project.yml
+++ b/.github/workflows/triage_add_to_project.yml
@@ -1,6 +1,15 @@
name: 'Triage: add issue/PR to project'
on:
+ # makes this workflow reusable
+ workflow_call:
+ secrets:
+ ADD_TO_TRIAGE_BOARD_TOKEN:
+ required: true
+ TRIAGE_BOARD_TOKEN:
+ required: true
+ WORKFLOW_DEPLOY_KEY:
+ required: true
issues:
types:
- opened
@@ -12,9 +21,48 @@ jobs:
add-to-triage-project:
name: Add to triage project
runs-on: ubuntu-latest
+ permissions:
+ issues: write
+ env:
+ PROJECT_NUMBER: 9
+ GITHUB_TOKEN: ${{ secrets.ADD_TO_TRIAGE_BOARD_TOKEN }}
steps:
- - uses: actions/add-to-project@v0.3.0
+ - name: is-collaborator
+ run: |
+ gh api graphql -f query='
+ query($org: String!, $repo: String!, $user: String!) {
+ repository(owner: $org, name: $repo) {
+ collaborators(query: $user, first: 1) {
+ totalCount
+ }
+ }
+ } ' -f org=${{ github.repository_owner }} -f repo=${{ github.event.repository.name }} -f user=${{ github.event.pull_request.user.login || github.event.issue.user.login }} > collaborators.json
+
+ echo 'IS_COLLABORATOR='$(jq -r '.data.repository.collaborators.totalCount' collaborators.json) >> $GITHUB_ENV
+ - uses: actions/add-to-project@v0.4.1
+ # only add issues/prs from outside contributors to the project
+ if: ${{ env.IS_COLLABORATOR == 0 || github.event.repository.name == 'cypress-support-internal' || github.event.pull_request.user.login == 'github-actions[bot]' || github.event.issue.user.login == 'github-actions[bot]' }}
+ with:
+ project-url: https://github.com/orgs/${{github.repository_owner}}/projects/${{env.PROJECT_NUMBER}}
+ github-token: ${{ secrets.ADD_TO_TRIAGE_BOARD_TOKEN }}
+ add-contributor-pr-comment:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
with:
- project-url: https://github.com/orgs/cypress-io/projects/9
- github-token: ${{ secrets.ADD_TO_PROJECT_TOKEN }}
-
+ repository: 'cypress-io/release-automations'
+ ref: 'master'
+ ssh-key: ${{ secrets.WORKFLOW_DEPLOY_KEY }}
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 'lts/*'
+ - name: Run comment_workflow.js Script
+ uses: actions/github-script@v7
+ with:
+ github-token: ${{ secrets.TRIAGE_BOARD_TOKEN }}
+ script: |
+ const script = require('./scripts/triage/add_contributing_comment.js')
+ await script.addContributingComment(github, context);
+
diff --git a/.github/workflows/triage_add_to_routed_project.yml b/.github/workflows/triage_add_to_routed_project.yml
index 6bb13d85fa3..c50f4233cc2 100644
--- a/.github/workflows/triage_add_to_routed_project.yml
+++ b/.github/workflows/triage_add_to_routed_project.yml
@@ -1,5 +1,10 @@
name: 'Triage: route to team project board'
on:
+# makes this workflow reusable
+ workflow_call:
+ secrets:
+ ADD_TO_TRIAGE_BOARD_TOKEN:
+ required: true
issues:
types:
- labeled
@@ -10,7 +15,7 @@ jobs:
steps:
- name: Get project data
env:
- GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.ADD_TO_TRIAGE_BOARD_TOKEN }}
ORGANIZATION: 'cypress-io'
PROJECT_NUMBER: 10
run: |
@@ -26,7 +31,7 @@ jobs:
echo 'PROJECT_ID='$(jq -r '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
- name: add issue to e2e project
env:
- GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.ADD_TO_TRIAGE_BOARD_TOKEN }}
ISSUE_ID: ${{ github.event.issue.node_id }}
run: |
gh api graphql -f query='
diff --git a/.github/workflows/triage_closed_issue_comment.yml b/.github/workflows/triage_closed_issue_comment.yml
deleted file mode 100644
index 1caf8abdbb3..00000000000
--- a/.github/workflows/triage_closed_issue_comment.yml
+++ /dev/null
@@ -1,93 +0,0 @@
-name: 'Triage: closed issue comment'
-on:
- issue_comment:
- types:
- - created
-jobs:
- move-to-new-issue-status:
- if: |
- !github.event.issue.pull_request &&
- github.event.issue.state == 'closed' &&
- github.event.comment.created_at != github.event.issue.closed_at &&
- github.event.sender.login != 'cypress-bot'
- runs-on: ubuntu-latest
- steps:
- - name: Get project data
- env:
- GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_TOKEN }}
- ORGANIZATION: 'cypress-io'
- REPOSITORY: 'cypress'
- PROJECT_NUMBER: 9
- ISSUE_NUMBER: ${{ github.event.issue.number }}
- run: |
- gh api graphql -f query='
- query($org: String!, $repo: String!, $project: Int!, $issue: Int!) {
- organization(login: $org) {
- repository(name: $repo) {
- issue(number: $issue) {
- projectItems(first: 10, includeArchived: false) {
- nodes {
- id
- fieldValueByName(name: "Status") {
- ... on ProjectV2ItemFieldSingleSelectValue {
- name
- field {
- ... on ProjectV2SingleSelectField {
- project {
- ... on ProjectV2 {
- id
- number
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- projectV2(number: $project) {
- field(name: "Status") {
- ... on ProjectV2SingleSelectField {
- id
- options {
- id
- name
- }
- }
- }
- }
- }
- }' -f org=$ORGANIZATION -f repo=$REPOSITORY -F issue=$ISSUE_NUMBER -F project=$PROJECT_NUMBER > project_data.json
-
- echo 'PROJECT_ID='$(jq -r '.data.organization.repository.issue.projectItems.nodes[].fieldValueByName.field.project | select(.number == ${{ env.PROJECT_NUMBER }}) | .id' project_data.json) >> $GITHUB_ENV
- echo 'PROJECT_ITEM_ID='$(jq -r '.data.organization.repository.issue.projectItems.nodes[] | select(.fieldValueByName.field.project.number == ${{ env.PROJECT_NUMBER }}) | .id' project_data.json) >> $GITHUB_ENV
- echo 'STATUS_FIELD_ID='$(jq -r '.data.organization.projectV2.field | .id' project_data.json) >> $GITHUB_ENV
- echo 'STATUS='$(jq -r '.data.organization.repository.issue.projectItems.nodes[].fieldValueByName | select(.field.project.number == ${{ env.PROJECT_NUMBER }}) | .name' project_data.json) >> $GITHUB_ENV
- echo 'NEW_ISSUE_OPTION_ID='$(jq -r '.data.organization.projectV2.field.options[] | select(.name== "New Issue") | .id' project_data.json) >> $GITHUB_ENV
- - name: Move issue to New Issue status
- env:
- GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_TOKEN }}
- if: env.STATUS == 'Closed'
- run: |
- gh api graphql -f query='
- mutation (
- $project: ID!
- $item: ID!
- $status_field: ID!
- $status_value: String!
- ) {
- updateProjectV2ItemFieldValue(input: {
- projectId: $project
- itemId: $item
- fieldId: $status_field
- value: {
- singleSelectOptionId: $status_value
- }
- }) {
- projectV2Item {
- id
- }
- }
- }' -f project=$PROJECT_ID -f item=$PROJECT_ITEM_ID -f status_field=$STATUS_FIELD_ID -f status_value=$NEW_ISSUE_OPTION_ID
diff --git a/.github/workflows/triage_handle_new_comments.yml b/.github/workflows/triage_handle_new_comments.yml
new file mode 100644
index 00000000000..5778b08c555
--- /dev/null
+++ b/.github/workflows/triage_handle_new_comments.yml
@@ -0,0 +1,32 @@
+name: 'Handle Issue/PR Comment Workflow'
+on:
+ # makes this workflow reusable
+ workflow_call:
+ secrets:
+ TRIAGE_BOARD_TOKEN:
+ required: true
+
+ issue_comment:
+ types: [created]
+
+jobs:
+ handle-comment-scenarios:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ with:
+ repository: 'cypress-io/release-automations'
+ ref: 'master'
+ ssh-key: ${{ secrets.WORKFLOW_DEPLOY_KEY }}
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 'lts/*'
+ - name: Run comment_workflow.js Script
+ uses: actions/github-script@v7
+ with:
+ github-token: ${{ secrets.TRIAGE_BOARD_TOKEN }}
+ script: |
+ const script = require('./scripts/triage/comment_workflow.js')
+ await script.handleComment(github, context);
diff --git a/.github/workflows/triage_issue_metrics.yml b/.github/workflows/triage_issue_metrics.yml
deleted file mode 100644
index 55c8101d3c6..00000000000
--- a/.github/workflows/triage_issue_metrics.yml
+++ /dev/null
@@ -1,114 +0,0 @@
-name: 'Triage: issue metrics'
-
-on:
- workflow_dispatch:
- inputs:
- startDate:
- description: 'Start date (YYYY-MM-DD)'
- type: date
- endDate:
- description: 'End date (YYYY-MM-DD)'
- type: date
-jobs:
- seven-day-close:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/github-script@v6
- env:
- ORGANIZATION: 'cypress-io'
- REPOSITORY: 'cypress'
- PROJECT_NUMBER: 9
- with:
- github-token: ${{ secrets.ADD_TO_PROJECT_TOKEN }}
- script: |
- const ROUTED_TO_LABELS = ['routed-to-e2e', 'routed-to-ct']
- const MS_PER_DAY = 1000 * 60 * 60 * 24
- const { REPOSITORY, ORGANIZATION, PROJECT_NUMBER } = process.env
-
- const issues = []
-
- const determineDateRange = () => {
- const inputStartDate = '${{ inputs.startDate }}'
- const inputEndDate = '${{ inputs.endDate }}'
-
- if (inputStartDate && inputEndDate) {
- return { startDate: inputStartDate, endDate: inputEndDate }
- }
-
- if (inputStartDate || inputEndDate) {
- core.setFailed('Both startDate and endDate are required if one is provided.')
- }
-
- const startDate = new Date()
-
- startDate.setDate(startDate.getDate() - 6)
-
- return { startDate: startDate.toISOString().split('T')[0], endDate: (new Date()).toISOString().split('T')[0] }
- }
-
- const dateRange = determineDateRange()
- const query = `is:issue+repo:${ORGANIZATION}/${REPOSITORY}+project:${ORGANIZATION}/${PROJECT_NUMBER}+created:${dateRange.startDate}..${dateRange.endDate}`
-
- const findLabelDateTime = async (issueNumber) => {
- const iterator = github.paginate.iterator(github.rest.issues.listEventsForTimeline, {
- owner: ORGANIZATION,
- repo: REPOSITORY,
- issue_number: issueNumber,
- })
-
- for await (const { data: timelineData } of iterator) {
- for (const timelineItem of timelineData) {
- if (timelineItem.event === 'labeled' && ROUTED_TO_LABELS.includes(timelineItem.label.name)) {
- return timelineItem.created_at
- }
- }
- }
- }
-
- const calculateElapsedDays = (createdAt, routedOrClosedAt) => {
- return Math.round((new Date(routedOrClosedAt) - new Date(createdAt)) / MS_PER_DAY, 0)
- }
-
- const iterator = github.paginate.iterator(github.rest.search.issuesAndPullRequests, {
- q: query,
- per_page: 100,
- })
-
- for await (const { data } of iterator) {
- for (const issue of data) {
- let routedOrClosedAt
-
- if (!issue.pull_request) {
- const routedLabel = issue.labels.find((label) => ROUTED_TO_LABELS.includes(label.name))
-
- if (routedLabel) {
- routedOrClosedAt = await findLabelDateTime(issue.number)
- } else if (issue.state === 'closed') {
- routedOrClosedAt = issue.closed_at
- }
-
- let elapsedDays
-
- if (routedOrClosedAt) {
- elapsedDays = calculateElapsedDays(issue.created_at, routedOrClosedAt)
- }
-
- issues.push({
- number: issue.number,
- title: issue.title,
- state: issue.state,
- url: issue.html_url,
- createdAt: issue.created_at,
- routedOrClosedAt,
- elapsedDays,
- })
- }
- }
- }
-
- const issuesRoutedOrClosedIn7Days = issues.filter((issue) => issue.elapsedDays <= 7).length
- const percentage = Number(issues.length > 0 ? issuesRoutedOrClosedIn7Days / issues.length : 0).toLocaleString(undefined, { style: 'percent', minimumFractionDigits: 2 })
-
- console.log(`Triage Metrics (${dateRange.startDate} - ${dateRange.endDate})`)
- console.log('Total issues:', issues.length)
- console.log(`Issues routed/closed within 7 days: ${issuesRoutedOrClosedIn7Days} (${percentage})`)
diff --git a/.github/workflows/triage_update_status.yml b/.github/workflows/triage_update_status.yml
new file mode 100644
index 00000000000..b71b0daf077
--- /dev/null
+++ b/.github/workflows/triage_update_status.yml
@@ -0,0 +1,97 @@
+name: 'Set Issue Status'
+on:
+ # makes this workflow reusable
+ workflow_call:
+ inputs:
+ status:
+ description: 'Which status column?'
+ default: 'New Issue'
+ required: false
+ type: string
+ secrets:
+ ADD_TO_TRIAGE_BOARD_TOKEN:
+ required: true
+
+jobs:
+ move-to-requested-status:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Get project data
+ env:
+ STATUS: ${{ inputs.status || 'New Issue' }}
+ GITHUB_TOKEN: ${{ secrets.ADD_TO_TRIAGE_BOARD_TOKEN }}
+ ORGANIZATION: 'cypress-io'
+ REPOSITORY: ${{ github.event.repository.name }}
+ PROJECT_NUMBER: 9
+ ISSUE_NUMBER: ${{ github.event.issue.number }}
+
+ run: |
+ gh api graphql -f query='
+ query($org: String!, $repo: String!, $project: Int!, $issue: Int!) {
+ organization(login: $org) {
+ repository(name: $repo) {
+ issue(number: $issue) {
+ projectItems(first: 10, includeArchived: false) {
+ nodes {
+ id
+ fieldValueByName(name: "Status") {
+ ... on ProjectV2ItemFieldSingleSelectValue {
+ name
+ field {
+ ... on ProjectV2SingleSelectField {
+ project {
+ ... on ProjectV2 {
+ id
+ number
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ projectV2(number: $project) {
+ field(name: "Status") {
+ ... on ProjectV2SingleSelectField {
+ id
+ options {
+ id
+ name
+ }
+ }
+ }
+ }
+ }
+ }' -f org=$ORGANIZATION -f repo=$REPOSITORY -F issue=$ISSUE_NUMBER -F project=$PROJECT_NUMBER > project_data.json
+
+ echo 'PROJECT_ID='$(jq -r '.data.organization.repository.issue.projectItems.nodes[].fieldValueByName.field.project | select(.number == ${{ env.PROJECT_NUMBER }}) | .id' project_data.json) >> $GITHUB_ENV
+ echo 'PROJECT_ITEM_ID='$(jq -r '.data.organization.repository.issue.projectItems.nodes[] | select(.fieldValueByName.field.project.number == ${{ env.PROJECT_NUMBER }}) | .id' project_data.json) >> $GITHUB_ENV
+ echo 'STATUS_FIELD_ID='$(jq -r '.data.organization.projectV2.field | .id' project_data.json) >> $GITHUB_ENV
+ echo 'STATUS_OPTION_ID='$(jq -r '.data.organization.projectV2.field.options[] | select(.name== "${{ env.STATUS }}") | .id' project_data.json) >> $GITHUB_ENV
+ - name: Move issue to new status
+ env:
+ GITHUB_TOKEN: ${{ secrets.ADD_TO_TRIAGE_BOARD_TOKEN }}
+ run: |
+ gh api graphql -f query='
+ mutation (
+ $project: ID!
+ $item: ID!
+ $status_field: ID!
+ $status_value: String!
+ ) {
+ updateProjectV2ItemFieldValue(input: {
+ projectId: $project
+ itemId: $item
+ fieldId: $status_field
+ value: {
+ singleSelectOptionId: $status_value
+ }
+ }) {
+ projectV2Item {
+ id
+ }
+ }
+ }' -f project=$PROJECT_ID -f item=$PROJECT_ITEM_ID -f status_field=$STATUS_FIELD_ID -f status_value=$STATUS_OPTION_ID
diff --git a/.github/workflows/update-browser-versions.yml b/.github/workflows/update-browser-versions.yml
index 0d73441e469..330464273fb 100644
--- a/.github/workflows/update-browser-versions.yml
+++ b/.github/workflows/update-browser-versions.yml
@@ -1,5 +1,7 @@
name: Update Browser Versions
on:
+ workflow_dispatch:
+
schedule:
- cron: '0 8 * * *' # every day at 8am UTC (3/4am EST/EDT)
jobs:
@@ -8,12 +10,14 @@ jobs:
env:
CYPRESS_BOT_APP_ID: ${{ secrets.CYPRESS_BOT_APP_ID }}
BASE_BRANCH: develop
+ # Prevent from running this workflow on forks
+ if: github.repository == 'cypress-io/cypress'
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
fetch-depth: 0
- token: ${{ secrets.GITHUB_TOKEN }}
+ token: ${{ secrets.BOT_GITHUB_ACTION_TOKEN }}
- name: Set committer info
## attribute the commit to cypress-bot: https://github.community/t/logging-into-git-as-a-github-app/115916
run: |
@@ -24,12 +28,12 @@ jobs:
git fetch origin
git checkout ${{ env.BASE_BRANCH }}
- name: Set up Node.js
- uses: actions/setup-node@v2
+ uses: actions/setup-node@v4
with:
- node-version: 14
+ node-version: 18
- name: Check for new Chrome versions
id: get-versions
- uses: actions/github-script@v4
+ uses: actions/github-script@v7
with:
script: |
const { getVersions } = require('./scripts/github-actions/update-browser-versions.js')
@@ -40,13 +44,13 @@ jobs:
env:
BRANCH_NAME: update-chrome-stable-from-${{ steps.get-versions.outputs.current_stable_version }}-beta-from-${{ steps.get-versions.outputs.current_beta_version }}
run: |
- echo "::set-output name=branch_name::${{ env.BRANCH_NAME }}"
- echo "::set-output name=branch_exists::$(git show-ref --verify --quiet refs/remotes/origin/${{ env.BRANCH_NAME }} && echo 'true')"
+ echo "branch_name=${{ env.BRANCH_NAME }}" >> $GITHUB_OUTPUT
+ echo "branch_exists=$(git show-ref --verify --quiet refs/remotes/origin/${{ env.BRANCH_NAME }} && echo 'true')" >> $GITHUB_OUTPUT
- name: Check need for PR or branch update
id: check-need-for-pr
run: |
- echo "::set-output name=needs_pr::${{ steps.get-versions.outputs.has_update == 'true' && steps.check-branch.outputs.branch_exists != 'true' }}"
- echo "::set-output name=needs_branch_update::${{ steps.get-versions.outputs.has_update == 'true' && steps.check-branch.outputs.branch_exists == 'true' }}"
+ echo "needs_pr=${{ steps.get-versions.outputs.has_update == 'true' && steps.check-branch.outputs.branch_exists != 'true' }}" >> $GITHUB_OUTPUT
+ echo "needs_branch_update=${{ steps.get-versions.outputs.has_update == 'true' && steps.check-branch.outputs.branch_exists == 'true' }}" >> $GITHUB_OUTPUT
## Update available and a branch/PR already exists
- name: Checkout existing branch
if: ${{ steps.check-need-for-pr.outputs.needs_branch_update == 'true' }}
@@ -54,7 +58,7 @@ jobs:
- name: Check need for update on existing branch
if: ${{ steps.check-need-for-pr.outputs.needs_branch_update == 'true' }}
id: check-need-for-branch-update
- uses: actions/github-script@v4
+ uses: actions/github-script@v7
with:
script: |
const { checkNeedForBranchUpdate } = require('./scripts/github-actions/update-browser-versions.js')
@@ -71,7 +75,7 @@ jobs:
## Both
- name: Update Browser Versions File
if: ${{ steps.check-need-for-pr.outputs.needs_pr == 'true' || steps.check-need-for-branch-update.outputs.has_newer_update == 'true' }}
- uses: actions/github-script@v4
+ uses: actions/github-script@v7
with:
script: |
const { updateBrowserVersionsFile } = require('./scripts/github-actions/update-browser-versions.js')
@@ -90,7 +94,7 @@ jobs:
## Update available and a branch/PR already exists
- name: Update PR Title
if: ${{ steps.check-need-for-pr.outputs.needs_branch_update == 'true' }}
- uses: actions/github-script@v4
+ uses: actions/github-script@v7
with:
script: |
const { updatePRTitle } = require('./scripts/github-actions/update-browser-versions.js')
@@ -104,11 +108,12 @@ jobs:
})
# Update available and a PR doesn't already exist
- name: Create Pull Request
+ id: create-pr
if: ${{ steps.check-need-for-pr.outputs.needs_pr == 'true' }}
- uses: actions/github-script@v4
+ uses: actions/github-script@v7
with:
script: |
- const { createPullRequest } = require('./scripts/github-actions/update-browser-versions.js')
+ const { createPullRequest } = require('./scripts/github-actions/create-pull-request.js')
await createPullRequest({
context,
@@ -116,4 +121,6 @@ jobs:
baseBranch: '${{ env.BASE_BRANCH }}',
branchName: '${{ steps.check-branch.outputs.branch_name }}',
description: '${{ steps.get-versions.outputs.description }}',
+ body: 'This PR was auto-generated to update the version(s) of Chrome for driver tests',
+ addToProjectBoard: true,
})
diff --git a/.github/workflows/update_v8_snapshot_cache.yml b/.github/workflows/update_v8_snapshot_cache.yml
new file mode 100644
index 00000000000..fc36072a260
--- /dev/null
+++ b/.github/workflows/update_v8_snapshot_cache.yml
@@ -0,0 +1,158 @@
+name: Update V8 Snapshot Cache
+on:
+ schedule:
+ # Run everyday except Wednesday at 00:00 UTC
+ - cron: '0 0 * * 0,1,2,4,5,6'
+ # Run every Wednesday at 00:00 UTC
+ - cron: '0 0 * * 3'
+ push:
+ branches:
+ - 'release/**'
+ paths-ignore:
+ - .husky/**
+ - .vscode/**
+ - .eslintrc.js
+ - .gitattributes
+ - .gitignore
+ - .percy.yml
+ - .prettierignore
+ - .releaserc.js
+ - .yarnclean
+ - CHANGELOG.md
+ - CODE_OF_CONDUCT.md
+ - CONTRIBUTING.md
+ - LICENSE
+ - README.md
+ - ROADMAP.md
+ - SECURITY.md
+ workflow_dispatch:
+ inputs:
+ branch:
+ description: 'Branch to update'
+ required: true
+ default: 'develop'
+ generate_from_scratch:
+ description: 'Generate from scratch'
+ type: boolean
+ default: false
+ commit_directly_to_branch:
+ description: 'Commit directly to branch'
+ type: boolean
+ default: false
+concurrency:
+ group: ${{ inputs.branch || github.ref }}
+ cancel-in-progress: true
+jobs:
+ update-v8-snapshot-cache:
+ strategy:
+ max-parallel: 1
+ matrix:
+ platform: [ubuntu-latest, macos-latest, windows-latest]
+ runs-on: ${{ matrix.platform }}
+ env:
+ CYPRESS_BOT_APP_ID: ${{ secrets.RAM_APP }}
+ BASE_BRANCH: ${{ inputs.branch || github.ref_name }}
+ # Flex the generate from scratch option based on manual input or if we are on the weekly schedule
+ GENERATE_FROM_SCRATCH: ${{ inputs.generate_from_scratch == true || (github.event_name == 'schedule' && github.event.schedule == '0 0 * * 3') }}
+ steps:
+ - name: Determine snapshot files - Windows
+ if: ${{ matrix.platform == 'windows-latest' }}
+ run: echo "SNAPSHOT_FILES='tooling\v8-snapshot\cache\win32\snapshot-meta.json'" >> $GITHUB_ENV
+ shell: bash
+ - name: Determine snapshot files - Linux
+ if: ${{ matrix.platform == 'ubuntu-latest' }}
+ run: echo "SNAPSHOT_FILES='tooling/v8-snapshot/cache/linux/snapshot-meta.json'" >> $GITHUB_ENV
+ - name: Determine snapshot files - Mac
+ if: ${{ matrix.platform == 'macos-latest' }}
+ run: echo "SNAPSHOT_FILES='tooling/v8-snapshot/cache/darwin/snapshot-meta.json'" >> $GITHUB_ENV
+ - name: Install setuptools - Mac
+ if: ${{ matrix.platform == 'macos-latest' }}
+ run: sudo -H pip install setuptools
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ token: ${{ secrets.BOT_GITHUB_ACTION_TOKEN }}
+ ref: ${{ env.BASE_BRANCH }}
+ - name: Set committer info
+ ## attribute the commit to cypress-bot: https://github.community/t/logging-into-git-as-a-github-app/115916
+ run: |
+ git config --local user.email "${{ env.CYPRESS_BOT_APP_ID }}+cypress-bot[bot]@users.noreply.github.com"
+ git config --local user.name "cypress-bot[bot]"
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 18
+ cache: 'yarn'
+ - name: Run yarn
+ run: yarn
+ - name: Run build
+ run: yarn build
+ - name: Generate prod snapshot from scratch
+ if: ${{ env.GENERATE_FROM_SCRATCH == 'true' }}
+ run: yarn cross-env V8_SNAPSHOT_FROM_SCRATCH=1 V8_UPDATE_METAFILE=1 yarn build-v8-snapshot-prod
+ - name: Generate prod snapshot iteratively
+ if: ${{ env.GENERATE_FROM_SCRATCH != 'true' }}
+ run: yarn cross-env V8_UPDATE_METAFILE=1 yarn build-v8-snapshot-prod
+ - name: Check for v8 snapshot cache changes
+ id: check-for-v8-snapshot-cache-changes
+ run: |
+ echo "has_changes=$(test "$(git status --porcelain -- ${{ env.SNAPSHOT_FILES }})" && echo 'true')" >> $GITHUB_OUTPUT
+ shell: bash
+ - name: Determine branch name - commit directly to branch
+ if: ${{ inputs.commit_directly_to_branch == true }}
+ run: |
+ echo "BRANCH_NAME=${{ env.BASE_BRANCH }}" >> $GITHUB_ENV
+ echo "BRANCH_EXISTS=true" >> $GITHUB_ENV
+ shell: bash
+ - name: Determine branch name - commit to separate branch
+ if: ${{ inputs.commit_directly_to_branch != true }}
+ run: |
+ echo "BRANCH_NAME=update-v8-snapshot-cache-on-${{ env.BASE_BRANCH }}" >> $GITHUB_ENV
+ echo "BRANCH_EXISTS=$(git show-ref --verify --quiet refs/remotes/origin/update-v8-snapshot-cache-on-${{ env.BASE_BRANCH }} && echo 'true')" >> $GITHUB_ENV
+ shell: bash
+ - name: Check need for PR or branch update
+ id: check-need-for-pr
+ run: |
+ echo "needs_pr=${{ steps.check-for-v8-snapshot-cache-changes.outputs.has_changes == 'true' && env.BRANCH_EXISTS != 'true' }}" >> $GITHUB_OUTPUT
+ echo "needs_branch_update=${{ steps.check-for-v8-snapshot-cache-changes.outputs.has_changes == 'true' && env.BRANCH_EXISTS == 'true' }}" >> $GITHUB_OUTPUT
+ shell: bash
+ ## Update available and a branch/PR already exists
+ - name: Checkout existing branch
+ if: ${{ steps.check-need-for-pr.outputs.needs_branch_update == 'true' }}
+ run: |
+ git stash push -- ${{ env.SNAPSHOT_FILES }}
+ git reset --hard
+ git checkout ${{ env.BRANCH_NAME }}
+ git pull origin ${{ env.BRANCH_NAME }}
+ git merge --squash -Xtheirs stash
+ ## Update available and a PR doesn't already exist
+ - name: Checkout new branch
+ if: ${{ steps.check-need-for-pr.outputs.needs_pr == 'true' }}
+ run: git checkout -b ${{ env.BRANCH_NAME }} ${{ env.BASE_BRANCH }}
+ ## Commit changes if present
+ - name: Commit the changes
+ if: ${{ steps.check-for-v8-snapshot-cache-changes.outputs.has_changes == 'true' }}
+ run: |
+ git diff-index --quiet HEAD || git commit -am "chore: updating v8 snapshot cache"
+ ## Push branch
+ - name: Push branch to remote
+ if: ${{ steps.check-for-v8-snapshot-cache-changes.outputs.has_changes == 'true' }}
+ run: git push origin ${{ env.BRANCH_NAME }}
+ # PR needs to be created
+ - name: Create Pull Request
+ if: ${{ steps.check-need-for-pr.outputs.needs_pr == 'true' }}
+ uses: actions/github-script@v7
+ with:
+ script: |
+ const { createPullRequest } = require('./scripts/github-actions/create-pull-request.js')
+
+ await createPullRequest({
+ context,
+ github,
+ baseBranch: '${{ env.BASE_BRANCH }}',
+ branchName: '${{ env.BRANCH_NAME }}',
+ description: 'Update v8 snapshot cache',
+ body: 'This PR was automatically generated by the [update-v8-snapshot-cache](https://github.com/cypress-io/cypress/actions/workflows/update_v8_snapshot_cache.yml) github action.',
+ reviewers: ['ryanthemanuel']
+ })
diff --git a/.github/workflows/upload_release_asset.yml b/.github/workflows/upload_release_asset.yml
index 1934d2fc22b..b089f42a480 100644
--- a/.github/workflows/upload_release_asset.yml
+++ b/.github/workflows/upload_release_asset.yml
@@ -13,9 +13,11 @@ jobs:
FOSSA_API_KEY: ${{secrets.FOSSAAPIKEY}}
repo-token: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ permissions:
+ contents: write
steps:
- name: Check out repository code
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Download Fossa binary and install
# This step utilizes a curl of the latest install pkg from Fossa. Using a git action from
# Fossa doesn't produce the SBOM artifact needed. This manual approach is the only way to
diff --git a/.gitignore b/.gitignore
index 5f8a277767c..cb6f213a1c8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -78,6 +78,9 @@ system-tests/lib/fixtureDirs.ts
# from npm/webpack-dev-server
/npm/webpack-dev-server/cypress/videos
+# from npm/grep
+/npm/grep/cypress/videos
+
# from errors
/packages/errors/__snapshot-images__
/packages/errors/__snapshot-md__
@@ -89,7 +92,7 @@ system-tests/lib/fixtureDirs.ts
/packages/frontend-shared/src/generated
/packages/frontend-shared/cypress/e2e/support/e2eProjectDirs.ts
-# from npm/create-cypress-tests
+# from old npm/create-cypress-tests
/npm/create-cypress-tests/initial-template
/npm/create-cypress-tests/src/test-output
@@ -112,6 +115,9 @@ cli/visual-snapshots
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+# Fleet
+.fleet/
+
# User-specific stuff
.idea
.idea/**/workspace.xml
@@ -377,3 +383,18 @@ globbed_node_modules
# Autogenerated files, typically from graphql-code-generator
*.gen.ts
*.gen.json
+
+# Snapshot Binaries
+snapshot_blob.bin
+v8_context_snapshot.x86_64.bin
+
+# Legacy snapshot cache files
+tooling/v8-snapshot/cache/dev-darwin
+tooling/v8-snapshot/cache/dev-linux
+tooling/v8-snapshot/cache/dev-win32
+tooling/v8-snapshot/cache/prod-darwin
+tooling/v8-snapshot/cache/prod-linux
+tooling/v8-snapshot/cache/prod-win32
+
+# Cloud API validations
+system-tests/lib/validations
diff --git a/.node-version b/.node-version
index a1fe1878845..4a1f488b6c3 100644
--- a/.node-version
+++ b/.node-version
@@ -1 +1 @@
-16.14.2
\ No newline at end of file
+18.17.1
diff --git a/.releaserc.base.js b/.releaserc.base.js
deleted file mode 100644
index 95f6bbf9400..00000000000
--- a/.releaserc.base.js
+++ /dev/null
@@ -1,20 +0,0 @@
-module.exports = {
- plugins: [
- '@semantic-release/commit-analyzer',
- '@semantic-release/release-notes-generator',
- ['@semantic-release/changelog', {
- changelogFile: 'CHANGELOG.md',
- }],
- ['@semantic-release/git', {
- assets: [
- './CHANGELOG.md',
- ],
- message: 'chore: release ${nextRelease.gitTag}\n\n[skip ci]',
- }],
- '@semantic-release/npm',
- ],
- extends: 'semantic-release-monorepo',
- branches: [
- 'master',
- ],
-}
diff --git a/.releaserc.js b/.releaserc.js
index 4025bd1ff58..77b55505f85 100644
--- a/.releaserc.js
+++ b/.releaserc.js
@@ -1,7 +1,31 @@
+const { parserOpts, releaseRules } = require('./scripts/semantic-commits/change-categories')
+
module.exports = {
- ...require('./.releaserc.base'),
+ plugins: [
+ ['@semantic-release/commit-analyzer', {
+ preset: 'angular',
+ parserOpts,
+ releaseRules,
+ }],
+ ['@semantic-release/release-notes-generator',
+ {
+ preset: 'angular',
+ parserOpts,
+ }
+ ],
+ ['@semantic-release/changelog', {
+ changelogFile: 'CHANGELOG.md',
+ }],
+ ['@semantic-release/git', {
+ assets: [
+ './CHANGELOG.md',
+ ],
+ message: 'chore: release ${nextRelease.gitTag}\n\n[skip ci]',
+ }],
+ '@semantic-release/npm',
+ ],
+ extends: 'semantic-release-monorepo',
branches: [
- 'master',
- { name: 'chore/webpack-5', channel: 'channel-next' },
+ { name: 'develop', channel: 'latest' },
],
}
diff --git a/.vscode/cspell.json b/.vscode/cspell.json
index 5649488074b..bc6c6cdb3f6 100644
--- a/.vscode/cspell.json
+++ b/.vscode/cspell.json
@@ -8,21 +8,29 @@
"composables",
"dedup",
"ERRORED",
+ "esbuild",
"execa",
"Fetchable",
"Fetchables",
"forcedefault",
"getenv",
+ "GIBIBYTES",
"graphcache",
"headlessui",
"Iconify",
"intlify",
+ "KIBIBYTE",
+ "kibibytes",
"Lachlan",
"loggedin",
+ "mksnapshot",
"msapplication",
+ "norewrite",
"NOTESTS",
"OVERLIMIT",
"overscan",
+ "packherd",
+ "pidusage",
"Pinia",
"pnpm",
"pseudoclass",
@@ -30,22 +38,29 @@
"Screenshotting",
"semibold",
"shiki",
+ "snapbuild",
+ "snapgen",
+ "snapshottable",
+ "snapshotted",
+ "snapshotting",
+ "sourcemaps",
"speclist",
+ "systeminformation",
"testid",
"TIMEDOUT",
"titleize",
"topnav",
"unconfigured",
"unplugin",
+ "unref",
"unrunnable",
"unstaged",
"urql",
"viewports",
"vite",
"vitejs",
- "vueuse",
- "Windi"
+ "vueuse"
],
"ignoreWords": [],
"import": []
-}
\ No newline at end of file
+}
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index 845b2fc5567..c28ee62bcb0 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -22,9 +22,9 @@
// Description: Adds syntax highlighting for all gql tags.
"apollographql.vscode-apollo",
- // Name: WindiCSS Intellisense
- // Description: Automatically sorts your WindiCSS classes.
- "voorjaar.windicss-intellisense",
+ // Name: TailwindCSS Intellisense
+ // Description: Automatically sorts your TailwindCSS classes.
+ "bradlc.vscode-tailwindcss",
// Name: Volar
// Description: Language server for Vue. Required for any syntax highlighting in Vue files.
diff --git a/.vscode/launch.json b/.vscode/launch.json
index ff2618c4bf7..2142cdfd3ce 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -8,6 +8,21 @@
"processId": "${command:PickProcess}",
"continueOnAttach": true
},
+ {
+ "type": "node",
+ "request": "attach",
+ "name": "Attach to port 5566",
+ "port": 5566,
+ "continueOnAttach": true,
+ },
+ {
+ "type": "node",
+ "request": "attach",
+ "name": "Attach to Docker",
+ "port": 5566,
+ "continueOnAttach": true,
+ "remoteRoot": "/opt/cypress",
+ },
{
"type": "node",
"request": "attach",
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 47436c0f111..3e90e64819c 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -19,13 +19,10 @@
"json"
],
"editor.codeActionsOnSave": {
- "source.fixAll.eslint": true
+ "source.fixAll.eslint": "explicit"
},
"typescript.tsdk": "node_modules/typescript/lib",
- // A flag that controls whether or not Windi CSS classes will be sorted on save on save.
- "windicss.sortOnSave": true,
-
// Support autocompletion and preview of strings.
// Additionally, support extraction of hardcoded strings into key-values.
"i18n-ally.localesPaths": "packages/frontend-shared/src/locales",
diff --git a/.yarnclean b/.yarnclean
new file mode 100644
index 00000000000..1b0696546cd
--- /dev/null
+++ b/.yarnclean
@@ -0,0 +1,50 @@
+# test directories
+__tests__
+test
+tests
+powered-test
+
+# yaml package has a `doc` folder that we need
+!yaml/**/doc/*
+website
+images
+assets
+!mochawesome-report-generator/dist/assets
+
+# Do NOT clean out app assets from cypress-example-kitchensink to avoid broken deployments
+# Needed for https://example.cypress.io/
+!cypress-example-kitchensink/app/assets
+
+# examples
+example
+!@packages/example
+examples
+
+# code coverage directories
+coverage
+.nyc_output
+
+# build scripts
+Makefile
+Gulpfile.js
+Gruntfile.js
+
+# configs
+appveyor.yml
+circle.yml
+codeship-services.yml
+codeship-steps.yml
+wercker.yml
+.tern-project
+.gitattributes
+.editorconfig
+.*ignore
+.eslintrc
+.jshintrc
+.flowconfig
+.documentup.json
+.yarn-metadata.json
+.travis.yml
+
+# misc
+*.md
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2a007ead1b9..c387bf62a53 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1 +1,16 @@
-https://on.cypress.io/changelog
+# Changelogs
+
+- [Cypress App](https://on.cypress.io/changelog)
+- [`@cypress/angular`](https://github.com/cypress-io/cypress/blob/develop/npm/angular/CHANGELOG.md)
+- [`@cypress/angular-signals`](https://github.com/cypress-io/cypress/blob/develop/npm/angular-signals/CHANGELOG.md)
+- [`@cypress/eslint-plugin-dev`](https://github.com/cypress-io/cypress/blob/develop/npm/eslint-plugin-dev/CHANGELOG.md)
+- [`@cypress/mount-utils`](https://github.com/cypress-io/cypress/blob/develop/npm/mount-utils/CHANGELOG.md)
+- [`@cypress/react`](https://github.com/cypress-io/cypress/blob/develop/npm/react/CHANGELOG.md)
+- [`@cypress/react18`](https://github.com/cypress-io/cypress/blob/develop/npm/react18/CHANGELOG.md)
+- [`@cypress/svelte`](https://github.com/cypress-io/cypress/blob/develop/npm/svelte/CHANGELOG.md)
+- [`@cypress/vite-dev-server`](https://github.com/cypress-io/cypress/blob/develop/npm/vite-dev-server/CHANGELOG.md)
+- [`@cypress/vue`](https://github.com/cypress-io/cypress/blob/develop/npm/vue/CHANGELOG.md)
+- [`@cypress/vue2`](https://github.com/cypress-io/cypress/blob/develop/npm/vue2/CHANGELOG.md)
+- [`@cypress/webpack-batteries-included-preprocessor`](https://github.com/cypress-io/cypress/blob/develop/npm/webpack-batteries-included-preprocessor/CHANGELOG.md)
+- [`@cypress/webpack-dev-server`](https://github.com/cypress-io/cypress/blob/develop/npm/webpack-dev-server/CHANGELOG.md)
+- [`@cypress/webpack-preprocessor`](https://github.com/cypress-io/cypress/blob/develop/npm/webpack-preprocessor/CHANGELOG.md)
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index cb65de563b2..2e9de105357 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -2,7 +2,7 @@
## Our Pledge
-In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
+In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
@@ -20,13 +20,13 @@ Examples of unacceptable behavior by participants include:
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
-* Other conduct which could reasonably be considered inappropriate in a professional setting
+* Other conduct that could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
-Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned with this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c81b48eb623..b48e83f6f3b 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -4,8 +4,8 @@ Thanks for taking the time to contribute! :smile:
**Once you learn how to use Cypress, you can contribute in many ways:**
-- Join the [Cypress Discord](https://on.cypress.io/discord) and answer questions. Teaching others how to use Cypress is a great way to learn more about how it works.
-- Blog about Cypress. We display blogs featuring Cypress on our [Examples](https://on.cypress.io/examples) page. If you'd like your blog featured, [open a PR to add it to our docs](https://github.com/cypress-io/cypress-documentation/blob/develop/CONTRIBUTING.md#adding-examples).
+- Join the [Cypress Discord](https://on.cypress.io/chat) and answer questions. Teaching others how to use Cypress is a great way to learn more about how it works.
+- Blog about Cypress. We display blogs featuring Cypress on our [Examples](https://on.cypress.io/examples) page. If you'd like your blog featured, [open a PR to add it to our docs](https://github.com/cypress-io/cypress-documentation/blob/master/CONTRIBUTING.md#adding-examples).
- Write some documentation or improve our existing docs. See our [guide to contributing to our docs](https://github.com/cypress-io/cypress-documentation/blob/master/CONTRIBUTING.md).
- Give a talk about Cypress. [Contact us](mailto:support@cypress.io) ahead of time and we'll send you some swag. :shirt:
@@ -20,7 +20,6 @@ Thanks for taking the time to contribute! :smile:
- [Code of Conduct](#code-of-conduct)
- [Opening Issues](#opening-issues)
-- [Triaging Issues](#triaging-issues)
- [Writing Documentation](#writing-documentation)
- [Writing Code](#writing-code)
- [What you need to know before getting started](#what-you-need-to-know-before-getting-started)
@@ -43,7 +42,7 @@ Thanks for taking the time to contribute! :smile:
## Code of Conduct
-All contributors are expecting to abide by our [Code of Conduct](./CODE_OF_CONDUCT.md).
+All contributors are expected to abide by our [Code of Conduct](./CODE_OF_CONDUCT.md).
## Opening Issues
@@ -111,134 +110,11 @@ test execution | Running tests inside a single spec | [open](https://github.com/
typescript | Transpiling or bundling TypeScript | [open](https://github.com/cypress-io/cypress/labels/topic%3A%20typescript), [closed](https://github.com/cypress-io/cypress/issues?q=label%3A%22topic%3A+typescript%22+is%3Aclosed)
video | Problems with video recordings | [open](https://github.com/cypress-io/cypress/labels/topic%3A%20video%20%F0%9F%93%B9), [closed](https://github.com/cypress-io/cypress/issues?q=label%3A%22topic%3A+video+%F0%9F%93%B9%22+is%3Aclosed)
-## Triaging Issues
-
-When an issue is opened in [cypress](https://github.com/cypress-io/cypress), we need to evaluate the issue to determine what steps should be taken next. So, when approaching new issues, there are some steps that should be taken.
-
-### Is this a question?
-
-Some opened issues are questions, not bug reports or feature requests. Issues are reserved for potential bugs or feature requests *only*. If this is the case, you should:
-
-- Explain that issues in our GitHub repo are reserved for potential bugs or feature requests and that the issue will be closed since it appears to be neither a bug nor a feature request.
-- Guide them to existing resources where their questions can be asked like our [Discussions](https://github.com/cypress-io/cypress/discussions), [community chat](https://on.cypress.io/chat), [Discord](https://on.cypress.io/discord), or [Stack Overflow](https://stackoverflow.com/questions/tagged/cypress).
-- Cypress offers support via email when signing up for any of our [paid plans](https://www.cypress.io/pricing/), so remind them that this is an option if they already have a paid account.
-- Move the issue to [Discussions](https://github.com/cypress-io/cypress/discussions).
-
-### Does this issue belong in this repository?
-
-#### Other open source repos
-
-Issues may be opened about wanting changes to our [documentation](https://github.com/cypress-io/cypress-documentation), our [example-kitchensink app](https://github.com/cypress-io/cypress-example-kitchensink), or [another repository](https://github.com/cypress-io). In this case you should:
-
-- Thank them for their contribution.
-- Explain that this repo is only for bugs or feature requests of the Cypress App.
-- If you have permission to 'Transfer the issue', do so. If not, explain that they can open an issue in our other repository and link to the repository.
-- Close the issue (if not already transferred).
-
-#### Cypress Dashboard
-
-Issues may be opened about wanting features in our Dashboard Service. In this case you should:
-
-- Thank them for opening an issue.
-- Add the `external: dashboard` label.
-
-#### Component Testing
-
-Issues may be opened about wanting features in Component Testing. In this case you should:
-
-- Thank them for opening an issue.
-- Add the `component testing` label.
-
-### Is this already an open issue?
-
-Search [all issues](https://github.com/cypress-io/cypress/issues) for keywords from the issue to ensure there isn't already an issue open for this. GitHub has some [search tips](https://help.github.com/articles/searching-issues-and-pull-requests/) that may help you better find the relevant issue.
-
-If an issue already exists you should:
-
-- Thank them for their contribution.
-- Explain that this issue is a duplicate of another issue, linking to the relevant issue (`#1234`).
-- Add the `type: duplicate` label to the issue.
-- Close the issue.
-
-### Does the issue provide all the information from our issue template?
-
-When opening an issue, there is a provided issue template based on the type of issue. If the opened issue does not provide enough information asked from the issue template you should:
-
-- Explain that we require new issues follow our provided issue template and that issues that are opened without this information are automatically closed per our [contributing guidelines](#fill-out-our-issue-template).
-- Close the issue.
-
-### Are they running the current version of Cypress?
-
-If they listed an older version of Cypress in their issue. We don't want to spend the time to set up a reproducible project (which can be time consuming) only to find that bumping the Cypress version fixes it. You should:
-
-- Ask them to update to the newest version of Cypress and comment about the results.
-- Add the `stage: awaiting response` label to the issue.
-
-### Is the fix or feature within our vision for Cypress?
-
-There will inevitably be suggestions that will not fit within the scope of Cypress's vision for our product. If an issue or pull request falls under this category you should:
-
-- Thank them for their contribution.
-- Explain why it doesn't fit into the scope at Cypress, and offer clear suggestions for improvement, if you're able. Be kind, but firm.
-- Link to relevant documentation, if there is any. If you notice repeated requests for things that are not within scope, add them into the [documentation](https://github.com/cypress-io/cypress-documentation) to avoid repeating yourself.
-- Add the `stage: wontfix` label to the issue.
-- Close the issue/pull request.
-
-### Is what they're describing actually happening?
-
-The best way to determine the validity of a bug is to recreate it yourself. Follow the directions or information provided to recreate the bug that is described. Did they provide a repository that demonstrates the bug? Great - fork it and run the project and steps required. If they didn't provide a repository, the best way to reproduce the issue is to have a 'sandbox' project up and running locally for Cypress. This is just a simple project with Cypress installed where you can freely edit the application under test and the tests themselves to recreate the problem.
-
-**Attempting to recreate the bug will lead to a few scenarios:**
-
-#### 1. You can't recreate the bug
-
- If you can't recreate the situation happening you should:
-
-- Thank them for their contribution.
-- Explain that there isn't enough information to reproduce the bug. Provide information on how you went about recreating the scenario, if you're able. Note your OS, Browser, Cypress version and any other information.
-- Note that if no reproducible example is provided, we will unfortunately have to close the issue.
-- Add the `stage: needs information` label to the issue.
-
-#### 2. You can recreate the bug
-
-If you can recreate the bug you should:
-
-- Thank them for their contribution.
-- Explain that you're able to recreate the bug. Provide the exact test code ran and the versions of Cypress, OS, and browser you used to recreate it.
-- If you know where the code is that could possibly fix this issue - link to the file or line of code from the [cypress](https://github.com/cypress-io/cypress) repo and remind the user that we are open source and that we gladly accept PRs, even if they are a work in progress.
-- Add the `stage: ready for work` label to the issue.
-
-#### 3. You can tell the problem is a user error
-
-In recreating the issue, you may realize that they had a typo or used the Cypress API incorrectly, etc. In this case you should:
-
-- Leave a comment informing the user of their error.
-- Link to relevant documentation, if there is any. If you notice repeated user errors for the same situation, add them into the [documentation](https://github.com/cypress-io/cypress-documentation) to avoid repeating yourself.
-- Close the issue.
-
-### Has the issue gone stale?
-
-Some issues are opened and sadly forgotten about by the person originally opening the issue.
-
-#### Not enough information ever provided
-
-Sometimes we request more information to be provided (label `stage: needs information`) for an open issue, but no one is able to provide a reproducible example or they simply never respond. **This does not mean that we don't believe that there is a bug!** We just, unfortunately, don't have a path forward to fix it without this information. In this case you should:
-
-- Add a comment reminding them or our request for more information and that the issue will be closed if it is not provided. Sometimes issues get forgotten about, and all the person needs is a gentle reminder.
-- If there is still no response after a weeks time, explain that you are closing the issue due to not enough information or inactivity and that they can comment in the issue with a reproducible example and we will reopen the issue.
-- Close the issue.
-
-#### They already solved their issue
-
-Some issues are resolved by the community, by giving some guidance or a workaround, but the original opener of the issue forgets to close the issue. In this case you should:
-
-- Explain that you are closing the issue as resolved and that they can comment if they are still having the issue and we will consider reopening it.
-- Close the issue.
## Writing Documentation
Cypress documentation lives in a separate repository with its own dependencies and build tools.
-See [Documentation Contributing Guideline](https://github.com/cypress-io/cypress-documentation/blob/master/CONTRIBUTING.md).
+See [Documentation Contributing Guidelines](https://github.com/cypress-io/cypress-documentation/blob/master/CONTRIBUTING.md).
## Writing code
@@ -252,29 +128,53 @@ Cypress is a large open source project. When you want to contribute to Cypress,
Cypress uses a monorepo, which means there are many independent packages in this repository. There are two main types of packages: private and public.
-Private packages generally live within the [`packages`](./packages) directory and are in the `@packages/` namespace. These packages are combined to form the main Cypress app that you get when you `npm install cypress`. They are discrete modules with different responsibilities, but each is necessary for the Cypress app and is not necessarily useful outside of the Cypress app. Since these modules are all compiled and bundled into a binary upon release, they are sometimes collectively referred to as the Cypress binary.
+Private packages included in the app generally live within the [`packages`](./packages) directory and are in the `@packages/` namespace. These packages are combined to form the main Cypress app that you get when you `npm install cypress`. They are discrete modules with different responsibilities, but each is necessary for the Cypress app and is not necessarily useful outside of the Cypress app. Since these modules are all compiled and bundled into a binary upon release, they are sometimes collectively referred to as the Cypress binary.
Here is a list of the core packages in this repository with a short description, located within the [`packages`](./packages) directory:
| Folder Name | Package Name | Purpose |
| :------------------------------------ | :---------------------- | :--------------------------------------------------------------------------- |
| [cli](./cli) | `cypress` | The command-line tool that is packaged as an `npm` module. |
+ | [app](./packages/app) | `@packages/app` | The front-end for the Cypress App that renders in the launched browser instance. |
+ | [config](./packages/config) | `@packages/config` | The Cypress configuration types and validation used in the server, data-context and driver. |
+ | [data-context](./packages/data-context) | `@packages/data-context` | Centralized data access for the Cypress application. |
| [driver](./packages/driver) | `@packages/driver` | The code that is used to drive the behavior of the API commands. |
| [electron](./packages/electron) | `@packages/electron` | The Cypress implementation of Electron. |
+ | [errors](./packages/errors) | `@packages/errors` | Error definitions and utilities for Cypress |
| [example](./packages/example) | `@packages/example` | Our example kitchen-sink application. |
| [extension](./packages/extension) | `@packages/extension` | The Cypress Chrome browser extension |
+ | [frontend-shared](./packages/frontend-shared) | `@packages/frontend-shared` | Shared components and styles used in the `app` and `launchpad`. |
+ | [graphql](./packages/graphql) | `@packages/graphql` | The GraphQL layer that the `launchpad` and `app` use to interact with the `server`. |
| [https-proxy](./packages/https-proxy) | `@packages/https-proxy` | This does https proxy for handling http certs and traffic. |
+ | [icons](./packages/icons) | `@packages/icons` | The Cypress icons. |
+ | [launcher](./packages/launcher) | `@packages/launcher` | Finds and launches browsers installed on your system. |
+ | [launchpad](./packages/launchpad) | `@packages/launcher` | The portal to running Cypress that displays in `open` mode. |
| [net-stubbing](./packages/net-stubbing) | `@packages/net-stubbing` | Contains server side code for Cypress' network stubbing features. |
| [network](./packages/network) | `@packages/network` | Various utilities related to networking. |
+ | [packherd-require](./packages/packherd-require) | `@packages/packherd-require` | Loads modules that have been bundled by `@tooling/packherd`. |
| [proxy](./packages/proxy) | `@packages/proxy` | Code for Cypress' network proxy layer. |
- | [launcher](./packages/launcher) | `@packages/launcher` | Finds and launches browsers installed on your system. |
| [reporter](./packages/reporter) | `@packages/reporter` | The reporter shows the running results of the tests (The Command Log UI). |
+ | [resolve-dist](./packages/resolve-dist) | `@packages/resolve-dist` | Centralizes the resolution of paths to compiled/static assets from server-side code.. |
+ | [rewriter](./packages/rewriter) | `@packages/rewriter` | The logic to rewrite JS and HTML that flows through the Cypress proxy.
| [root](./packages/root) | `@packages/root` | Dummy package pointing at the root of the repository. |
- | [runner](./packages/runner) | `@packages/runner` | The runner is the minimal "chrome" around the user's application under test. |
+ | [runner](./packages/runner) | `@packages/runner` | (deprecated) The runner is the minimal "chrome" around the user's application under test. |
+ | [scaffold-config](./packages/scaffold-config) | `@packages/scaffold-config` | The logic related to scaffolding new projects using launchpad. |
| [server](./packages/server) | `@packages/server` | The <3 of Cypress. This orchestrates everything. The backend node process. |
- | [server-ct](./packages/server-ct) | `@packages/server-ct` | Some Component Testing specific overrides. Mostly extends functionality from `@packages/server` |
| [socket](./packages/socket) | `@packages/socket` | A wrapper around socket.io to provide common libraries. |
| [ts](./packages/ts) | `@packages/ts` | A centralized version of typescript. |
+ | [types](./packages/types) | `@packages/types` | The shared internal Cypress types. |
+ | [v8-snapshot-require](./packages/v8-snapshot-require) | `@packages/v8-snapshot-require` | Tool to load a snapshot for Electron applications that was created by `@tooling/v8-snapshot`. |
+ | [web-config](./packages/web-config) | `@packages/web-config` | The web-related configuration. |
+
+Private packages involved in development of the app live within the [`tooling`](./tooling) directory and are in the `@tooling/` namespace. They are discrete modules with different responsibilities, but each is necessary for development of the Cypress app and is not necessarily useful outside of the Cypress app.
+
+Here is a list of the packages in this repository with a short description, located within the [`tooling`](./tooling) directory:
+
+ | Folder Name | Package Name | Purpose |
+ | :------------------------------------ | :---------------------- | :--------------------------------------------------------------------------- |
+ | [electron-mksnapshot](./electron-mksnapshot) | `electron-mksnapshot` | A rewrite of [electron/mksnapshot](https://github.com/electron/mksnapshot) to support multiple versions. |
+ | [packherd](./tooling/packherd) | `packherd` | Herds all dependencies reachable from an entry and packs them. |
+ | [v8-snapshot](./tooling/v8-snapshot) | `v8-snapshot` | Tool to create a snapshot for Electron applications. |
Public packages live within the [`npm`](./npm) folder and are standalone modules that get independently published to npm under the `@cypress/` namespace. These packages generally contain extensions, plugins, or other packages that are complementary to, yet independent of, the main Cypress app.
@@ -283,16 +183,20 @@ Here is a list of the npm packages in this repository:
| Folder Name | Package Name | Purpose |
| :----------------------------------------------------- | :--------------------------------- | :--------------------------------------------------------------------------- |
| [angular](./npm/angular) | `@cypress/angular` | Cypress component testing for Angular. |
- | [create-cypress-tests](./npm/create-cypress-tests) | `@cypress/create-cypress-tests` | Tooling to scaffold Cypress configuration and demo test files. |
+ | [angular signals](./npm/angular-signals) | `@cypress/angular-signals` | Cypress component testing for Angular 17/18 including support for signals. |
| [eslint-plugin-dev](./npm/eslint-plugin-dev) | `@cypress/eslint-plugin-dev` | Eslint plugin for internal development. |
+ | [grep](./npm/grep) | `@cypress/grep` | Filter tests using substring |
| [mount-utils](./npm/mount-utils) | `@cypress/mount-utils` | Common functionality for Vue/React/Angular adapters. |
| [react](./npm/react) | `@cypress/react` | Cypress component testing for React. |
| [react18](./npm/react18) | `@cypress/react18` | Cypress component testing for React 18. |
+ | [schematic](./npm/cypress-schematic) | `@cypress/schematic` | Official Angular Schematic and Builder for the Angular CLI.|
+ | [svelte](./npm/svelte) | `@cypress/svelte` | Cypress component testing for Svelte. |
| [vite-dev-server](./npm/vite-dev-server) | `@cypress/vite-dev-server` | Vite powered dev server for Component Testing. |
- | [webpack-preprocessor](./npm/webpack-preprocessor) | `@cypress/webpack-preprocessor` | Cypress preprocessor for bundling JavaScript via webpack. |
- | [webpack-dev-server](./npm/webpack-dev-server) | `@cypress/webpack-dev-server` | Webpack powered dev server for Component Testing. |
| [vue](./npm/vue) | `@cypress/vue` | Cypress component testing for Vue 3. |
| [vue2](./npm/vue2) | `@cypress/vue2` | Cypress component testing for Vue 2. |
+ | [webpack-batteries-included-preprocessor](./npm/webpack-batteries-included-preprocessor) | `@cypress/webpack-batteries-included-preprocessor` | Cypress preprocessor for bundling JavaScript via webpack with dependencies included and support for various ES features, TypeScript, and CoffeeScript. |
+ | [webpack-dev-server](./npm/webpack-dev-server) | `@cypress/webpack-dev-server` | Webpack powered dev server for Component Testing. |
+ | [webpack-preprocessor](./npm/webpack-preprocessor) | `@cypress/webpack-preprocessor` | Cypress preprocessor for bundling JavaScript via webpack. |
We try to tag all issues with a `pkg/` or `npm/` tag describing the appropriate package the work is required in. For public packages, we use their qualified package name: For example, issues relating to the webpack preprocessor are tagged under [`npm: @cypress/webpack-preprocessor`](https://github.com/cypress-io/cypress/labels/npm%3A%20%40cypress%2Fwebpack-preprocessor) label and issues related to the `driver` package are tagged with the [`pkg/driver`](https://github.com/cypress-io/cypress/labels/pkg%2Fdriver) label.
@@ -300,9 +204,35 @@ We try to tag all issues with a `pkg/` or `npm/` tag describing the appropriate
You must have the following installed on your system to contribute locally:
-- [`Node.js`](https://nodejs.org/en/) (See the root [.node-version](.node-version) file for minimum version requirements. You can use [avn](https://github.com/wbyoung/avn) to automatically switch to the right version of Node.js for this repo.)
+- [`Node.js`](https://nodejs.org/en/) (See the root [.node-version](.node-version) file for the required version. You can find a list of tools on [node-version-usage](https://github.com/shadowspawn/node-version-usage) to switch the version of [`Node.js`](https://nodejs.org/en/) based on [.node-version](.node-version).)
- [`yarn`](https://yarnpkg.com/en/docs/install)
-- [`python`](https://www.python.org/downloads/) (since we use `node-gyp`. See their [repo](https://github.com/nodejs/node-gyp) for Python version requirements.)
+- [`python`](https://www.python.org/downloads/) (since we use `node-gyp`. See their [repo](https://github.com/nodejs/node-gyp) for Python version requirements. Use Python `3.11` or lower.)
+
+#### Debian/Ubuntu
+
+`sudo apt install g++ make` meets the additional requirements to run `node-gyp` in the context of building Cypress from source.
+`python` is pre-installed on Debian-based systems including Ubuntu.
+The Python versions shipped with Ubuntu versions `20.04`, `23.10` and `22.04` are compatible with Cypress requirements.
+
+Only on Ubuntu `24.04` install Python `3.11` by executing the following commands:
+
+```shell
+sudo add-apt-repository ppa:deadsnakes/ppa
+sudo apt update
+sudo apt install python3.11
+```
+
+Add the environment variable `NODE_GYP_FORCE_PYTHON` to `~/.bashrc`:
+
+```shell
+export NODE_GYP_FORCE_PYTHON=/usr/bin/python3.11
+```
+
+For Ubuntu `24.04` refer also to the [Release notes](https://discourse.ubuntu.com/t/noble-numbat-release-notes/39890) in the section [Unprivileged user namespace restrictions](https://discourse.ubuntu.com/t/noble-numbat-release-notes/39890#unprivileged-user-namespace-restrictions-15) and apply one of the workarounds to disable unprivileged user namespace restrictions for the entire system, either for one boot or persistently, as described. If you do not do this you may receive an error which includes the text `FATAL:setuid_sandbox_host.cc` when you try to run Cypress on this version of Ubuntu after building Cypress from source.
+
+#### Windows
+
+When installing the Visual Studio C++ environment recommended by [node-gyp](https://github.com/nodejs/node-gyp), install also a Windows 10 SDK. The currently used version of `node-gyp` may otherwise fail to recognise the Visual Studio installation.
### Getting Started
@@ -333,12 +263,14 @@ If there are errors building the packages, prefix the commands with `DEBUG=cypre
When running `yarn start` this routes through the CLI and eventually calls `yarn dev` with the proper arguments. This enables Cypress day-to-day development to match the logic of the built binary + CLI integration.
-If you want to bypass the CLI entirely, you can use the `yarn dev` task and pass arguments directly. For example, to headlessly run a project in a given folder, while trying to record to the Dashboard
+CLI flags can be passed to `yarn` targets to control application behavior when running locally. For example, to headlessly run a project in a given folder, while trying to record to Cypress Cloud:
```text
-yarn dev --run-project /project/folder --record --key
+yarn cypress:run --project /project/folder --record --key
```
+Alternatively, you can run `yarn dev` at the root of this repository to bypass the CLI. This will launch "global" mode, where you can then select a project.
+
#### Adding new Dependencies
⚠️ There is a [bug in yarn](https://github.com/yarnpkg/yarn/issues/7734) that may cause issues adding a new dependency to a workspace. You can avoid this by downgrading yarn to 1.19.1 (temporarily downgrade using `npx yarn@1.19.1 workspace @packages/server add my-new-dep1`).
@@ -413,13 +345,13 @@ Each package is responsible for building itself and testing itself and can do so
When executing top or package level scripts, [Vite](https://vitejs.dev/) may be used to build/host parts of the application. This section is to serve as a general reference for these environment variables that may be leverage throughout the repository.
###### `CYPRESS_INTERNAL_VITE_DEV`
Set to `1` if wanting to leverage [vite's](https://vitejs.dev/guide/#command-line-interface) `vite dev` over `vite build` to avoid a full [production build](https://vitejs.dev/guide/build.html).
-###### `CYPRESS_INTERNAL_VITE_INSPECT`
+###### `CYPRESS_INTERNAL_VITE_INSPECT`
Used internally to leverage [vite-plugin-inspect](https://github.com/antfu/vite-plugin-inspect) to view intermediary vite plugin state. The `CYPRESS_INTERNAL_VITE_DEV` is required for this to be applied correctly. Set to `1` to enable.
-###### `CYPRESS_INTERNAL_VITE_OPEN_MODE_TESTING`
+###### `CYPRESS_INTERNAL_VITE_OPEN_MODE_TESTING`
Leveraged only for internal cy-in-cy type tests to access the Cypress instance from the parent frame. Please see the [E2E Open Mode Testing](./guides/e2e-open-testing.md) Guide. Set to `true` when doing
-###### `CYPRESS_INTERNAL_VITE_APP_PORT`
+###### `CYPRESS_INTERNAL_VITE_APP_PORT`
Leveraged only when `CYPRESS_INTERNAL_VITE_DEV` is set to spawn the vite dev server for the app on the specified port. The default port is `3333`.
-###### `CYPRESS_INTERNAL_VITE_LAUNCHPAD_PORT`
+###### `CYPRESS_INTERNAL_VITE_LAUNCHPAD_PORT`
Leveraged only when `CYPRESS_INTERNAL_VITE_DEV` is set to spawn the vite dev server for the launchpad on the specified port. The default port is `3001`.
#### Debug Logs
@@ -428,16 +360,10 @@ Many Cypress packages print out debugging information to console via the `debug`
### Coding Style
We use [eslint](https://eslint.org/) to lint all JavaScript code and follow rules specified in
-[@cypress/eslint-plugin-dev](./npm/eslint-plugin-cypress) plugin.
-
-When you edit files, you can quickly fix all changed files before you commit using
-
-```bash
-$ yarn lint-changed --fix
-```
+[@cypress/eslint-plugin-dev](./npm/eslint-plugin-dev) plugin.
-When committing files, we run a Git pre-commit hook to lint the staged JS files. See the [`lint-staged` project](https://github.com/okonet/lint-staged).
-If this command fails, you may need to run `yarn lint-changed --fix` and commit those changes.
+This project uses a Git pre-commit hook to lint staged files before committing. See the [`lint-staged` project](https://github.com/okonet/lint-staged) for details.
+`lint-staged` will try to auto-fix any lint errors with `eslint --fix`, so if it fails, you must manually fix the lint errors before committing.
We **DO NOT** use Prettier to format code. You can find [.prettierignore](.prettierignore) file that ignores all files in this repository. To ensure this file is loaded, please always open _the root repository folder_ in your text editor, otherwise your code formatter might execute, reformatting lots of source files.
@@ -453,7 +379,7 @@ This is to ensure that links do not go dead in older versions of Cypress when th
### Tests
-For most packages there are typically unit and integration tests.
+For most packages there are typically unit and integration tests. For UI packages there are E2E and component tests.
Please refer to each packages' `README.md` which documents how to run tests. It is not feasible to try to run all of the tests together. We run our entire test fleet across over a dozen containers in CI.
@@ -461,7 +387,9 @@ There are also a set of system tests in [`system-tests`](system-tests) which att
Additionally, we test the code by running it against various other example projects in CI. See CI badges and links at the top of this document.
-If you're curious how we manage all of these tests in CI check out our [`circle.yml`](circle.yml) file found in the root `cypress` directory.
+If you're curious how we manage all of these tests in CI check out our [CircleCI config](.circleci/config.yml).
+
+Some of our test jobs in CircleCI require access to environment variables that are sensitive and are restricted to Cypress maintainers only. If you are not a Cypress maintainer, when your CI job runs, only a subset of jobs will run at first. A Cypress maintainer will need to approve the `contributor-pr` job in your workflow in order for your CI pipeline to complete.
#### Docker
@@ -474,7 +402,7 @@ Sometimes tests pass locally, but fail in CI. Our CI environment is dockerized.
$ yarn docker
```
-There is a script [scripts/run-docker-local.sh](scripts/run-docker-local.sh) that runs the cypress image (see [circle.yml](circle.yml) for the current image name).
+There is a script [scripts/run-docker-local.sh](scripts/run-docker-local.sh) that runs the cypress image (see [CircleCI config](.circleci/config.yml) for the current image name).
The image will start and will map the root of the repository to `/cypress` inside the image. Now you can modify the files using your favorite environment and rerun tests inside the docker environment.
@@ -496,54 +424,89 @@ $ yarn add https://cdn.cypress.io/beta/npm/.../cypress.tgz
Note that unzipping the Linux binary inside a Docker container onto a mapped volume drive is *slow*. But once this is done you can modify the application resource folder in the local folder `/tmp/test-folder/node_modules/cypress/cypress-cache/3.3.0/Cypress/resources/app` to debug issues.
-### Packages
+#### Docker as a performance constrained environment
-Generally when making contributions, you are typically making them to a small number of packages. Most of your local development work will be inside a single package at a time.
+Sometimes performance issues are easier to reproduce in performance constrained environments. A docker container can be a good way to simulate this locally and allow for quick iteration.
-Each package documents how to best work with it, so consult the `README.md` of each package.
+In a fresh cypress repository run the following command:
-They will outline development and test procedures. When in doubt just look at the `scripts` of each `package.json` file. Everything we do at Cypress is contained there.
+```shell
+docker compose run --service-port dev
+```
-## Committing Code
+This will spin up a docker container based off cypress/browsers:latest and start up the bash terminal. From here you can yarn install and develop as normal, although slower. It's recommend that you run this in a fresh repo because node modules may differ between an install on your local device and from within a linux docker image.
-### Branches
+Ports 5566 and 5567 are available to attach debuggers to, please note that docker compose run only maps ports if the `--service-port` command is used.
-The repository is setup with two main (protected) branches.
+### Packages
-- `master` is the code already published, both for the main Cypress app and independent npm packages.
-- `develop` is the current latest "pre-release" code. This branch is set as the default branch, and all pull requests that update the main Cypress binary should be made against this branch.
+Generally when making contributions, you are typically making them to a small number of packages. Most of your local development work will be inside a single package at a time.
-In general, we want to publish our [standalone npm packages](./npm) continuously as new features are added. Therefore, any pull requests that only change independent `@cypress/` packages in the [`npm`](./npm) directory should be made directly off the `master` branch. We use [`semantic-release`](https://semantic-release.gitbook.io/semantic-release/) to automatically publish these packages to npm when a PR is merged directly into master.
+Each package documents how to best work with it, so consult the `README.md` of each package.
-When updating the main Cypress app, pull requests should be made against the `develop` branch. We do not continuously deploy the Cypress binary, so `develop` contains all of the new features and fixes that are staged to go out in the next update of the main Cypress app. In addition, if you make changes to an npm package that can't be published until the binary is also updated, you should make a pull request against the `develop` branch.
+They will outline development and test procedures. When in doubt just look at the `scripts` of each `package.json` file. Everything we do at Cypress is contained there.
-Essentially, if you only change files within the [`npm`](./npm) folder, then you should make a pull request against `master`. Otherwise, make it against `develop`.
+## Committing Code
-All updates to `master` are automatically merged into `develop`, so `develop` always has the latest version of every package.
+### Branches
-#### Workflow Diagrams
+The repository has one protected branch:
-
-
-
+- `develop` contains the current latest "pre-release" code for the Cypress app and contains the already published code of all [standalone npm packages](./npm) Cypress maintains. This branch is set as the default branch, and all pull requests should be made against this branch.
-### Independent Packages CI Workflow
+We want to publish our [standalone npm packages](./npm) continuously as new features are added. Therefore, after any pull request that changes independent `@cypress/` packages in the [`npm`](./npm) directory will automatically publish when a PR is merged directly into `develop` and the entire build passes. We used [`semantic-release`](https://semantic-release.gitbook.io/semantic-release/) to automate the release of these packages to npm.
-Independent packages are automatically released when code is merged into `master` and the entire build passes.
+We do not continuously deploy the Cypress binary, so `develop` contains all of the new features and fixes that are staged to go out in the next update of the main Cypress app. If you make changes to an npm package that can't be published until the binary is also updated, the pull request should clearly state that it should not be merged until the next scheduled Cypress app release date.
### Pull Requests
- Break down pull requests into the smallest necessary parts to address the original issue or feature. This helps you get a timely review and helps the reviewer clearly understand which pieces of the code changes are relevant.
- When opening a PR for a specific issue already open, please name the branch you are working on using the convention `issue-[issue number]`. For example, if your PR fixes Issue #803, name your branch `issue-803`. If the PR is a larger issue, you can add more context like `issue-803-new-scrollable-area`. If there's not an associated open issue, **[create an issue](https://github.com/cypress-io/cypress/issues/new/choose)**.
-- PR's can be opened before all the work is finished. In fact we encourage this! Please create a [Draft Pull Request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests#draft-pull-requests) if your PR is not ready for review. [Mark the PR as **Ready for Review**](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/changing-the-stage-of-a-pull-request#marking-a-pull-request-as-ready-for-review) when you're ready for a Cypress team member to review the PR.
-- Prefix the title of the Pull Request using [semantic-release](https://github.com/semantic-release/semantic-release)'s format as defined [here](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#type). For example, if your PR is fixing a bug, you should prefix the PR title with `fix:`.
-- Fill out the [Pull Request Template](./.github/PULL_REQUEST_TEMPLATE.md) completely within the body of the PR. If you feel some areas are not relevant add `N/A` as opposed to deleting those sections. PR's will not be reviewed if this template is not filled in.
-- If the PR is a user facing change and you're a Cypress team member that has logged into [ZenHub](https://www.zenhub.com/) and downloaded the [ZenHub for GitHub extension](https://www.zenhub.com/extension), set the release the PR is intended to ship in from the sidebar of the PR. Follow semantic versioning to select the intended release. This is used to generate the changelog for the release. If you don't tag a PR for release, it won't be mentioned in the changelog.
- 
+- PRs can be opened before all the work is finished. In fact we encourage this! Please create a [Draft Pull Request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests#draft-pull-requests) if your PR is not ready for review. [Mark the PR as **Ready for Review**](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/changing-the-stage-of-a-pull-request#marking-a-pull-request-as-ready-for-review) when you're ready for a Cypress team member to review the PR.
+- Prefix the title of the Pull Request using [semantic-release](https://github.com/semantic-release/semantic-release)'s format using one of the following definitions. Once committed to develop, this prefix will determine the appropriate 'next version' of Cypress or the corresponding npm module.
+ - Changes has user-facing impact:
+ - `breaking` - A breaking change that will require a MVB
+ - `dependency` - A change to a dependency that impact the user
+ - `deprecation` - An API deprecation notice for users
+ - `feat` - A new feature
+ - `fix` - A bug fix or regression fix.
+ - `misc` - a misc user-facing change, like a UI update which is not a fix or enhancement to how Cypress works
+ - `perf` - A code change that improves performance
+ - Changes that improves the codebase or system but has no user-facing impact:
+ - `chore` - Changes to the build process or auxiliary tools and libraries such as documentation generation
+ - `docs` - Documentation only changes
+ - `refactor` - A code change that neither fixes a bug nor adds a feature
+ - `revert` - Reverts a previous commit
+ - `test` - Adding missing or correcting existing tests
+- For user-facing changes that will be released with the next Cypress version, be sure to add a changelog entry to the appropriate section in [`cli/CHANGELOG.md`](./cli/CHANGELOG.md). See [Writing the Cypress Changelog Guide](./guides/writing-the-cypress-changelog.md) for more details.
+- Fill out the [Pull Request Template](./.github/PULL_REQUEST_TEMPLATE.md) completely within the body of the PR. If you feel some areas are not relevant add `N/A` as opposed to deleting those sections. PRs will not be reviewed if this template is not filled in.
- 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.

+- All Pull Requests require a minimum of **two** approvals.
- 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.*
+- 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 exceptions to squashing are:*
+
+1. When converting files to another language and there is a clear commit history needed to maintain from the file conversion.
+2. When merging a `release/*` branch to `develop`. Individual PRs were already squashed when they were merged to the release branch, and we want that history intact on develop.
+
+### Write Some Tests
+
+If you are adding a new feature or fixing a regression, ensure you add tests for it. Broadly speaking, there are four categories of tests you might consider:
+
+1. Unit tests. Those are inside of `test/unit`, if the package has them. These are the fastest and cheapest to execute.
+2. Component Tests. These are co-located with components in the `src` directory of UI-related packages. These test individual UI components in isolation. They can exhaustively test all expected variations of a component and are faster than E2E tests.
+3. E2E/Integration tests. Those are inside `cypress/e2e`, if the package has them. These are between Unit Tests and System Tests when it comes to speed of execution.
+4. System tests. Those go in the [`system-tests`](https://github.com/cypress-io/cypress/tree/develop/system-tests) directory. The README explains how they work. These are the slowest to run, so you generally only want to add a system-test if it's absolutely required (but don't let that discourage you; they are also the most realistic way to test Cypress).
+
+When choosing what's most appropriate, consider:
+
+- ease of understanding
+- ease of debugging
+- resilience to refactoring
+
+It is also worth considering when a failure will be noticed. A unit or component test is likely to be run while the related code is being modified and provides very fast feedback. E2E tests and System Tests are more likely to only fail in CI since they are slower to run.
### Dependencies
@@ -600,10 +563,6 @@ Below are guidelines to help during code review. If any of the following require
- [ ] There is no irrelevant code to the issue being addressed. If there is, ask the contributor to break the work out into a separate PR.
- [ ] Tests are testing the code's intended functionality in the best way possible.
-#### Internal
-
-- [ ] The original issue has been tagged with a release in ZenHub.
-
### Code Review of Dependency Updates
Below are some guidelines Cypress uses when reviewing dependency updates.
@@ -618,14 +577,15 @@ Below are some guidelines Cypress uses when reviewing dependency updates.
- [ ] Code using the dependency has been updated to accommodate any breaking changes
- [ ] The dependency still supports the version of Node that the package requires.
-- [ ] The PR been tagged with a release in ZenHub.
- [ ] Appropriate labels have been added to the PR (for example: label `type: breaking change` if it is a breaking change)
-## Deployment
+## Releases
+
+[Standalone npm packages](./npm) are deployed immediately when a PR is merged into `develop` and the entire build passes.
-We will try to review and merge pull requests quickly. If you want to know our build process or build your own Cypress binary, read [the "Release Process" guide](./guides/release-process.md).
+The Cypress app is typically released every two weeks. All PRs merged to `develop` will build a "pre-released" Cypress app which can be installed to verify or leverage your changes before the scheduled release. Read these instructions for [installing pre-release versions](https://docs.cypress.io/guides/references/advanced-installation#Install-pre-release-version).
-Independent packages are deployed immediately upon being merged into master. You can read more [above](#independent-packages-ci-workflow).
+If you want to know our build process or build your own Cypress binary, read [the "Release Process" guide](./guides/release-process.md).
## Known problems
diff --git a/LICENSE b/LICENSE
index 4ce6792e2a7..c7379e8b1d0 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2021 Cypress.io
+Copyright (c) 2023 Cypress.io
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index d10a7089342..b1eee75c8f6 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
-
+
@@ -21,15 +21,15 @@
Fast, easy and reliable testing for anything that runs in a browser.