Skip to content
This repository was archived by the owner on Jun 30, 2021. It is now read-only.

Commit d01b232

Browse files
committed
Add Selenium 3.0.0-beta4 via docker run -e USE_SELENIUM=3
1 parent a61dc8a commit d01b232

23 files changed

+282
-84
lines changed

.travis.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ services:
1919
- docker
2020

2121
matrix:
22-
allow_failures:
23-
# Currently erroring in Mac (OSX):
24-
# https://travis-ci.org/elgalu/docker-selenium/jobs/143553463#L636
25-
# com.docker.docker Incompatible CPU detected
26-
# Docker requires a processor with virtualization capabilities
27-
- env:
28-
- DOCKER_VERSION="1.12.1"
29-
DOCKER_COMPOSE_VERSION="1.8.1"
30-
OPERATING_SYSTEM="osx"
22+
# allow_failures:
23+
# # Currently erroring in Mac (OSX):
24+
# # https://travis-ci.org/elgalu/docker-selenium/jobs/143553463#L636
25+
# # com.docker.docker Incompatible CPU detected
26+
# # Docker requires a processor with virtualization capabilities
27+
# - env:
28+
# - DOCKER_VERSION="1.12.1"
29+
# DOCKER_COMPOSE_VERSION="1.8.1"
30+
# OPERATING_SYSTEM="osx"
3131
include:
3232
# Linux with docker:stable compose:stable
3333
# Use DOCKER_PUSH_LATEST=false to debug
@@ -40,7 +40,7 @@ matrix:
4040
- DOCKER_VERSION="stable"
4141
DOCKER_COMPOSE_VERSION="1.8.1"
4242
DOCKER_PUSH=true
43-
DOCKER_PUSH_LATEST=true
43+
DOCKER_PUSH_LATEST=false
4444
# Linux with docker:beta/older compose:beta/older
4545
- os: linux
4646
sudo: required

CHANGELOG.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,39 @@ Note image ids also change after scm-source.json has being updated which trigger
77
###### To get container versions
88
docker exec grid versions
99

10+
## TBD_DOCKER_TAG
11+
+ Date: TBD_DATE
12+
+ Include Selenium 3 (3.0.0-beta4) and enable via `-e USE_SELENIUM=3`
13+
+ Allow to choose Selenium 2 or Selenium 3 via `USE_SELENIUM=2` (default) or `USE_SELENIUM=3`
14+
+ Provide Firefox 49.0.1 for Selenium 3
15+
+ Provide Firefox 47.0.1 for Selenium 2
16+
+ Upgrade Chrome patch to 53.0.2785.143
17+
+ Bug: Removed config option that didn't belong to the hub (is node-only) `-nodePolling`
18+
+ Bug: Java CLI required all system `-D` args to be before the `-jar` argument
19+
+ Removed future supported option `-trustAllSSLCertificates`
20+
+ Add `--disable-gpu` to CHROME_ARGS to avoid the single GPU thread error message
21+
+ Re-add geckodriver 0.10.0
22+
+ Image tag details:
23+
+ Selenium: vTBD_SELENIUM_VERSION (TBD_SELENIUM_REVISION)
24+
+ Chrome stable: TBD_CHROME_STABLE
25+
+ Firefox stable: TBD_FIREFOX_STABLE
26+
+ Chromedriver: TBD_CHROME_DRIVER (TBD_CHROMEDRIVER_COMMIT)
27+
+ Java: TBD_JAVA_VENDOR Java TBD_JAVA_BUILD
28+
+ Timezone: TBD_TIME_ZONE
29+
+ FROM ubuntu:UBUNTU_FLAVOR-UBUNTU_DATE
30+
+ Python: TBD_PYTHON_VERSION
31+
+ Sauce Connect TBD_SAUCE_CONNECT_VERS, build TBD_SAUCE_CONNECT_BUILD TBD_SAUCE_CONNECT_REVISION
32+
+ BrowserStack Local version TBD_BROWSER_STACK_VERSION
33+
+ Tested on kernel dev host: 4.4.0-38-generic x86_64
34+
+ Tested on kernel CI host: TBD_HOST_UNAME
35+
+ Built at dev host with: Docker version 1.12.1, build 23cf638
36+
+ Built at CI host with: Docker version TBD_DOCKER_VERS, build TBD_DOCKER_BUILD
37+
+ Built at dev host with: Docker Compose version 1.8.0, build f3628c7
38+
+ Built at CI host with: Docker Compose version TBD_DOCKER_COMPOSE_VERS, build TBD_DOCKER_COMPOSE_BUILD
39+
+ Image size: TBD_IMAGE_SIZE
40+
+ Digest: TBD_DIGEST
41+
+ Image ID: TBD_IMAGE_ID
42+
1043
## 2.53.1z
1144
+ Date: 2016-09-29
1245
+ Remove geckodriver as is not being used yet
@@ -25,7 +58,7 @@ Note image ids also change after scm-source.json has being updated which trigger
2558
+ Tested on kernel CI host: 3.19.0-66-generic x86_64
2659
+ Built at dev host with: Docker version 1.12.1, build 23cf638
2760
+ Built at CI host with: Docker version 1.12.1, build 23cf638
28-
+ Built at dev host with: Docker Compose version 1.8.1, build 878cff1
61+
+ Built at dev host with: Docker Compose version 1.8.0, build f3628c7
2962
+ Built at CI host with: Docker Compose version 1.8.1, build 878cff1
3063
+ Image size: 2.576 GB
3164
+ Digest: sha256:6c4bdb751fe15ebcec8b5a6dc120dd9ccee7f0883fcd24c82e187320e57beda6

CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ For pull requests or local commits:
66
time (./test/bef && ./test/install && ./test/script_start && ./test/script_end) ; beep
77
docker exec grid versions && ./test/after_script && travis lint
88
open ./images/grid_console.png && open ./videos/chrome/*.mkv
9-
git checkout -b tmp-2.53.1z && git checkout ./images/grid_console.png
9+
git checkout -b tmp-3.0.0b4 && git checkout ./images/grid_console.png
1010
#git add ... git commit ... git push ... open pull request
1111

1212
For repository owners only:
1313

14-
git commit -m "Remove geckodriver as is not being used yet"
15-
git tag -d latest && git tag 2.53.1z && git push origin tmp-2.53.1z && git push --tags
14+
git commit -m "Add Selenium 3.0.0-beta4 via docker run -e USE_SELENIUM=3"
15+
git tag -d latest && git tag 3.0.0b4 && git push origin tmp-3.0.0b4 && git push --tags
1616

1717
-- Wait for Travis to pass OK
1818
-- Make sure changes got merged into master by elgalubot
1919

20-
git checkout master && git pull && git branch -d tmp-2.53.1z && git push origin --delete tmp-2.53.1z
20+
git checkout master && git pull && git branch -d tmp-3.0.0b4 && git push origin --delete tmp-3.0.0b4
2121

2222
-- Re-add TBD_* section in CHANGELOG.md starting with TBD_DOCKER_TAG
2323
-- If Chrome version changed upload:
@@ -35,9 +35,9 @@ Keep certain bins if chrome version changed for example:
3535
## Retry
3636
Failed in Travis? retry
3737

38-
git tag -d 2.53.1z && git push origin :2.53.1z
38+
git tag -d 3.0.0b4 && git push origin :3.0.0b4
3939
#git add ...
40-
git commit --amend && git tag 2.53.1z && git push --force origin tmp-2.53.1z && git push --tags
40+
git commit --amend && git tag 3.0.0b4 && git push --force origin tmp-3.0.0b4 && git push --tags
4141

4242
## Docker push from Travis CI
4343
Travis [steps](https://docs.travis-ci.com/user/docker/#Pushing-a-Docker-Image-to-a-Registry) involve `docker login` and docker credentials encryptions.

Dockerfile

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,7 @@ RUN cd /tmp \
680680
# && rm -rf /var/lib/apt/lists/*
681681
# ENV FF_VER="latest" \
682682
# FF_LANG="en-US" \
683-
# FF_DEST="/usr/lib/firefox"
684-
# ENV FIREFOX_DEST_BIN="${FF_DEST}/firefox"
683+
# FIREFOX_DEST_BIN="/usr/lib/firefox/firefox"
685684
# RUN ln -fs ${FIREFOX_DEST_BIN} /usr/bin/firefox
686685

687686
#-------------------------#
@@ -709,39 +708,49 @@ RUN cd /tmp \
709708

710709
ENV FF_LANG="en-US" \
711710
FF_BASE_URL="https://archive.mozilla.org/pub" \
712-
FF_DEST="${SEL_HOME}/firefox"
713-
ENV FIREFOX_DEST_BIN="${FF_DEST}/firefox"
714-
715-
#--- Stable
716-
ENV FF_VER="47.0.1" \
717711
FF_PLATFORM="linux-x86_64" \
718712
FF_INNER_PATH="firefox/releases"
713+
714+
#--- For Selenium 3
715+
ENV FF_VER="49.0.1"
719716
ENV FF_COMP="firefox-${FF_VER}.tar.bz2"
720717
ENV FF_URL="${FF_BASE_URL}/${FF_INNER_PATH}/${FF_VER}/${FF_PLATFORM}/${FF_LANG}/${FF_COMP}"
718+
RUN mkdir -p ${SEL_HOME} && cd ${SEL_HOME} \
719+
&& wget -nv "${FF_URL}" -O "firefox.tar.bz2" \
720+
&& bzip2 -d "firefox.tar.bz2" \
721+
&& tar xf "firefox.tar" \
722+
&& rm "firefox.tar" \
723+
&& mv firefox firefox-for-sel-3 \
724+
&& sudo ln -fs ${SEL_HOME}/firefox-for-sel-3/firefox /usr/bin/firefox
721725

726+
#--- Stable for Selenium 2
727+
ENV FF_VER="47.0.1"
728+
ENV FF_COMP="firefox-${FF_VER}.tar.bz2"
729+
ENV FF_URL="${FF_BASE_URL}/${FF_INNER_PATH}/${FF_VER}/${FF_PLATFORM}/${FF_LANG}/${FF_COMP}"
722730
RUN mkdir -p ${SEL_HOME} && cd ${SEL_HOME} \
723731
&& wget -nv "${FF_URL}" -O "firefox.tar.bz2" \
724732
&& bzip2 -d "firefox.tar.bz2" \
725733
&& tar xf "firefox.tar" \
726734
&& rm "firefox.tar" \
727-
&& sudo ln -fs ${FIREFOX_DEST_BIN} /usr/bin/firefox
735+
&& mv firefox firefox-for-sel-2 \
736+
&& sudo ln -fs ${SEL_HOME}/firefox-for-sel-2/firefox /usr/bin/firefox
728737

729738
#============
730739
# GeckoDriver
731740
#============
732-
# ENV GECKOD_VER="0.10.0" \
733-
# GECKOD_URL="https://github.com/mozilla/geckodriver/releases/download"
734-
# RUN wget --no-verbose -O /tmp/geckodriver.tar.gz \
735-
# "${GECKOD_URL}/v${GECKOD_VER}/geckodriver-v${GECKOD_VER}-linux64.tar.gz" \
736-
# && rm -rf /opt/geckodriver* \
737-
# && tar -C /opt -xvzf /tmp/geckodriver.tar.gz \
738-
# && mv /opt/geckodriver /usr/bin/geckodriver \
739-
# && chmod +x /usr/bin/geckodriver \
740-
# && ln -fs /usr/bin/geckodriver /opt/geckodriver \
741-
# && ln -fs /usr/bin/geckodriver /usr/bin/wires \
742-
# && ln -fs /usr/bin/geckodriver ${FF_DEST}/geckodriver \
743-
# && ln -fs /usr/bin/geckodriver ${FF_DEST}/wires \
744-
# && rm /tmp/geckodriver.tar.gz
741+
ENV GECKOD_VER="0.10.0" \
742+
GECKOD_URL="https://github.com/mozilla/geckodriver/releases/download"
743+
RUN wget --no-verbose -O /tmp/geckodriver.tar.gz \
744+
"${GECKOD_URL}/v${GECKOD_VER}/geckodriver-v${GECKOD_VER}-linux64.tar.gz" \
745+
&& rm -rf /opt/geckodriver* \
746+
&& tar -C /opt -xvzf /tmp/geckodriver.tar.gz \
747+
&& mv /opt/geckodriver /usr/bin/geckodriver \
748+
&& chmod +x /usr/bin/geckodriver \
749+
&& ln -fs /usr/bin/geckodriver /opt/geckodriver \
750+
&& ln -fs /usr/bin/geckodriver /usr/bin/wires \
751+
&& rm /tmp/geckodriver.tar.gz
752+
# && ln -fs /usr/bin/geckodriver ${FF_DEST}/geckodriver \
753+
# && ln -fs /usr/bin/geckodriver ${FF_DEST}/wires \
745754

746755
# && rm -rf ${NORMAL_USER_HOME}/firefox-src
747756
# RUN mkdir -p ${NORMAL_USER_HOME}/firefox-src \
@@ -774,13 +783,22 @@ USER ${NORMAL_USER}
774783
#==========
775784
# Selenium
776785
#==========
777-
ENV SEL_MAJOR_MINOR_VER 2.53
778-
ENV SEL_PATCH_LEVEL_VER 1
786+
# Selenium 3
787+
ENV SEL_DIRECTORY="3.0-beta4" \
788+
SEL_VERSION="3.0.0-beta4"
789+
RUN mkdir -p ${SEL_HOME} \
790+
&& export SELBASE="https://selenium-release.storage.googleapis.com" \
791+
&& export SELPATH="${SEL_DIRECTORY}/selenium-server-standalone-${SEL_VERSION}.jar" \
792+
&& wget -nv ${SELBASE}/${SELPATH} \
793+
-O ${SEL_HOME}/selenium-server-standalone-3.jar
794+
# Selenium 2
795+
ENV SEL_MAJOR_MINOR_VER="2.53" \
796+
SEL_PATCH_LEVEL_VER="1"
779797
RUN mkdir -p ${SEL_HOME} \
780798
&& export SELBASE="https://selenium-release.storage.googleapis.com" \
781799
&& export SELPATH="${SEL_MAJOR_MINOR_VER}/selenium-server-standalone-${SEL_MAJOR_MINOR_VER}.${SEL_PATCH_LEVEL_VER}.jar" \
782800
&& wget -nv ${SELBASE}/${SELPATH} \
783-
-O ${SEL_HOME}/selenium-server-standalone.jar
801+
-O ${SEL_HOME}/selenium-server-standalone-2.jar
784802

785803
#==================
786804
# Chrome webdriver
@@ -816,7 +834,7 @@ RUN mkdir -p ${NORMAL_USER_HOME}/tmp && cd ${NORMAL_USER_HOME}/tmp \
816834
# TODO: Use Google fingerprint to verify downloads
817835
# https://www.google.de/linuxrepositories/
818836
# Also fix .deb file names with correct version
819-
RUN latest_chrome_version_trigger="53.0.2785.116" \
837+
RUN latest_chrome_version_trigger="53.0.2785.143" \
820838
&& mkdir -p ${NORMAL_USER_HOME}/chrome-deb \
821839
&& export CHROME_URL="https://dl.google.com/linux/direct" \
822840
&& wget -nv -O \
@@ -972,6 +990,8 @@ ENV DEFAULT_SELENIUM_HUB_PORT="24444" \
972990
# Firefox version to use during run
973991
# For firefox please pick one of $FIREFOX_VERSIONS, default latest
974992
ENV FIREFOX_VERSION="${FF_VER}" \
993+
# Selenium 2 or 3
994+
USE_SELENIUM="2" \
975995
# Default chrome flavor, options no longer avariable: beta|unstable
976996
CHROME_FLAVOR="stable" \
977997
# Randomize all ports, i.e. pick unused unprivileged ones
@@ -1017,7 +1037,7 @@ ENV FIREFOX_VERSION="${FF_VER}" \
10171037
SELENIUM_NODE_PARAMS="" \
10181038
SELENIUM_NODE_PROXY_PARAMS="" \
10191039
# To taggle issue #58 see https://goo.gl/fz6RTu
1020-
CHROME_ARGS="--no-sandbox" \
1040+
CHROME_ARGS="--no-sandbox --disable-gpu" \
10211041
# Will be passed with: -Dwebdriver.chrome.verboseLogging
10221042
CHROME_VERBOSELOGGING="true" \
10231043
# e.g. CHROME_ARGS="--no-sandbox --ignore-certificate-errors" \

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ Shutdown immediately, no mercy
9191

9292
docker rm -vf grid
9393

94+
### Selenium 3
95+
Is now possible to choose Selenium 2 or Selenium 3 via docker run `-e USE_SELENIUM=2` (default) or `-e USE_SELENIUM=3`
96+
Be ready for seeing your tests failing in Firefox.
97+
Please google those errors first before opening an issue in this project.
98+
9499
### Docker Compose
95100
See [docker-compose](./docs/docker-compose.md)
96101

bin/entry.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,17 @@ stop 2>&1 >/dev/null || true
2727
rm -f ${LOGS_DIR}/*
2828
rm -f ${RUN_DIR}/*
2929

30-
echo "-- INFO: Available Google Chrome Version: $(chrome_stable_version)"
31-
echo "-- INFO: Available Firefox...... Version: ${FIREFOX_VERSION}"
32-
3330
#---------------------
3431
# Fix/extend ENV vars
3532
#---------------------
33+
export SELENIUM_JAR_PATH="${SEL_HOME}/selenium-server-standalone-${USE_SELENIUM}.jar"
34+
export FIREFOX_DEST_BIN="${SEL_HOME}/firefox-for-sel-${USE_SELENIUM}/firefox"
35+
sudo ln -fs ${FIREFOX_DEST_BIN} /usr/bin/firefox
36+
37+
echo "-- INFO: Chrome..... Version: $(chrome_stable_version)"
38+
echo "-- INFO: Firefox.... Version: $(firefox_version)"
39+
echo "-- INFO: Selenium... Version: ${USE_SELENIUM}"
40+
3641
# export PATH="${PATH}:${BIN_UTILS}"
3742
export SAUCE_LOG_FILE="${LOGS_DIR}/saucelabs-stdout.log"
3843
export BSTACK_LOG_FILE="${LOGS_DIR}/browserstack-stdout.log"
@@ -398,6 +403,11 @@ echo "${NOVNC_PORT}" > NOVNC_PORT
398403
echo "${SSHD_PORT}" > SSHD_PORT
399404
echo "${SAUCE_LOCAL_SEL_PORT}" > SAUCE_LOCAL_SEL_PORT
400405
echo "${SUPERVISOR_HTTP_PORT}" > SUPERVISOR_HTTP_PORT
406+
echo "${FIREFOX_DEST_BIN}" > FIREFOX_DEST_BIN
407+
echo "${USE_SELENIUM}" > USE_SELENIUM
408+
echo "${SEL_HOME}" > SEL_HOME
409+
echo "${SELENIUM_JAR_PATH}" > SELENIUM_JAR_PATH
410+
echo "${LOGS_DIR}" > LOGS_DIR
401411
env > env
402412

403413
#------

bin/firefox-for-sel-2_version

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
# Example:
4+
# firefox -version 2>&1
5+
#=> Mozilla Firefox 47.0.1
6+
7+
[ -z "${SEL_HOME}" ] && export SEL_HOME="$(cat SEL_HOME)"
8+
9+
# Example:
10+
#=> 47.0.1
11+
${SEL_HOME}/firefox-for-sel-2/firefox \
12+
-version 2>&1 | grep -Po '(?<=Firefox )([a-z0-9\.]+)'

bin/firefox-for-sel-3_version

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
# Example:
4+
# firefox -version 2>&1
5+
#=> Mozilla Firefox 49.0.1
6+
7+
[ -z "${SEL_HOME}" ] && export SEL_HOME="$(cat SEL_HOME)"
8+
9+
# Example:
10+
#=> 49.0.1
11+
${SEL_HOME}/firefox-for-sel-3/firefox \
12+
-version 2>&1 | grep -Po '(?<=Firefox )([a-z0-9\.]+)'

bin/firefox_version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66

77
# Example:
88
#=> 45.0.2
9-
${FIREFOX_DEST_BIN} -version 2>&1 | grep -Po '(?<=Firefox )([a-z0-9\.]+)'
9+
firefox -version 2>&1 | grep -Po '(?<=Firefox )([a-z0-9\.]+)'

bin/selenium_revision_version

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,32 @@
11
#!/usr/bin/env bash
22

3-
# Example:
4-
#=> 35ae25b
5-
java -jar ${SEL_HOME}/selenium-server-standalone.jar -port ${SELENIUM_HUB_PORT} 2>&1 \
6-
| grep revision \
7-
| grep -Po '(?<=revision )([a-z0-9\.]+)'
3+
# log_file="selenium_version.log"
4+
# java -jar ${SELENIUM_JAR_PATH} \
5+
# -port ${SELENIUM_HUB_PORT} \
6+
# -log ${log_file} \
7+
# >/dev/null 2>&1 &
8+
# pid=$!
9+
# sleep 1 && kill ${pid} || true
10+
# rm -f ${log_file}
11+
12+
[ -z "${USE_SELENIUM}" ] && export USE_SELENIUM="$(cat USE_SELENIUM)"
13+
[ -z "${SELENIUM_JAR_PATH}" ] && export SELENIUM_JAR_PATH="$(cat SELENIUM_JAR_PATH)"
14+
[ -z "${SELENIUM_HUB_PORT}" ] && export SELENIUM_HUB_PORT="$(cat SELENIUM_HUB_PORT)"
15+
[ -z "${LOGS_DIR}" ] && export LOGS_DIR="$(cat LOGS_DIR)"
16+
17+
if [ "${USE_SELENIUM}" == "2" ]; then
18+
# Selenium 2 - Example:
19+
#=> 35ae25b
20+
java -jar ${SELENIUM_JAR_PATH} -port ${SELENIUM_HUB_PORT} 2>&1 \
21+
| grep revision \
22+
| grep -Po '(?<=revision )([a-z0-9\.]+)'
23+
else
24+
# Selenium 3 - Example:
25+
#=> 3169782
26+
log_file="${LOGS_DIR}/selenium-hub-stderr.log"
27+
cat ${log_file} \
28+
| grep revision \
29+
| grep -Po "(?<=revision: ')([a-z0-9\.]+)" \
30+
| sed "s/'//g" \
31+
| sed "s/,//g"
32+
fi

0 commit comments

Comments
 (0)