bug
when I launch test with nightmare (using testcafe-browser-provider-nightmare) i get
ERROR Unable to establish one or more of the specified browser connections. This can be caused by network issues or remote device failure.
I use amazone EC2 instance,
also i open some ports from amazon console, and runt tests using "DEBUG=* testcafe nightmare tests/ --ports 9991,9992 --hostname 127.0.0.1" - no luck(
test results expected
fails at any test
Tested with test.js example from testcafe
Hello, Eldar! Likely it's because the nightmare browser requires an X11 display server on Linux, which is not enabled by default on Amazon EC2. It required to install and run Xvfb; required commands depend on a distribution that you use in your instance. E.g. for Debian-based distros, including Ubuntu, it is like:
apt-get install xvfb
Xvfb :99 -ac -screen 0 1024x768x16
export DISPLAY=:99.0
testcafe nightmare tests/
Hi Andrey,
It works!!
I use "xvfb-run" to run this tests,
Thanks!
Hi how to run xvfb-run? what's the options?
Hello @jackyxiao126, it's likely
xvfb-run --server-num=99 --server-args='-ac -screen 0 1024x768x16' testcafe ...
Check the xvfb-run manual.
Could get Jenkins in Docker to run TestCafe with Firefox and Nightmare, but not Chrome/Chromium.
xvfb-run -a --server-args='-ac -screen 0 1024x768x16' npm run jenkins-testcafe
Chrome needs the --no-sandbox flag in a Docker container, or container should be started in privileged mode.
testcafe 'chrome --no-sandbox' tests/
Hi Everyone,
I am facing the same issue when running tests in Jenkins env using Firefox browser.
Unable to establish one or more of the specified browser connections. This can be caused by network issues or remote device failure.
@AndreyBelym
Could you please help me here?
Hi @avozicov,if it's a headless Linux server you should check that you've configured Xvfb: https://github.com/DevExpress/testcafe/issues/1133#issuecomment-272447990. Or you can try to use Firefox 57+ in headless mode.
If it's a WIndows server, and you configured Jenkins to run as a service, you can try to start Jenkins from command line, or follow this article to enable GUI for the Jenkins service.
I had the same issue with the Travis CI setup for the open source project I am working on.
The changes made the work again.
Testcafe itself has a documentation page for such topics.
Documentation
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.
Most helpful comment
Chrome needs the
--no-sandboxflag in a Docker container, or container should be started in privileged mode.