.travis.yml.disable
language: java
jdk:
- oraclejdk8
- openjdk11
# docker, see: https://docs.travis-ci.com/user/reference/overview/
sudo: false
dist: trusty
addons:
firefox: latest
chrome: stable
install: true # disable default mvn install
notifications:
slack:
secure: IqgM1pS7ViQnEv9Fv+/jUA2wJ9Tt8NGd7JhJOENV+S1rTpXgaQw+uG7Fo1srfiUe3Hs2DAP+bv6AmEsEJvkO44al+lh0TMcDaSW3tqKa2mG9RtVdL3ZvhzCGARg0sdofTV/hko37iESRFjQyeXkXilNhtG7/IeNaU/7Ac9Mn55IZLSL76t3P7XRk7uaJtrQ098IZfVr57IsyTKpy8WMS2eZbqIsM8/MNynzyEj3o6X6bIRL1ovO9GHQ+ImbJitDnVzVYKlcn4R6/tDBTzkiJyWL8Uw6wFEglq0g5GrtnLwtZMGtqROo2y5rezpANe62NdYYWzR79laqSwDAeGkGqGYJVp8wZAmVAuA7axzqiSe0C+SDQxXR8euXAjQUzVhpnmMB7ABHEHHVMHNEqFp+Ps0V2egoPEZP6nTVvi/k8uOjN4n67UKAEZJroOZ3nuPFX9LFvGeKs4OCmjWx9RJWeX4DDcKudZu7AGkvUCHTJfnOPX7jTZmocFXUjsq42SeCJrA2I1UW7okNqaAV2PwAmhwCbfwP5p1JXL8j2Bvn4iBHYC/Gefm6F80INrMCE7XdpDCNeAUOke+jnAihQ0/h7Z6EyZu5nvoYkDiNUs9iwiPHIMpMcGZPhQ6e26Ij0DqipQp6RJYwa7hek1TCJMqdQil3rh1o9gMYPDusN3Ovkf/Y=
cache:
directories:
- $HOME/.m2
env:
global:
- CAPTURE_URL=""
- SUT_NAME="frameworkium-core"
- SUT_VERSION=${TRAVIS_BRANCH}
- THREAD_COUNT=2
- SELENIUM_MAJ_VER=3.141
- SELENIUM_VER=${SELENIUM_MAJ_VER}.59
- SELENIUM_JAR=selenium-server-standalone-${SELENIUM_VER}.jar
- GECKO_VER=0.26.0
- CHROME_DRIVER_VER=83.0.4103.39
# Override Travis default to give browsers more room
- _JAVA_OPTIONS="-Xmx1024m -Xms128m"
# Required to turn on workaround for the following issue:
# https://github.com/travis-ci/travis-ci/issues/8836
- CHROME_NO_SANDBOX=true
before_script:
# Setup X to allow non-headless browsers to run
- export DISPLAY=:99.0
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1400x1024x16
# Set up code climate test reporter
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
# Set up Selenium Grid Hub
- wget --quiet https://selenium-release.storage.googleapis.com/${SELENIUM_MAJ_VER}/${SELENIUM_JAR}
- java -Xmx128m -jar ${SELENIUM_JAR} -role hub > hub.log 2>&1 &
# Download geckodriver
- wget --quiet https://github.com/mozilla/geckodriver/releases/download/v${GECKO_VER}/geckodriver-v${GECKO_VER}-linux64.tar.gz
- tar -xzf geckodriver-v${GECKO_VER}-linux64.tar.gz
# Download chromedriver
- wget --quiet http://chromedriver.storage.googleapis.com/${CHROME_DRIVER_VER}/chromedriver_linux64.zip
- unzip chromedriver_linux64.zip
# Wait for grid hub to be up
- until $(curl --output /dev/null --silent --fail http://localhost:4444/grid/console); do printf '.'; sleep 1; done
# Setup Firefox Selenium Grid Node
- java -Xmx128m -jar ${SELENIUM_JAR} -role node -hub http://localhost:4444/grid/register -browser browserName=firefox,maxInstances=${THREAD_COUNT} -maxSession ${THREAD_COUNT} -port 5555 > ff-node.log 2>&1 &
# Set up Chrome Selenium Grid Node
- java -Xmx128m -jar ${SELENIUM_JAR} -role node -hub http://localhost:4444/grid/register -browser browserName=chrome,maxInstances=${THREAD_COUNT} -maxSession ${THREAD_COUNT} -port 5556 > chrome-node.log 2>&1 &
script:
# Download deps, compile and run checkstyle
- mvn test-compile -B -U --show-version -DskipTests=true -Dmaven.javadoc.skip=true
# Firefox on the grid
# Dec 2018: Back to 1 thread due to regular NPEs (likely caused by browser crashing)
- mvn verify -B -Dthreads=1 -Dconfig=FirefoxGrid.yaml
#-DcaptureURL=${CAPTURE_URL} -DsutName="${SUT_NAME}" -DsutVersion="${SUT_VERSION}"
# Following have -o (offline) flag to prevent timing out for snapshot metadata
# Problem appeared Sept 2018
# Firefox off the grid
- mvn verify -B -o -Dthreads=${THREAD_COUNT} -Dbrowser=firefox -DreuseBrowser=true -Dheadless=true -Dit.test=TheInternetExampleTests 2> /dev/null
# Chrome on the grid
- mvn verify -B -o -Dthreads=${THREAD_COUNT} -Dbrowser=chrome -DreuseBrowser=true -Dheadless=true -DgridURL=http://localhost:4444/wd/hub
# Custom Browser Impl (without Capture so the PageFactorySpec runs)
- mvn verify -B -o -Dthreads=${THREAD_COUNT} -DcustomBrowserImpl=com.frameworkium.integration.CustomFirefoxImpl -Dmaximise=true -Dit.test=DocumentationTest 2> /dev/null
# Test groups and test that all @Before methods in BaseUITest run
- mvn verify -B -o -Dthreads=${THREAD_COUNT} -Dbrowser=chrome -Dgroups=fw-bugs -DreuseBrowser=true -Dheadless=true
# Query Jira for which test to run and then log results to Jira
# Disabled until we have a JIRA to use
# - mvn verify -B -Dthreads=${THREAD_COUNT} -Dbrowser=chrome -DjiraURL="http://52.29.130.45:8080" -DjqlQuery="issueKey=TEST-1" -DresultVersion="BUILD TEST VERSION" -DzapiCycleRegex="Test Cycle" -DjiraUsername=frameworkium -DjiraPassword=frameworkium -DcaptureURL=${CAPTURE_URL} -DsutName="${SUT_NAME}" -DsutVersion="${SUT_VERSION}"
# SauceLabs - disabled until we have a sauce account to use
# - mvn verify -Dsauce=true -Dplatform=ios -Dbrowser=safari -DplatformVersion=8.0 -Ddevice=iPad -DcaptureURL=${CAPTURE_URL} -DsutName="${SUT_NAME}" -DsutVersion="${SUT_VERSION}"
# Allure report
- mvn allure:report -B
after_script:
# Code coverage report
- bash <(curl -s https://codecov.io/bash)
# Upload code coverage to code climate - with workaround for jacoco (Dec 2017)
- cp target/site/jacoco/jacoco.xml src/main/java/jacoco.xml
- cd src/main/java/
- ../../../cc-test-reporter after-build -t jacoco --exit-code $TRAVIS_TEST_RESULT