diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index 15701f41fac8..5627bc82e55f 100644 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -28,7 +28,7 @@ mainBuildFilters: &mainBuildFilters only: - develop - /^release\/\d+\.\d+\.\d+$/ - - 'emily/next-version' + - 'mikep/22825-next-middleware' # 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 @@ -37,7 +37,7 @@ macWorkflowFilters: &darwin-workflow-filters when: or: - equal: [ develop, << pipeline.git.branch >> ] - - equal: [ 'mschile/chrome_memory_fix', << pipeline.git.branch >> ] + - equal: [ 'mikep/22825-next-middleware', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -46,7 +46,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters when: or: - equal: [ develop, << pipeline.git.branch >> ] - - equal: [ 'mschile/chrome_memory_fix', << pipeline.git.branch >> ] + - equal: [ 'mikep/22825-next-middleware', << pipeline.git.branch >> ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -130,7 +130,7 @@ commands: - run: name: Check current branch to persist artifacts command: | - if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "emily/next-version" ]]; then + if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "mikep/22825-next-middleware" ]]; then echo "Not uploading artifacts or posting install comment for this branch." circleci-agent step halt fi diff --git a/README.md b/README.md index 59de2bd82b57..8df5cd1a3ef7 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,8 @@ yarn add cypress --dev ## Contributing -- [![CircleCI](https://circleci.com/gh/cypress-io/cypress/tree/develop.svg?style=svg)](https://circleci.com/gh/cypress-io/cypress/tree/develop) - `develop` branch +[![cypress](https://img.shields.io/endpoint?url=https://cloud.cypress.io/badge/simple/ypt4pf/develop&style=flat&logo=cypress)](https://cloud.cypress.io/projects/ypt4pf/runs) +[![CircleCI](https://circleci.com/gh/cypress-io/cypress/tree/develop.svg?style=svg)](https://circleci.com/gh/cypress-io/cypress/tree/develop) - `develop` branch Please see our [Contributing Guideline](./CONTRIBUTING.md) which explains repo organization, linting, testing, and other steps. @@ -79,7 +80,13 @@ This project is licensed under the terms of the [MIT license](/LICENSE). ## Badges -Let the world know your project is using Cypress.io to test with this cool badge +Configure a badge for your project's README to show your test status or test count in the [Cypress Cloud](https://www.cypress.io/cloud). + +[![cypress](https://img.shields.io/endpoint?url=https://cloud.cypress.io/badge/simple/ypt4pf/develop&style=flat&logo=cypress)](https://cloud.cypress.io/projects/ypt4pf/runs) + +[![cypress](https://img.shields.io/endpoint?url=https://cloud.cypress.io/badge/count/ypt4pf/develop&style=flat&logo=cypress)](https://cloud.cypress.io/projects/ypt4pf/runs) + +Or let the world know your project is using Cypress with the badge below. [![Cypress.io](https://img.shields.io/badge/tested%20with-Cypress-04C38E.svg)](https://www.cypress.io/) diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index d7ffbd40a63e..86f02681fa6f 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -1,21 +1,59 @@ +## 12.6.0 + +_Released 02/14/2023 (PENDING)_ + +**Bugfixes:** + +- Fixed an issue with the Cloud project selection modal not showing the correct prompts. Fixes [#25520](https://github.com/cypress-io/cypress/issues/25520). +- Fixed an issue in middleware where error-handling code could itself generate an error and fail to report the original issue. Fixes [#22825](https://github.com/cypress-io/cypress/issues/22825). + +**Features:** + +- Added the "Open in IDE" feature for failed tests reported from the Debug page. Addressed in [#25691](https://github.com/cypress-io/cypress/pull/25691). + +**Misc:** + +- Improved the layout of the Debug Page on smaller viewports when there is a pending run. Addresses [#25664](https://github.com/cypress-io/cypress/issues/25664). +- Improved the layout of the Debug Page when displaying informational messages. Addresses [#25669](https://github.com/cypress-io/cypress/issues/25669). +- Icons in Debug page will no longer shrink at small viewports. Addresses [#25665](https://github.com/cypress-io/cypress/issues/25665). +- Increased the spacing between elements and their associated tooltip and added borders around artifact links on the Debug Page. Addresses [#25666](https://github.com/cypress-io/cypress/issues/25666). + +**Dependency Updates:** + +- Upgrade [`debug`][(https://www.npmjs.com/package/debug) to `4.3.4`. Addressed in [#25699](https://github.com/cypress-io/cypress/pull/25699). + +## 12.5.1 + +_Released 02/10/2023_ + +**Bugfixes:** + +- Fixed a regression introduced in Cypress [12.5.0](https://docs.cypress.io/guides/references/changelog#12-5-0) where the `runnable` was not included in the [`test:after:run`](https://docs.cypress.io/api/events/catalog-of-events) event. Fixes [#25663](https://github.com/cypress-io/cypress/issues/25663). + +**Dependency Updates:** + +- Upgraded [`simple-git`](https://github.com/steveukx/git-js) from `3.15.0` to `3.16.0` to address this [security vulnerability](https://github.com/advisories/GHSA-9p95-fxvg-qgq2) where Remote Code Execution (RCE) via the clone(), pull(), push() and listRemote() methods due to improper input sanitization was possible. Addressed in [#25603](https://github.com/cypress-io/cypress/pull/25603). + ## 12.5.0 -_Released 01/31/2023 (PENDING)_ +_Released 01/31/2023_ **Features:** -- Easily debug failed CI test runs right from your local Cypress app with the new Debug page, powered by Cypress Cloud. For more details, see the [Debug documentation](https://on.cypress.io/debug-page). Addressed in [#25488](https://github.com/cypress-io/cypress/pull/25488). +- Easily debug failed CI test runs recorded to the Cypress Cloud from your local Cypress app with the new Debug page. Please leave any feedback [here](https://github.com/cypress-io/cypress/discussions/25649). Your feedback will help us make decisions to improve the Debug experience. For more details, see [our blog post](https://on.cypress.io/debug-page-release). Addressed in [#25488](https://github.com/cypress-io/cypress/pull/25488). + +**Performance:** + +- Improved memory consumption in `run` mode by removing reporter logs for successful tests. Fixes [#25230](https://github.com/cypress-io/cypress/issues/25230). **Bugfixes:** -- Fixed an issue where alternative Microsoft Edge Beta, Canary, and Dev binary versions were not being discovered by Cypress. - Fixes [#25455](https://github.com/cypress-io/cypress/issues/25455). +- Fixed an issue where alternative Microsoft Edge Beta, Canary, and Dev binary versions were not being discovered by Cypress. Fixes [#25455](https://github.com/cypress-io/cypress/issues/25455). **Dependency Updates:** -- Upgraded [`underscore.string`](https://github.com/esamattis/underscore.string/blob/HEAD/CHANGELOG.markdown) from `3.3.5` to `3.3.6` to reference rebuilt assets after security patch to fix regular expression DDOS exploit. - Fixed in [#25574](https://github.com/cypress-io/cypress/pull/25574). +- Upgraded [`underscore.string`](https://github.com/esamattis/underscore.string/blob/HEAD/CHANGELOG.markdown) from `3.3.5` to `3.3.6` to reference rebuilt assets after security patch to fix regular expression DDOS exploit. Addressed in [#25574](https://github.com/cypress-io/cypress/pull/25574). ## 12.4.1 diff --git a/cli/package.json b/cli/package.json index d485b7e34f3c..bc03bfb8936c 100644 --- a/cli/package.json +++ b/cli/package.json @@ -37,7 +37,7 @@ "commander": "^5.1.0", "common-tags": "^1.8.0", "dayjs": "^1.10.4", - "debug": "^4.3.2", + "debug": "^4.3.4", "enquirer": "^2.3.6", "eventemitter2": "6.4.7", "execa": "4.1.0", diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index 6aa84eb495a8..3dfaab987170 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -5976,14 +5976,14 @@ declare namespace Cypress { * Useful to see how internal cypress commands utilize the {% url 'Cypress.log()' cypress-log %} API. * @see https://on.cypress.io/catalog-of-events#App-Events */ - (action: 'log:added', fn: (log: any, interactive: boolean) => void): Cypress + (action: 'log:added', fn: (attributes: ObjectLike, log: any) => void): Cypress /** * Fires whenever a command's attributes changes. * This event is debounced to prevent it from firing too quickly and too often. * Useful to see how internal cypress commands utilize the {% url 'Cypress.log()' cypress-log %} API. * @see https://on.cypress.io/catalog-of-events#App-Events */ - (action: 'log:changed', fn: (log: any, interactive: boolean) => void): Cypress + (action: 'log:changed', fn: (attributes: ObjectLike, log: any) => void): Cypress /** * Fires before the test and all **before** and **beforeEach** hooks run. * @see https://on.cypress.io/catalog-of-events#App-Events diff --git a/cli/types/tests/actions.ts b/cli/types/tests/actions.ts index 6ebf7799a69f..af5563597d23 100644 --- a/cli/types/tests/actions.ts +++ b/cli/types/tests/actions.ts @@ -61,11 +61,13 @@ Cypress.on('command:retry', (command) => { command // $ExpectType CommandQueue }) -Cypress.on('log:added', (log, interactive: boolean) => { +Cypress.on('log:added', (attributes, log) => { + attributes // $ExpectType ObjectLike log // $ExpectTyped any }) -Cypress.on('log:changed', (log, interactive: boolean) => { +Cypress.on('log:changed', (attributes, log) => { + attributes // $ExpectType ObjectLike log // $ExpectTyped any }) @@ -74,6 +76,11 @@ Cypress.on('test:before:run', (attributes , test) => { test // $ExpectType Test }) +Cypress.on('test:before:run:async', (attributes , test) => { + attributes // $ExpectType ObjectLike + test // $ExpectType Test +}) + Cypress.on('test:after:run', (attributes , test) => { attributes // $ExpectType ObjectLike test // $ExpectType Test diff --git a/npm/grep/CHANGELOG.md b/npm/grep/CHANGELOG.md index 200c73ca841f..c5f2c9469b71 100644 --- a/npm/grep/CHANGELOG.md +++ b/npm/grep/CHANGELOG.md @@ -1,3 +1,5 @@ +# [@cypress/grep-v3.1.4](https://github.com/cypress-io/cypress/compare/@cypress/grep-v3.1.3...@cypress/grep-v3.1.4) (2023-02-06) + # [@cypress/grep-v3.1.3](https://github.com/cypress-io/cypress/compare/@cypress/grep-v3.1.2...@cypress/grep-v3.1.3) (2022-12-14) diff --git a/npm/grep/package.json b/npm/grep/package.json index e9b989151a68..66057f2dc7b5 100644 --- a/npm/grep/package.json +++ b/npm/grep/package.json @@ -9,7 +9,7 @@ "lint": "eslint . --ext .js,.ts" }, "dependencies": { - "debug": "^4.3.2", + "debug": "^4.3.4", "find-test-names": "^1.19.0", "globby": "^11.0.4" }, diff --git a/npm/react18/src/index.ts b/npm/react18/src/index.ts index 846a6d0941ea..4d5c3f6766df 100644 --- a/npm/react18/src/index.ts +++ b/npm/react18/src/index.ts @@ -8,6 +8,7 @@ import { } from '@cypress/react' import type { MountOptions, + MountReturn, InternalMountOptions, UnmountArgs, } from '@cypress/react' @@ -83,3 +84,8 @@ export function unmount (options: UnmountArgs = { log: true }) { export { getContainerEl, } + +export type { + MountOptions, + MountReturn, +} diff --git a/npm/vue/CHANGELOG.md b/npm/vue/CHANGELOG.md index 2619fc00a348..4032c2461a2b 100644 --- a/npm/vue/CHANGELOG.md +++ b/npm/vue/CHANGELOG.md @@ -1,3 +1,5 @@ +# [@cypress/vue-v5.0.4](https://github.com/cypress-io/cypress/compare/@cypress/vue-v5.0.3...@cypress/vue-v5.0.4) (2023-02-06) + # [@cypress/vue-v5.0.3](https://github.com/cypress-io/cypress/compare/@cypress/vue-v5.0.2...@cypress/vue-v5.0.3) (2022-12-02) diff --git a/npm/vue/package.json b/npm/vue/package.json index 37c074892624..64d0ea8355ef 100644 --- a/npm/vue/package.json +++ b/npm/vue/package.json @@ -23,7 +23,7 @@ "@vue/test-utils": "2.0.2", "axios": "0.21.2", "cypress": "0.0.0-development", - "debug": "^4.3.2", + "debug": "^4.3.4", "globby": "^11.0.1", "tailwindcss": "1.1.4", "typescript": "^4.7.4", diff --git a/npm/webpack-preprocessor/CHANGELOG.md b/npm/webpack-preprocessor/CHANGELOG.md index 68f0436bb44c..ea3f01d1b8eb 100644 --- a/npm/webpack-preprocessor/CHANGELOG.md +++ b/npm/webpack-preprocessor/CHANGELOG.md @@ -1,3 +1,12 @@ +# [@cypress/webpack-preprocessor-v5.16.3](https://github.com/cypress-io/cypress/compare/@cypress/webpack-preprocessor-v5.16.2...@cypress/webpack-preprocessor-v5.16.3) (2023-02-06) + +# [@cypress/webpack-preprocessor-v5.16.2](https://github.com/cypress-io/cypress/compare/@cypress/webpack-preprocessor-v5.16.1...@cypress/webpack-preprocessor-v5.16.2) (2023-02-02) + + +### Bug Fixes + +* allow version 9 of the babel-loader peer dependency ([#25569](https://github.com/cypress-io/cypress/issues/25569)) ([5afe19f](https://github.com/cypress-io/cypress/commit/5afe19f8d17b5da53d66a0513424403006167adf)) + # [@cypress/webpack-preprocessor-v5.16.1](https://github.com/cypress-io/cypress/compare/@cypress/webpack-preprocessor-v5.16.0...@cypress/webpack-preprocessor-v5.16.1) (2022-12-29) diff --git a/npm/webpack-preprocessor/package.json b/npm/webpack-preprocessor/package.json index 2badb36fd7ed..f08c70d242da 100644 --- a/npm/webpack-preprocessor/package.json +++ b/npm/webpack-preprocessor/package.json @@ -26,7 +26,7 @@ "@babel/parser": "^7.13.0", "@babel/traverse": "^7.17.9", "bluebird": "3.7.1", - "debug": "^4.3.2", + "debug": "^4.3.4", "fs-extra": "^10.1.0", "loader-utils": "^2.0.0", "lodash": "^4.17.20", diff --git a/package.json b/package.json index a4d138bf7128..1c9ab667368b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cypress", - "version": "12.4.1", + "version": "12.5.1", "description": "Cypress is a next generation front end testing tool built for the modern web", "private": true, "scripts": { @@ -93,7 +93,7 @@ "@types/bluebird": "3.5.29", "@types/chai-enzyme": "0.6.7", "@types/classnames": "2.2.9", - "@types/debug": "4.1.5", + "@types/debug": "4.1.7", "@types/detect-port": "^1.3.1", "@types/enzyme-adapter-react-16": "1.0.5", "@types/execa": "0.9.0", @@ -137,7 +137,7 @@ "common-tags": "1.8.0", "conventional-recommended-bump": "6.1.0", "cross-env": "7.0.3", - "debug": "^4.3.2", + "debug": "^4.3.4", "dedent": "^0.7.0", "del": "3.0.0", "detect-port": "^1.3.0", diff --git a/packages/app/cypress/e2e/debug.cy.ts b/packages/app/cypress/e2e/debug.cy.ts index 1ebf16833cd3..b39c4ca19ddd 100644 --- a/packages/app/cypress/e2e/debug.cy.ts +++ b/packages/app/cypress/e2e/debug.cy.ts @@ -1,3 +1,4 @@ +import type { OpenFileInIdeQuery } from '../../src/generated/graphql-test' import RelevantRunsDataSource_RunsByCommitShas from '../fixtures/gql-RelevantRunsDataSource_RunsByCommitShas.json' Cypress.on('window:before:load', (win) => { @@ -31,27 +32,27 @@ describe('App - Debug Page', () => { it('all tests passed', () => { // This mocks all the responses so we can get deterministic // results to test the debug page. - cy.intercept('POST', '/__cypress/graphql/query-Debug', { + cy.intercept('query-Debug', { fixture: 'debug-Passing/gql-Debug.json', }) - cy.intercept('POST', '/__cypress/graphql/query-CloudViewerAndProject_RequiredData', { + cy.intercept('query-CloudViewerAndProject_RequiredData', { fixture: 'debug-Passing/gql-CloudViewerAndProject_RequiredData.json', }) - cy.intercept('POST', '/__cypress/graphql/query-MainAppQuery', { + cy.intercept('query-MainAppQuery', { fixture: 'debug-Passing/gql-MainAppQuery.json', }) - cy.intercept('POST', '/__cypress/graphql/query-SideBarNavigationContainer', { + cy.intercept('query-SideBarNavigationContainer', { fixture: 'debug-Passing/gql-SideBarNavigationContainer', }) - cy.intercept('POST', '/__cypress/graphql/query-HeaderBar_HeaderBarQuery', { + cy.intercept('query-HeaderBar_HeaderBarQuery', { fixture: 'debug-Passing/gql-HeaderBar_HeaderBarQuery', }) - cy.intercept('POST', '/__cypress/graphql/query-SpecsPageContainer', { + cy.intercept('query-SpecsPageContainer', { fixture: 'debug-Passing/gql-SpecsPageContainer', }) @@ -86,30 +87,44 @@ describe('App - Debug Page', () => { }) it('shows information about a failed spec', () => { - cy.intercept('POST', '/__cypress/graphql/query-Debug', { + cy.intercept('query-Debug', { fixture: 'debug-Failing/gql-Debug.json', }) - cy.intercept('POST', '/__cypress/graphql/query-CloudViewerAndProject_RequiredData', { + cy.intercept('query-CloudViewerAndProject_RequiredData', { fixture: 'debug-Failing/gql-CloudViewerAndProject_RequiredData.json', }) - cy.intercept('POST', '/__cypress/graphql/query-MainAppQuery', { + cy.intercept('query-MainAppQuery', { fixture: 'debug-Failing/gql-MainAppQuery.json', }) - cy.intercept('POST', '/__cypress/graphql/query-SideBarNavigationContainer', { + cy.intercept('query-SideBarNavigationContainer', { fixture: 'debug-Failing/gql-SideBarNavigationContainer', }) - cy.intercept('POST', '/__cypress/graphql/query-HeaderBar_HeaderBarQuery', { + cy.intercept('query-HeaderBar_HeaderBarQuery', { fixture: 'debug-Failing/gql-HeaderBar_HeaderBarQuery', }) - cy.intercept('POST', '/__cypress/graphql/query-SpecsPageContainer', { + cy.intercept('query-SpecsPageContainer', { fixture: 'debug-Failing/gql-SpecsPageContainer', }) + cy.intercept('query-OpenFileInIDE', (req) => { + req.on('response', (res) => { + const gqlData = res.body.data as OpenFileInIdeQuery + + gqlData.localSettings.preferences.preferredEditorBinary = 'code' + }) + }) + + cy.intercept('mutation-OpenFileInIDE_Mutation').as('openFileInIDE') + + cy.withCtx((ctx, { sinon }) => { + sinon.stub(ctx.actions.file, 'openFile') + }) + cy.visitApp() cy.findByTestId('sidebar-link-debug-page').click() @@ -147,5 +162,11 @@ describe('App - Debug Page', () => { cy.findByTestId('test-row').contains('InfoPanel') cy.findByTestId('test-row').contains('renders') cy.findByTestId('run-failures').should('exist').should('have.attr', 'href', '#/specs/runner?file=src/components/InfoPanel/InfoPanel.cy.ts&mode=debug') + + cy.findByLabelText('Open in IDE').click() + cy.wait('@openFileInIDE') + cy.withCtx((ctx) => { + expect(ctx.actions.file.openFile).to.have.been.calledWith('src/components/InfoPanel/InfoPanel.cy.ts', 1, 1) + }) }) }) diff --git a/packages/app/src/debug/DebugArtifactLink.cy.tsx b/packages/app/src/debug/DebugArtifactLink.cy.tsx index 919abc703d88..196da01d36ce 100644 --- a/packages/app/src/debug/DebugArtifactLink.cy.tsx +++ b/packages/app/src/debug/DebugArtifactLink.cy.tsx @@ -11,7 +11,7 @@ describe('', () => { it('mounts correctly, provides expected tooltip content, and emits correct event', () => { artifactMapping.forEach((artifact) => { cy.mount(() => ( - + )) cy.findByTestId(`artifact-for-${artifact.icon}`).should('have.length', 1) diff --git a/packages/app/src/debug/DebugArtifactLink.vue b/packages/app/src/debug/DebugArtifactLink.vue index 635705840128..b1fa3cc31160 100644 --- a/packages/app/src/debug/DebugArtifactLink.vue +++ b/packages/app/src/debug/DebugArtifactLink.vue @@ -2,9 +2,10 @@