diff --git a/.circleci/cache-version.txt b/.circleci/cache-version.txt index 288d03ad1526..7cb1b8d30414 100644 --- a/.circleci/cache-version.txt +++ b/.circleci/cache-version.txt @@ -1,3 +1,3 @@ # Bump this version to force CI to re-create the cache from scratch. -10-05-23 +10-25-23.1 diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index 5211a72cd1af..125f5c1743b5 100644 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -29,8 +29,9 @@ mainBuildFilters: &mainBuildFilters - develop - /^release\/\d+\.\d+\.\d+$/ # use the following branch as well to ensure that v8 snapshot cache updates are fully tested + - 'feature/experimental-retries' - 'publish-binary' - - 'ryanm/fix/better-sqlite3' + - 'em/shallow-checkout' # 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 @@ -41,7 +42,9 @@ macWorkflowFilters: &darwin-workflow-filters - 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: [ 'ryanm/fix/better-sqlite3', << pipeline.git.branch >> ] + - equal: [ 'feature/experimental-retries', << pipeline.git.branch >> ] + - equal: [ 'chore/update_webpack_deps_to_latest_webpack4_compat', << pipeline.git.branch >> ] + - equal: [ 'lerna-optimize-tasks', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -52,7 +55,10 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters - 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: [ 'ryanm/fix/better-sqlite3', << pipeline.git.branch >> ] + - equal: [ 'feature/experimental-retries', << pipeline.git.branch >> ] + - equal: [ 'chore/update_webpack_deps_to_latest_webpack4_compat', << pipeline.git.branch >> ] + - equal: [ 'chore/bump_loaders_and_optimize_webpack', << pipeline.git.branch >> ] + - equal: [ 'lerna-optimize-tasks', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -75,7 +81,10 @@ windowsWorkflowFilters: &windows-workflow-filters - 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: [ 'ryanm/fix/better-sqlite3', << pipeline.git.branch >> ] + - equal: [ 'feature/experimental-retries', << pipeline.git.branch >> ] + - equal: [ 'chore/update_webpack_deps_to_latest_webpack4_compat', << pipeline.git.branch >> ] + - equal: [ 'lerna-optimize-tasks', << pipeline.git.branch >> ] + - equal: [ 'em/shallow-checkout', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -145,7 +154,7 @@ commands: 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" != "publish-binary" && "$CIRCLE_BRANCH" != "update-v8-snapshot-cache-on-develop" && "$CIRCLE_BRANCH" != "ryanm/fix/better-sqlite3" ]]; then + echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "publish-binary" && "$CIRCLE_BRANCH" != "lerna-optimize-tasks" ]]; 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 @@ -242,8 +251,6 @@ commands: root: ~/ paths: - cypress - - .ssh - - node_modules # contains the npm i -g modules install_cache_helpers_dependencies: steps: @@ -473,12 +480,9 @@ commands: # https://discuss.circleci.com/t/switch-nodejs-version-on-machine-executor-solved/26675/2 description: Install Node version matching .node-version steps: - # installing NVM will use git+ssh, so update known_hosts - - update_known_hosts - run: name: Install Node command: | - node_version=$(cat .node-version) source ./scripts/ensure-node.sh echo "Installing Yarn" npm install yarn --location=global # ensure yarn is installed with the correct node engine @@ -1337,7 +1341,19 @@ jobs: default: false resource_class: << parameters.resource_class >> steps: - - checkout + - update_known_hosts + - when: + condition: + equal: [ *windows-executor, << parameters.executor >> ] + steps: # issue with ssh keys on windows + - checkout + - unless: + condition: + equal: [ *windows-executor, << parameters.executor >> ] + steps: + - run: + name: checkout + command: git clone -b "$CIRCLE_BRANCH" "$CIRCLE_REPOSITORY_URL" . --depth 1 - install-required-node - verify-build-setup: executor: << parameters.executor >> @@ -1345,6 +1361,7 @@ jobs: root: ~/ paths: - cypress + - .ssh - .nvm # mac / linux - ProgramData/nvm # windows - caching-dependency-installer: @@ -2215,13 +2232,6 @@ jobs: - clone-repo-and-checkout-branch: repo: cypress-example-kitchensink - install-required-node - - run: - name: Remove cypress.json - description: Remove cypress.json in case it exists - working_directory: /tmp/cypress-example-kitchensink - environment: - CYPRESS_INTERNAL_FORCE_SCAFFOLD: "1" - command: rm -rf cypress.json - run: name: Install prod dependencies command: yarn --production --ignore-engines @@ -3609,4 +3619,4 @@ workflows: <<: *darwin-workflow-filters windows: <<: *windows-workflow - <<: *windows-workflow-filters \ No newline at end of file + <<: *windows-workflow-filters diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index cb65de563b27..2e9de1053570 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/README.md b/README.md index aeaf893644ae..9867193933f2 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,6 @@
Fast, easy and reliable testing for anything that runs in a browser.
-- - - -
Join us, we're hiring.
diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 8ee75d734adf..dc30b7a0e017 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -1,22 +1,76 @@ -## 13.3.1 +## 13.4.1 -_Released 10/09/2023 (PENDING)_ +_Released 11/7/2023 (PENDING)_ **Bugfixes:** -- Fixed an issue where requests were correlated in the wrong order in the proxy. This could cause an issue where the wrong request is used for `cy.intercept` or assets (e.g. stylesheets or images) may not properly be available in Test Replay. Addressed in [#27892](https://github.com/cypress-io/cypress/pull/27892). -- Fixed an issue where a crashed Chrome renderer can cause the Test Replay recorder to hang. Addressed in [#27909](https://github.com/cypress-io/cypress/pull/27909). -- Fixed an issue where multiple responses yielded from calls to `cy.wait()` would sometimes be out of order. Fixes [#27337](https://github.com/cypress-io/cypress/issues/27337). -- Fixed an issue where requests were timing out in the proxy. This could cause an issue where the wrong request is used for `cy.intercept` or assets (e.g. stylesheets or images) may not properly be available in Test Replay. Addressed in [#27976](https://github.com/cypress-io/cypress/pull/27976) -- Fixed an issue where Test Replay couldn't record tests due to issues involving `GLIBC`. Fixed deprecation warnings during the rebuild of better-sqlite3. Fixes [#27891](https://github.com/cypress-io/cypress/issues/27891) and [#27902](https://github.com/cypress-io/cypress/issues/27902). -- Enables test replay for executed specs in runs that have a spec that causes a browser crash. Addressed in [#27786](https://github.com/cypress-io/cypress/pull/27786) +- Fixed an issue where clicking a link to download a file could cause a page load timeout when the download attribute was missing. Note: download behaviors in experimental Webkit are still an issue. Fixes [#14857](https://github.com/cypress-io/cypress/issues/14857). +- Fixed an issue to account for canceled and failed downloads to correctly reflect these status in Command log as a download failure where previously it would be pending. Fixed in [#28222](https://github.com/cypress-io/cypress/pull/28222). +- Fixed an issue determining visibility when an element is hidden by an ancestor with a shared edge. Fixes [#27514](https://github.com/cypress-io/cypress/issues/27514). +- We now pass a flag to Chromium browsers to disable Chrome translation, both the manual option and the popup prompt, when a page with a differing language is detected. Fixes [#28225](https://github.com/cypress-io/cypress/issues/28225). +- Fixed an issue where in chromium based browsers, global style updates can trigger flooding of font face requests in DevTools and Test Replay. This can affect performance due to the flooding of messages in CDP. Fixes [#28150](https://github.com/cypress-io/cypress/issues/28150) and [#28215](https://github.com/cypress-io/cypress/issues/28215). +- Fixed an issue with 'other' targets (e.g. pdf documents embedded in an object tag) not fully loading. Fixes [#28228](https://github.com/cypress-io/cypress/issues/28228) and [#28162](https://github.com/cypress-io/cypress/issues/28162). +- Fixed an issue where network requests made from tabs/windows other than the main Cypress tab would be delayed. Fixes [#28113](https://github.com/cypress-io/cypress/issues/28113). +- Stopped processing CDP events at the end of a spec when Test Isolation is off and Test Replay is enabled. Addressed in [#28213](https://github.com/cypress-io/cypress/pull/28213). - Fixed an issue where nested object url queries would be incorrectly serialized in `cy.request()` and `cy.visit()`. Fixes [#27745](https://github.com/cypress-io/cypress/issues/27745). Addressed in [#27908](https://github.com/cypress-io/cypress/pull/27908). **Dependency Updates:** - Added dependency to [npm qs@6.11.2](https://www.npmjs.com/package/qs) in driver. Addressed in [#27908](https://github.com/cypress-io/cypress/pull/27908). +## 13.4.0 + +_Released 10/30/2023_ + +**Features:** + +- Introduced experimental configuration options for advanced retry logic: adds `experimentalStrategy` and `experimentalOptions` keys to the `retry` configuration key. See [Experimental Flake Detection Features](https://docs.cypress.io/guides/references/experiments/#Experimental-Flake-Detection-Features) in the documentation. Addressed in [#27930](https://github.com/cypress-io/cypress/pull/27930). + +**Bugfixes:** + +- Fixed a regression in [`13.3.2`](https://docs.cypress.io/guides/references/changelog/13.3.2) where Cypress would crash with 'Inspected target navigated or closed' or 'Session with given id not found'. Fixes [#28141](https://github.com/cypress-io/cypress/issues/28141) and [#28148](https://github.com/cypress-io/cypress/issues/28148). + +## 13.3.3 + +_Released 10/24/2023_ + +**Bugfixes:** + +- Fixed a performance regression in `13.3.1` with proxy correlation timeouts and requests issued from web and shared workers. Fixes [#28104](https://github.com/cypress-io/cypress/issues/28104). +- Fixed a performance problem with proxy correlation when requests get aborted and then get miscorrelated with follow up requests. Addressed in [#28094](https://github.com/cypress-io/cypress/pull/28094). +- Fixed a regression in [10.0.0](#10.0.0), where search would not find a spec if the file name contains "-" or "\_", but search prompt contains " " instead (e.g. search file "spec-file.cy.ts" with prompt "spec file"). Fixes [#25303](https://github.com/cypress-io/cypress/issues/25303). + +## 13.3.2 + +_Released 10/18/2023_ + +**Bugfixes:** + +- Fixed a performance regression in `13.3.1` with proxy correlation timeouts and requests issued from service workers. Fixes [#28054](https://github.com/cypress-io/cypress/issues/28054) and [#28056](https://github.com/cypress-io/cypress/issues/28056). +- Fixed an issue where proxy correlation would leak over from a previous spec causing performance problems, `cy.intercept` problems, and Test Replay asset capturing issues. Addressed in [#28060](https://github.com/cypress-io/cypress/pull/28060). +- Fixed an issue where redirects of requests that knowingly don't have CDP traffic should also be assumed to not have CDP traffic. Addressed in [#28060](https://github.com/cypress-io/cypress/pull/28060). +- Fixed an issue with Accept Encoding headers by forcing gzip when no accept encoding header is sent and using identity if gzip is not sent. Fixes [#28025](https://github.com/cypress-io/cypress/issues/28025). + +**Dependency Updates:** + +- Upgraded [`@babel/core`](https://www.npmjs.com/package/@babel/core) from `7.22.9` to `7.23.2` to address the [SNYK-JS-SEMVER-3247795](https://snyk.io/vuln/SNYK-JS-SEMVER-3247795) security vulnerability. Addressed in [#28063](https://github.com/cypress-io/cypress/pull/28063). +- Upgraded [`@babel/traverse`](https://www.npmjs.com/package/@babel/traverse) from `7.22.8` to `7.23.2` to address the [SNYK-JS-BABELTRAVERSE-5962462](https://snyk.io/vuln/SNYK-JS-BABELTRAVERSE-5962462) security vulnerability. Addressed in [#28063](https://github.com/cypress-io/cypress/pull/28063). +- Upgraded [`react-docgen`](https://www.npmjs.com/package/react-docgen) from `6.0.0-alpha.3` to `6.0.4` to address the [SNYK-JS-BABELTRAVERSE-5962462](https://snyk.io/vuln/SNYK-JS-BABELTRAVERSE-5962462) security vulnerability. Addressed in [#28063](https://github.com/cypress-io/cypress/pull/28063). + +## 13.3.1 + +_Released 10/11/2023_ + +**Bugfixes:** + +- Fixed an issue where requests were correlated in the wrong order in the proxy. This could cause an issue where the wrong request is used for `cy.intercept` or assets (e.g. stylesheets or images) may not properly be available in Test Replay. Addressed in [#27892](https://github.com/cypress-io/cypress/pull/27892). +- Fixed an issue where a crashed Chrome renderer can cause the Test Replay recorder to hang. Addressed in [#27909](https://github.com/cypress-io/cypress/pull/27909). +- Fixed an issue where multiple responses yielded from calls to `cy.wait()` would sometimes be out of order. Fixes [#27337](https://github.com/cypress-io/cypress/issues/27337). +- Fixed an issue where requests were timing out in the proxy. This could cause an issue where the wrong request is used for `cy.intercept` or assets (e.g. stylesheets or images) may not properly be available in Test Replay. Addressed in [#27976](https://github.com/cypress-io/cypress/pull/27976). +- Fixed an issue where Test Replay couldn't record tests due to issues involving `GLIBC`. Fixed deprecation warnings during the rebuild of better-sqlite3. Fixes [#27891](https://github.com/cypress-io/cypress/issues/27891) and [#27902](https://github.com/cypress-io/cypress/issues/27902). +- Enables test replay for executed specs in runs that have a spec that causes a browser crash. Addressed in [#27786](https://github.com/cypress-io/cypress/pull/27786). + ## 13.3.0 _Released 09/27/2023_ @@ -41,7 +95,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). -- 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 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). diff --git a/cli/__snapshots__/build_spec.js b/cli/__snapshots__/build_spec.js index 751f417d0e3a..2f0a3189ea96 100644 --- a/cli/__snapshots__/build_spec.js +++ b/cli/__snapshots__/build_spec.js @@ -4,7 +4,7 @@ exports['package.json build outputs expected properties 1'] = { 'version': 'x.y.z', 'buildInfo': 'replaced by normalizePackageJson', 'description': 'Cypress is a next generation front end testing tool built for the modern web', - 'homepage': 'https://github.com/cypress-io/cypress', + 'homepage': 'https://cypress.io', 'license': 'MIT', 'bugs': { 'url': 'https://github.com/cypress-io/cypress/issues', diff --git a/cli/lib/exec/spawn.js b/cli/lib/exec/spawn.js index 096458fa5022..d158aa8eb7a9 100644 --- a/cli/lib/exec/spawn.js +++ b/cli/lib/exec/spawn.js @@ -239,7 +239,7 @@ module.exports = { return } - // if we have a callback and this explictly returns + // if we have a callback and this explicitly returns // false then bail if (onStderrData && onStderrData(str) === false) { return diff --git a/cli/lib/util.js b/cli/lib/util.js index 3a3b4399adb6..653ffdd1af0d 100644 --- a/cli/lib/util.js +++ b/cli/lib/util.js @@ -331,7 +331,7 @@ const util = { }, supportsColor () { - // if we've been explictly told not to support + // if we've been explicitly told not to support // color then turn this off if (process.env.NO_COLOR) { return false diff --git a/cli/scripts/build.js b/cli/scripts/build.js index 155a8a47a35e..a957f3e701b3 100644 --- a/cli/scripts/build.js +++ b/cli/scripts/build.js @@ -1,8 +1,6 @@ const _ = require('lodash') const path = require('path') const shell = require('shelljs') -const minimist = require('minimist') - const fs = require('../lib/fs') // grab the current version and a few other properties @@ -72,9 +70,7 @@ function makeUserPackageFile (branchName) { module.exports = makeUserPackageFile if (!module.parent) { - const args = minimist(process.argv) - - makeUserPackageFile(args.branch) + makeUserPackageFile(process.env.BRANCH) .catch((err) => { /* eslint-disable no-console */ console.error('Could not write user package file') diff --git a/cli/test/lib/cli_spec.js b/cli/test/lib/cli_spec.js index 9de88e13ce0d..3e0de35ddfae 100644 --- a/cli/test/lib/cli_spec.js +++ b/cli/test/lib/cli_spec.js @@ -635,7 +635,7 @@ describe('cli', () => { expect(spawn.start.firstCall.args[0]).to.include('component') }) - it('spawns server with correct args for depricated component-testing command', () => { + it('spawns server with correct args for deprecated component-testing command', () => { this.exec('open-ct --dev') expect(spawn.start.firstCall.args[0]).to.include('--testing-type') expect(spawn.start.firstCall.args[0]).to.include('component') @@ -647,7 +647,7 @@ describe('cli', () => { expect(spawn.start.firstCall.args[0]).to.include('component') }) - it('runs server with correct args for depricated component-testing command', () => { + it('runs server with correct args for deprecated component-testing command', () => { this.exec('run-ct --dev') expect(spawn.start.firstCall.args[0]).to.include('--testing-type') expect(spawn.start.firstCall.args[0]).to.include('component') diff --git a/cli/test/lib/exec/spawn_spec.js b/cli/test/lib/exec/spawn_spec.js index ce39d1b8fa3f..6725e0c1c9c7 100644 --- a/cli/test/lib/exec/spawn_spec.js +++ b/cli/test/lib/exec/spawn_spec.js @@ -409,7 +409,7 @@ describe('lib/exec/spawn', function () { }) }) - it('inherits when on linux and xvfb isnt needed', function () { + it('inherits when on linux and xvfb isn\'t needed', function () { this.spawnedProcess.on.withArgs('close').yieldsAsync(0) os.platform.returns('linux') xvfb.isNeeded.returns(false) diff --git a/cli/types/cypress-npm-api.d.ts b/cli/types/cypress-npm-api.d.ts index ffeda31685ea..2181f8640001 100644 --- a/cli/types/cypress-npm-api.d.ts +++ b/cli/types/cypress-npm-api.d.ts @@ -382,7 +382,7 @@ declare module 'cypress' { * recommend wrapping your config object with `defineConfig()` * @example * module.exports = defineConfig({ - * viewportWith: 400 + * viewportWidth: 400 * }) * * @see ../types/cypress-npm-api.d.ts diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index a40f2fcdf92c..f4c69ec165cf 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -2851,6 +2851,30 @@ declare namespace Cypress { certs: PEMCert[] | PFXCert[] } + type RetryStrategyWithModeSpecs = RetryStrategy & { + openMode: boolean; // defaults to false + runMode: boolean; // defaults to true + } + + type RetryStrategy = + | RetryStrategyDetectFlakeAndPassOnThresholdType + | RetryStrategyDetectFlakeButAlwaysFailType + + interface RetryStrategyDetectFlakeAndPassOnThresholdType { + experimentalStrategy: "detect-flake-and-pass-on-threshold" + experimentalOptions?: { + maxRetries: number; // defaults to 2 if experimentalOptions is not provided, must be a whole number > 0 + passesRequired: number; // defaults to 2 if experimentalOptions is not provided, must be a whole number > 0 and <= maxRetries + } + } + + interface RetryStrategyDetectFlakeButAlwaysFailType { + experimentalStrategy: "detect-flake-but-always-fail" + experimentalOptions?: { + maxRetries: number; // defaults to 2 if experimentalOptions is not provided, must be a whole number > 0 + stopIfAnyPassed: boolean; // defaults to false if experimentalOptions is not provided + } + } interface ResolvedConfigOptions