Skip to content

Add support for Selenium 3.0.0-beta4 and Firefox 48 & 49 #271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
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
4 changes: 3 additions & 1 deletion Base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ RUN apt-get update -qqy \
# Selenium
#==========
RUN mkdir -p /opt/selenium \
&& wget --no-verbose https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar -O /opt/selenium/selenium-server-standalone.jar
&& wget --no-verbose https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar -O /opt/selenium/selenium-server-standalone-2.53.1.jar \
&& wget --no-verbose https://selenium-release.storage.googleapis.com/3.0-beta4/selenium-server-standalone-3.0.0-beta4.jar -O /opt/selenium/selenium-server-standalone-3.0.0-beta4.jar
ENV SELENIUM_VERSION=2.53.1

#========================================
# Add normal user with passwordless sudo
Expand Down
2 changes: 1 addition & 1 deletion Hub/entry_point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function shutdown {
echo "shutdown complete"
}

java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone-${SELENIUM_VERSION}.jar \
-role hub \
-hubConfig $CONF \
${SE_OPTS} &
Expand Down
6 changes: 5 additions & 1 deletion NodeBase/entry_point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ if [ ! -z "$REMOTE_HOST" ]; then
REMOTE_HOST_PARAM="-remoteHost $REMOTE_HOST"
fi

if [ ! -z "$FIREFOX_VERSION" ]; then
sudo ln -fs /opt/firefox/${FIREFOX_VERSION}/firefox /usr/bin/firefox
fi

if [ ! -z "$SE_OPTS" ]; then
echo "appending selenium options: ${SE_OPTS}"
fi
Expand All @@ -33,7 +37,7 @@ fi

SERVERNUM=$(get_server_num)
xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone-${SELENIUM_VERSION}.jar \
-role node \
-hub http://$HUB_PORT_4444_TCP_ADDR:$HUB_PORT_4444_TCP_PORT/grid/register \
${REMOTE_HOST_PARAM} \
Expand Down
2 changes: 1 addition & 1 deletion NodeChromeDebug/entry_point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ env | cut -f 1 -d "=" | sort > asroot
$(for E in $(grep -vxFf asseluser asroot); do echo $E=$(eval echo \$$E); done) \
DISPLAY=$DISPLAY \
xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone-${SELENIUM_VERSION}.jar \
-role node \
-hub http://$HUB_PORT_4444_TCP_ADDR:$HUB_PORT_4444_TCP_PORT/grid/register \
${REMOTE_HOST_PARAM} \
Expand Down
30 changes: 22 additions & 8 deletions NodeFirefox/Dockerfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,31 @@ USER root
#=========
# Firefox
#=========
ENV FIREFOX_VERSION 47.0.1
RUN apt-get update -qqy \
&& apt-get -qqy --no-install-recommends install firefox \
&& rm -rf /var/lib/apt/lists/* \
&& wget --no-verbose -O /tmp/firefox.tar.bz2 https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FIREFOX_VERSION/linux-x86_64/en-US/firefox-$FIREFOX_VERSION.tar.bz2 \
&& apt-get -y purge firefox \
&& rm -rf /opt/firefox \
&& tar -C /opt -xjf /tmp/firefox.tar.bz2 \
&& rm /tmp/firefox.tar.bz2 \
&& mv /opt/firefox /opt/firefox-$FIREFOX_VERSION \
&& ln -fs /opt/firefox-$FIREFOX_VERSION/firefox /usr/bin/firefox
&& apt-get -y purge firefox
ENV FIREFOX_VERSION 47.0.1
RUN for VERSION in 49.0.1 48.0.2 47.0.1 45.4.0esr 38.8.0esr; do \
wget --no-verbose -O /tmp/firefox-$VERSION.tar.bz2 https://download-installer.cdn.mozilla.net/pub/firefox/releases/$VERSION/linux-x86_64/en-US/firefox-$VERSION.tar.bz2 \
&& mkdir -p /opt/firefox/$VERSION \
&& tar -C /opt/firefox/$VERSION --strip-components 1 -xjf /tmp/firefox-$VERSION.tar.bz2 \
&& rm /tmp/firefox-$VERSION.tar.bz2 \
;done
RUN ln -fs /opt/firefox/$FIREFOX_VERSION/firefox /usr/bin/firefox

#============
# GeckoDriver
#============
ENV GECKODRIVER_VERSION 0.10.0
RUN wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz \
&& rm -rf /opt/geckodriver \
&& tar -C /opt -zxf /tmp/geckodriver.tar.gz \
&& rm /tmp/geckodriver.tar.gz \
&& mv /opt/geckodriver /opt/geckodriver-$GECKODRIVER_VERSION \
&& chmod 755 /opt/geckodriver-$GECKODRIVER_VERSION \
&& ln -fs /opt/geckodriver-$GECKODRIVER_VERSION /usr/bin/geckodriver \
&& ln -fs /opt/geckodriver-$GECKODRIVER_VERSION /usr/bin/wires

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for wires rename, do we know which firefox version need that ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a requirement of Firefox, but of the Selenium: 2.53.x expects wires but 3.x expects geckodriver.


#========================
# Selenium Configuration
Expand Down
2 changes: 1 addition & 1 deletion NodeFirefoxDebug/entry_point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ env | cut -f 1 -d "=" | sort > asroot
$(for E in $(grep -vxFf asseluser asroot); do echo $E=$(eval echo \$$E); done) \
DISPLAY=$DISPLAY \
xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone-${SELENIUM_VERSION}.jar \
-role node \
-hub http://$HUB_PORT_4444_TCP_ADDR:$HUB_PORT_4444_TCP_PORT/grid/register \
${REMOTE_HOST_PARAM} \
Expand Down
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ Images included:
- __selenium/node-firefox-debug__: Selenium node with Firefox installed and runs a VNC server, needs to be connected to a Selenium Grid Hub

## Running the images

When executing docker run for an image with chrome browser please add volume mount `-v /dev/shm:/dev/shm` to use the host's shared memory.

``` bash
$ docker run -d -p 4444:4444 -v /dev/shm:/dev/shm selenium/standalone-chrome:2.53.1
```

This is a workaround to node-chrome crash in docker container issue: https://code.google.com/p/chromium/issues/detail?id=519952
This is a workaround to node-chrome crash in docker container issue: https://code.google.com/p/chromium/issues/detail?id=519952


### Standalone Chrome and Firefox
Expand Down Expand Up @@ -56,6 +56,31 @@ $ docker run -d --link selenium-hub:hub selenium/node-chrome:2.53.1
$ docker run -d --link selenium-hub:hub selenium/node-firefox:2.53.1
```

### Specifying versions

By default the latest stable versions will be used, however you can override
these using the following environment variables:

- `SELENIUM_VERSION` - version of the Selenium server
- latest stable: `2.53.1`
- latest beta: `3.0.0-beta4`
- `FIREFOX_VERSION` - version of Firefox (only applies to Firefox images)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better to list the version we supported here, since image users not know which versions is included in that image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I'll update this too.

- latest release: `49.0.1`
- previous release: `48.0.2`
- latest ESR: `45.4.0esr`
- previous ESR: `38.8.0esr`

Note that as the latest releases of Firefox work best with Selenium 3.0, which
is currently in beta, the latest release supported by 2.53.x is `47.0.1` and is
also available (and the default).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember my test before, the 2.53.x can work with Firefox 47.0.1 if not use caps["marionette"] = True.

if you use caps["marionette"] = True to run selenium test. it would fail.

This is my only concern here for various versions matrix.

Other code LGTM.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2.53.x should work against Firefox 47.0.1 with marionette=True. It's the first version of Firefox that was officially supported by GeckoDriver, so there certainly were more bugs in that version than there are in later releases.

For example, the following will start a standalone server using Selenium 3.0.0-beta4
and Firefox 49.0.1:

```bash
$ docker run -d -p 4444:4444 -e SELENIUM_VERSION=3.0.0-beta4 -e FIREFOX_VERSION=49.0.1 selenium/standalone-firefox:latest
```

### JAVA_OPTS Java Environment Options

You can pass `JAVA_OPTS` environment variable to java process.
Expand Down Expand Up @@ -135,7 +160,7 @@ $ docker run -d -P -p 5901:5900 --link selenium-hub:hub selenium/node-firefox-de

to connect to the Chrome node on 5900 and the Firefox node on 5901 (assuming those node are free, and reachable).

And for standalone:
And for standalone:
``` bash
$ docker run -d -p 4444:4444 -p <port4VNC>:5900 selenium/standalone-chrome-debug:2.53.1
# OR
Expand Down
6 changes: 5 additions & 1 deletion Standalone/entry_point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ function shutdown {
wait $NODE_PID
}

if [ ! -z "$FIREFOX_VERSION" ]; then
sudo ln -fs /opt/firefox/${FIREFOX_VERSION}/firefox /usr/bin/firefox
fi

if [ ! -z "$SE_OPTS" ]; then
echo "appending selenium options: ${SE_OPTS}"
fi

SERVERNUM=$(get_server_num)
xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone-${SELENIUM_VERSION}.jar \
${SE_OPTS} &
NODE_PID=$!

Expand Down
2 changes: 1 addition & 1 deletion StandaloneChrome/entry_point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fi

SERVERNUM=$(get_server_num)
xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone-${SELENIUM_VERSION}.jar \
${SE_OPTS} &
NODE_PID=$!

Expand Down
2 changes: 1 addition & 1 deletion StandaloneDebug/entry_point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ sudo -E -i -u seluser \
$(for E in $(grep -vxFf asseluser asroot); do echo $E=$(eval echo \$$E); done) \
DISPLAY=$DISPLAY \
xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone-${SELENIUM_VERSION}.jar \
${SE_OPTS} &
NODE_PID=$!

Expand Down
2 changes: 1 addition & 1 deletion StandaloneFirefox/entry_point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fi

SERVERNUM=$(get_server_num)
xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone-${SELENIUM_VERSION}.jar \
${SE_OPTS} &
NODE_PID=$!

Expand Down