Skip to content

Commit 872a5b2

Browse files
committed
Update acceptance tests to Selenium 3
The acceptance tests used the last Selenium 2 Docker container available, which provides a rather old Firefox version (Firefox 47). Nevertheless, despite some rendering issues, most things still worked as expected due to the JavaScript files being built with support for older browsers. However, now that support for Internet Explorer 11 and older browsers will be dropped things could start to fail, so a newer browser (and thus a newer Selenium version) should be used in the acceptance tests. Selenium has been standardized by the W3C, and the protocol to communicate between the Selenium server and the browser has changed due to that. Firefox >= 48 only supports the new W3C protocol, but the Selenium driver for Mink does not support it yet. The old protocol can still be used in recent Chromium/Chrome versions by explicitly forcing it, so for the time being the acceptance tests will need to be run on Chrome instead (although Firefox provides some interesting features like the fake streams that would be needed to test calls in Talk, so they should be moved again to Firefox once possible). Finally, the default shm size of Docker is 64 MiB. This does not seem enough to run newer Chromium releases and causes the browser to randomly crash during the tests ("unknown error: session deleted because of page crash" is shown in the logs), so a larger size (256 MiB) needs to be used instead. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
1 parent 8a99071 commit 872a5b2

File tree

3 files changed

+33
-13
lines changed

3 files changed

+33
-13
lines changed

.drone.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,7 +1684,7 @@ steps:
16841684

16851685
services:
16861686
- name: selenium
1687-
image: selenium/standalone-firefox:2.53.1-beryllium
1687+
image: selenium/standalone-chrome:3.141.59
16881688
environment:
16891689
# Reduce default log level for Selenium server (INFO) as it is too
16901690
# verbose.
@@ -1714,7 +1714,7 @@ trigger:
17141714
#
17151715
#services:
17161716
#- name: selenium
1717-
# image: selenium/standalone-firefox:2.53.1-beryllium
1717+
# image: selenium/standalone-chrome:3.141.59
17181718
# environment:
17191719
# # Reduce default log level for Selenium server (INFO) as it is too
17201720
# # verbose.
@@ -1744,7 +1744,7 @@ steps:
17441744

17451745
services:
17461746
- name: selenium
1747-
image: selenium/standalone-firefox:2.53.1-beryllium
1747+
image: selenium/standalone-chrome:3.141.59
17481748
environment:
17491749
# Reduce default log level for Selenium server (INFO) as it is too
17501750
# verbose.
@@ -1774,7 +1774,7 @@ steps:
17741774

17751775
services:
17761776
- name: selenium
1777-
image: selenium/standalone-firefox:2.53.1-beryllium
1777+
image: selenium/standalone-chrome:3.141.59
17781778
environment:
17791779
# Reduce default log level for Selenium server (INFO) as it is too
17801780
# verbose.
@@ -1804,7 +1804,7 @@ steps:
18041804

18051805
services:
18061806
- name: selenium
1807-
image: selenium/standalone-firefox:2.53.1-beryllium
1807+
image: selenium/standalone-chrome:3.141.59
18081808
environment:
18091809
# Reduce default log level for Selenium server (INFO) as it is too
18101810
# verbose.
@@ -1834,7 +1834,7 @@ steps:
18341834

18351835
services:
18361836
- name: selenium
1837-
image: selenium/standalone-firefox:2.53.1-beryllium
1837+
image: selenium/standalone-chrome:3.141.59
18381838
environment:
18391839
# Reduce default log level for Selenium server (INFO) as it is too
18401840
# verbose.
@@ -1864,7 +1864,7 @@ steps:
18641864

18651865
services:
18661866
- name: selenium
1867-
image: selenium/standalone-firefox:2.53.1-beryllium
1867+
image: selenium/standalone-chrome:3.141.59
18681868
environment:
18691869
# Reduce default log level for Selenium server (INFO) as it is too
18701870
# verbose.
@@ -1894,7 +1894,7 @@ steps:
18941894

18951895
services:
18961896
- name: selenium
1897-
image: selenium/standalone-firefox:2.53.1-beryllium
1897+
image: selenium/standalone-chrome:3.141.59
18981898
environment:
18991899
# Reduce default log level for Selenium server (INFO) as it is too
19001900
# verbose.
@@ -1924,7 +1924,7 @@ steps:
19241924

19251925
services:
19261926
- name: selenium
1927-
image: selenium/standalone-firefox:2.53.1-beryllium
1927+
image: selenium/standalone-chrome:3.141.59
19281928
environment:
19291929
# Reduce default log level for Selenium server (INFO) as it is too
19301930
# verbose.
@@ -1954,7 +1954,7 @@ steps:
19541954

19551955
services:
19561956
- name: selenium
1957-
image: selenium/standalone-firefox:2.53.1-beryllium
1957+
image: selenium/standalone-chrome:3.141.59
19581958
environment:
19591959
# Reduce default log level for Selenium server (INFO) as it is too
19601960
# verbose.
@@ -1984,7 +1984,7 @@ steps:
19841984

19851985
services:
19861986
- name: selenium
1987-
image: selenium/standalone-firefox:2.53.1-beryllium
1987+
image: selenium/standalone-chrome:3.141.59
19881988
environment:
19891989
# Reduce default log level for Selenium server (INFO) as it is too
19901990
# verbose.

tests/acceptance/config/behat.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,35 @@ default:
6565
default:
6666
selenium2:
6767
wd_host: %selenium.server%
68+
browser: "chrome"
69+
capabilities:
70+
extra_capabilities:
71+
goog:chromeOptions:
72+
w3c: false
6873
John:
6974
selenium2:
7075
wd_host: %selenium.server%
76+
browser: "chrome"
77+
capabilities:
78+
extra_capabilities:
79+
goog:chromeOptions:
80+
w3c: false
7181
Jane:
7282
selenium2:
7383
wd_host: %selenium.server%
84+
browser: "chrome"
85+
capabilities:
86+
extra_capabilities:
87+
goog:chromeOptions:
88+
w3c: false
7489
Jim:
7590
selenium2:
7691
wd_host: %selenium.server%
92+
browser: "chrome"
93+
capabilities:
94+
extra_capabilities:
95+
goog:chromeOptions:
96+
w3c: false
7797
Rubeus:
7898
# Rubeus uses a browser that has CSS grid support.
7999
selenium2:

tests/acceptance/run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ function prepareSelenium() {
108108
SELENIUM_CONTAINER=selenium-nextcloud-local-test-acceptance
109109

110110
echo "Starting Selenium server"
111-
docker run --detach --name=$SELENIUM_CONTAINER --publish 4444:4444 --publish 5900:5900 $DOCKER_OPTIONS selenium/standalone-firefox-debug:2.53.1-beryllium
111+
docker run --detach --name=$SELENIUM_CONTAINER --publish 4444:4444 --publish 5900:5900 --shm-size 256m $DOCKER_OPTIONS selenium/standalone-chrome-debug:3.141.59
112112

113113
echo "Waiting for Selenium server to be ready"
114114
if ! $TIMEOUT 10s bash -c "while ! curl 127.0.0.1:4444 >/dev/null 2>&1; do sleep 1; done"; then
115115
echo "Could not start Selenium server; running" \
116-
"\"docker run --rm --publish 4444:4444 --publish 5900:5900 $DOCKER_OPTIONS selenium/standalone-firefox-debug:2.53.1-beryllium\"" \
116+
"\"docker run --rm --publish 4444:4444 --publish 5900:5900 $DOCKER_OPTIONS selenium/standalone-chrome-debug:3.141.59\"" \
117117
"could give you a hint of the problem"
118118

119119
exit 1

0 commit comments

Comments
 (0)