Skip to content
This repository was archived by the owner on Jun 30, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .menv
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ export SIZE ?= 50%
# Enable video recording
export VIDEO ?= true

# Enable audio recording
export AUDIO ?= true

# App name is the service name for the web app under test
# export APP ?= zalando_uk
export APP ?= mock
Expand Down
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ ARG UBUNTU_DATE
# Docker build debug logging, green colored
RUN printf "\033[1;32mFROM ubuntu:${UBUNTU_FLAVOR}-${UBUNTU_DATE} \033[0m\n"

MAINTAINER Diego Molina <diemol@gmail.com>
MAINTAINER Leo Gallucci <elgalu3+dosel@gmail.com>

# https://github.com/docker/docker/pull/25466#discussion-diff-74622923R677
LABEL maintainer "Diego Molina <diemol@gmail.com>"
LABEL maintainer "Leo Gallucci <elgalu3+dosel@gmail.com>"
Expand Down Expand Up @@ -89,6 +86,9 @@ RUN apt -qqy update \
dbus-x11 \
wget \
curl \
pulseaudio \
socat \
alsa-utils \
&& apt -qyy autoremove \
&& rm -rf /var/lib/apt/lists/* \
&& apt -qyy clean
Expand Down Expand Up @@ -429,7 +429,7 @@ ENV FF_LANG="en-US" \
FF_PLATFORM="linux-x86_64" \
FF_INNER_PATH="firefox/releases"

ARG FF_VER="73.0"
ARG FF_VER="75.0"

ENV FF_COMP="firefox-${FF_VER}.tar.bz2"
ENV FF_URL="${FF_BASE_URL}/${FF_INNER_PATH}/${FF_VER}/${FF_PLATFORM}/${FF_LANG}/${FF_COMP}"
Expand Down Expand Up @@ -466,7 +466,7 @@ COPY bin/fail /usr/bin/
#===============
# TODO: Use Google fingerprint to verify downloads
# https://www.google.de/linuxrepositories/
ARG EXPECTED_CHROME_VERSION="80.0.3987.106"
ARG EXPECTED_CHROME_VERSION="81.0.4044.92"
ENV CHROME_URL="https://dl.google.com/linux/direct" \
CHROME_BASE_DEB_PATH="/home/seluser/chrome-deb/google-chrome" \
GREP_ONLY_NUMS_VER="[0-9.]{2,20}"
Expand Down Expand Up @@ -758,12 +758,14 @@ ENV FIREFOX_VERSION="${FF_VER}" \
LOGFILE_BACKUPS=5 \
LOGS_DIR="/var/log/cont" \
VIDEO="false" \
AUDIO="false" \
GRID="true" \
CHROME="true" \
FIREFOX="true" \
MULTINODE="false" \
FFMPEG_FRAME_RATE=10 \
FFMPEG_CODEC_ARGS="-vcodec libx264 -preset ultrafast -pix_fmt yuv420p" \
FFMPEG_CODEC_VA_ARGS="-vcodec libx264 -acodec copy -preset ultrafast" \
FFMPEG_FINAL_CRF=0 \
FFMPEG_DRAW_MOUSE=1 \
VIDEO_TMP_FILE_EXTENSION="mkv" \
Expand Down
2 changes: 2 additions & 0 deletions docker-compose-scales.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ services:
- SCREEN_WIDTH=1300
- SCREEN_HEIGHT=999
- VIDEO=false
- AUDIO=false
- GRID=false
- CHROME=true
- FIREFOX=false
Expand All @@ -53,6 +54,7 @@ services:
- SCREEN_WIDTH=1300
- SCREEN_HEIGHT=999
- VIDEO=false
- AUDIO=false
- GRID=false
- CHROME=false
- FIREFOX=true
2 changes: 2 additions & 0 deletions docker-compose-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ services:
- SCREEN_WIDTH=1300
- SCREEN_HEIGHT=999
- VIDEO=${VIDEO-false}
- AUDIO=${AUDIO-false}
- GRID=false
- CHROME=true
- FIREFOX=false
Expand All @@ -71,6 +72,7 @@ services:
- SCREEN_WIDTH=1300
- SCREEN_HEIGHT=999
- VIDEO=${VIDEO-false}
- AUDIO=${AUDIO-false}
- GRID=false
- CHROME=false
- FIREFOX=true
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ services:
- SCREEN_WIDTH=1300
- SCREEN_HEIGHT=999
- VIDEO=false
- AUDIO=false
- GRID=false
- CHROME=true
- FIREFOX=false
Expand All @@ -68,6 +69,7 @@ services:
- SCREEN_WIDTH=1300
- SCREEN_HEIGHT=999
- VIDEO=false
- AUDIO=false
- GRID=false
- CHROME=false
- FIREFOX=true
10 changes: 9 additions & 1 deletion docs/videos.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Pull image
Run a new grid

docker run --rm --name=grid -p 4444:24444 -p 5920:25900 \
--shm-size=1g -e VNC_PASSWORD=hola \
--shm-size=2g -e VNC_PASSWORD=hola \
-e VIDEO=true elgalu/selenium

### Wait
Expand Down Expand Up @@ -49,6 +49,14 @@ Check your video, note it may be splitted in many files if is too long

## Customizations

### Audio
If you want to additionaly record audio with the video use this

docker run --rm --name=grid -p 4444:24444 -p 5920:25900 \
--shm-size=2g -e VNC_PASSWORD=hola \
-e VIDEO=true \
-e AUDIO=true elgalu/selenium

### Start
Start and stop on-demand

Expand Down
2 changes: 1 addition & 1 deletion scm-source.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"url": "https://github.com/elgalu/docker-selenium",
"revision": "979ee6f137b8fa103c396773dd7a8f8c671afcc2",
"revision": "dc5bbf5a3e15272c6b830c8a3257f5f74ae01bb3",
"author": "lgallucci",
"status": ""
}
1 change: 1 addition & 0 deletions test/script_scenario_compose_N_N
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ echo "#==================================================================="
set -x

export VIDEO="false"
export AUDIO="false"
export NUM_NODES=2 PARAL_TESTS=2 WAIT_ALL_DONE="390s" SLEEP_TIME=10 PAUSE_SECS_BETWEEN_RUN_TEST="0"

export VNC_FROM_PORT="26950" VNC_TO_PORT="26999"
Expand Down
38 changes: 31 additions & 7 deletions video-rec/bin/start-video-rec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,37 @@ else
fi

# ffmpeg
ffmpeg -f x11grab \
-s ${FFMPEG_FRAME_SIZE} \
-draw_mouse ${FFMPEG_DRAW_MOUSE} \
-i "${DISPLAY}.0" \
${FFMPEG_CODEC_ARGS} \
-r ${FFMPEG_FRAME_RATE} \
-y -an "${tmp_video_path}" 2>&1 &
if [ "${AUDIO}" == "true" ]; then
# Start the pulseaudio server
pulseaudio -D --exit-idle-time=-1

# Load the virtual sink and set it as default
pacmd load-module module-virtual-sink sink_name=v1
pacmd set-default-sink v1

# set the monitor of v1 sink to be the default source
pacmd set-default-source v1.monitor

ffmpeg \
-s "${FFMPEG_FRAME_SIZE}" \
-draw_mouse ${FFMPEG_DRAW_MOUSE} \
-r ${FFMPEG_FRAME_RATE} \
-f "x11grab" \
-i "default" \
-i "${DISPLAY}.0" \
-f "pulse" \
${FFMPEG_CODEC_VA_ARGS} \
-y -an "${tmp_video_path}" 2>&1 &
else
ffmpeg \
-s ${FFMPEG_FRAME_SIZE} \
-draw_mouse ${FFMPEG_DRAW_MOUSE} \
-r ${FFMPEG_FRAME_RATE} \
-f "x11grab" \
-i "${DISPLAY}.0" \
${FFMPEG_CODEC_ARGS} \
-y -an "${tmp_video_path}" 2>&1 &
fi

VID_TOOL_PID=$!

Expand Down