I am trying to run a simple test which navigates to google.com and captures its performance metrics. I am using docker compose. One container has the webdriverIO automation app and another container has selenium/selenium-chrome running on port 4444. Below are my docker-compose, wdio and error message. I am assuming the automation container is unable to communicate or get the tests running on selenium containers port 4444. Selenium is running successfully in its container. What could I be doing wrong?
docker-compose.yml:
version: '3'
services:
app:
container_name: perfApp
build: .
depends_on:
- selenium
links:
- selenium
command: npm run test:compose -- --host selenium
volumes:
- ./app:/app
selenium:
container_name: seleniumApp
image: selenium/standalone-chrome
expose:
- "4444"
ports:
- "4444:4444"
network_mode: host
volumes:
- ./:/app
wdio:
exports.config = {
sync: true,
path: '/wd/hub',
specs: [
'./test/specs/**/basic.js'
],
maxInstances: 10,
capabilities: [{
browserName: 'chrome',
}],
logLevels: 'trace',
bail: 0,
waitforTimeout: 10000,
connectionRetryCount: 3,
services: ['devtools'],
framework: 'mocha',
reporters: ['allure'],
mochaOpts: {
ui: 'bdd',
timeout: 360000
},
afterTest: function(test, context, { error, result, duration, passed, retries }) {
if (!passed) {
browser.takeScreenshot();
}
},
}
Error: [0-0] 2020-03-12T17:03:51.087Z ERROR webdriver: Request failed due to Error: connect ECONNREFUSED 127.0.0.1:4444 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16) [0-0] 2020-03-12T17:03:51.088Z ERROR webdriver: Error: connect ECONNREFUSED 127.0.0.1:4444 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16) [0-0] 2020-03-12T17:03:51.088Z ERROR @wdio/runner: Error: Failed to create session. Unable to connect to "127.0.0.1:4444", make sure browser driver is running on that address.