I’m trying to run browser testing on CircleCi using TestCafe. I have followed this documentation. The major problem is that the chrome browser isn't able to open. CircleCi is able to successfully download the image because the spin environment is passed.
I am facing problem in the next step (Container circleci/node:11.6.0-browsers) on CircleCi which throws an error :
$ _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
Job was canceled
And later on the UI test step throws this error:
$ testcafe chrome:headless uitests/tests/* -r xunit:/tmp/test-results/res.xml -e
ERROR Was unable to open the browser "chrome:headless" due to an error.
Error: Unable to run the browser. The browser path or command template is not specified.
at checkBrowserPath$ (/rp-web/node_modules/testcafe-browser-tools/lib/api/open.js:47:23)
at tryCatch (/rp-web/node_modules/testcafe-browser-tools/node_modules/babel-runtime/regenerator/runtime.js:72:40)
at Generator.invoke [as _invoke] (/rp-web/node_modules/testcafe-browser-tools/node_modules/babel-runtime/regenerator/runtime.js:334:22)
at Generator.prototype.(anonymous function) [as next] (/rp-web/node_modules/testcafe-browser-tools/node_modules/babel-runtime/regenerator/runtime.js:105:21)
at tryCatch (/rp-web/node_modules/testcafe-browser-tools/node_modules/babel-runtime/regenerator/runtime.js:72:40)
at invoke (/rp-web/node_modules/testcafe-browser-tools/node_modules/babel-runtime/regenerator/runtime.js:146:20)
at /rp-web/node_modules/testcafe-browser-tools/node_modules/babel-runtime/regenerator/runtime.js:191:11
at new Promise (<anonymous>)
at new F (/rp-web/node_modules/core-js/library/modules/$.export.js:30:36)
at callInvokeWithMethodAndArg (/rp-web/node_modules/testcafe-browser-tools/node_modules/babel-runtime/regenerator/runtime.js:190:16)
Type "testcafe -h" for help.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Exited with code 1
this is how my yml looks like:
jobs:
build-and-test:
working_directory: /repo
docker:
- image: node:10.5.0
- image: circleci/node:11.6-browsers
Also, tried the run command with no sandbox but got the same error:
testcafe chrome:headless uitests/tests/* -r xunit:/tmp/test results/res.xml -e --no-sandbox
I'm successfully able to run things locally but unable to run on CircleCi. Can anyone help with this on how to fix this?