Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breaking: default video configuration option to false #27008

Merged
merged 16 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2070,7 +2070,6 @@ jobs:
CYPRESS_PROJECT_ID=$TEST_KITCHENSINK_PROJECT_ID \
CYPRESS_RECORD_KEY=$TEST_KITCHENSINK_RECORD_KEY \
CYPRESS_INTERNAL_ENV=staging \
CYPRESS_video=false \
yarn cypress:run --project /tmp/cypress-example-kitchensink --record
- store-npm-logs

Expand Down
1 change: 1 addition & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ _Released 08/1/2023 (PENDING)_
**Breaking Changes:**

- 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 deprecated configuration option, `nodeVersion` has been removed. Addresses [#27016](https://github.com/cypress-io/cypress/issues/27016).

Expand Down
4 changes: 2 additions & 2 deletions cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3007,8 +3007,8 @@ declare namespace Cypress {
*/
videoCompression: number | boolean
/**
* Whether Cypress will record a video of the test run when running headlessly.
* @default true
* Whether Cypress will record a video of the test run when executing in run mode.
* @default false
*/
video: boolean
/**
Expand Down
1 change: 0 additions & 1 deletion npm/grep/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ module.exports = defineConfig({
specPattern: '**/spec.js',
},
fixturesFolder: false,
video: false,
})
1 change: 0 additions & 1 deletion npm/react/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module.exports = {
'viewportWidth': 400,
'viewportHeight': 400,
'video': false,
'projectId': 'z9dxah',
'env': {
'reactDevtools': true,
Expand Down
1 change: 0 additions & 1 deletion npm/vue/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { defineConfig } from 'cypress'
export default defineConfig({
'viewportWidth': 500,
'viewportHeight': 500,
'video': false,
'responseTimeout': 2500,
'projectId': '134ej7',
'experimentalFetchPolyfill': true,
Expand Down
3 changes: 0 additions & 3 deletions npm/webpack-preprocessor/test/e2e/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ exports.runTest = async (options = {}) => {
spec: opts.spec,
browser: opts.browser,
exit: opts.exit,
config: {
video: false,
},
dev: true,
})
.finally(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
"field": "userAgent"
},
{
"value": true,
"value": false,
"from": "default",
"field": "video"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
"field": "userAgent"
},
{
"value": true,
"value": false,
"from": "default",
"field": "video"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@
"field": "userAgent"
},
{
"value": true,
"value": false,
"from": "default",
"field": "video"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
"field": "userAgent"
},
{
"value": true,
"value": false,
"from": "default",
"field": "video"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
"field": "userAgent"
},
{
"value": true,
"value": false,
"from": "default",
"field": "video"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,7 @@
"field": "userAgent"
},
{
"value": true,
"value": false,
"from": "default",
"field": "video"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/config/__snapshots__/index.spec.ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ exports['config/src/index .getDefaultValues returns list of public config keys 1
'testIsolation': true,
'trashAssetsBeforeRuns': true,
'userAgent': null,
'video': true,
'video': false,
'videoCompression': 32,
'videosFolder': 'cypress/videos',
'videoUploadOnPasses': true,
Expand Down Expand Up @@ -162,7 +162,7 @@ exports['config/src/index .getDefaultValues returns list of public config keys f
'testIsolation': true,
'trashAssetsBeforeRuns': true,
'userAgent': null,
'video': true,
'video': false,
'videoCompression': 32,
'videosFolder': 'cypress/videos',
'videoUploadOnPasses': true,
Expand Down
2 changes: 1 addition & 1 deletion packages/config/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ const driverConfigOptions: Array<DriverConfigOption> = [
requireRestartOnChange: 'browser',
}, {
name: 'video',
defaultValue: true,
defaultValue: false,
validation: validate.isBoolean,
}, {
name: 'videoCompression',
Expand Down
8 changes: 4 additions & 4 deletions packages/config/test/project/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -762,8 +762,8 @@ describe('config/src/project/utils', () => {
return this.defaults('animationDistanceThreshold', 5)
})

it('video=true', function () {
return this.defaults('video', true)
it('video=false', function () {
return this.defaults('video', false)
})

it('videoCompression=32', function () {
Expand Down Expand Up @@ -1076,7 +1076,7 @@ describe('config/src/project/utils', () => {
testIsolation: { value: true, from: 'default' },
trashAssetsBeforeRuns: { value: true, from: 'default' },
userAgent: { value: null, from: 'default' },
video: { value: true, from: 'default' },
video: { value: false, from: 'default' },
videoCompression: { value: 32, from: 'default' },
videosFolder: { value: 'cypress/videos', from: 'default' },
videoUploadOnPasses: { value: true, from: 'default' },
Expand Down Expand Up @@ -1194,7 +1194,7 @@ describe('config/src/project/utils', () => {
testIsolation: { value: true, from: 'default' },
trashAssetsBeforeRuns: { value: true, from: 'default' },
userAgent: { value: null, from: 'default' },
video: { value: true, from: 'default' },
video: { value: false, from: 'default' },
videoCompression: { value: 32, from: 'default' },
videosFolder: { value: 'cypress/videos', from: 'default' },
videoUploadOnPasses: { value: true, from: 'default' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ const resolvedOptions: Array<ResolvedConfigOption> = [
canUpdateDuringTestTime: false,
}, {
name: 'video',
defaultValue: true,
defaultValue: false,
canUpdateDuringTestTime: false,
}, {
name: 'videoCompression',
Expand Down
2 changes: 1 addition & 1 deletion packages/driver/cypress/e2e/commands/actions/click.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,7 @@ describe('src/cy/commands/actions/click', () => {

it('waits until element stops animating', () => {
cy.get('button:first').then(($btn) => $btn.animate({ width: '30em' }, 100)).click().then(() => {
expect(retries).to.gt(1)
expect(retries).to.gte(1)
})
})

Expand Down
2 changes: 1 addition & 1 deletion packages/driver/cypress/e2e/commands/actions/trigger.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ describe('src/cy/commands/actions/trigger', () => {

it('waits until element stops animating', () => {
cy.get('button:first').then(($btn) => $btn.animate({ width: '30em' }, 100)).trigger('mouseover').then(() => {
expect(retries).to.be.gt(1)
expect(retries).to.be.gte(1)
})
})

Expand Down
2 changes: 1 addition & 1 deletion packages/driver/cypress/e2e/commands/actions/type.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ describe('src/cy/commands/actions/type - #type', () => {

it('waits until element stops animating', () => {
cy.get('button:first').then(($btn) => $btn.animate({ width: '30em' }, 100)).type('foo').then(() => {
expect(retries).to.be.gt(1)
expect(retries).to.be.gte(1)
})
})

Expand Down
7 changes: 6 additions & 1 deletion packages/driver/cypress/e2e/commands/navigation.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -764,9 +764,14 @@ describe('src/cy/commands/navigation', () => {
// https://github.com/cypress-io/cypress/issues/14445
// FIXME: fix flaky test (webkit): https://github.com/cypress-io/cypress/issues/24600
it('should eventually fail on assertion despite redirects', { browser: '!webkit' }, (done) => {
let hasDoneBeenCalled = false

cy.on('fail', (err) => {
expect(err.message).to.contain('The application redirected to')
done()
if (!hasDoneBeenCalled) {
hasDoneBeenCalled = true
done()
}
})

// One time, set the amount of times we want the page to perform it's redirect loop.
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend-shared/cypress/fixtures/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"field": "userAgent"
},
{
"value": true,
"value": false,
"from": "default",
"field": "video"
},
Expand Down
5 changes: 3 additions & 2 deletions packages/server/lib/modes/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ async function waitForTestsToFinishRunning (options: { project: Project, screens

if (!shouldUploadVideo) {
debug(`Spec run had no failures and config.videoUploadOnPasses=false. Skip compressing video. Video path: ${videoName}`)
results.video = null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did we remove results.video = null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because video is still be captured, it just isn't uploaded to the cloud or compressed, meaning that we still want to print video: true in the terminal but want to return null when the function ends, which is handled here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ultimately it doesn't matter too much, since this gets ripped out in #27010

results.videoCompression = false
}

if (!quiet && !skippedSpec) {
Expand Down Expand Up @@ -734,7 +734,8 @@ async function waitForTestsToFinishRunning (options: { project: Project, screens
printResults.printVideoPath(videoName)
}

if (videoCaptureFailed || videoCompressionFailed) {
// if capture or compressing has failed, or the test passed and videoUploadOnPasses=false
if (videoCaptureFailed || videoCompressionFailed || !shouldUploadVideo) {
results.video = null
}

Expand Down
2 changes: 1 addition & 1 deletion packages/server/test/integration/cypress_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ describe('lib/cypress', () => {

expect(chromeBrowser._navigateUsingCRI).to.have.been.calledOnce
expect(chromeBrowser._setAutomation).to.have.been.calledOnce
expect(chromeBrowser._recordVideo).to.have.been.calledOnce
expect(chromeBrowser._recordVideo).not.to.have.been.called

expect(BrowserCriClient.create).to.have.been.calledOnce
expect(browserCriClient.attachToTargetUrl).to.have.been.calledOnce
Expand Down
7 changes: 1 addition & 6 deletions system-tests/__snapshots__/async_timeouts_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ exports['e2e async timeouts / failing1'] = `
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 2 │
│ Video: true
│ Video: false
│ Duration: X seconds │
│ Spec Ran: async_timeouts.cy.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
Expand All @@ -61,11 +61,6 @@ exports['e2e async timeouts / failing1'] = `
cypress command (failed).png


(Video)

- Video output: /XXX/XXX/XXX/cypress/videos/async_timeouts.cy.js.mp4


====================================================================================================

(Run Finished)
Expand Down
14 changes: 2 additions & 12 deletions system-tests/__snapshots__/base_url_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,12 @@ exports['e2e baseUrl / https / passes'] = `
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: true
│ Video: false
│ Duration: X seconds │
│ Spec Ran: base_url.cy.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘


(Video)

- Video output: /XXX/XXX/XXX/cypress/videos/base_url.cy.js.mp4


====================================================================================================

(Run Finished)
Expand Down Expand Up @@ -93,17 +88,12 @@ exports['e2e baseUrl / http / passes'] = `
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: true
│ Video: false
│ Duration: X seconds │
│ Spec Ran: base_url.cy.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘


(Video)

- Video output: /XXX/XXX/XXX/cypress/videos/base_url.cy.js.mp4


====================================================================================================

(Run Finished)
Expand Down
28 changes: 4 additions & 24 deletions system-tests/__snapshots__/browser_crash_handling_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,12 @@ https://on.cypress.io/renderer-process-crashed
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: true
│ Video: false
│ Duration: X seconds │
│ Spec Ran: chrome_tab_crash.cy.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘


(Video)

- Video output: /XXX/XXX/XXX/cypress/videos/chrome_tab_crash.cy.js.mp4


────────────────────────────────────────────────────────────────────────────────────────────────────

Running: simple.cy.js (2 of 2)
Expand All @@ -70,17 +65,12 @@ https://on.cypress.io/renderer-process-crashed
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: true
│ Video: false
│ Duration: X seconds │
│ Spec Ran: simple.cy.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘


(Video)

- Video output: /XXX/XXX/XXX/cypress/videos/simple.cy.js.mp4


====================================================================================================

(Run Finished)
Expand Down Expand Up @@ -139,17 +129,12 @@ https://on.cypress.io/renderer-process-crashed
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: true
│ Video: false
│ Duration: X seconds │
│ Spec Ran: chrome_tab_crash.cy.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘


(Video)

- Video output: /XXX/XXX/XXX/cypress/videos/chrome_tab_crash.cy.js.mp4


────────────────────────────────────────────────────────────────────────────────────────────────────

Running: simple.cy.js (2 of 2)
Expand All @@ -169,17 +154,12 @@ https://on.cypress.io/renderer-process-crashed
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: true
│ Video: false
│ Duration: X seconds │
│ Spec Ran: simple.cy.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘


(Video)

- Video output: /XXX/XXX/XXX/cypress/videos/simple.cy.js.mp4


====================================================================================================

(Run Finished)
Expand Down
Loading