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

Commit a556f4a

Browse files
committed
Set --user-data-dir using CHROME_ADDITIONAL_ARGS when -e ZALENIUM=true
1 parent bb6db02 commit a556f4a

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ For pull requests or local commits:
1212

1313
For repository owners only:
1414

15-
git commit -m "Fix tzdata not installed credits @dubner @tnguyen14 @eitany https://goo.gl/n84gJl"
15+
git commit -m "Set --user-data-dir using CHROME_ADDITIONAL_ARGS when -e ZALENIUM=true"
1616
git tag -d latest; git tag -d `cat VERSION`; git push origin :`cat VERSION`; git tag `cat VERSION` && git push --force origin tmp-`cat VERSION` && git push --tags
1717

1818
-- Wait for Travis to pass OK

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,7 @@ ENV FIREFOX_VERSION="${FF_VER}" \
828828
SELENIUM_NODE_PARAMS="" \
829829
SELENIUM_NODE_PROXY_PARAMS="" \
830830
CHROME_ARGS="--no-sandbox --disable-gpu" \
831+
CHROME_ADDITIONAL_ARGS="" \
831832
CHROME_VERBOSELOGGING="true" \
832833
MAX_INSTANCES=1 \
833834
MAX_SESSIONS=1 \
@@ -909,6 +910,7 @@ ENV FIREFOX_VERSION="${FF_VER}" \
909910
VIDEO_REC_STOP_SIGNAL="INT" \
910911
DOCKER_SOCK="/var/run/docker.sock" \
911912
TEST_SLEEPS="0.5" \
913+
ZALENIUM="false" \
912914
SEND_ANONYMOUS_USAGE_INFO="true" \
913915
GA_TRACKING_ID="UA-18144954-9" \
914916
GA_ENDPOINT=https://www.google-analytics.com/collect \

bin/entry.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,11 @@ fi
173173
# Fix extra quotes in Time zone $TZ env var
174174
export TZ=$(echo ${TZ} | sed "s/^\([\"']\)\(.*\)\1\$/\2/g")
175175

176+
# When running for Zalenium prepare certain customizations
177+
if [ "${ZALENIUM}" == "true" ]; then
178+
export CHROME_ADDITIONAL_ARGS="--user-data-dir=/home/seluser/chrome-user-data-dir"
179+
fi
180+
176181
# TODO: Remove this duplicated logic
177182
if [ "${SELENIUM_HUB_PORT}" = "0" ]; then
178183
export SELENIUM_HUB_PORT=$(get_unused_port_from_range ${RANDOM_PORT_FROM} ${RANDOM_PORT_TO})
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env bash
22

3-
# Try to retrieve Browser console logs
4-
cp /tmp/.*/chrome_debug.log "/var/log/cont/chrome_browser.log"
3+
# Try to retrieve Chrome Browser console logs when using this image through Zalenium
4+
cp /home/seluser/chrome-user-data-dir/chrome_debug.log /var/log/cont/chrome_browser.log

selenium-node-chrome/opt/google/chrome/google-chrome

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
exec /opt/google/chrome/google-chrome-base "$@" ${CHROME_ARGS}
3+
exec /opt/google/chrome/google-chrome-base "$@" ${CHROME_ARGS} ${CHROME_ADDITIONAL_ARGS}
44

55
# See: On How To Turn Chrome or Firefox Into A Single-Site Browser
66
# Google Chrome users can make use of the --host-rules parameter to block all domain connections except the ones they whitelist. The general parameter looks like this:

0 commit comments

Comments
 (0)