diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index 5bb549f89b..99d4ad8a94 100644 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -30,7 +30,6 @@ mainBuildFilters: &mainBuildFilters - /^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' - - 'ryanm/feat/change-test-isolation-logic' # 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 +40,6 @@ 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/feat/change-test-isolation-logic', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -52,7 +50,6 @@ 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/feat/change-test-isolation-logic', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -72,7 +69,6 @@ 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/feat/change-test-isolation-logic', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -119,8 +115,11 @@ executors: environment: PLATFORM: windows + # see https://circleci.com/docs/configuration-reference/#macos-execution-environment darwin-arm64: &darwin-arm64-executor - machine: true + macos: + xcode: "14.2.0" + resource_class: macos.m1.large.gen1 environment: PLATFORM: darwin @@ -1356,12 +1355,18 @@ jobs: 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 >> ] + 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: rm -f /tmp/cypress/junit/* + - run: + name: Run v8 integration tests + command: | + source ./scripts/ensure-node.sh + yarn test-integration --scope "'@tooling/packherd'" + - verify-mocha-results: + expectedResultCount: 1 - unless: condition: or: @@ -1374,18 +1379,6 @@ jobs: 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 @@ -1521,12 +1514,6 @@ jobs: 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 @@ -2865,13 +2852,11 @@ darwin-arm64-workflow: &darwin-arm64-workflow - node_modules_install: name: darwin-arm64-node-modules-install executor: darwin-arm64 - resource_class: cypress-io/latest_m1 only-cache-for-root-user: true - build: name: darwin-arm64-build executor: darwin-arm64 - resource_class: cypress-io/latest_m1 requires: - darwin-arm64-node-modules-install @@ -2883,26 +2868,23 @@ darwin-arm64-workflow: &darwin-arm64-workflow - test-runner:commit-status-checks - test-runner:build-binary executor: darwin-arm64 - resource_class: cypress-io/latest_m1 + resource_class: large requires: - darwin-arm64-build - v8-integration-tests: name: darwin-arm64-v8-integration-tests executor: darwin-arm64 - resource_class: cypress-io/latest_m1 requires: - darwin-arm64-build - driver-integration-memory-tests: name: darwin-arm64-driver-integration-memory-tests executor: darwin-arm64 - resource_class: cypress-io/latest_m1 requires: - darwin-arm64-build - server-unit-tests-cloud-environment: name: darwin-arm64-server-unit-tests-cloud-environment executor: darwin-arm64 - resource_class: cypress-io/latest_m1 requires: - darwin-arm64-build diff --git a/.github/workflows/report_weekly_app_kpis.yml b/.github/workflows/report_weekly_app_kpis.yml index 9cebda376c..be4b097af0 100644 --- a/.github/workflows/report_weekly_app_kpis.yml +++ b/.github/workflows/report_weekly_app_kpis.yml @@ -41,6 +41,7 @@ jobs: 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"]' }} @@ -48,8 +49,9 @@ jobs: github-token: ${{ secrets.TRIAGE_BOARD_TOKEN }} script: | const script = require('./scripts/reports/open-vs-closed-issues.js') - await script.getOpenAndClosedIssueMetrics(github, context, ${{ env.DEFAULT_REPOS }}); + 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"]' }} @@ -57,8 +59,9 @@ jobs: github-token: ${{ secrets.TRIAGE_BOARD_TOKEN }} script: | const script = require('./scripts/reports/open-vs-closed-issues.js') - await script.getOpenAndClosedIssueMetrics(github, context, ${{ env.DEFAULT_MONO_REPO }}); + 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 }} @@ -68,4 +71,29 @@ jobs: github-token: ${{ secrets.TRIAGE_BOARD_TOKEN }} script: | const script = require('./scripts/reports/triage_throughput_kpis.js') - await script.getTriageIssueMetrics(github, context, "${{ env.START_DATE }}", "${{ env.END_DATE }}", "${{ env.PROJECT_BOARD_NUMBER }}"); + 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 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 }} ); + \ No newline at end of file diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 10c4358121..f14b64f5e6 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -12,25 +12,48 @@ _Released 08/1/2023 (PENDING)_ - The deprecated configuration option, `nodeVersion` has been removed. Addresses [#27016](https://github.com/cypress-io/cypress/issues/27016). +## 12.17.2 + +_Released 07/18/2023 (PENDING)_ + +**Bugfixes:** + +- Fixed an issue where `cy.writeFile()` would erroneously fail with the error `cy.writeFile() must only be invoked from the spec file or support file`. Fixes [#27097](https://github.com/cypress-io/cypress/issues/27097). + +## 12.17.1 + +_Released 07/10/2023_ + +**Bugfixes:** + +- Fixed invalid stored preference when enabling in-app notifications that could cause the application to crash. Fixes [#27228](https://github.com/cypress-io/cypress/issues/27228). +- Fixed an issue with the Typescript types of [`cy.screenshot()`](https://docs.cypress.io/api/commands/screenshot). Fixed in [#27130](https://github.com/cypress-io/cypress/pull/27130). + +**Dependency Updates:** + +- Upgraded [`@cypress/request`](https://www.npmjs.com/package/@cypress/request) from `2.88.10` to `2.88.11` to address [CVE-2022-24999](https://www.cve.org/CVERecord?id=CVE-2022-24999) security vulnerability. Addressed in [#27005](https://github.com/cypress-io/cypress/pull/27005). + ## 12.17.0 -_Released 07/05/2023 (PENDING)_ +_Released 07/05/2023_ **Features:** -- Cypress Cloud users can now receive desktop notifications about their runs, including when one starts, finishes, or fails. Addessed in [#27078](https://github.com/cypress-io/cypress/pull/27078). Addresses [#26686](https://github.com/cypress-io/cypress/issues/26686). +- Cypress Cloud users can now receive desktop notifications about their runs, including when one starts, finishes, or fails. Addresses [#26686](https://github.com/cypress-io/cypress/issues/26686). **Bugfixes:** - Fixed issues where commands would fail with the error `must only be invoked from the spec file or support file`. Fixes [#27149](https://github.com/cypress-io/cypress/issues/27149) and [#27163](https://github.com/cypress-io/cypress/issues/27163). +- Fixed a regression introduced in Cypress [12.12.0](#12-12-0) where Cypress may fail to reconnect to the Chrome DevTools Protocol in Electron. Fixes [#26900](https://github.com/cypress-io/cypress/issues/26900). - Fixed an issue where chrome was not recovering from browser crashes properly. Fixes [#24650](https://github.com/cypress-io/cypress/issues/24650). - Fixed a race condition that was causing a GraphQL error to appear on the [Debug page](https://docs.cypress.io/guides/cloud/runs#Debug) when viewing a running Cypress Cloud build. Fixed in [#27134](https://github.com/cypress-io/cypress/pull/27134). - Fixed a race condition in electron where the test window exiting prematurely during the browser launch process was causing the whole test run to fail. Addressed in [#27167](https://github.com/cypress-io/cypress/pull/27167). - Fixed minor issues with Typescript types in the CLI. Fixes [#24110](https://github.com/cypress-io/cypress/issues/24110). +- Fixed an issue where a value for the Electron debug port would not be respected if defined using the `ELECTRON_EXTRA_LAUNCH_ARGS` environment variable. Fixes [#26711](https://github.com/cypress-io/cypress/issues/26711). **Dependency Updates:** - - Update dependency semver to ^7.5.3. Addressed in [#27151](https://github.com/cypress-io/cypress/pull/27151). +- Update dependency semver to ^7.5.3. Addressed in [#27151](https://github.com/cypress-io/cypress/pull/27151). ## 12.16.0 diff --git a/cli/package.json b/cli/package.json index 0308e78ddb..df22f47d7c 100644 --- a/cli/package.json +++ b/cli/package.json @@ -20,7 +20,7 @@ "unit": "cross-env BLUEBIRD_DEBUG=1 NODE_ENV=test mocha --reporter mocha-multi-reporters --reporter-options configFile=../mocha-reporter-config.json" }, "dependencies": { - "@cypress/request": "^2.88.10", + "@cypress/request": "^2.88.11", "@cypress/xvfb": "^1.2.4", "@types/node": "^14.14.31", "@types/sinonjs__fake-timers": "8.1.1", diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index baa3417dfc..082c590fc1 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -1901,15 +1901,17 @@ declare namespace Cypress { * cy.screenshot() * cy.get(".post").screenshot() */ - screenshot(options?: Partial): Chainable + screenshot(options?: Partial): Chainable + /** * Take a screenshot of the application under test and the Cypress Command Log and save under given filename. * * @see https://on.cypress.io/screenshot * @example + * cy.screenshot("post-element") * cy.get(".post").screenshot("post-element") */ - screenshot(fileName: string, options?: Partial): Chainable + screenshot(fileName: string, options?: Partial): Chainable /** * Scroll an element into view. diff --git a/cli/types/tests/cypress-tests.ts b/cli/types/tests/cypress-tests.ts index 4b036baa10..dd306c4ed4 100644 --- a/cli/types/tests/cypress-tests.ts +++ b/cli/types/tests/cypress-tests.ts @@ -292,6 +292,11 @@ namespace CypressCommandsTests { return originalFn(element, text, options) }) + Cypress.Commands.overwrite<'screenshot', 'element'>('screenshot', (originalFn, subject, fileName, options) => { + subject // $ExpectType JQueryWithSelector + fileName // $ExpectType string + options // $ExpectType Partial | undefined + }) Cypress.Commands.addQuery('newQuery', function(arg) { this // $ExpectType Command @@ -661,6 +666,9 @@ namespace CypressFilterTests { } namespace CypressScreenshotTests { + cy.screenshot().then((result) => { + result // $ExpectType undefined + }) cy.screenshot('example-name') cy.screenshot('example', { log: false }) cy.screenshot({ log: false }) @@ -672,6 +680,10 @@ namespace CypressScreenshotTests { log: true, blackout: [] }) + cy.get('#id').screenshot('example-name', { log: false }) + cy.get('#id').screenshot().then((result) => { + result // $ExpectType JQuery + }) } namespace CypressShadowDomTests { diff --git a/package.json b/package.json index 117ec5fa5b..ed29f328a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cypress", - "version": "12.16.0", + "version": "12.17.1", "description": "Cypress is a next generation front end testing tool built for the modern web", "private": true, "scripts": { @@ -70,7 +70,7 @@ "devDependencies": { "@aws-sdk/credential-providers": "3.53.0", "@cypress/questions-remain": "1.0.1", - "@cypress/request": "2.88.10", + "@cypress/request": "^2.88.11", "@cypress/request-promise": "4.2.6", "@electron/fuses": "1.6.1", "@fellow/eslint-plugin-coffee": "0.4.13", diff --git a/packages/app/src/settings/device/NotificationSettings.vue b/packages/app/src/settings/device/NotificationSettings.vue index 8cf8a11ebf..8b415ac727 100644 --- a/packages/app/src/settings/device/NotificationSettings.vue +++ b/packages/app/src/settings/device/NotificationSettings.vue @@ -101,7 +101,7 @@