Skip to content

Commit

Permalink
updates for travis ci
Browse files Browse the repository at this point in the history
- fix failed tests in codegen
- fix process exit code failure point in travis-run-ci-tests.sh
- switch to ubuntu 'trusty' distro
- attempt to use firefox and chrome addons supported by travis ci
  • Loading branch information
Doug Simmons committed Jul 27, 2017
1 parent 91fd12a commit bafaf16
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 31 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
@@ -1,9 +1,12 @@
dist: trusty
language: java
sudo: false
jdk:
- oraclejdk8
addons:
sauce_connect: true
firefox: latest
chrome: stable
cache:
directories:
- $HOME/.m2
Expand Down
Expand Up @@ -33,7 +33,8 @@ public void before() {
public void testGet() {
SeLionElementSet elementSet = AndroidSeLionElementSet.getInstance();
assertNotNull(elementSet);
assertEquals(elementSet.size(), 7);
// 7 is the min required from the construction of AndroidSeLionElementSet
assertTrue(elementSet.size() >= 7);
assertTrue(elementSet.contains(AndroidSeLionElement.UI_BUTTON));
}
}
Expand Up @@ -33,7 +33,8 @@ public void before() {
public void testGet() {
SeLionElementSet elementSet = MobileSeLionElementSet.getInstance();
assertNotNull(elementSet);
assertEquals(elementSet.size(), 10);
// 10 is the min required from the construction of MobileSeLionElementSet
assertTrue(elementSet.size() >= 10);
assertTrue(elementSet.contains(MobileSeLionElement.BUTTON));
}
}
16 changes: 2 additions & 14 deletions utilities/travis-run-chrome-tests.sh
Expand Up @@ -10,20 +10,8 @@ if [ -n "${SAUCE_USERNAME}" ]; then
echo { \"sauceUserName\": \"${SAUCE_USERNAME}\", \"sauceApiKey\": \"${SAUCE_ACCESS_KEY}\", \"tunnel-identifier\": \"__string__${TRAVIS_JOB_NUMBER}\", \"build\": \"${TRAVIS_BUILD_NUMBER}\", \"idle-timeout\": 120, \"tags\": [\"commit ${TRAVIS_COMMIT}\", \"branch ${TRAVIS_BRANCH}\", \"pull request ${TRAVIS_PULL_REQUEST}\"] } > client/src/test/resources/sauceConfig.json
fi

mkdir -p target
cd target
if [ ! -f "./google-chrome" ]; then
export CHROME_REVISION=`curl -s http://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/LAST_CHANGE`
curl -L -O "http://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/${CHROME_REVISION}/chrome-linux.zip"
unzip -o chrome-linux.zip
ln -sf ${PWD}/chrome-linux/chrome-wrapper google-chrome
fi

./google-chrome -version
cd ..

export PATH=${PWD}/target:${PATH}
mvn test -pl client -DsuiteXmlFile=Chrome-Suite.xml \
-DSELION_SELENIUM_RUN_LOCALLY=true -DSELION_DOWNLOAD_DEPENDENCIES=true \
-DSELION_SELENIUM_CUSTOM_CAPABILITIES_PROVIDER=com.paypal.selion.TravisCICapabilityBuilder \
-DBROWSER_PATH=${PWD}/target/google-chrome -B -V
-DBROWSER_PATH=`which google-chrome` -B -V
exit $?
4 changes: 2 additions & 2 deletions utilities/travis-run-ci-tests.sh
Expand Up @@ -9,7 +9,7 @@ set -ev

if [ "$USE_SAUCELABS" = true ]; then
echo { \"sauceUserName\": \"${SAUCE_USERNAME}\", \"sauceApiKey\": \"${SAUCE_ACCESS_KEY}\", \"tunnel-identifier\": \"__string__${TRAVIS_JOB_NUMBER}\", \"build\": \"${TRAVIS_BUILD_NUMBER}\", \"idle-timeout\": 120, \"tags\": [\"commit ${TRAVIS_COMMIT}\", \"branch ${TRAVIS_BRANCH}\", \"pull request ${TRAVIS_PULL_REQUEST}\"] } > client/src/test/resources/sauceConfig.json
mvn test -DSELION_BROWSER_CAPABILITY_PLATFORM=WINDOWS -B -V
mvn test -DSELION_BROWSER_CAPABILITY_PLATFORM=WINDOWS -B -V && exit $?
else
mvn test -DsuiteXmlFile=PhantomJS-Suite.xml -DSELION_SELENIUM_RUN_LOCALLY=true -B -V
mvn test -DsuiteXmlFile=PhantomJS-Suite.xml -DSELION_SELENIUM_RUN_LOCALLY=true -B -V && exit $?
fi
14 changes: 1 addition & 13 deletions utilities/travis-run-firefox-tests.sh
Expand Up @@ -15,18 +15,6 @@ if [ "${TRAVIS}" = true ]; then
rm -rf ${HOME}/.mozilla
fi

mkdir -p target
cd target
if [ ! -f "./firefox/firefox" ]
then
export FIREFOX_VERSION=52.0
export FIREFOX_URL=http://download.cdn.mozilla.net/pub/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/firefox-${FIREFOX_VERSION}.tar.bz2
wget -O firefox-${FIREFOX_VERSION}.tar.bz2 ${FIREFOX_URL}
# and install downloaded firefox
tar -xjf firefox-${FIREFOX_VERSION}.tar.bz2
fi
cd ..

export PATH=${PWD}/target/firefox:${PATH}
mvn test -pl client -B -V -DsuiteXmlFile=Firefox-Suite.xml \
-DSELION_SELENIUM_RUN_LOCALLY=true -DSELION_DOWNLOAD_DEPENDENCIES=true -B -V
exit $?

0 comments on commit bafaf16

Please sign in to comment.