Я пытаюсь понять, как правильно настроить мой compose-файл для запуска webdriverio.
Я следую инструкциям:
https://github.com/SeleniumHQ/docker-selenium/wiki/Getting-Started-with-Docker-Compose
и здесь
https://github.com/blueimp/wdio/blob/master/docker-compose.yml
Я в основном изо всех сил пытаюсь понять, чтоконцентраторы должны у меня быть и что зависит от чего.Любые входные данные приветствуются
вот мой файл docker-compose
version: '3'
services:
chromedriver:
image: blueimp/chromedriver
environment:
- DISABLE_X11=false
- ENABLE_VNC=true
- EXPOSE_X11=true
ports:
- 127.0.0.1:7900:7900
geckodriver:
image: blueimp/geckodriver
environment:
- DISABLE_X11=false
- ENABLE_VNC=true
- EXPOSE_X11=true
ports:
- 127.0.0.1:6901:6900
selenium:
image: selenium/hub
ports:
- '14444:4444'
firefox:
image: selenium/node-firefox
ports:
- 5900
environment:
- HUB_PORT_4444_TCP_ADDR=selenium
depends_on:
- selenium
chrome:
image: selenium/node-chrome
ports:
- 5900
environment:
- HUB_PORT_4444_TCP_ADDR=selenium
depends_on:
- selenium
my-app-selenium:
build: .
environment:
SELENIUM_REMOTE_URL: 'http://selenium:4444/wd/hub'
SELENIUM_APP_SUPER_URL: 'http://192.168.0.10:9000/super/'
SELENIUM_APP_ADMIN_URL: 'http://192.168.0.10:9000/admin/'
вот мой Dockerfile
FROM node:carbon
RUN apt-get update && apt-get upgrade -y
WORKDIR /var/app/current
COPY package.json package-lock.json ./
RUN npm install
RUN apt-get update && \
apt-get install -y openjdk-8-jdk && \
apt-get install -y ant && \
apt-get clean;
# Fix certificate issues
RUN apt-get update && \
apt-get install ca-certificates-java && \
apt-get clean && \
update-ca-certificates -f;
# Setup JAVA_HOME -- useful for docker commandline
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
RUN export JAVA_HOME
COPY . .
CMD ./wait && npm run test
последняя ошибка, которую я получил в консоли, была
unknown error: unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.43.600233 (523efee95e3d68b8719b3a1c83051aa63aa6b10d),platform=Linux 4.15.0-46-generic x86_64) (WARNING: The server did not provide any stacktrace information)
и
Driver info: driver.version: unknown
wdio.conf.js
//to use debug option run `DEBUG=true followed by your .conf.js`
const defaultTimeoutInterval = process.env.DEBUG ? (60 * 60 * 500) : 90000;
exports.config = {
hostname: 'selenium',
port: 4444,
specs: [
'./test/specs/*.js'
],
exclude: [],
maxInstances: 15,
capabilities: [{
maxInstances: 5,
browserName: 'chrome'
}, ],
sync: false,
logLevel: 'silent',
deprecationWarnings: true,
bail: 0,
baseUrl: 'http://localhost:9000',
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
// services: ['docker'],
framework: 'mocha',
mochaOpts: {
ui: 'bdd',
timeout: 90000,
compilers: ['js:@babel/register'],
},
reporters: [
'spec',
['junit', {
outputDir: './test/reports/junit-results/',
outputFileFormat: function (opts) { // optional
return `results-${opts.cid}.${opts.capabilities}.xml`
}
}],
['allure', {
outputDir: './test/reports/allure-results/',
disableWebdriverStepsReporting: true,
disableWebdriverScreenshotsReporting: false,
}],
],
onPrepare: function (config, capabilities) {
console.log('**** let\'s go ****');
},
beforeSession: function (config, capabilities, specs) {
require('@babel/register');
},
before: function (capabilities, specs) {
/**
* Setup the Chai assertion framework
*/
const chai = require('chai');
global.expect = chai.expect;
global.assert = chai.assert;
global.should = chai.should();
},
afterTest: function (test) {
//console.log(test);
},
onComplete: function (exitCode) {
console.log('**** that\'s it ****');
}
}