Right now the resolution of the screenshots and the recorded video is fixed at 1280x720. This should be configurable
+1
Like also to see this feature/option! 馃憤 HD, FHD or even UHD with all kidding aside... 馃槃 Not sure if this is technically possible but it would be nice indeed.
any news about this issue? would really be helpfull. sometimes it is not possible/very hard to read tiny texts on recorded video :(
+1
@jennifer-shehane any update?
This worked for me and adjusted all attached screenshots to x1080.
In cypress\plugins\index.js:
module.exports = (on,config) => {
on('before:browser:launch', (browser = {}, launchOptions) => {
if (browser.name === 'electron') {
launchOptions.preferences['width'] = 1920;
launchOptions.preferences['height'] = 1080;
launchOptions.preferences['resizable'] = false;
return launchOptions
}
if (browser.name === 'chrome' && browser.isHeadless) {
launchOptions.push('--window-size=1920,1080')
return launchOptions
}
})
};
@Phenomite where did you add that code?
Oh yes sorry, updated.
In the latest version of Cypress (4.0.0 and up), the signature of the before:browser;launch
event has changed, the second parameter is now an object, not an array, so this needs to be changed a little bit. Also, we only want to do this if we are running headless, even if it is Electron, so my final version is a bit different:
on('before:browser:launch', (browser = {}, launchOptions) => {
if (browser.name === 'electron' && browser.isHeadless) {
launchOptions.preferences['width'] = 1920;
launchOptions.preferences['height'] = 1080;
launchOptions.preferences['resizable'] = false;
return launchOptions
}
if (browser.name === 'chrome' && browser.isHeadless) {
launchOptions.args.push('--window-size=1920,1080')
return launchOptions
}
})
I can confirm that this works perfectly both for screenshots and videos, so this is great news
Do you need to return unmodified launchOptions, or is implicitly returning undefined fine? This is a feature I'm interested in using. Should I copy from the above, or is this supposed to be added to some future release? How does the cypress config viewPort relate to this? I had imagined that the video should capture the viewPort, and then it could be optional if we also want to capture the test runner that wraps the app. But that is maybe out of scope for this ticket.
You can see high-resolution movies in action in http://github.com/bahmutov/cypress-movie
Example still from the movie showing the resolution
Most helpful comment
any news about this issue? would really be helpfull. sometimes it is not possible/very hard to read tiny texts on recorded video :(