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

Commit 53e6319

Browse files
committed
Support Selenium IDE tests
1 parent 0d32cfa commit 53e6319

22 files changed

+508
-30
lines changed

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export WAIT_ALL_DONE ?= 80s
3232
# Number of nodes
3333
export chrome ?= 1
3434
export firefox ?= 1
35+
export rc_chrome ?= 1
36+
export rc_firefox ?= 1
3537

3638
# To target a specific node number
3739
# for example to VNC into it via

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ VNC-*-MacOSX-x86_64.pkg
2424
vnc_linux.md5
2525
vnc_osx.md5
2626
tmposx/
27+
*.log

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,33 @@ 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+
+ Support Selenium IDE tests
13+
+ Image tag details:
14+
+ Selenium 2: TBD_SELENIUM_2_VERSION (TBD_SELENIUM_2_REVISION)
15+
+ Selenium 3: 3.0.0-beta4 (3169782)
16+
+ Chrome stable: TBD_CHROME_STABLE
17+
+ Firefox for Selenium 2: TBD_FIREFOX_FOR_SEL2
18+
+ Firefox for Selenium 3: TBD_FIREFOX_FOR_SEL3
19+
+ Geckodriver: TBD_GECKO_DRIVER
20+
+ Chromedriver: TBD_CHROME_DRIVER (TBD_CHROMEDRIVER_COMMIT)
21+
+ Java: TBD_JAVA_VENDOR Java TBD_JAVA_BUILD
22+
+ Timezone: TBD_TIME_ZONE
23+
+ FROM ubuntu:UBUNTU_FLAVOR-UBUNTU_DATE
24+
+ Python: TBD_PYTHON_VERSION
25+
+ Sauce Connect TBD_SAUCE_CONNECT_VERS, build TBD_SAUCE_CONNECT_BUILD TBD_SAUCE_CONNECT_REVISION
26+
+ BrowserStack Local version TBD_BROWSER_STACK_VERSION
27+
+ Tested on kernel dev host: 4.4.0-38-generic x86_64
28+
+ Tested on kernel CI host: TBD_HOST_UNAME
29+
+ Built at dev host with: Docker version 1.12.1, build 23cf638
30+
+ Built at CI host with: Docker version TBD_DOCKER_VERS, build TBD_DOCKER_BUILD
31+
+ Built at dev host with: Docker Compose version 1.8.0, build f3628c7
32+
+ Built at CI host with: Docker Compose version TBD_DOCKER_COMPOSE_VERS, build TBD_DOCKER_COMPOSE_BUILD
33+
+ Image size: TBD_IMAGE_SIZE
34+
+ Digest: TBD_DIGEST
35+
+ Image ID: TBD_IMAGE_ID
36+
1037
## 3.0.0b4a
1138
+ Date: 2016-10-06
1239
+ Selenium 3 and Selenium 2 will both be provided

CONTRIBUTING.md

Lines changed: 8 additions & 8 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/grid2_console.png && open ./images/grid3_console.png && open ./videos/mobile_emulation/*.mkv
9-
git checkout -b tmp-3.0.0b4a && git checkout ./images/grid2_console.png && git checkout ./images/grid3_console.png
9+
git checkout -b tmp-3.0.0b4b && git checkout ./images/grid2_console.png && git checkout ./images/grid3_console.png
1010
#git add ... git commit ... git push ... open pull request
1111

1212
For repository owners only:
1313

14-
git commit -m "Support Mobile Emulation https://goo.gl/pqa7cn"
15-
git tag -d latest && git tag 3.0.0b4a && git push origin tmp-3.0.0b4a && git push --tags
14+
git commit -m "Support Selenium IDE tests"
15+
git tag -d latest && git tag 3.0.0b4b && git push origin tmp-3.0.0b4b && 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-3.0.0b4a && git push origin --delete tmp-3.0.0b4a
20+
git checkout master && git pull && git branch -d tmp-3.0.0b4b && git push origin --delete tmp-3.0.0b4b
2121

2222
-- Re-add TBD_* section in CHANGELOG.md starting with TBD_DOCKER_TAG
2323
-- If Chrome version changed upload:
@@ -27,17 +27,17 @@ For repository owners only:
2727
### Chrome artifact
2828
Keep certain bins if chrome version changed for example:
2929

30-
cd ~/tmp_binaries && VER="53.0.2785.116" && NAME="google-chrome-stable_${VER}_amd64" && echo ${NAME}
30+
cd ~/tmp_binaries && VER="53.0.2785.143" && NAME="google-chrome-stable_${VER}_amd64" && echo ${NAME}
3131
wget -nv --show-progress -O ${NAME}.deb "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
3232
md5sum ${NAME}.deb > ${NAME}.md5 && shasum ${NAME}.deb > ${NAME}.sha
33-
cp ${NAME}.md5 ${NAME}.sha ~/docker/binaries
33+
cp ${NAME}.md5 ${NAME}.sha ~/dosel/binaries
3434

3535
## Retry
3636
Failed in Travis? retry
3737

38-
git tag -d 3.0.0b4a && git push origin :3.0.0b4a
38+
git tag -d 3.0.0b4b && git push origin :3.0.0b4b
3939
#git add ...
40-
git commit --amend && git tag 3.0.0b4a && git push --force origin tmp-3.0.0b4a && git push --tags
40+
git commit --amend && git tag 3.0.0b4b && git push --force origin tmp-3.0.0b4b && 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: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,14 +968,16 @@ USER ${NORMAL_USER}
968968
#===================
969969
# DNS & hosts stuff
970970
#===================
971-
COPY ./dns/etc/hosts /tmp/hosts
971+
ADD ./dns/etc/hosts /tmp/hosts
972972

973973
#======
974974
# Envs
975975
#======
976976
ENV DEFAULT_SELENIUM_HUB_PORT="24444" \
977977
DEFAULT_SELENIUM_NODE_CH_PORT="25550" \
978978
DEFAULT_SELENIUM_NODE_FF_PORT="25551" \
979+
DEFAULT_SELENIUM_NODE_RC_CH_PORT="25552" \
980+
DEFAULT_SELENIUM_NODE_RC_FF_PORT="25553" \
979981
DEFAULT_VNC_PORT="25900" \
980982
DEFAULT_NOVNC_PORT="26080" \
981983
DEFAULT_SSHD_PORT="22222" \
@@ -1032,6 +1034,8 @@ ENV FIREFOX_VERSION="${FF_VER}" \
10321034
SELENIUM_NODE_HOST="127.0.0.1" \
10331035
SELENIUM_NODE_CH_PORT="${DEFAULT_SELENIUM_NODE_CH_PORT}" \
10341036
SELENIUM_NODE_FF_PORT="${DEFAULT_SELENIUM_NODE_FF_PORT}" \
1037+
SELENIUM_NODE_RC_CH_PORT="${DEFAULT_SELENIUM_NODE_RC_CH_PORT}" \
1038+
SELENIUM_NODE_RC_FF_PORT="${DEFAULT_SELENIUM_NODE_RC_FF_PORT}" \
10351039
# Selenium additional params:
10361040
SELENIUM_HUB_PARAMS="" \
10371041
SELENIUM_NODE_PARAMS="" \
@@ -1133,6 +1137,8 @@ ENV FIREFOX_VERSION="${FF_VER}" \
11331137
GRID="true" \
11341138
CHROME="true" \
11351139
FIREFOX="true" \
1140+
RC_CHROME="true" \
1141+
RC_FIREFOX="true" \
11361142
# Video file and extension, e.g. swf, mp4, mkv, flv
11371143
VIDEO_FILE_EXTENSION="mkv" \
11381144
VIDEO_FILE_NAME="" \

Makefile

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,21 @@ check_wmctrl:
138138
see: check_vncviewer
139139
./mk/see.sh &
140140

141+
# Shortcut to VNC into Chrome
142+
seech:
143+
@$(MAKE) -s see browser=chrome
144+
141145
# Shortcut to VNC into Firefox
142146
seeff:
143147
@$(MAKE) -s see browser=firefox
144148

145-
# Shortcut to VNC into Chrome
146-
seech:
147-
@$(MAKE) -s see browser=chrome
149+
# Shortcut to VNC into RC Firefox
150+
seercff:
151+
@$(MAKE) -s see browser=rc_firefox
152+
153+
# Shortcut to VNC into RC Chrome
154+
seercch:
155+
@$(MAKE) -s see browser=rc_chrome
148156

149157
env:
150158
env
@@ -166,6 +174,8 @@ down:
166174
@if [ "${VIDEO}" = "true" ]; then \
167175
$(MAKE) -s stop_videos_chrome ; \
168176
$(MAKE) -s stop_videos_firefox ; \
177+
$(MAKE) -s stop_videos_rc_chrome ; \
178+
$(MAKE) -s stop_videos_rc_firefox ; \
169179
fi
170180
docker-compose -f ${COMPOSE_FILE} -p ${COMPOSE_PROJ_NAME} down \
171181
--remove-orphans
@@ -182,14 +192,20 @@ stop_videos_chrome:
182192
stop_videos_firefox:
183193
@$(MAKE) -s stop_videos browser=firefox tot_nodes=${firefox}
184194

195+
stop_videos_rc_chrome:
196+
@$(MAKE) -s stop_videos browser=rc_chrome tot_nodes=${rc_chrome}
197+
198+
stop_videos_rc_firefox:
199+
@$(MAKE) -s stop_videos browser=rc_firefox tot_nodes=${rc_firefox}
200+
185201
scale:
186202
docker-compose -f ${COMPOSE_FILE} -p ${COMPOSE_PROJ_NAME} scale \
187-
${APP_NAME}=1 hub=1 chrome=${chrome} firefox=${firefox}
203+
${APP_NAME}=1 hub=1 chrome=${chrome} firefox=${firefox} rc_chrome=${rc_chrome} rc_firefox=${rc_firefox}
188204
@$(MAKE) -s wait chrome=${chrome} firefox=${firefox}
189205

190206
compose: basic_reqs cleanup
191207
docker-compose -f ${COMPOSE_FILE} -p ${COMPOSE_PROJ_NAME} up -d
192-
@$(MAKE) -s scale chrome=${chrome} firefox=${firefox}
208+
@$(MAKE) -s scale chrome=${chrome} firefox=${firefox} rc_chrome=${rc_chrome} rc_firefox=${rc_firefox}
193209

194210
wait:
195211
./mk/wait.sh
@@ -216,18 +232,24 @@ gather_videos_chrome:
216232
gather_videos_firefox:
217233
@$(MAKE) -s gather_videos browser=firefox tot_nodes=${firefox}
218234

235+
gather_videos_rc_chrome:
236+
@$(MAKE) -s gather_videos browser=rc_chrome tot_nodes=${rc_chrome}
237+
238+
gather_videos_rc_firefox:
239+
@$(MAKE) -s gather_videos browser=rc_firefox tot_nodes=${rc_firefox}
240+
219241
# Gather video artifacts
220-
videos: gather_videos_chrome gather_videos_firefox
242+
videos: gather_videos_chrome gather_videos_firefox gather_videos_rc_chrome gather_videos_rc_firefox
221243

222244
# VNC open all. As of now only 4 are supported
223245
seeall: check_vncviewer
224246
@$(MAKE) -s see browser=chrome node=1
225247
@sleep 0.3
226248
@$(MAKE) -s see browser=firefox node=1
227249
@sleep 0.4
228-
@$(MAKE) -s see browser=chrome node=2
229-
@sleep 0.5
230-
@$(MAKE) -s see browser=firefox node=2
250+
@$(MAKE) -s see browser=rc_chrome node=1
251+
@sleep 0.3
252+
@$(MAKE) -s see browser=rc_firefox node=1
231253

232254
# Move them all. As of now only 4 are supported
233255
dock: check_wmctrl
@@ -236,9 +258,9 @@ dock: check_wmctrl
236258
@sleep 0.2 #TODO Make active wait
237259
@$(MAKE) -s move browser=firefox node=1
238260
@sleep 0.2 #TODO Make active wait
239-
@$(MAKE) -s move browser=chrome node=2
261+
@$(MAKE) -s move browser=rc_chrome node=1
240262
@sleep 0.2 #TODO Make active wait
241-
@$(MAKE) -s move browser=firefox node=2
263+
@$(MAKE) -s move browser=rc_firefox node=1
242264

243265
# Run self tests
244266
test:
@@ -266,6 +288,8 @@ test:
266288
scale \
267289
seeff \
268290
seech \
291+
seercff \
292+
seercch \
269293
compose \
270294
wait \
271295
down \

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,10 @@ Powered by Supervisor, the container leaves many logs;
505505
/var/log/cont/selenium-node-chrome-stdout.log
506506
/var/log/cont/selenium-node-firefox-stderr.log
507507
/var/log/cont/selenium-node-firefox-stdout.log
508+
/var/log/cont/selenium-rc-chrome-stderr.log
509+
/var/log/cont/selenium-rc-chrome-stdout.log
510+
/var/log/cont/selenium-rc-firefox-stderr.log
511+
/var/log/cont/selenium-rc-firefox-stdout.log
508512
/var/log/cont/sshd-stderr.log
509513
/var/log/cont/sshd-stdout.log
510514
/var/log/cont/supervisord.log

bin/entry.sh

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

30+
# Selenium IDE RC (legacy) doesn't seem to keep working on 3.0.0
31+
if [ "${USE_SELENIUM}" == "3" ]; then
32+
export RC_CHROME="false"
33+
export RC_FIREFOX="false"
34+
fi
35+
36+
# We need larger screens for Selenium IDE RC tests
37+
if [ "${RC_CHROME}" = "true" ] || [ "${RC_FIREFOX}" = "true" ]; then
38+
export SCREEN_HEIGHT=$((SCREEN_HEIGHT*2))
39+
fi
40+
3041
#---------------------
3142
# Fix/extend ENV vars
3243
#---------------------
@@ -99,6 +110,14 @@ if [ "${FIREFOX}" = "true" ]; then
99110
export SUPERVISOR_REQUIRED_SRV_LIST="${SUPERVISOR_REQUIRED_SRV_LIST}|selenium-node-firefox"
100111
fi
101112

113+
if [ "${RC_CHROME}" = "true" ]; then
114+
export SUPERVISOR_REQUIRED_SRV_LIST="${SUPERVISOR_REQUIRED_SRV_LIST}|selenium-rc-chrome"
115+
fi
116+
117+
if [ "${RC_FIREFOX}" = "true" ]; then
118+
export SUPERVISOR_REQUIRED_SRV_LIST="${SUPERVISOR_REQUIRED_SRV_LIST}|selenium-rc-firefox"
119+
fi
120+
102121
if [ "${SAUCE_TUNNEL}" = "true" ]; then
103122
export SUPERVISOR_REQUIRED_SRV_LIST="${SUPERVISOR_REQUIRED_SRV_LIST}|saucelabs"
104123
fi
@@ -140,6 +159,24 @@ elif [ "${PICK_ALL_RANDMON_PORTS}" = "true" ]; then
140159
fi
141160
fi
142161

162+
if [ "${SELENIUM_NODE_RC_CH_PORT}" = "0" ]; then
163+
export SELENIUM_NODE_RC_CH_PORT=$(get_unused_port)
164+
elif [ "${PICK_ALL_RANDMON_PORTS}" = "true" ]; then
165+
# User want to pick random ports but may also want to fix some others
166+
if [ "${SELENIUM_NODE_RC_CH_PORT}" = "${DEFAULT_SELENIUM_NODE_RC_CH_PORT}" ]; then
167+
export SELENIUM_NODE_RC_CH_PORT=$(get_unused_port)
168+
fi
169+
fi
170+
171+
if [ "${SELENIUM_NODE_RC_FF_PORT}" = "0" ]; then
172+
export SELENIUM_NODE_RC_FF_PORT=$(get_unused_port)
173+
elif [ "${PICK_ALL_RANDMON_PORTS}" = "true" ]; then
174+
# User want to pick random ports but may also want to fix some others
175+
if [ "${SELENIUM_NODE_RC_FF_PORT}" = "${DEFAULT_SELENIUM_NODE_RC_FF_PORT}" ]; then
176+
export SELENIUM_NODE_RC_FF_PORT=$(get_unused_port)
177+
fi
178+
fi
179+
143180
# Video
144181
export VIDEO_LOG_FILE="${LOGS_DIR}/video-rec-stdout.log"
145182
export VIDEO_PIDFILE="${RUN_DIR}/video.pid"
@@ -398,6 +435,10 @@ echo "${SELENIUM_NODE_CH_PORT}" > SELENIUM_NODE_CH_PORT
398435
echo "${SELENIUM_NODE_CH_PORT}" > CH_PORT
399436
echo "${SELENIUM_NODE_FF_PORT}" > SELENIUM_NODE_FF_PORT
400437
echo "${SELENIUM_NODE_FF_PORT}" > FF_PORT
438+
echo "${SELENIUM_NODE_RC_CH_PORT}" > SELENIUM_NODE_RC_CH_PORT
439+
echo "${SELENIUM_NODE_RC_CH_PORT}" > RC_CH_PORT
440+
echo "${SELENIUM_NODE_RC_FF_PORT}" > SELENIUM_NODE_RC_FF_PORT
441+
echo "${SELENIUM_NODE_RC_FF_PORT}" > RC_FF_PORT
401442
echo "${DISPLAY}" > DISPLAY
402443
echo "${VNC_PORT}" > VNC_PORT
403444
echo "${NOVNC_PORT}" > NOVNC_PORT

docker-compose-host.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,21 @@ services:
1010
- GRID=true
1111
- CHROME=false
1212
- FIREFOX=false
13+
- RC_CHROME=false
14+
- RC_FIREFOX=false
1315

1416
chrome:
1517
image: elgalu/selenium
1618
network_mode: host
1719
shm_size: 1g
18-
# volumes:
19-
# - /var/run/dbus:/var/run/dbus
2020
environment:
2121
- SELENIUM_HUB_PORT
2222
- PICK_ALL_RANDMON_PORTS=true
2323
- GRID=false
2424
- CHROME=true
2525
- FIREFOX=false
26+
- RC_CHROME=false
27+
- RC_FIREFOX=false
2628

2729
firefox:
2830
image: elgalu/selenium
@@ -33,6 +35,33 @@ services:
3335
- GRID=false
3436
- CHROME=false
3537
- FIREFOX=true
38+
- RC_CHROME=false
39+
- RC_FIREFOX=false
40+
41+
rc_chrome:
42+
image: elgalu/selenium
43+
network_mode: host
44+
shm_size: 1g
45+
environment:
46+
- SELENIUM_HUB_PORT
47+
- PICK_ALL_RANDMON_PORTS=true
48+
- GRID=false
49+
- CHROME=false
50+
- FIREFOX=false
51+
- RC_CHROME=true
52+
- RC_FIREFOX=false
53+
54+
rc_firefox:
55+
image: elgalu/selenium
56+
network_mode: host
57+
environment:
58+
- SELENIUM_HUB_PORT
59+
- PICK_ALL_RANDMON_PORTS=true
60+
- GRID=false
61+
- CHROME=false
62+
- FIREFOX=false
63+
- RC_CHROME=false
64+
- RC_FIREFOX=true
3665

3766
mock:
3867
image: elgalu/google_adwords_mock

0 commit comments

Comments
 (0)