How to run Selenium Server on Travis CI while testing Node.js project with Nightwatch

I have a node.js project that I am trying to use to test Nightwatch. Nightwatch uses a selenium server under the hood.

My tests are working correctly locally, but on Travis it immediately chokes on this error :

An error occurred while starting the Selenium server:

Exception on thread "main" java.lang.UnsupportedClassVersionError: org / openqa / grid / selenium / GridLauncherV3: Unsupported major.minor 52.0

I think this means he wants Java 8 or newer, but I'm not sure how to set this up on Travis. I tried setting up jdk: oracle8jdk

in my travis.yml
but it didn't seem to matter. (Maybe this only works for Java tests?)

Any suggestions?

+3


source to share


1 answer


Trusty Environment has a tool called jdk_switcher . This tool can be used to configure the correct Java version to run selenium. Here's the important parts of my travis.yml :



dist: trusty
sudo: false
#...
before_script:
    #...
    - jdk_switcher use oraclejdk8

      

+2


source







All Articles