Issue running wdio tests (v8) in a docker container on CI #11000
-
Hello, I'm having an issue with running tests in a docker container since upgrading from v7 to v8. Env: In our Jenkins pipeline, we use a dockerFile as agent for our WDIO tests. When the tests are launched in this container, the logs show that Chrome for testing and Chromedriver are downloaded
The runner then goes through the hooks (onWorkerStart, beforeSession) but gets stuck after running the first feature file:
After the log The same test, with the same wdio.conf file, runs well on my local environment. It also ran without issue in the same container, but with WDIO v7. Capabilities
browserName: 'chrome',
browserVersion: 'stable',
acceptInsecureCerts: true,
'goog:chromeOptions': {
args: [
'--no-sandbox',
'--disable-dev-shm-usage',
'--ignore-certificate-errors',
'--allow-insecure-localhost',
'--window-size=1920,1080',
'--headless=new',
'--disable-gpu'
],
prefs: {
directory_upgrade: true,
'download.prompt_for_download': false,
'download.default_directory': '/custom/path/for/downloads',
'safebrowsing.enabled': false,
'safebrowsing.disable_download_protection': true
} I'm not sure where the issue lies, if it is a conf issue, or an issue with the node image, or something else entirely. Any help would be appreciated. I should be able to provide more details if needed |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 10 replies
-
Can you please provide the full wdio logs? |
Beta Was this translation helpful? Give feedback.
-
Here are the logs (I removed most of the "Downloading Chrome" ones as they're not relevant): wdio logs
It then gets stuck here, and keeps on running, never ending. I tried to investigate, and from what I found, it gets stuck in the function My guess is that it's an issue I should discuss on the wait-port github, though I'd appreciate some leads if you have any. Thanks |
Beta Was this translation helpful? Give feedback.
-
Even I have the same issue, Trying to run the tests inside a docker container with WDIO 8, runs fine in local though with browser version set in capabilities. But when i try to run in docker container i see that it gets stuck at logs
part of my config
|
Beta Was this translation helpful? Give feedback.
-
Hi, `added 779 packages, and audited 780 packages in 10s 100 packages are looking for funding found 0 vulnerabilities
Execution of 1 workers started at 2023-09-14T13:49:54.312Z 2023-09-14T13:49:54.324Z INFO @wdio/cli:launcher: Run onPrepare hook Spec Files: 0 passed, 1 failed, 1 total (100% completed) in 00:00:16 2023-09-14T13:50:10.555Z INFO @wdio/local-runner: Shutting down spawned worker ❌ npm run test |
Beta Was this translation helpful? Give feedback.
So, it seems it was a Selenium issue. I tried to change my base image from
FROM node:16.19.0-buster
toFROM circleci/node:16-browsers
and the driver could start.In the CircleCI image, the Selenium jar is downloaded and put in /usr/local/bin/
As I don't need everything in the CircleCI image, I still use the node one, but I added the commands to get the Selenium jar.
For Java, I used to install it with
COPY --from=eclipse-temurin:11
but it didn't seem to work here, so I installed it with the apt command found at L25.I also had to add the chrome dependencies described in the CircleCI Dockerfile (at L36).
I don't know about Java, but is there a possibility that WDIO could take care of downl…