Online Training: Web test automation with CodeceptJS. Sign up now!

Docker with Webdriver IO

hello all,
I’m trying to use the codeceptjs in docker and just happens errors, someone’s already seen these:

codeceptjs_1_15dbab65b9c9 | Error: Can’t connect to WebDriver.
codeceptjs_1_15dbab65b9c9 | Error: Failed to create session.

when I take out the wdio plugin. codecept.conf.js:

    exports.config = {
      tests: './tests/*_test.js',
      output: './output',
      helpers: {
        WebDriver: {
          url: 'http://127.0.0.1:3000/',
          browser: 'chrome',
          host: 'chrome-container',
          desiredCapabilities: {
            chromeOptions: {
              args: ["--headless", '--disable-extensions', '--disable-gpu', '--no-sandbox', '--disable-dev-shm-usage']
            }
          },
          windowSize: "1440x1000",
          smartWait: 5000,
          timeouts: {
            "script": 60000,
            "page load": 10000
          }
        }
      },
      include: {
        I: './steps_file.js',
        masters: './pages/masters.js',
        newOrder: './steps/newOrderSteps.js',
        newItemOrderFill: './pages/itemOrderFill.js',
        styleBehavior: './steps/doorStyleBehavior.js',
        glazedUnitBehavior: './steps/glazedUnitBehaviors.js'
      },
      bootstrap: null,
      mocha: {},
      name: 'TestsSuit',
      // plugins: {
      //   wdio: {
      //     enabled: true,
      //     services: ['selenium-standalone']
      //   },
      //   autoDelay:{
      //     enabled: false
      //   },
      //   screenshotOnFail: {
      //     enabled: true
      //    },
      // }
    }

Docker-compose:

version: '3.7'
services:
  chrome-container:
    container_name: chrome-container
    image: selenium/standalone-chrome-debug:3.141.59
    ports:
      - '4444'
      - '5900'
  codeceptjs:
    image: codeception/codeceptjs
    depends_on:
      - chrome-container
    volumes:
      - .:/tests

When I add wdio:

exports.config = {
  tests: './tests/*_test.js',
  output: './output',
  helpers: {
WebDriver: {
  url: 'http://127.0.0.1:3000/',
  browser: 'chrome',
  host: 'chrome-container',
  desiredCapabilities: {
    chromeOptions: {
      args: ["--headless", '--disable-extensions', '--disable-gpu', '--no-sandbox', '--disable-dev-shm-usage']
    }
  },
  windowSize: "1440x1000",
  smartWait: 5000,
  timeouts: {
    "script": 60000,
    "page load": 10000
  }
}
  },
  include: {
I: './steps_file.js',
masters: './pages/masters.js',
newOrder: './steps/newOrderSteps.js',
newItemOrderFill: './pages/itemOrderFill.js',
styleBehavior: './steps/doorStyleBehavior.js',
glazedUnitBehavior: './steps/glazedUnitBehaviors.js'
  },
  bootstrap: null,
  mocha: {},
  name: 'TestsSuit',
  plugins: {
wdio: {
  enabled: true,
  services: ['selenium-standalone']
},
autoDelay:{
  enabled: false
},
screenshotOnFail: {
  enabled: true
 },
  }
}

codeceptjs_1_15dbab65b9c9 | Error: not found: java
codeceptjs_1_15dbab65b9c9 | Tests started at 17:30 and finished at 17:30 Summarizing 0.13391666666666666 (edited)

Java is not pre installed in codeceptjs image. More info could be found here https://github.com/Codeception/CodeceptJS/pull/2035

But there is in the selenium/standalone-chrome-debug:3.141.59

And this image is predicted in the Docker-Compose mentioned…