diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 65b3676c2b43..3cf5fcf7fbdc 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -8,6 +8,7 @@ _Released 08/1/2023 (PENDING)_ - The [`cy.readFile()`](/api/commands/readfile) command is now retry-able as a [query command](https://on.cypress.io/retry-ability). This should not affect any tests using it; the functionality is unchanged. However, it can no longer be overwritten using [`Cypress.Commands.overwrite()`](/api/cypress-api/custom-commands#Overwrite-Existing-Commands). Addressed in [#25595](https://github.com/cypress-io/cypress/pull/25595). - The [`video`](https://docs.cypress.io/guides/references/configuration#Videos) configuration option now defaults to `false`. Addresses [#26157](https://github.com/cypress-io/cypress/issues/26157). - The [`videoCompression`](https://docs.cypress.io/guides/references/configuration#Videos) configuration option now defaults to `false`. Addresses [#26160](https://github.com/cypress-io/cypress/issues/26160). +- The [`videoUploadOnPasses`](https://docs.cypress.io/guides/references/configuration#Videos) configuration option has been removed. Please see our [screenshots & videos guide](https://docs.cypress.io/guides/guides/screenshots-and-videos#Delete-videos-for-specs-without-failing-or-retried-tests) on how to accomplish similar functionality. Addresses [#26899](https://github.com/cypress-io/cypress/issues/26899). - The deprecated configuration option, `nodeVersion` has been removed. Addresses [#27016](https://github.com/cypress-io/cypress/issues/27016). diff --git a/cli/types/cypress-npm-api.d.ts b/cli/types/cypress-npm-api.d.ts index 41a38abfdacd..f928b5446c7e 100644 --- a/cli/types/cypress-npm-api.d.ts +++ b/cli/types/cypress-npm-api.d.ts @@ -266,7 +266,6 @@ declare namespace CypressCommandLine { absolute: string relativeToCommonRoot: string } - shouldUploadVideo: boolean skippedSpec: boolean } diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index 4d574cd03594..89046b0d3611 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -3011,11 +3011,6 @@ declare namespace Cypress { * @default false */ video: boolean - /** - * Whether Cypress will upload the video to Cypress Cloud even if all tests are passing. This applies only when recording your runs to Cypress Cloud. Turn this off if you'd like the video uploaded only when there are failing tests. - * @default true - */ - videoUploadOnPasses: boolean /** * Whether Chrome Web Security for same-origin policy and insecure mixed content is enabled. Read more about this here * @default true diff --git a/packages/app/cypress/fixtures/debug-Failing/gql-CloudViewerAndProject_RequiredData.json b/packages/app/cypress/fixtures/debug-Failing/gql-CloudViewerAndProject_RequiredData.json index 39aa0917db81..be33d9625eeb 100644 --- a/packages/app/cypress/fixtures/debug-Failing/gql-CloudViewerAndProject_RequiredData.json +++ b/packages/app/cypress/fixtures/debug-Failing/gql-CloudViewerAndProject_RequiredData.json @@ -308,11 +308,6 @@ "from": "default", "field": "videosFolder" }, - { - "value": true, - "from": "default", - "field": "videoUploadOnPasses" - }, { "value": 500, "from": "default", diff --git a/packages/app/cypress/fixtures/debug-Failing/gql-HeaderBar_HeaderBarQuery.json b/packages/app/cypress/fixtures/debug-Failing/gql-HeaderBar_HeaderBarQuery.json index 0789b35dd8f0..261ef63a2c2b 100644 --- a/packages/app/cypress/fixtures/debug-Failing/gql-HeaderBar_HeaderBarQuery.json +++ b/packages/app/cypress/fixtures/debug-Failing/gql-HeaderBar_HeaderBarQuery.json @@ -284,11 +284,6 @@ "from": "default", "field": "videosFolder" }, - { - "value": true, - "from": "default", - "field": "videoUploadOnPasses" - }, { "value": 500, "from": "default", diff --git a/packages/app/cypress/fixtures/debug-Failing/gql-SpecsPageContainer.json b/packages/app/cypress/fixtures/debug-Failing/gql-SpecsPageContainer.json index 27521174034d..a677ce685285 100644 --- a/packages/app/cypress/fixtures/debug-Failing/gql-SpecsPageContainer.json +++ b/packages/app/cypress/fixtures/debug-Failing/gql-SpecsPageContainer.json @@ -669,11 +669,6 @@ "from": "default", "field": "videosFolder" }, - { - "value": true, - "from": "default", - "field": "videoUploadOnPasses" - }, { "value": 500, "from": "default", diff --git a/packages/app/cypress/fixtures/debug-Passing/gql-CloudViewerAndProject_RequiredData.json b/packages/app/cypress/fixtures/debug-Passing/gql-CloudViewerAndProject_RequiredData.json index afe9d1433a67..b33e7911793a 100644 --- a/packages/app/cypress/fixtures/debug-Passing/gql-CloudViewerAndProject_RequiredData.json +++ b/packages/app/cypress/fixtures/debug-Passing/gql-CloudViewerAndProject_RequiredData.json @@ -308,11 +308,6 @@ "from": "default", "field": "videosFolder" }, - { - "value": true, - "from": "default", - "field": "videoUploadOnPasses" - }, { "value": 500, "from": "default", diff --git a/packages/app/cypress/fixtures/debug-Passing/gql-HeaderBar_HeaderBarQuery.json b/packages/app/cypress/fixtures/debug-Passing/gql-HeaderBar_HeaderBarQuery.json index 0789b35dd8f0..261ef63a2c2b 100644 --- a/packages/app/cypress/fixtures/debug-Passing/gql-HeaderBar_HeaderBarQuery.json +++ b/packages/app/cypress/fixtures/debug-Passing/gql-HeaderBar_HeaderBarQuery.json @@ -284,11 +284,6 @@ "from": "default", "field": "videosFolder" }, - { - "value": true, - "from": "default", - "field": "videoUploadOnPasses" - }, { "value": 500, "from": "default", diff --git a/packages/app/cypress/fixtures/debug-Passing/gql-SpecsPageContainer.json b/packages/app/cypress/fixtures/debug-Passing/gql-SpecsPageContainer.json index f0c6b4f7f673..cd0df340a79c 100644 --- a/packages/app/cypress/fixtures/debug-Passing/gql-SpecsPageContainer.json +++ b/packages/app/cypress/fixtures/debug-Passing/gql-SpecsPageContainer.json @@ -1670,11 +1670,6 @@ "from": "default", "field": "videosFolder" }, - { - "value": true, - "from": "default", - "field": "videoUploadOnPasses" - }, { "value": 500, "from": "default", diff --git a/packages/config/__snapshots__/index.spec.ts.js b/packages/config/__snapshots__/index.spec.ts.js index ca8caede6dcc..dec481ee83dd 100644 --- a/packages/config/__snapshots__/index.spec.ts.js +++ b/packages/config/__snapshots__/index.spec.ts.js @@ -77,7 +77,6 @@ exports['config/src/index .getDefaultValues returns list of public config keys 1 'video': false, 'videoCompression': false, 'videosFolder': 'cypress/videos', - 'videoUploadOnPasses': true, 'viewportHeight': 660, 'viewportWidth': 1000, 'waitForAnimations': true, @@ -165,7 +164,6 @@ exports['config/src/index .getDefaultValues returns list of public config keys f 'video': false, 'videoCompression': false, 'videosFolder': 'cypress/videos', - 'videoUploadOnPasses': true, 'viewportHeight': 660, 'viewportWidth': 1000, 'waitForAnimations': true, @@ -247,7 +245,6 @@ exports['config/src/index .getPublicConfigKeys returns list of public config key 'video', 'videoCompression', 'videosFolder', - 'videoUploadOnPasses', 'viewportHeight', 'viewportWidth', 'waitForAnimations', diff --git a/packages/config/src/options.ts b/packages/config/src/options.ts index 538a7c35431c..cb92e1df641e 100644 --- a/packages/config/src/options.ts +++ b/packages/config/src/options.ts @@ -429,10 +429,6 @@ const driverConfigOptions: Array = [ defaultValue: 'cypress/videos', validation: validate.isString, isFolder: true, - }, { - name: 'videoUploadOnPasses', - defaultValue: true, - validation: validate.isBoolean, }, { name: 'viewportHeight', defaultValue: (options: Record = {}) => options.testingType === 'component' ? 500 : 660, diff --git a/packages/config/test/project/utils.spec.ts b/packages/config/test/project/utils.spec.ts index a49d43fdabd9..8b251901b9db 100644 --- a/packages/config/test/project/utils.spec.ts +++ b/packages/config/test/project/utils.spec.ts @@ -770,10 +770,6 @@ describe('config/src/project/utils', () => { return this.defaults('videoCompression', false) }) - it('videoUploadOnPasses=true', function () { - return this.defaults('videoUploadOnPasses', true) - }) - it('trashAssetsBeforeRuns=32', function () { return this.defaults('trashAssetsBeforeRuns', true) }) @@ -1079,7 +1075,6 @@ describe('config/src/project/utils', () => { video: { value: false, from: 'default' }, videoCompression: { value: false, from: 'default' }, videosFolder: { value: 'cypress/videos', from: 'default' }, - videoUploadOnPasses: { value: true, from: 'default' }, viewportHeight: { value: 660, from: 'default' }, viewportWidth: { value: 1000, from: 'default' }, waitForAnimations: { value: true, from: 'default' }, @@ -1197,7 +1192,6 @@ describe('config/src/project/utils', () => { video: { value: false, from: 'default' }, videoCompression: { value: false, from: 'default' }, videosFolder: { value: 'cypress/videos', from: 'default' }, - videoUploadOnPasses: { value: true, from: 'default' }, viewportHeight: { value: 660, from: 'default' }, viewportWidth: { value: 1000, from: 'default' }, waitForAnimations: { value: true, from: 'default' }, diff --git a/packages/frontend-shared/cypress/fixtures/config.json b/packages/frontend-shared/cypress/fixtures/config.json index 3f2cf328321f..f99ef940416b 100644 --- a/packages/frontend-shared/cypress/fixtures/config.json +++ b/packages/frontend-shared/cypress/fixtures/config.json @@ -242,11 +242,6 @@ "from": "default", "field": "videosFolder" }, - { - "value": true, - "from": "default", - "field": "videoUploadOnPasses" - }, { "value": 850, "from": "config", diff --git a/packages/server/lib/modes/record.js b/packages/server/lib/modes/record.js index f32ee38e3036..8a47b3649519 100644 --- a/packages/server/lib/modes/record.js +++ b/packages/server/lib/modes/record.js @@ -109,7 +109,7 @@ const getSpecRelativePath = (spec) => { } const uploadArtifacts = (options = {}) => { - const { protocolManager, video, screenshots, videoUploadUrl, captureUploadUrl, shouldUploadVideo, screenshotUploadUrls, quiet } = options + const { protocolManager, video, screenshots, videoUploadUrl, captureUploadUrl, screenshotUploadUrls, quiet } = options const uploads = [] const uploadReport = { @@ -196,7 +196,7 @@ const uploadArtifacts = (options = {}) => { ) } - if (videoUploadUrl && shouldUploadVideo) { + if (videoUploadUrl) { send(video, videoUploadUrl, 'video') } @@ -796,7 +796,7 @@ const createRunAndRecordSpecs = (options = {}) => { return } - const { video, shouldUploadVideo, screenshots } = results + const { video, screenshots } = results const { videoUploadUrl, captureUploadUrl, screenshotUploadUrls } = resp return uploadArtifacts({ @@ -807,7 +807,6 @@ const createRunAndRecordSpecs = (options = {}) => { videoUploadUrl, captureUploadUrl, protocolManager, - shouldUploadVideo, screenshotUploadUrls, quiet, }) diff --git a/packages/server/lib/modes/run.ts b/packages/server/lib/modes/run.ts index d159f9946914..bff1954959b5 100644 --- a/packages/server/lib/modes/run.ts +++ b/packages/server/lib/modes/run.ts @@ -332,14 +332,14 @@ const warnVideoCompressionFailed = (err) => { errors.warning('VIDEO_COMPRESSION_FAILED', err) } -async function compressRecording (options: { quiet: boolean, videoCompression: number | boolean, shouldUploadVideo: boolean, processOptions: Omit }) { +async function compressRecording (options: { quiet: boolean, videoCompression: number | boolean, processOptions: Omit }) { debug('ending the video recording %o', options) // once this ended promises resolves // then begin compressing the file // don't compress anything if videoCompress is off // or we've been told not to upload the video - if (options.videoCompression === false || options.videoCompression === 0 || options.shouldUploadVideo === false) { + if (options.videoCompression === false || options.videoCompression === 0) { debug('skipping compression') return @@ -574,10 +574,10 @@ function waitForSocketConnection (project: Project, id: string) { }) } -async function waitForTestsToFinishRunning (options: { project: Project, screenshots: ScreenshotMetadata[], videoCompression: number | boolean, videoUploadOnPasses: boolean, exit: boolean, spec: SpecWithRelativeRoot, estimated: number, quiet: boolean, config: Cfg, shouldKeepTabOpen: boolean, testingType: TestingType, videoRecording?: VideoRecording }) { +async function waitForTestsToFinishRunning (options: { project: Project, screenshots: ScreenshotMetadata[], videoCompression: number | boolean, exit: boolean, spec: SpecWithRelativeRoot, estimated: number, quiet: boolean, config: Cfg, shouldKeepTabOpen: boolean, testingType: TestingType, videoRecording?: VideoRecording }) { if (globalThis.CY_TEST_MOCK?.waitForTestsToFinishRunning) return Promise.resolve(globalThis.CY_TEST_MOCK.waitForTestsToFinishRunning) - const { project, screenshots, videoRecording, videoCompression, videoUploadOnPasses, exit, spec, estimated, quiet, config, shouldKeepTabOpen, testingType } = options + const { project, screenshots, videoRecording, videoCompression, exit, spec, estimated, quiet, config, shouldKeepTabOpen, testingType } = options const results = await listenForProjectEnd(project, exit) @@ -617,7 +617,7 @@ async function waitForTestsToFinishRunning (options: { project: Project, screens results.spec = spec - const { tests, stats } = results + const { tests } = results const attempts = _.flatMap(tests, (test) => test.attempts) let videoCaptureFailed = false @@ -659,18 +659,6 @@ async function waitForTestsToFinishRunning (options: { project: Project, screens results.video = null } - const hasFailingTests = _.get(stats, 'failures') > 0 - // we should upload the video if we upload on passes (by default) - // or if we have any failures and have started the video - const shouldUploadVideo = !skippedSpec && videoUploadOnPasses === true || Boolean((/* startedVideoCapture */ videoExists && hasFailingTests)) - - results.shouldUploadVideo = shouldUploadVideo - - if (!shouldUploadVideo) { - debug(`Spec run had no failures and config.videoUploadOnPasses=false. Skip compressing video. Video path: ${videoName}`) - results.videoCompression = false - } - if (!quiet && !skippedSpec) { printResults.displayResults(results, estimated) } @@ -711,7 +699,6 @@ async function waitForTestsToFinishRunning (options: { project: Project, screens }) await compressRecording({ - shouldUploadVideo, quiet, videoCompression, processOptions: { @@ -734,8 +721,7 @@ async function waitForTestsToFinishRunning (options: { project: Project, screens printResults.printVideoPath(videoName) } - // if capture or compressing has failed, or the test passed and videoUploadOnPasses=false - if (videoCaptureFailed || videoCompressionFailed || !shouldUploadVideo) { + if (videoCaptureFailed || videoCompressionFailed) { results.video = null } @@ -756,7 +742,7 @@ function screenshotMetadata (data, resp) { } } -async function runSpecs (options: { config: Cfg, browser: Browser, sys: any, headed: boolean, outputPath: string, specs: SpecWithRelativeRoot[], specPattern: string | RegExp | string[], beforeSpecRun?: BeforeSpecRun, afterSpecRun?: AfterSpecRun, runUrl?: string, parallel?: boolean, group?: string, tag?: string, autoCancelAfterFailures?: number | false, testingType: TestingType, quiet: boolean, project: Project, onError: (err: Error) => void, exit: boolean, socketId: string, webSecurity: boolean, projectRoot: string, protocolManager?: ProtocolManager } & Pick) { +async function runSpecs (options: { config: Cfg, browser: Browser, sys: any, headed: boolean, outputPath: string, specs: SpecWithRelativeRoot[], specPattern: string | RegExp | string[], beforeSpecRun?: BeforeSpecRun, afterSpecRun?: AfterSpecRun, runUrl?: string, parallel?: boolean, group?: string, tag?: string, autoCancelAfterFailures?: number | false, testingType: TestingType, quiet: boolean, project: Project, onError: (err: Error) => void, exit: boolean, socketId: string, webSecurity: boolean, projectRoot: string, protocolManager?: ProtocolManager } & Pick) { if (globalThis.CY_TEST_MOCK?.runSpecs) return globalThis.CY_TEST_MOCK.runSpecs const { config, browser, sys, headed, outputPath, specs, specPattern, beforeSpecRun, afterSpecRun, runUrl, parallel, group, tag, autoCancelAfterFailures, protocolManager } = options @@ -923,7 +909,7 @@ async function runSpecs (options: { config: Cfg, browser: Browser, sys: any, hea return results } -async function runSpec (config, spec: SpecWithRelativeRoot, options: { project: Project, browser: Browser, onError: (err: Error) => void, config: Cfg, quiet: boolean, exit: boolean, testingType: TestingType, socketId: string, webSecurity: boolean, projectRoot: string, protocolManager?: ProtocolManager } & Pick, estimated, isFirstSpec, isLastSpec) { +async function runSpec (config, spec: SpecWithRelativeRoot, options: { project: Project, browser: Browser, onError: (err: Error) => void, config: Cfg, quiet: boolean, exit: boolean, testingType: TestingType, socketId: string, webSecurity: boolean, projectRoot: string, protocolManager?: ProtocolManager } & Pick, estimated, isFirstSpec, isLastSpec) { const { project, browser, onError } = options const { isHeadless } = browser @@ -974,7 +960,6 @@ async function runSpec (config, spec: SpecWithRelativeRoot, options: { project: exit: options.exit, testingType: options.testingType, videoCompression: options.videoCompression, - videoUploadOnPasses: options.videoUploadOnPasses, quiet: options.quiet, shouldKeepTabOpen: !isLastSpec, }), @@ -1112,7 +1097,6 @@ async function ready (options: { projectRoot: string, record: boolean, key: stri videosFolder: config.videosFolder, video: config.video, videoCompression: config.videoCompression, - videoUploadOnPasses: config.videoUploadOnPasses, headed: options.headed, quiet: options.quiet, outputPath: options.outputPath, diff --git a/packages/server/test/integration/cypress_spec.js b/packages/server/test/integration/cypress_spec.js index 9d01efbcd750..1dd25ce52fa9 100644 --- a/packages/server/test/integration/cypress_spec.js +++ b/packages/server/test/integration/cypress_spec.js @@ -1241,7 +1241,6 @@ describe('lib/cypress', () => { tests: [], hooks: [], video: 'path/to/video', - shouldUploadVideo: true, screenshots: [], config: {}, spec: {}, diff --git a/packages/server/test/unit/config_spec.js b/packages/server/test/unit/config_spec.js index d517e3f0efb8..ed1ca528eb28 100644 --- a/packages/server/test/unit/config_spec.js +++ b/packages/server/test/unit/config_spec.js @@ -655,20 +655,6 @@ describe('lib/config', () => { }) }) - context('videoUploadOnPasses', () => { - it('passes if a boolean', function () { - this.setup({ videoUploadOnPasses: false }) - - return this.expectValidationPasses() - }) - - it('fails if not a boolean', function () { - this.setup({ videoUploadOnPasses: 99 }) - - return this.expectValidationFails('be a boolean') - }) - }) - context('videosFolder', () => { it('passes if a string', function () { this.setup({ videosFolder: '_videos' }) diff --git a/packages/types/src/config.ts b/packages/types/src/config.ts index 41c4b6037f64..f10d8bfba472 100644 --- a/packages/types/src/config.ts +++ b/packages/types/src/config.ts @@ -30,7 +30,7 @@ export interface FullConfig extends Partial - & Pick // TODO: Figure out how to type this better. + & Pick // TODO: Figure out how to type this better. export interface SettingsOptions { testingType?: 'component' |'e2e' diff --git a/system-tests/__snapshots__/record_spec.js b/system-tests/__snapshots__/record_spec.js index e4875c882b82..deccc2dc98df 100644 --- a/system-tests/__snapshots__/record_spec.js +++ b/system-tests/__snapshots__/record_spec.js @@ -160,7 +160,7 @@ plugin stdout │ Pending: 1 │ │ Skipped: 0 │ │ Screenshots: 1 │ - │ Video: true │ + │ Video: false │ │ Duration: X seconds │ │ Estimated: X second(s) │ │ Spec Ran: record_pass.cy.js │ @@ -172,11 +172,6 @@ plugin stdout - /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png (400x1022) - (Video) - - - Video output: /XXX/XXX/XXX/cypress/videos/record_pass.cy.js.mp4 - - (Uploading Screenshots & Videos) - Done Uploading (1/1) /foo/bar/.projects/e2e/cypress/screenshots/record_pass.cy.js/yay it passes.png @@ -2304,147 +2299,6 @@ Request Sent: } } -` - -exports['e2e record video recording when videoUploadOnPasses=false does not upload when specs pass 1'] = ` - -==================================================================================================== - - (Run Starting) - - ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ - │ Cypress: 1.2.3 │ - │ Browser: FooBrowser 88 │ - │ Specs: 2 found (record_fail.cy.js, record_pass.cy.js) │ - │ Searched: cypress/e2e/record_fail*, cypress/e2e/record_pass* │ - │ Params: Tag: false, Group: false, Parallel: false │ - │ Run URL: https://dashboard.cypress.io/projects/cjvoj7/runs/12 │ - └────────────────────────────────────────────────────────────────────────────────────────────────┘ - - -──────────────────────────────────────────────────────────────────────────────────────────────────── - - Running: record_fail.cy.js (1 of 2) - Estimated: X second(s) - - - record fails - 1) "before each" hook for "fails 1" - - - 0 passing - 1 failing - - 1) record fails - "before each" hook for "fails 1": - Error: foo - -Because this error occurred during a \`before each\` hook we are skipping the remaining tests in the current suite: \`record fails\` - [stack trace lines] - - - - - (Results) - - ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ - │ Tests: 2 │ - │ Passing: 0 │ - │ Failing: 1 │ - │ Pending: 0 │ - │ Skipped: 1 │ - │ Screenshots: 1 │ - │ Video: true │ - │ Duration: X seconds │ - │ Estimated: X second(s) │ - │ Spec Ran: record_fail.cy.js │ - └────────────────────────────────────────────────────────────────────────────────────────────────┘ - - - (Screenshots) - - - /XXX/XXX/XXX/cypress/screenshots/record_fail.cy.js/record fails -- fails 1 -- be (1280x720) - fore each hook (failed).png - - - (Video) - - - Started compressing: Compressing to 32 CRF - - Finished compressing: X second(s) - - - Video output: /XXX/XXX/XXX/cypress/videos/record_fail.cy.js.mp4 - - - (Uploading Screenshots & Videos) - - - Done Uploading (*/2) /foo/bar/.projects/e2e/cypress/screenshots/record_fail.cy.js/record fails -- fails 1 -- before each hook (failed).png - - Done Uploading (*/2) /foo/bar/.projects/e2e/cypress/videos/record_fail.cy.js.mp4 - -──────────────────────────────────────────────────────────────────────────────────────────────────── - - Running: record_pass.cy.js (2 of 2) - Estimated: X second(s) - - - record pass -plugin stdout - ✓ passes - - is pending - - - 1 passing - 1 pending - - - (Results) - - ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ - │ Tests: 2 │ - │ Passing: 1 │ - │ Failing: 0 │ - │ Pending: 1 │ - │ Skipped: 0 │ - │ Screenshots: 1 │ - │ Video: true │ - │ Duration: X seconds │ - │ Estimated: X second(s) │ - │ Spec Ran: record_pass.cy.js │ - └────────────────────────────────────────────────────────────────────────────────────────────────┘ - - - (Screenshots) - - - /XXX/XXX/XXX/cypress/screenshots/record_pass.cy.js/yay it passes.png (400x1022) - - - (Video) - - - Video output: /XXX/XXX/XXX/cypress/videos/record_pass.cy.js.mp4 - - - (Uploading Screenshots & Videos) - - - Done Uploading (1/1) /foo/bar/.projects/e2e/cypress/screenshots/record_pass.cy.js/yay it passes.png - -==================================================================================================== - - (Run Finished) - - - Spec Tests Passing Failing Pending Skipped - ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ - │ ✖ record_fail.cy.js XX:XX 2 - 1 - 1 │ - ├────────────────────────────────────────────────────────────────────────────────────────────────┤ - │ ✔ record_pass.cy.js XX:XX 2 1 - 1 - │ - └────────────────────────────────────────────────────────────────────────────────────────────────┘ - ✖ 1 of 2 failed (50%) XX:XX 4 1 1 1 1 - - -─────────────────────────────────────────────────────────────────────────────────────────────────────── - - Recorded Run: https://dashboard.cypress.io/projects/cjvoj7/runs/12 - - ` exports['e2e record video recording when video=false does not upload when not enabled 1'] = ` diff --git a/system-tests/__snapshots__/spec_isolation_spec.js b/system-tests/__snapshots__/spec_isolation_spec.js index 915b847a0328..724f3c979646 100644 --- a/system-tests/__snapshots__/spec_isolation_spec.js +++ b/system-tests/__snapshots__/spec_isolation_spec.js @@ -232,7 +232,6 @@ exports['e2e spec_isolation fails [electron] 1'] = { 'relative': 'cypress/e2e/simple_passing.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_passing.cy.js', }, - 'shouldUploadVideo': true, }, { 'stats': { @@ -359,7 +358,6 @@ exports['e2e spec_isolation fails [electron] 1'] = { 'relative': 'cypress/e2e/simple_hooks.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_hooks.cy.js', }, - 'shouldUploadVideo': true, }, { 'stats': { @@ -480,7 +478,6 @@ exports['e2e spec_isolation fails [electron] 1'] = { 'relative': 'cypress/e2e/simple_failing.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_failing.cy.js', }, - 'shouldUploadVideo': true, }, { 'stats': { @@ -726,7 +723,6 @@ exports['e2e spec_isolation fails [electron] 1'] = { 'relative': 'cypress/e2e/simple_failing_hook.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_failing_hook.cy.js', }, - 'shouldUploadVideo': true, }, ], 'browserPath': 'path/to/browser', @@ -816,7 +812,6 @@ exports['e2e spec_isolation fails [chrome] 1'] = { 'relative': 'cypress/e2e/simple_passing.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_passing.cy.js', }, - 'shouldUploadVideo': true, }, { 'stats': { @@ -943,7 +938,6 @@ exports['e2e spec_isolation fails [chrome] 1'] = { 'relative': 'cypress/e2e/simple_hooks.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_hooks.cy.js', }, - 'shouldUploadVideo': true, }, { 'stats': { @@ -1064,7 +1058,6 @@ exports['e2e spec_isolation fails [chrome] 1'] = { 'relative': 'cypress/e2e/simple_failing.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_failing.cy.js', }, - 'shouldUploadVideo': true, }, { 'stats': { @@ -1310,7 +1303,6 @@ exports['e2e spec_isolation fails [chrome] 1'] = { 'relative': 'cypress/e2e/simple_failing_hook.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_failing_hook.cy.js', }, - 'shouldUploadVideo': true, }, ], 'browserPath': 'path/to/browser', @@ -1400,7 +1392,6 @@ exports['e2e spec_isolation fails [firefox] 1'] = { 'relative': 'cypress/e2e/simple_passing.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_passing.cy.js', }, - 'shouldUploadVideo': true, }, { 'stats': { @@ -1527,7 +1518,6 @@ exports['e2e spec_isolation fails [firefox] 1'] = { 'relative': 'cypress/e2e/simple_hooks.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_hooks.cy.js', }, - 'shouldUploadVideo': true, }, { 'stats': { @@ -1648,7 +1638,6 @@ exports['e2e spec_isolation fails [firefox] 1'] = { 'relative': 'cypress/e2e/simple_failing.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_failing.cy.js', }, - 'shouldUploadVideo': true, }, { 'stats': { @@ -1894,7 +1883,6 @@ exports['e2e spec_isolation fails [firefox] 1'] = { 'relative': 'cypress/e2e/simple_failing_hook.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_failing_hook.cy.js', }, - 'shouldUploadVideo': true, }, ], 'browserPath': 'path/to/browser', @@ -2221,7 +2209,6 @@ exports['e2e spec_isolation failing with retries enabled [electron] 1'] = { 'relative': 'cypress/e2e/simple_failing_hook.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_failing_hook.cy.js', }, - 'shouldUploadVideo': true, }, { 'stats': { @@ -2350,7 +2337,6 @@ exports['e2e spec_isolation failing with retries enabled [electron] 1'] = { 'relative': 'cypress/e2e/simple_retrying.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_retrying.cy.js', }, - 'shouldUploadVideo': true, }, ], 'browserPath': 'path/to/browser', @@ -2676,7 +2662,6 @@ exports['e2e spec_isolation failing with retries enabled [chrome] 1'] = { 'relative': 'cypress/e2e/simple_failing_hook.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_failing_hook.cy.js', }, - 'shouldUploadVideo': true, }, { 'stats': { @@ -2805,7 +2790,6 @@ exports['e2e spec_isolation failing with retries enabled [chrome] 1'] = { 'relative': 'cypress/e2e/simple_retrying.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_retrying.cy.js', }, - 'shouldUploadVideo': true, }, ], 'browserPath': 'path/to/browser', @@ -3131,7 +3115,6 @@ exports['e2e spec_isolation failing with retries enabled [firefox] 1'] = { 'relative': 'cypress/e2e/simple_failing_hook.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_failing_hook.cy.js', }, - 'shouldUploadVideo': true, }, { 'stats': { @@ -3260,7 +3243,6 @@ exports['e2e spec_isolation failing with retries enabled [firefox] 1'] = { 'relative': 'cypress/e2e/simple_retrying.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_retrying.cy.js', }, - 'shouldUploadVideo': true, }, ], 'browserPath': 'path/to/browser', @@ -3541,7 +3523,6 @@ exports['e2e spec_isolation failing with retries enabled [webkit] 1'] = { 'relative': 'cypress/e2e/simple_failing_hook.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_failing_hook.cy.js', }, - 'shouldUploadVideo': true, }, { 'stats': { @@ -3652,7 +3633,6 @@ exports['e2e spec_isolation failing with retries enabled [webkit] 1'] = { 'relative': 'cypress/e2e/simple_retrying.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_retrying.cy.js', }, - 'shouldUploadVideo': true, }, ], 'browserPath': 'path/to/browser', @@ -3742,7 +3722,6 @@ exports['e2e spec_isolation fails [webkit] 1'] = { 'relative': 'cypress/e2e/simple_passing.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_passing.cy.js', }, - 'shouldUploadVideo': true, }, { 'stats': { @@ -3869,7 +3848,6 @@ exports['e2e spec_isolation fails [webkit] 1'] = { 'relative': 'cypress/e2e/simple_hooks.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_hooks.cy.js', }, - 'shouldUploadVideo': true, }, { 'stats': { @@ -3972,7 +3950,6 @@ exports['e2e spec_isolation fails [webkit] 1'] = { 'relative': 'cypress/e2e/simple_failing.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_failing.cy.js', }, - 'shouldUploadVideo': true, }, { 'stats': { @@ -4191,7 +4168,6 @@ exports['e2e spec_isolation fails [webkit] 1'] = { 'relative': 'cypress/e2e/simple_failing_hook.cy.js', 'absolute': '/foo/bar/.projects/e2e/cypress/e2e/simple_failing_hook.cy.js', }, - 'shouldUploadVideo': true, }, ], 'browserPath': 'path/to/browser', diff --git a/system-tests/projects/e2e/cypress-with-project-id-and-no-upload-on-pass-event.config.js b/system-tests/projects/e2e/cypress-with-project-id-and-no-upload-on-pass-event.config.js new file mode 100644 index 000000000000..b1aa86445223 --- /dev/null +++ b/system-tests/projects/e2e/cypress-with-project-id-and-no-upload-on-pass-event.config.js @@ -0,0 +1,28 @@ +const fs = require('fs') + +module.exports = { + 'projectId': 'pid123', + 'e2e': { + setupNodeEvents (on, config) { + const plugin = require('./cypress/plugins') + + // @see https://docs.cypress.io/guides/guides/screenshots-and-videos#Delete-videos-for-specs-without-failing-or-retried-tests + // for videoUploadOnPasses workaround, which was removed in Cypress v13.0.0 + on( + 'after:spec', + (spec, results) => { + if (results && results.video) { + const areFailuresPresent = results.stats.failures > 0 + + if (!areFailuresPresent) { + // delete the video if the spec passed and no tests retried + fs.unlinkSync(results.video) + } + } + }, + ) + + return plugin(on, config) + }, + }, +} diff --git a/system-tests/projects/e2e/cypress-with-project-id-uploading-assets.config.js b/system-tests/projects/e2e/cypress-with-project-id-uploading-assets.config.js index 811e0268e520..af161ed8adb9 100644 --- a/system-tests/projects/e2e/cypress-with-project-id-uploading-assets.config.js +++ b/system-tests/projects/e2e/cypress-with-project-id-uploading-assets.config.js @@ -1,6 +1,5 @@ module.exports = { 'projectId': 'pid123', - 'videoUploadOnPasses': true, 'e2e': { setupNodeEvents (on, config) { const plugin = require('./cypress/plugins') diff --git a/system-tests/projects/e2e/cypress-with-project-id-without-video.config.js b/system-tests/projects/e2e/cypress-with-project-id-without-video.config.js index 174d73455e1a..f2fe9c6e56b8 100644 --- a/system-tests/projects/e2e/cypress-with-project-id-without-video.config.js +++ b/system-tests/projects/e2e/cypress-with-project-id-without-video.config.js @@ -1,6 +1,5 @@ module.exports = { 'projectId': 'pid123', - 'videoUploadOnPasses': false, 'defaultCommandTimeout': 9999, 'e2e': { setupNodeEvents (on, config) { diff --git a/system-tests/projects/e2e/cypress-with-project-id.config.js b/system-tests/projects/e2e/cypress-with-project-id.config.js index cd9204d3ae31..af161ed8adb9 100644 --- a/system-tests/projects/e2e/cypress-with-project-id.config.js +++ b/system-tests/projects/e2e/cypress-with-project-id.config.js @@ -1,6 +1,5 @@ module.exports = { 'projectId': 'pid123', - 'videoUploadOnPasses': false, 'e2e': { setupNodeEvents (on, config) { const plugin = require('./cypress/plugins') diff --git a/system-tests/test/record_spec.js b/system-tests/test/record_spec.js index 2cb1a0e2948f..26e7d41f8f9b 100644 --- a/system-tests/test/record_spec.js +++ b/system-tests/test/record_spec.js @@ -35,7 +35,7 @@ describe('e2e record', () => { it('passes', async function () { const { stdout } = await systemTests.exec(this, { key: 'f858a2bc-b469-4e48-be67-0876339ee7e1', - configFile: 'cypress-with-project-id.config.js', + configFile: 'cypress-with-project-id-and-no-upload-on-pass-event.config.js', spec: 'record*', record: true, snapshot: true, @@ -781,49 +781,6 @@ describe('e2e record', () => { expect(runResults.body.video).to.be.false }) }) - - describe('when videoUploadOnPasses=false', () => { - setupStubbedServer(createRoutes()) - it('does not upload when specs pass', async function () { - const { stdout } = await systemTests.exec(this, { - key: 'f858a2bc-b469-4e48-be67-0876339ee7e1', - configFile: 'cypress-with-project-id.config.js', - spec: 'record_fail*,record_pass*', - record: true, - snapshot: true, - expectedExitCode: 1, - config: { - video: true, - videoCompression: 32, - env: { - 'TEST_STDIO': '1', - }, - }, - }) - const requests = getRequests() - - console.log(stdout) - - expect(stdout).to.include('Run URL:') - expect(stdout).to.include(runUrl) - - const postRun = requests[0] - - // ensure its relative to projectRoot - expect(postRun.body.specs).to.deep.eq([ - 'cypress/e2e/record_fail.cy.js', - 'cypress/e2e/record_pass.cy.js', - ]) - - const recordFailSpecResults = requests[3] - - expect(recordFailSpecResults.body.video).to.be.true // failed spec has video - - const recordPassSpecResults = requests[9] - - expect(recordPassSpecResults.body.video).to.be.false // passing spec does not have video - }) - }) }) context('api interaction errors', () => {