Dont start all browsers in selenoid with docker-compose

Viewed 335

tell me about the docker: I have Windows 10+WSL2+docker for win, installed selenoid in ubuntu, launched and downloaded the images. (chrome 90,91 etc..)

The container aero cube/selenoid and aerocube/selenoid-ui is successfully launched, the tests in it from IDEA pass with a bang. I want to run tests in 2 versions of chrome via docker compose.

Config browser.json

{
  "chrome": {
    "default": "90.0",
    "versions": {
      "90.0": {
        "env" : ["LANG=ru_RU.UTF-8", "LANGUAGE=ru:en", "LC_ALL=ru_RU.UTF-8", "TZ=Europe/Moscow"],
        "image": "selenoid/chrome:90.0",
        "tmpfs": {"/tmp": "size=512m"},
        "hosts": ["x01.aidata.io:127.0.0.1"],
        "port": "4444"
      },
      "91.0": {
        "env": ["LANG=ru_RU.UTF-8", "LANGUAGE=ru:en", "LC_ALL=ru_RU.UTF-8", "TZ=Europe/Moscow"],
        "image": "selenoid/chrome:91.0",
        "tmpfs": {"/tmp": "size=512m"},
        "hosts": ["x01.aidata.io:127.0.0.1"],
        "port": "4444"
      }
    }
  }
}

Config docker-compose.yaml

version: '3.4'

services:
  selenoid:
    image: aerokube/selenoid:latest-release
    volumes:
      - "${PWD}/init/selenoid:/etc/selenoid"
      - "${PWD}/work/selenoid/video:/opt/selenoid/video"
      - "${PWD}/work/selenoid/logs:/opt/selenoid/logs"
      - "/var/run/docker.sock:/var/run/docker.sock"
    environment:
      - OVERRIDE_VIDEO_OUTPUT_DIR=work/selenoid/video
    command: ["-conf", "etc/selenoid/browsers.json", "-video-output-dir", "/opt/selenoid/video", "-log-output-dir", "/opt/selenoid/logs"]
    ports:
      - "4444:4444"
    network_mode: bridge

in IDEA:

@BeforeEach
public void initDriver() throws IOException {
    final String url = "http://localhost:4444/wd/hub";
    WebDriver driver = new RemoteWebDriver(new URL(url), DesiredCapabilities.chrome());
    driver.manage().window().setSize(new Dimension(1920,1024));
    WebDriverRunner.setWebDriver(driver);
}

@AfterEach
    public void stopDriver() {
    Optional.ofNullable(WebDriverRunner.getWebDriver()).ifPresent(WebDriver::quit);
      }

It starts only the 90th version (it is the first in browser.json) passes successfully and closes ignoring everything else that needs to be corrected? )

1 Answers

with the docker, everything is OK, we figured it out, you will need to edit the configs of the grad for selenide close topic

Related