Setting Electron Dimensions Does Not Work In CI
See original GitHub issueCurrent behavior
I was following the instructions at https://docs.cypress.io/api/plugins/browser-launch-api#Set-screen-size-when-running-headless to try to set the Electron headless dimensions when running in CI because at the moment the videos are very low quality. I have copied the exact code shown and it works fine locally but does not seem to have any affect when running on TeamCity. I’ve previously been doing this with Chrome and it worked fine but Electron does not work on CI for some reason.
Desired behavior
I would like any way to have decent looking recordings when setting the Electron viewport to 1367x768, currently the recording sidebar takes almost half the screen and I can’t really see the browser view.
Test code to reproduce
index.js
module.exports = (on, config) => {
on("before:browser:launch", (browser = {}, launchOptions) => {
console.log(
"launching browser %s is headless? %s",
browser.name,
browser.isHeadless,
);
// the browser width and height we want to get
// our screenshots and videos will be of that resolution
const width = 1920;
const height = 1080;
console.log("setting the browser window size to %d x %d", width, height);
if (browser.name === "chrome" && browser.isHeadless) {
launchOptions.args.push(`--window-size=${width},${height}`);
// force screen to be non-retina and just use our given resolution
launchOptions.args.push("--force-device-scale-factor=1");
}
if (browser.name === "electron" && browser.isHeadless) {
launchOptions.preferences.width = width;
launchOptions.preferences.height = height;
}
if (browser.name === "firefox" && browser.isHeadless) {
launchOptions.args.push(`--width=${width}`);
launchOptions.args.push(`--height=${height}`);
}
return launchOptions;
})
return config;
}
cypress.json
"viewportWidth": 1366,
"viewportHeight": 768,
Versions
6.8.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
electron-builder vs electron-packager [closed] - Stack Overflow
Update August 2019. I've been using electron-builder for more than a year now, packaging my app for macOS, Windows 10, and Ubuntu Desktop....
Read more >Common Configuration - electron-builder
If not specified inside of the build configuration, productName property defined at the top level of package.json is used. If not specified at...
Read more >Precision Measurements with the Single Electron Transistor
7.8 Superconducting SET Backaction: Conclusions and Future Work . ... coupling to the system that the SET is measuring (not shown in this...
Read more >Atom size electron vortex beams with selectable orbital ...
The main problem of using holographic dislocation masks is, that all different vortex states (e.g. L = +1, L = 0, L =...
Read more >Black-Box Description of Electron Correlation with the Spin ...
When we truncate the CI expansion at singles, we do not gain any ... using a 6-31G basis set, and the CI dimensions...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
this will be fixed in #15686
Thanks all, our recordings look great in 7.0.0. Will be upgrading after performance issues are sorted out.