diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index e788e533297c..7bc04283e6be 100644 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -66,6 +66,9 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters 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 @@ -161,6 +164,16 @@ commands: 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: @@ -593,7 +606,7 @@ commands: 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) + TESTFILES=$(find src -regextype posix-extended -name '*.cy.*' -not -regex '.*(FileMatch|PromoAction|SelectorPlayground|useDurationFormat|useTestingType|SpecPatterns|DebugPendingRunCounts|DebugRunStates|DebugPageHeader|DebugPendingRunSplash|DebugRunNavigation|DebugRunNavigationLimitMessage).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) @@ -1645,6 +1658,7 @@ jobs: docker_layer_caching: true resource_class: medium steps: + - maybe_skip_binary_jobs - run-binary-system-tests system-tests-chrome: @@ -2087,6 +2101,7 @@ jobs: default: xlarge resource_class: << parameters.resource_class >> steps: + - maybe_skip_binary_jobs - restore_cached_workspace - check-if-binary-exists - setup_should_persist_artifacts @@ -2102,6 +2117,7 @@ jobs: default: large resource_class: << parameters.resource_class >> steps: + - maybe_skip_binary_jobs - restore_cached_workspace - run: name: Check pipeline info @@ -2243,6 +2259,7 @@ jobs: docker: - image: cypress/base-internal:18.15.0 steps: + - maybe_skip_binary_jobs - restore_workspace_binaries - run: mkdir test-binary - run: @@ -2279,6 +2296,7 @@ jobs: <<: *defaults resource_class: small steps: + - maybe_skip_binary_jobs - restore_workspace_binaries - run: mkdir <> - run: @@ -2318,6 +2336,7 @@ jobs: <<: *defaults resource_class: small steps: + - maybe_skip_binary_jobs - restore_workspace_binaries - run: mkdir <> - run: @@ -2412,6 +2431,7 @@ jobs: test-binary-against-kitchensink: <<: *defaults steps: + - maybe_skip_binary_jobs - test-binary-against-repo: repo: cypress-example-kitchensink browser: electron @@ -2474,6 +2494,7 @@ jobs: test-binary-as-specific-user: <<: *defaults steps: + - maybe_skip_binary_jobs - restore_workspace_binaries # the user should be "node" - run: whoami @@ -2827,15 +2848,396 @@ linux-x64-workflow: &linux-x64-workflow 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:poll-circle-workflow, test-runner:percy] + required_env_var: PERCY_TOKEN # skips job if not defined (external PR) + requires: + - contributor-pr + - 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-react: + requires: + - build + - npm-angular: + requires: + - build + - npm-mount-utils: + requires: + - build + - npm-create-cypress-tests: + requires: + - build + - npm-eslint-plugin-dev: + requires: + - build + - npm-cypress-schematic: + requires: + - build + - v8-integration-tests: + requires: + - system-tests-node-modules-install + # This release definition must be updated with any new jobs + # Any attempts to automate this are welcome + # If CircleCI provided an "after all" hook, then this wouldn't be necessary + - trigger-binary-release-workflow: + context: test-runner:poll-circle-workflow + requires: + - build + - check-ts + - npm-angular + - npm-eslint-plugin-dev + - npm-create-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-memory-tests + - system-tests-non-root + - system-tests-firefox + - system-tests-electron + - system-tests-chrome + - 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 + - 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 + - v8-integration-tests + + - npm-release: + context: test-runner:npm-release + requires: + - build + - check-ts + - npm-angular + - npm-eslint-plugin-dev + - npm-create-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-memory-tests + - system-tests-non-root + - system-tests-firefox + - system-tests-electron + - system-tests-chrome + - server-performance-tests + - server-integration-tests + - server-unit-tests + - test-kitchensink + - unit-tests + - verify-release-readiness + - 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 + - v8-integration-tests + + - 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: + 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: @@ -2879,13 +3281,16 @@ linux-x64-workflow: &linux-x64-workflow - 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 @@ -2907,11 +3312,7 @@ linux-arm64-workflow: &linux-arm64-workflow - 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 + context: [test-runner:upload, test-runner:commit-status-checks, test-runner:build-binary, publish-binary] executor: linux-arm64 resource_class: arm.medium requires: @@ -2925,9 +3326,7 @@ linux-arm64-workflow: &linux-arm64-workflow - get-published-artifacts: name: linux-arm64-get-published-artifacts - context: - - publish-binary - - test-runner:commit-status-checks + context: [publish-binary, test-runner:commit-status-checks] executor: linux-arm64 resource_class: arm.medium requires: @@ -3132,6 +3531,12 @@ 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 @@ -3143,4 +3548,4 @@ workflows: <<: *darwin-workflow-filters windows: <<: *windows-workflow - <<: *windows-workflow-filters + <<: *windows-workflow-filters \ No newline at end of file diff --git a/.github/workflows/report_weekly_app_kpis.yml b/.github/workflows/report_weekly_app_kpis.yml deleted file mode 100644 index de727b058be5..000000000000 --- a/.github/workflows/report_weekly_app_kpis.yml +++ /dev/null @@ -1,123 +0,0 @@ -name: 'KPI Report Generation' -on: - # makes this workflow reusable - workflow_call: - secrets: - TRIAGE_BOARD_TOKEN: - required: true - - workflow_dispatch: - inputs: - start-date: - description: 'Beginning date of query (ex. 2023-06-01)' - required: false - end-date: - description: 'Ending date of query (ex. 2023-06-01)' - required: false - default-other-repos: - description: "Comma separated list of repos you want to query" - required: false - default: '["cypress-documentation", "circleci-orb", "github-action", "cypress-docker-images", "cypress-chrome-recorder-extension", "cypress-chrome-recorder", "cypress-recorder-extension", "cypress-example-kitchensink", "cypress-origin-providers", "release-automations", "cypress-test-tiny", "eslint-plugin-cypress", "netlify-plugin-cypress", "cypress-support-internal", "cypress-realworld-app", "code-coverage"]' - default-mono-repo: - description: "The Cypress mono repo" - required: false - default: '["cypress"]' - - schedule: - - cron: '0 18 * * 5' # this will run weekly on Friday at 2PM EST (the github workflow runners are on UTC) - -jobs: - run-kpi-reporting: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - repository: 'cypress-io/release-automations' - ref: 'master' - ssh-key: ${{ secrets.WORKFLOW_DEPLOY_KEY }} - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: 'lts/*' - - name: Generate Non-mono Repo Open / Closed KPIs - id: non-mono-repo-open-closed-metrics - uses: actions/github-script@v6 - env: - DEFAULT_REPOS: ${{ github.event.inputs.default-other-repos || '["cypress-documentation", "circleci-orb", "github-action", "cypress-docker-images", "cypress-chrome-recorder-extension", "cypress-chrome-recorder", "cypress-recorder-extension", "cypress-example-kitchensink", "cypress-origin-providers", "release-automations", "cypress-test-tiny", "eslint-plugin-cypress", "netlify-plugin-cypress", "cypress-support-internal", "cypress-realworld-app", "code-coverage"]' }} - with: - github-token: ${{ secrets.TRIAGE_BOARD_TOKEN }} - script: | - const script = require('./scripts/reports/open-vs-closed-issues.js') - await script.getOpenAndClosedIssueMetrics(github, context, core, ${{ env.DEFAULT_REPOS }}); - - name: Generate Cypress Mono Repo Open / Closed KPIs - id: mono-repo-open-closed-metrics - uses: actions/github-script@v6 - env: - DEFAULT_MONO_REPO: ${{ github.event.inputs.default-mono-repo || '["cypress"]' }} - with: - github-token: ${{ secrets.TRIAGE_BOARD_TOKEN }} - script: | - const script = require('./scripts/reports/open-vs-closed-issues.js') - await script.getOpenAndClosedIssueMetrics(github, context, core, ${{ env.DEFAULT_MONO_REPO }}); - - name: Generate Triage Throughput KPIs - id: triage-metrics - uses: actions/github-script@v6 - env: - START_DATE: ${{ github.event.inputs.start-date }} - END_DATE: ${{ github.event.inputs.end-date }} - PROJECT_BOARD_NUMBER: 9 - with: - github-token: ${{ secrets.TRIAGE_BOARD_TOKEN }} - script: | - const script = require('./scripts/reports/triage_throughput_kpis.js') - await script.getTriageIssueMetrics(github, context, core, "${{ env.START_DATE }}", "${{ env.END_DATE }}", "${{ env.PROJECT_BOARD_NUMBER }}"); - - name: Generate Mitigation KPIs - id: mitigation-metrics - uses: actions/github-script@v6 - env: - START_DATE: ${{ github.event.inputs.start-date }} - END_DATE: ${{ github.event.inputs.end-date }} - PROJECT_BOARD_NUMBER: 9 - with: - github-token: ${{ secrets.TRIAGE_BOARD_TOKEN }} - script: | - const script = require('./scripts/reports/triage_mitigation_kpis.js') - await script.getIssueMitigationMetrics(github, context, core, "${{ env.START_DATE }}", "${{ env.END_DATE }}", "${{ env.PROJECT_BOARD_NUMBER }}"); - - name: Generate Feature Request KPIs - id: feature-metrics - uses: actions/github-script@v6 - env: - START_DATE: ${{ github.event.inputs.start-date }} - END_DATE: ${{ github.event.inputs.end-date }} - PROJECT_BOARD_NUMBER: 9 - with: - github-token: ${{ secrets.TRIAGE_BOARD_TOKEN }} - script: | - const script = require('./scripts/reports/triage_feature_requests_metrics.js') - await script.getFeatureRequestMetrics(github, context, core, "${{ env.START_DATE }}", "${{ env.END_DATE }}", "${{ env.PROJECT_BOARD_NUMBER }}"); - - name: Generate Feature Review KPIs - id: feature-review-metrics - uses: actions/github-script@v6 - env: - START_DATE: ${{ github.event.inputs.start-date }} - END_DATE: ${{ github.event.inputs.end-date }} - PROJECT_BOARD_NUMBER: 9 - with: - github-token: ${{ secrets.TRIAGE_BOARD_TOKEN }} - script: | - const script = require('./scripts/reports/triage_feature_review_metrics.js') - await script.getFeatureReviewMetrics(github, context, core, "${{ env.START_DATE }}", "${{ env.END_DATE }}", "${{ env.PROJECT_BOARD_NUMBER }}"); - - name: Generate KPI Report - id: generate-report - uses: actions/github-script@v6 - env: - START_DATE: ${{ github.event.inputs.start-date }} - END_DATE: ${{ github.event.inputs.end-date }} - PROJECT_BOARD_NUMBER: 9 - with: - github-token: ${{ secrets.TRIAGE_BOARD_TOKEN }} - script: | - const script = require('./scripts/reports/generate_kpi_report.js') - await script.generateKPIReport(github, context, core, ${{ steps.non-mono-repo-open-closed-metrics.outputs.results }}, ${{ steps.mono-repo-open-closed-metrics.outputs.results }}, ${{ steps.triage-metrics.outputs.results }}, ${{ steps.mitigation-metrics.outputs.results }}, ${{ steps.feature-metrics.outputs.results }}, ${{ steps.feature-review-metrics.outputs.results }} ); - \ No newline at end of file diff --git a/.github/workflows/trigger_circleci.yml b/.github/workflows/trigger_circleci.yml deleted file mode 100644 index 1386ec551beb..000000000000 --- a/.github/workflows/trigger_circleci.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: "Trigger CircleCi Pipeline" - -on: - pull_request_target: - types: - - opened - - ready_for_review - -jobs: - main: - name: Trigger CircleCi Pipeline when PR is ready for review - runs-on: ubuntu-latest - steps: - - if: ${{ github.event.pull_request.draft == false }} - shell: bash - env: - CIRCLE_TOKEN: ${{ secrets.CIRCLE_TOKEN }} - BASE_ORG_AND_REPO: ${{ github.event.pull_request.head.full_name }} - PULL_ID: ${{ github.event.pull_request.number }} - run: | - if [[ "${CIRCLE_TOKEN}" == "" ]]; then - echo "The CIRCLE_TOKEN is unset. Cannot trigger pipeline..." - exit 1; - fi - - BRANCH="$GITHUB_HEAD_REF" - - if [[ "$BASE_ORG_AND_REPO" != "cypress-io/cypress" ]]; then - echo "Triggering CircleCi pipeline for outside contributor." - BRANCH="pull/$PULL_ID/head" - fi - - echo "Triggering CircleCi pipeline for $BRANCH" - - response=$(curl -X POST https://circleci.com/api/v2/project/github/cypress-io/cypress/pipeline \ - --header "Circle-Token:$CIRCLE_TOKEN" \ - --header "content-type:application/json" \ - --data "{\"branch\":\"$BRANCH\"}" \ - --silent - ) - - echo "$response" - - if [ "$(jq 'has("message")' <<< $response )" == "true" ]; then - echo "Error triggering pipeline..." - exit 1; - fi diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3f562577b436..843077d6855a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -207,6 +207,7 @@ 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 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.) + - Note for Debian-based systems: `python` is pre-installed.
`sudo apt install g++ make cmake` meets the additional requirements to run `node-gyp` in the context of building Cypress from source. ### Getting Started @@ -363,6 +364,8 @@ Additionally, we test the code by running it against various other example proje 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 Sometimes tests pass locally, but fail in CI. Our CI environment is dockerized. In order to run the image used in CI locally: diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 6418a505b6e8..9b79428a7e30 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -1,12 +1,17 @@ ## 13.3.0 -_Released 09/19/2023 (PENDING)_ +_Released 09/26/2023_ **Features:** - Introduces new layout for Runs page providing additional run information. Addresses [#27203](https://github.com/cypress-io/cypress/issues/27203). +**Bugfixes:** + +- Fixed an issue where actionability checks trigger a flood of font requests. Removing the font requests has the potential to improve performance and removes clutter from Test Replay. Addressed in [#27860](https://github.com/cypress-io/cypress/pull/27860). +- Fixed network stubbing not permitting status code 999. Fixes [#27567](https://github.com/cypress-io/cypress/issues/27567). Addressed in [#27853](https://github.com/cypress-io/cypress/pull/27853). + ## 13.2.0 _Released 09/12/2023_ @@ -17,7 +22,7 @@ _Released 09/12/2023_ **Bugfixes:** -- Edge cases where `cy.intercept()` would not properly intercept and asset response bodies would not properly be captured for test replay have been addressed. Addressed in [#27771](https://github.com/cypress-io/cypress/pull/27771). +- Edge cases where `cy.intercept()` would not properly intercept and asset response bodies would not properly be captured for Test Replay have been addressed. Addressed in [#27771](https://github.com/cypress-io/cypress/pull/27771). - Fixed an issue where `enter`, `keyup`, and `space` events were not triggering `click` events properly in some versions of Firefox. Addressed in [#27715](https://github.com/cypress-io/cypress/pull/27715). - Fixed a regression in `13.0.0` where tests using Basic Authorization can potentially hang indefinitely on chromium browsers. Addressed in [#27781](https://github.com/cypress-io/cypress/pull/27781). - Fixed a regression in `13.0.0` where component tests using an intercept that matches all requests can potentially hang indefinitely. Addressed in [#27788](https://github.com/cypress-io/cypress/pull/27788). @@ -37,7 +42,7 @@ _Released 08/31/2023_ **Bugfixes:** - Fixed a regression introduced in Cypress [13.0.0](#13-0-0) where the [Module API](https://docs.cypress.io/guides/guides/module-api), [`after:run`](https://docs.cypress.io/api/plugins/after-run-api), and [`after:spec`](https://docs.cypress.io/api/plugins/after-spec-api) results did not include the `stats.skipped` field for each run result. Fixes [#27694](https://github.com/cypress-io/cypress/issues/27694). Addressed in [#27695](https://github.com/cypress-io/cypress/pull/27695). -- Individual CDP errors that occur while capturing data for test replay will no longer prevent the entire run from being available. Addressed in [#27709](https://github.com/cypress-io/cypress/pull/27709). +- Individual CDP errors that occur while capturing data for Test Replay will no longer prevent the entire run from being available. Addressed in [#27709](https://github.com/cypress-io/cypress/pull/27709). - Fixed an issue where the release date on the `v13` landing page was a day behind. Fixed in [#27711](https://github.com/cypress-io/cypress/pull/27711). - Fixed an issue where fatal protocol errors would leak between specs causing all subsequent specs to fail to upload protocol information. Fixed in [#27720](https://github.com/cypress-io/cypress/pull/27720) - Updated `plist` from `3.0.6` to `3.1.0` to address [CVE-2022-37616](https://github.com/advisories/GHSA-9pgh-qqpf-7wqj) and [CVE-2022-39353](https://github.com/advisories/GHSA-crh6-fp67-6883). Fixed in [#27710](https://github.com/cypress-io/cypress/pull/27710). diff --git a/package.json b/package.json index d50c4598e5b8..e62189f01e0d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cypress", - "version": "13.2.0", + "version": "13.3.0", "description": "Cypress is a next generation front end testing tool built for the modern web", "private": true, "scripts": { @@ -145,7 +145,7 @@ "dedent": "^0.7.0", "del": "3.0.0", "detect-port": "^1.3.0", - "electron": "25.8.0", + "electron": "25.8.1", "electron-builder": "^23.6.0", "enzyme-adapter-react-16": "1.12.1", "eslint": "7.22.0", diff --git a/packages/driver/cypress/e2e/commands/actions/click.cy.js b/packages/driver/cypress/e2e/commands/actions/click.cy.js index 97fe26a7b6a0..de682862ce0e 100644 --- a/packages/driver/cypress/e2e/commands/actions/click.cy.js +++ b/packages/driver/cypress/e2e/commands/actions/click.cy.js @@ -1678,12 +1678,16 @@ describe('src/cy/commands/actions/click', () => { it('can scroll to and click elements in html with scroll-behavior: smooth', () => { cy.get('html').invoke('css', 'scrollBehavior', 'smooth') cy.get('#table tr:first').click() + // Validate that the scrollBehavior is still smooth even after the actionability fixes we do + cy.get('html').invoke('css', 'scrollBehavior').then((scrollBehavior) => expect(scrollBehavior).to.eq('smooth')) }) // https://github.com/cypress-io/cypress/issues/3200 it('can scroll to and click elements in ancestor element with scroll-behavior: smooth', () => { cy.get('#dom').invoke('css', 'scrollBehavior', 'smooth') cy.get('#table tr:first').click() + // Validate that the scrollBehavior is still smooth even after the actionability fixes we do + cy.get('#dom').invoke('css', 'scrollBehavior').then((scrollBehavior) => expect(scrollBehavior).to.eq('smooth')) }) }) }) diff --git a/packages/driver/cypress/e2e/dom/visibility.cy.ts b/packages/driver/cypress/e2e/dom/visibility.cy.ts index 903be554218a..adaa51f99b81 100644 --- a/packages/driver/cypress/e2e/dom/visibility.cy.ts +++ b/packages/driver/cypress/e2e/dom/visibility.cy.ts @@ -53,7 +53,7 @@ describe('src/cypress/dom/visibility', () => { expect(fn()).to.be.true }) - it('returns false window and body > window height', () => { + it('returns false if window and body < window height', () => { cy.$$('body').html('
foo
') const win = cy.state('window') @@ -65,6 +65,29 @@ describe('src/cypress/dom/visibility', () => { expect(fn()).to.be.false }) + it('returns true if document element and body > window height', function () { + this.add('
') + const documentElement = Cypress.dom.wrap(cy.state('document').documentElement) + + const fn = () => { + return dom.isScrollable(documentElement) + } + + expect(fn()).to.be.true + }) + + it('returns false if document element and body < window height', () => { + cy.$$('body').html('
foo
') + + const documentElement = Cypress.dom.wrap(cy.state('document').documentElement) + + const fn = () => { + return dom.isScrollable(documentElement) + } + + expect(fn()).to.be.false + }) + it('returns false el is not scrollable', function () { const noScroll = this.add(`\
diff --git a/packages/driver/src/cy/actionability.ts b/packages/driver/src/cy/actionability.ts index fa98fcf00f47..38db91c94eb0 100644 --- a/packages/driver/src/cy/actionability.ts +++ b/packages/driver/src/cy/actionability.ts @@ -8,6 +8,7 @@ import $utils from './../cypress/utils' import type { ElWindowPostion, ElViewportPostion, ElementPositioning } from '../dom/coordinates' import $elements from '../dom/elements' import $errUtils from '../cypress/error_utils' +import { callNativeMethod, getNativeProp } from '../dom/elements/nativeProps' const debug = debugFn('cypress:driver:actionability') const delay = 50 @@ -460,24 +461,46 @@ const verify = function (cy, $el, config, options, callbacks: VerifyCallbacks) { // make scrolling occur instantly. we do this by adding a style tag // and then removing it after we finish scrolling // https://github.com/cypress-io/cypress/issues/3200 - const addScrollBehaviorFix = () => { - let style + const addScrollBehaviorFix = (element: JQuery) => { + const affectedParents: Map = new Map() try { - const doc = $el.get(0).ownerDocument + let parent: JQuery | null = element - style = doc.createElement('style') - style.innerHTML = '* { scroll-behavior: inherit !important; }' - // there's guaranteed to be a