Closed reidkersey closed 1 year ago
@reidkersey I am facing exactly the same here. Using Cypress 8.7.0, did you find a solution for thie?
The only thing I found was to use Chrome instead of Electron
Same thing with Cypress 9.7.0, and I am using Chrome
Same here with cypress 10.3.1
Anyone managed to find a solution for this? Having the same issue in 10.6.0 when running it in docker
Occurring on 10.11.0
used commands: npm insall export ELECTRON_RUN_AS_NODE=1 npm run test
now iam getting this error......Anyone had any solution for this error??
It looks like this is your first time using Cypress: 12.7.0
[STARTED] Task without title. [FAILED] Cypress failed to start. [FAILED] [FAILED] This may be due to a missing library or dependency. https://on.cypress.io/required-dependencies [FAILED] [FAILED] Please refer to the error below for more details. [FAILED] [FAILED] ---------- [FAILED] [FAILED] /apps/jenkins/.cache/Cypress/12.7.0/Cypress/Cypress: bad option: --no-sandbox [FAILED] /apps/jenkins/.cache/Cypress/12.7.0/Cypress/Cypress: bad option: --smoke-test [FAILED] /apps/jenkins/.cache/Cypress/12.7.0/Cypress/Cypress: bad option: --ping=990 [FAILED] [FAILED] ---------- [FAILED]
used commands: npm insall export ELECTRON_RUN_AS_NODE=1 npm run test
now iam getting this error......Anyone had any solution for this error??
It looks like this is your first time using Cypress: 12.7.0
[STARTED] Task without title. [FAILED] Cypress failed to start. [FAILED] [FAILED] This may be due to a missing library or dependency. https://on.cypress.io/required-dependencies [FAILED] [FAILED] Please refer to the error below for more details. [FAILED] [FAILED] ---------- [FAILED] [FAILED] /apps/jenkins/.cache/Cypress/12.7.0/Cypress/Cypress: bad option: --no-sandbox [FAILED] /apps/jenkins/.cache/Cypress/12.7.0/Cypress/Cypress: bad option: --smoke-test [FAILED] /apps/jenkins/.cache/Cypress/12.7.0/Cypress/Cypress: bad option: --ping=990 [FAILED] [FAILED] ---------- [FAILED]
Same here with cypress 12.7 on Platform: linux-x64 (Red Hat Linux - 8.7)
did you fix it?
here is my npm command:
"cypress:run": " cypress run --component --browser chrome --headless"
Same here with Cypress 12.10.0, also setting ELECTRON_RUN_AS_NODE=1
Yesterday I tried for hours to get it to work with either the atlassian/default-image:3
or a custom docker image that I build on top of that. My Dockerfile I ended up with (while testing) was:
FROM atlassian/default-image:3
RUN apt-get update && \
apt-get autoremove -y && \
apt-get install -y --no-install-recommends libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb && \
rm -rf /var/lib/apt/lists/*
RUN Xvfb -screen 0 1280x1024x24 :99 &
ENV DISPLAY=:99
I also tried with ELECTRON_RUN_AS_NODE=1
before, I tried different Xvfb
-commands, but nothing worked.
I've almost given up hope, when I realized that I can use different images per pipeline-step in Bitbucket-Pipeline,
so my current solution is (in bitbucket-pipelines.yml
):
image: atlassian/default-image:3
pipelines:
branches:
master:
- step:
name: Build Frontend
deployment: production
caches:
- cypress
- node
- npm
clone:
depth: full
script:
- npm install -g grunt
- npm install
- grunt build4CDN
- declare -x VERSION=$(jq -r '.version' package.json)
- mkdir frontend
- mv build/assets/website frontend/${VERSION}
- mkdir changelog
- cp changelog.* changelog/
artifacts:
- changelog/**
- frontend/**
- parallel:
- step:
name: Deploy Frontend
clone:
depth: 1
caches:
- docker
services:
- docker
script:
- declare -x VERSION=$(jq -r '.version' package.json)
- pipe: atlassian/ftp-deploy:0.3.7
variables:
USER: $FTP_USER
PASSWORD: $FTP_PASS
SERVER: $FTP_HOST
REMOTE_PATH: './frontend/${VERSION}'
LOCAL_PATH: 'frontend/${VERSION}'
- step:
name: Deploy Changelog
clone:
enabled: false
caches:
- docker
services:
- docker
script:
- pipe: atlassian/ftp-deploy:0.3.7
variables:
USER: $FTP_USER
PASSWORD: $FTP_PASS
SERVER: $FTP_HOST
REMOTE_PATH: './frontend/changelog'
LOCAL_PATH: './changelog'
# TODO: Temporarily use different image until one of the following is resolved:
# https://github.com/cypress-io/cypress/issues/18183
# https://github.com/cypress-io/cypress/issues/18224
# and then use one image for all work / image: nonconformist/bitbucket-cypress:v1-release
- step:
name: End-to-End Testing
image: cypress/browsers:node14.17.6-chrome100-ff98
clone:
depth: 1
caches:
- cypress
- docker
- node
- npm
services:
- docker
script:
- npm -g config set user root
- npm test
- npm run test:chrome
- npm run test:firefox
definitions:
caches:
npm: $HOME/.npm
cypress: $HOME/.cache/Cypress
See the last step, it uses a different image: image: cypress/browsers:node14.17.6-chrome100-ff98
The relevant scripts from package.json
:
"test": "npx cypress run --headless --browser electron",
"test:chrome": "npx cypress run --headless --browser chrome",
"test:firefox": "npx cypress run --headless --browser firefox",
Hopefully this helps someone 🚀
Hopefully this helps someone 🚀
@reidkersey does this solution help you?
Just to clarify: It's more of a workaround, then a real solution. Ideally I think we all would like only one image for the whole build-process, as it saves time and build-budget.
@sebastian-marinescu Can you try the steps towards the bottom of this comment about "warming up" Cypress on initial install?
https://github.com/cypress-io/cypress/issues/17412#issuecomment-1125015667
I believe you are running into the same issue.
Hopefully this helps someone 🚀
@reidkersey does this solution help you?
We moved over to playwright for other reasons and it's been working great for us.
For this issue, please follow the progress here: https://github.com/cypress-io/cypress/issues/19868
Current behavior
I am working to integrate cypress testing into our CI. I was getting Xvfb errors, so I started using the
ELECTRON_RUN_AS_NODE=1
env variable.However, when that variable is fixed, it fixes the Xvfb errors but causes some bad option errors.
Desired behavior
Run the tests
Test code to reproduce
My configuration is:
I am also setting the env var
ELECTRON_RUN_AS_NODE=1
externally by usingexport ELECTRON_RUN_AS_NODE=1
Cypress Version
v8.3.0 (Also tested in 8.4.1)
Other
Not sure if the issue is related or not, but I can't test this issue locally because when I set the
ELECTRON_RUN_AS_NODE=1
env variable I get the errorError: Cannot find module '/Users/reidkersey/Library/Caches/Cypress/8.3.0/Cypress.app/Contents/MacOS/Contents/Resources/app/index.js'
I have also tried setting
"ELECTRON_RUN_AS_NODE": "1"
in the env section of the config file, and that didn't work, and gave me the Xvfb error.