Reputation: 28
I am currently trying to setup a basic repo for my next React project. For that I want to have end-to-end tests in place via webdriverio + cucumber.
While just running wdio
works fine locally, I cannot get it to run in my docker container. Even though I added wdio-docker-service it told me:
(service: reap) (step: feature_tests) A service failed in the
'onPrepare' hook (service: reap) (step: feature_tests) Error: not
found: java
When I was installing java manually in the Dockerfile it would complain:
(service: reap) (step: feature_tests) A service failed in the
'onPrepare' hook (service: reap) (step: feature_tests) Error: Selenium
server did not start. (service: reap) (step: feature_tests) Another
Selenium process may already be running or your java version may be
out of date. (service: reap) (step: feature_tests) Be sure to check
the official Selenium release notes for minimum required java version:
https://raw.githubusercontent.com/SeleniumHQ/selenium/master/java/CHANGELOG
Upvotes: 0
Views: 1839
Reputation: 2269
The first error seems to be coming from the 'selenium-standalone' service you're loading, which tries to start Selenium via Java. Since you're using the 'node' docker image, it doesn't have Java installed.
To use the 'wdio-docker-service', you need to get replace 'selenium-standalone' with 'docker' in your services line.
There will be two docker images running, the one with your tests that WebdriverIO is run on (Node), and the one running selenium standalone (started by wdio-docker-service).
Alternatively, you can run your WebdriverIO command locally, and just use Docker for the selenium standalone instance. That's probably easier, but less portable.
Upvotes: 2