#!/bin/bash if ! [ -f /.dockerenv ] && ! grep -q 'devices:/docker' /proc/1/cgroup ; then echo "Not running inside docker, exiting to avoid data damage." >&2 exit 1 fi set -e set -u pwd pkill -f '/usr/bin/java -jar /home/selenium/selenium-server-standalone.jar' || true # NOTE: this could silently fail because selenium-server-standalone.jar is missing a daemonize option DISPLAY=:98 /usr/bin/java -jar /home/selenium/selenium-server-standalone.jar -trustAllSSLCertificates -log /home/selenium/selenium.log & sleep 5 echo "### Copying and moving files" cp -Rf . /tmp/code ln -s /tmp/node_modules /tmp/code/t/node_modules cd /tmp/code/ echo "################################################################################" echo "Finished main setup, now running tests ..." echo "Selenium server log file available at /home/selenium/selenium.log" echo "### Building app" /opt/Sencha/Cmd/sencha app build -c cd /tmp/code/t/ echo "### Starting Karma test" ./node_modules/karma/bin/karma start config/karma.conf.js cd /tmp/code/ echo "### Starting app server" /opt/Sencha/Cmd/sencha web start & sleep 5 cd /tmp/code/t/ echo "### Starting Webdriver.io test" ./node_modules/.bin/wdio config/wdio.conf.js echo "### Moving JUnit XML files to /results" mv /tmp/code/t/*.xml /results echo "Finished test execution, test execution returned with exit code." echo "################################################################################"