I have an e2e tests project in protractor (v7) with chrome set as the target browser in the config.ts
...
directConnect: true,
multiCapabilities: [
{
browserName: 'chrome',
chromeOptions: {
args: ["--headless", "--disable-gpu", "--window-size=1920x1080", "--no-sandbox"]
}
}
],
...
Running the project via gitlab-runner's shell executor with gitlab-runner exec shell run_tests
works fine but if i run it via gitlab-runner's docker executor, with gitlab-runner exec docker run_tests
, it crashes on the yarn test
cmd (which basically translates to protractor config.ts
) of the gitlab-ci script with the following logs:
protractor config.ts
[09:14:27] I/launcher - Running 1 instances of WebDriver
[09:14:27] I/direct - Using ChromeDriver directly...
[09:14:27] E/launcher - spawn /builds/project-0/node_modules/webdriver-manager/selenium/chromedriver_90.0.4430.24 ENOENT
[09:14:27] E/launcher - Error: spawn /builds/project-0/node_modules/webdriver-manager/selenium/chromedriver_90.0.4430.24 ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:249:19)
at onErrorNT (internal/child_process.js:442:16)
at processTicksAndRejections (internal/process/task_queues.js:84:9)
[09:14:27] E/launcher - Process exited with error code 199
error Command failed with exit code 199.
The .gitlab-ci.yml looks like this:
image: node:12.2.0-alpine
stages:
- run
variables:
SERVER_URL: "https://xyz.io/login"
USER_1_USERNAME: "rico"
run_tests:
stage: run
script:
- echo $SERVER_URL
- echo $USER_1_USERNAME
- yarn install:deps
- yarn test
Any help will be much appreciated. Am i missing chrome installation in the ci script ?