Skip to content

Commit

Permalink
Added firefox profile option to acceptance tests with selenium and behat
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <[email protected]>
  • Loading branch information
skjnldsv committed May 9, 2018
1 parent 9fe95e8 commit 6bf6253
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/acceptance/firefox-profile/prefs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
user_pref("layout.css.grid.enabled", true);
8 changes: 8 additions & 0 deletions tests/acceptance/firefox-profile/profiles.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[General]
StartWithLastProfile=1

[Profile0]
Name=default
IsRelative=1
Path=firefox-profile
Default=1
8 changes: 7 additions & 1 deletion tests/acceptance/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,10 @@ function setOperatingSystemAbstractionVariables() {
# "vncviewer 127.0.0.1:5900"); when asked for the password use "secret".
function prepareSelenium() {
SELENIUM_CONTAINER=selenium-nextcloud-local-test-acceptance
export JAVA_OPTS=-Dwebdriver.firefox.profile=default

echo "Starting Selenium server"
docker run --detach --name=$SELENIUM_CONTAINER --publish 4444:4444 --publish 5900:5900 $DOCKER_OPTIONS selenium/standalone-firefox-debug:2.53.1-beryllium
docker run --detach --name=$SELENIUM_CONTAINER --publish 4444:4444 --publish 5900:5900 $DOCKER_OPTIONS -e JAVA_OPTS selenium/standalone-firefox-debug:2.53.1-beryllium

echo "Waiting for Selenium server to be ready"
if ! $TIMEOUT 10s bash -c "while ! curl 127.0.0.1:4444 >/dev/null 2>&1; do sleep 1; done"; then
Expand All @@ -118,6 +119,11 @@ function prepareSelenium() {

exit 1
fi

echo "Setting firefox profile"
docker exec --user=seluser $SELENIUM_CONTAINER mkdir -p /home/seluser/.mozilla/firefox
docker cp ./firefox-profile/profiles.ini $SELENIUM_CONTAINER:/home/seluser/.mozilla/firefox/
docker cp ./firefox-profile/ $SELENIUM_CONTAINER:/home/seluser/.mozilla/firefox/
}

# Creates a Docker container to run both the acceptance tests and the Nextcloud
Expand Down

0 comments on commit 6bf6253

Please sign in to comment.