-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
feat: allow users to pass true to videoCompression config and only a… #26810
Changes from 13 commits
11e723d
5f1e071
3b49bd3
2826f16
7805081
0b9100c
476b4d2
99a8cf2
d919367
d6cc771
7341310
6943671
fb38288
b653921
c0fe652
53a07c9
554177a
0292aa5
09bad26
7b3bde9
bd7e247
2eb4885
e86dcb1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -3004,10 +3004,13 @@ declare namespace Cypress { | |||||||
*/ | ||||||||
trashAssetsBeforeRuns: boolean | ||||||||
/** | ||||||||
* The quality setting for the video compression, in Constant Rate Factor (CRF). The value can be false to disable compression or a value between 0 and 51, where a lower value results in better quality (at the expense of a higher file size). | ||||||||
* The quality setting for the video compression, in Constant Rate Factor (CRF). | ||||||||
* The value can be false to disable compression. | ||||||||
* The value of true can use the default CRF of 32. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
* A number between 0 and 51, where a lower value results in better quality (at the expense of a higher file size). | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 0 is still a valid number for CRF, we just don't compress the video since a CRF of 0 is essentially a non compressed video There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we are using 0 to skip compression and not break users, I got the updates in on 53a07c9 |
||||||||
* @default 32 | ||||||||
*/ | ||||||||
videoCompression: number | false | ||||||||
videoCompression: number | boolean | ||||||||
/** | ||||||||
* Whether Cypress will record a video of the test run when running headlessly. | ||||||||
* @default true | ||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
exports['missing https protocol'] = { | ||
"key": "clientCertificates[0].url", | ||
"value": "http://url.com", | ||
"type": "an https protocol" | ||
'key': 'clientCertificates[0].url', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the husky hook did it I swear 😅 |
||
'value': 'http://url.com', | ||
'type': 'an https protocol', | ||
} | ||
|
||
exports['invalid url'] = { | ||
"key": "clientCertificates[0].url", | ||
"value": "not *", | ||
"type": "a valid URL" | ||
'key': 'clientCertificates[0].url', | ||
'value': 'not *', | ||
'type': 'a valid URL', | ||
} | ||
|
||
exports['undefined browsers'] = ` | ||
|
@@ -19,208 +19,220 @@ Expected at least one browser | |
` | ||
|
||
exports['browsers list with a string'] = { | ||
"key": "name", | ||
"value": "foo", | ||
"type": "a non-empty string", | ||
"list": "browsers" | ||
'key': 'name', | ||
'value': 'foo', | ||
'type': 'a non-empty string', | ||
'list': 'browsers', | ||
} | ||
|
||
exports['invalid retry value'] = { | ||
"key": "mockConfigKey", | ||
"value": "1", | ||
"type": "a positive number or null or an object with keys \"openMode\" and \"runMode\" with values of numbers or nulls" | ||
'key': 'mockConfigKey', | ||
'value': '1', | ||
'type': 'a positive number or null or an object with keys "openMode" and "runMode" with values of numbers or nulls', | ||
} | ||
|
||
exports['invalid retry object'] = { | ||
"key": "mockConfigKey", | ||
"value": { | ||
"fakeMode": 1 | ||
'key': 'mockConfigKey', | ||
'value': { | ||
'fakeMode': 1, | ||
}, | ||
"type": "a positive number or null or an object with keys \"openMode\" and \"runMode\" with values of numbers or nulls" | ||
'type': 'a positive number or null or an object with keys "openMode" and "runMode" with values of numbers or nulls', | ||
} | ||
|
||
exports['not qualified url'] = { | ||
"key": "mockConfigKey", | ||
"value": "url.com", | ||
"type": "a fully qualified URL (starting with `http://` or `https://`)" | ||
'key': 'mockConfigKey', | ||
'value': 'url.com', | ||
'type': 'a fully qualified URL (starting with `http://` or `https://`)', | ||
} | ||
|
||
exports['empty string'] = { | ||
"key": "mockConfigKey", | ||
"value": "", | ||
"type": "a fully qualified URL (starting with `http://` or `https://`)" | ||
'key': 'mockConfigKey', | ||
'value': '', | ||
'type': 'a fully qualified URL (starting with `http://` or `https://`)', | ||
} | ||
|
||
exports['not string or array'] = { | ||
"key": "mockConfigKey", | ||
"value": null, | ||
"type": "a string or an array of strings" | ||
'key': 'mockConfigKey', | ||
'value': null, | ||
'type': 'a string or an array of strings', | ||
} | ||
|
||
exports['array of non-strings'] = { | ||
"key": "mockConfigKey", | ||
"value": [ | ||
'key': 'mockConfigKey', | ||
'value': [ | ||
1, | ||
2, | ||
3 | ||
3, | ||
], | ||
"type": "a string or an array of strings" | ||
'type': 'a string or an array of strings', | ||
} | ||
|
||
exports['not one of the strings error message'] = { | ||
"key": "test", | ||
"value": "nope", | ||
"type": "one of these values: \"foo\", \"bar\"" | ||
'key': 'test', | ||
'value': 'nope', | ||
'type': 'one of these values: "foo", "bar"', | ||
} | ||
|
||
exports['number instead of string'] = { | ||
"key": "test", | ||
"value": 42, | ||
"type": "one of these values: \"foo\", \"bar\"" | ||
'key': 'test', | ||
'value': 42, | ||
'type': 'one of these values: "foo", "bar"', | ||
} | ||
|
||
exports['null instead of string'] = { | ||
"key": "test", | ||
"value": null, | ||
"type": "one of these values: \"foo\", \"bar\"" | ||
'key': 'test', | ||
'value': null, | ||
'type': 'one of these values: "foo", "bar"', | ||
} | ||
|
||
exports['not one of the numbers error message'] = { | ||
"key": "test", | ||
"value": 4, | ||
"type": "one of these values: 1, 2, 3" | ||
'key': 'test', | ||
'value': 4, | ||
'type': 'one of these values: 1, 2, 3', | ||
} | ||
|
||
exports['string instead of a number'] = { | ||
"key": "test", | ||
"value": "foo", | ||
"type": "one of these values: 1, 2, 3" | ||
'key': 'test', | ||
'value': 'foo', | ||
'type': 'one of these values: 1, 2, 3', | ||
} | ||
|
||
exports['null instead of a number'] = { | ||
"key": "test", | ||
"value": null, | ||
"type": "one of these values: 1, 2, 3" | ||
'key': 'test', | ||
'value': null, | ||
'type': 'one of these values: 1, 2, 3', | ||
} | ||
|
||
exports['config/src/validation .isValidClientCertificatesSet returns error message for certs not passed as an array array 1'] = { | ||
"key": "mockConfigKey", | ||
"value": "1", | ||
"type": "a positive number or null or an object with keys \"openMode\" and \"runMode\" with values of numbers or nulls" | ||
'key': 'mockConfigKey', | ||
'value': '1', | ||
'type': 'a positive number or null or an object with keys "openMode" and "runMode" with values of numbers or nulls', | ||
} | ||
|
||
exports['config/src/validation .isValidClientCertificatesSet returns error message for certs object without url 1'] = { | ||
"key": "clientCertificates[0].url", | ||
"type": "a URL matcher" | ||
'key': 'clientCertificates[0].url', | ||
'type': 'a URL matcher', | ||
} | ||
|
||
exports['config/src/validation .isValidBrowser passes valid browsers and forms error messages for invalid ones isValidBrowser 1'] = { | ||
"name": "isValidBrowser", | ||
"behavior": [ | ||
'name': 'isValidBrowser', | ||
'behavior': [ | ||
{ | ||
"given": { | ||
"name": "Chrome", | ||
"displayName": "Chrome Browser", | ||
"family": "chromium", | ||
"path": "/path/to/chrome", | ||
"version": "1.2.3", | ||
"majorVersion": 1 | ||
'given': { | ||
'name': 'Chrome', | ||
'displayName': 'Chrome Browser', | ||
'family': 'chromium', | ||
'path': '/path/to/chrome', | ||
'version': '1.2.3', | ||
'majorVersion': 1, | ||
}, | ||
"expect": true | ||
'expect': true, | ||
}, | ||
{ | ||
"given": { | ||
"name": "FF", | ||
"displayName": "Firefox", | ||
"family": "firefox", | ||
"path": "/path/to/firefox", | ||
"version": "1.2.3", | ||
"majorVersion": "1" | ||
'given': { | ||
'name': 'FF', | ||
'displayName': 'Firefox', | ||
'family': 'firefox', | ||
'path': '/path/to/firefox', | ||
'version': '1.2.3', | ||
'majorVersion': '1', | ||
}, | ||
"expect": true | ||
'expect': true, | ||
}, | ||
{ | ||
"given": { | ||
"name": "Electron", | ||
"displayName": "Electron", | ||
"family": "chromium", | ||
"path": "", | ||
"version": "99.101.3", | ||
"majorVersion": 99 | ||
'given': { | ||
'name': 'Electron', | ||
'displayName': 'Electron', | ||
'family': 'chromium', | ||
'path': '', | ||
'version': '99.101.3', | ||
'majorVersion': 99, | ||
}, | ||
"expect": true | ||
'expect': true, | ||
}, | ||
{ | ||
"given": { | ||
"name": "No display name", | ||
"family": "chromium" | ||
'given': { | ||
'name': 'No display name', | ||
'family': 'chromium', | ||
}, | ||
"expect": { | ||
"key": "displayName", | ||
"value": { | ||
"name": "No display name", | ||
"family": "chromium" | ||
'expect': { | ||
'key': 'displayName', | ||
'value': { | ||
'name': 'No display name', | ||
'family': 'chromium', | ||
}, | ||
"type": "a non-empty string" | ||
} | ||
'type': 'a non-empty string', | ||
}, | ||
}, | ||
{ | ||
"given": { | ||
"name": "bad family", | ||
"displayName": "Bad family browser", | ||
"family": "unknown family" | ||
'given': { | ||
'name': 'bad family', | ||
'displayName': 'Bad family browser', | ||
'family': 'unknown family', | ||
}, | ||
"expect": { | ||
"key": "family", | ||
"value": { | ||
"name": "bad family", | ||
"displayName": "Bad family browser", | ||
"family": "unknown family" | ||
'expect': { | ||
'key': 'family', | ||
'value': { | ||
'name': 'bad family', | ||
'displayName': 'Bad family browser', | ||
'family': 'unknown family', | ||
}, | ||
"type": "either chromium, firefox or webkit" | ||
} | ||
} | ||
] | ||
'type': 'either chromium, firefox or webkit', | ||
}, | ||
}, | ||
], | ||
} | ||
|
||
exports['config/src/validation .isPlainObject returns error message when value is a not an object 1'] = { | ||
"key": "mockConfigKey", | ||
"value": 1, | ||
"type": "a plain object" | ||
'key': 'mockConfigKey', | ||
'value': 1, | ||
'type': 'a plain object', | ||
} | ||
|
||
exports['config/src/validation .isNumber returns error message when value is a not a number 1'] = { | ||
"key": "mockConfigKey", | ||
"value": "string", | ||
"type": "a number" | ||
'key': 'mockConfigKey', | ||
'value': 'string', | ||
'type': 'a number', | ||
} | ||
|
||
exports['config/src/validation .isNumberOrFalse returns error message when value is a not number or false 1'] = { | ||
"key": "mockConfigKey", | ||
"value": null, | ||
"type": "a number or false" | ||
'key': 'mockConfigKey', | ||
'value': null, | ||
'type': 'a number or false', | ||
} | ||
|
||
exports['config/src/validation .isBoolean returns error message when value is a not a string 1'] = { | ||
"key": "mockConfigKey", | ||
"value": 1, | ||
"type": "a string" | ||
'key': 'mockConfigKey', | ||
'value': 1, | ||
'type': 'a string', | ||
} | ||
|
||
exports['config/src/validation .isString returns error message when value is a not a string 1'] = { | ||
"key": "mockConfigKey", | ||
"value": 1, | ||
"type": "a string" | ||
'key': 'mockConfigKey', | ||
'value': 1, | ||
'type': 'a string', | ||
} | ||
|
||
exports['config/src/validation .isArray returns error message when value is a non-array 1'] = { | ||
"key": "mockConfigKey", | ||
"value": 1, | ||
"type": "an array" | ||
'key': 'mockConfigKey', | ||
'value': 1, | ||
'type': 'an array', | ||
} | ||
|
||
exports['config/src/validation .isStringOrFalse returns error message when value is neither string nor false 1'] = { | ||
"key": "mockConfigKey", | ||
"value": null, | ||
"type": "a string or false" | ||
'key': 'mockConfigKey', | ||
'value': null, | ||
'type': 'a string or false', | ||
} | ||
|
||
exports['invalid lower bound'] = { | ||
'key': 'test', | ||
'value': -1, | ||
'type': 'a valid CRF number between 0 & 51, false to disable compression, or true to use the default compression of 32', | ||
} | ||
|
||
exports['invalid upper bound'] = { | ||
'key': 'test', | ||
'value': 52, | ||
'type': 'a valid CRF number between 0 & 51, false to disable compression, or true to use the default compression of 32', | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 is still a valid number for CRF, we just don't compress the video since a CRF of 0 is essentially a non compressed video
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its better to be explicit that this disabled compression even if it is a valid CRF value. If I didn't have context, I'd expect 0 to compress since false is called out to prevent compression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I got this added in 53a07c9