selenium.sh 1.07 KB
Newer Older
Karel Koci's avatar
Karel Koci committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/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
27
apk add firefox gcompat tar
Karel Koci's avatar
Karel Koci committed
28
29
30
31
32
33
34
35
36
37
38
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