Cypress verify command failing
See original GitHub issueCurrent behavior:
After an apt update of ubuntu 18.04 (yesterday 16/01/2020), the following cypress command return an error.
npx cypress verify
It looks like this is your first time using Cypress: 3.8.2
✖ Verifying Cypress can run /root/.cache/Cypress/3.8.2/Cypress → Cypress Version: 3.8.2 Cypress failed to start.
This is usually caused by a missing library or dependency.
The error below should indicate which dependency is missing.
https://on.cypress.io/required-dependencies
If you are using Docker, we provide containers with all required dependencies installed.
Command failed: /root/.cache/Cypress/3.8.2/Cypress/Cypress --no-sandbox --smoke-test --ping=24
Platform: linux (Ubuntu Linux - 18.04) Cypress Version: 3.8.2
/root/.cache/Cypress/3.8.2/Cypress/Cypress --no-sandbox --smoke-test --ping=24
(Cypress:20915): Gtk-WARNING **: 12:20:46.593: cannot open display:
Desired behavior:
cypress verify should pass
Test code to reproduce
Versions
Ubuntu Linux - 18.04 Cypress Version: 3.8.2
Packages Versions :
apt-get install libgtk2.0-0 libgtk-3-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
libgtk2.0-0 is already the newest version (2.24.32-1ubuntu1). libnotify-dev is already the newest version (0.7.7-3). libxss1 is already the newest version (1:1.2.2-1). libxtst6 is already the newest version (2:1.2.3-1). xauth is already the newest version (1:1.0.10-1). libgconf-2-4 is already the newest version (3.2.6-4ubuntu1). libasound2 is already the newest version (1.1.3-5ubuntu0.2). libgtk-3-0 is already the newest version (3.22.30-1ubuntu4). libnss3 is already the newest version (2:3.35-2ubuntu2.7). xvfb is already the newest version (2:1.19.6-1ubuntu4.3).
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:15 (5 by maintainers)
Got the source of the problem, Xvfb is run without
-screen
so electron dies with:If is set fallback
this._xvfb_args = options.xvfb_args || [ '-screen', '0', '1024x768x24' ]
at @cypress/xvfb it looks like everything works.I’ve got a docker image before it was broken. If I run the following command
you can see cypress starts and correctly waits for something that’s not running. If I do an
apt update
andapt upgrade
with the following output:and the I run the previous command again I get this output
A workaround found by @krishofmans is running your command prefixed with
xvfb-run --server-args="-screen 0 1024x768x24"