Verified Commit 32e311dd authored by Karel Koci's avatar Karel Koci 🤘
Browse files

imgs/selenium: add new image

This is image that can be used to test web interface.

It is based on client container but we do not want to put this as part
of it. It generates pretty big image and in most tests it is not
necessary to start web drivers.

The container itself provides driver for Chrome (Chromium) and Firefox
browsers.
There is also driver for WebKit but it does not work, it crashes right
now so it is there just for the future once something is fixed in
upstream or we found out what we are doing wrong.
parent bc286a97
#!/bin/bash
# nsfarm:client
##################################################################################
# Selenium client for testing web interface
##################################################################################
set -eu
GECKODRIVER_VERSION="0.29.1"
GECKODRIVER_URL="https://github.com/mozilla/geckodriver/releases/download/v${GECKODRIVER_VERSION}/geckodriver-v${GECKODRIVER_VERSION}-linux64.tar.gz"
# Create user we run web drivers under
addgroup -S webdriver
adduser -D -h /home/webdriver -G webdriver webdriver
# Make our init scripts executable
for init in xvfb x11vnc geckodriver chromedriver webkitdriver; do
chmod +x "/etc/init.d/$init"
done
wait4network
# Selenium
apk add xvfb xorgproto x11vnc
rc-update add xvfb
rc-update add x11vnc
# Firefox
apk add firefox gcompat tar
wget "$GECKODRIVER_URL" -O - | tar -xzf - -C /usr/bin geckodriver
rc-update add geckodriver
# Chromium
apk add chromium-chromedriver chromium dbus
rc-update add dbus
rc-update add chromedriver
# WebKit
apk add webkit2gtk adwaita-gtk2-theme adwaita-icon-theme
rc-update add webkitdriver
#!/sbin/openrc-run
command=/usr/bin/chromedriver
command_args="--port=9515"
supervisor="supervise-daemon"
supervise_daemon_args="-e 'DISPLAY=:0' -u webdriver"
depend() {
need localmount net
use logger
}
#!/sbin/openrc-run
command=/usr/bin/geckodriver
command_args="--port 4444"
supervisor="supervise-daemon"
supervise_daemon_args="-e 'DISPLAY=:0' -u webdriver"
depend() {
need localmount net
use logger
}
#!/sbin/openrc-run
command=/usr/bin/WebKitWebDriver
command_args="--port=4445"
supervisor="supervise-daemon"
supervise_daemon_args="-e 'DISPLAY=:0' -u webdriver"
depend() {
need localmount net
use logger
}
#!/sbin/openrc-run
command=/usr/bin/x11vnc
command_args="-localhost -shared -forever -display :0"
supervisor="supervise-daemon"
supervise_daemon_args="-u webdriver"
command_background="yes"
depend() {
need localmount net xvfb
use logger
}
#!/sbin/openrc-run
command=/usr/bin/Xvfb
command_args=":0 -screen 0 1366x768x24"
supervisor="supervise-daemon"
supervise_daemon_args="-u webdriver"
depend() {
need localmount net
use logger
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment