Home | RU | EN

docker-compose.yml - with video recording capability

services:
  selenoid:
    image: aerokube/selenoid
    network_mode: bridge
    ports:
      - "4444:4444"
    volumes:
      - ${PWD}:/etc/selenoid
      - /var/run/docker.sock:/var/run/docker.sock
      - ${PWD}/video:/opt/selenoid/video
      - ${PWD}/logs:/opt/selenoid/logs
    environment:
      OVERRIDE_VIDEO_OUTPUT_DIR: /root/selenoid_with_video/video     #here the path to the video folder specified above must be absolute! ${PWD} won't work. As written in the official docs
    command:
      [
        "-conf", "/etc/selenoid/browsers.json",
        "-video-output-dir", "/opt/selenoid/video",
        "-log-output-dir", "/opt/selenoid/logs"
      ]

  selenoid-ui:
    container_name: selenoid-ui
    image: aerokube/selenoid-ui
    network_mode: bridge
    links:
      - selenoid
    ports:
      - "8080:8080"
    command: ["--selenoid-uri", "http://selenoid:4444"]
Important for video recording:

Passing parameters to test (Selenide/Java):

Configuration.browserCapabilities.setCapability(
    "selenoid:options",
    Map.of(
        "enableVNC", true,
        "enableLog", true,
        "enableVideo", true
    )
);

Session and video naming: you can set the test name and video file name by adding, for example, a timestamp. This is done in the test itself, it's not difficult - ask AI how to do it