New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPIKE Can we run the e2e tests on TravisCI (or other CI)? #8

Closed
nelsonic opened this Issue Jun 14, 2016 · 37 comments

Comments

Projects
None yet
10 participants
@nelsonic
Member

nelsonic commented Jun 14, 2016

Given that we have the selenium start/shutdown and test run in a single command npm run e2e,
we could try to run this on Travis...

@nelsonic nelsonic self-assigned this Jun 14, 2016

nelsonic added a commit that referenced this issue Jun 14, 2016

@nelsonic

This comment has been minimized.

Member

nelsonic commented Jun 14, 2016

Sadly this did not work looks like the Selenium server did not start: https://travis-ci.org/nelsonic/learn-nightwatch/builds/137542228#L185
we don't have an easy way of debugging it...
But I'm going to try and install Java before running the tests...
http://superuser.com/questions/993718/can-i-install-java-8-on-travis-ci-for-a-python-project

nelsonic added a commit that referenced this issue Jun 14, 2016

@nelsonic

This comment has been minimized.

Member

nelsonic commented Jun 14, 2016

@nelsonic

This comment has been minimized.

Member

nelsonic commented Jun 14, 2016

Looks like Travis-CI is not going to be an option... see: travis-ci/travis-ci#4090 (for now...)

nelsonic added a commit that referenced this issue Jun 14, 2016

@nelsonic

This comment has been minimized.

Member

nelsonic commented Jun 14, 2016

Hold on, found this: http://stackoverflow.com/questions/18456611/is-it-possible-to-set-up-travis-to-run-tests-for-several-languages which leads to http://entulho.fiatjaf.alhur.es/guias/how-to-use-node-along-with-other-language-on-travis-ci/ which suggests that we set the language in .travis.yml to Java and then run the tests in a script ... e.g:

language: java

install:
  - . $HOME/.nvm/nvm.sh
  - nvm install stable
  - nvm use stable
  - npm install

script:
  - npm test

This example is for Go but still relevant: https://github.com/OrangeTux/Goppetto/blob/develop/.travis.yml

nelsonic added a commit that referenced this issue Jun 14, 2016

nelsonic added a commit that referenced this issue Jun 14, 2016

@nelsonic

This comment has been minimized.

Member

nelsonic commented Jun 14, 2016

Note: This works on CodeShip without any issues:
learn-nightwatch-codeship-passes
learn-nightwatch-codeship-2
Codeship passes while Travis Fails...
codeship-passes-travis-fails
https://travis-ci.org/nelsonic/learn-nightwatch/builds/137568733#L138

@nelsonic

This comment has been minimized.

Member

nelsonic commented Jun 14, 2016

nelsonic added a commit that referenced this issue Jun 15, 2016

nelsonic added a commit that referenced this issue Jun 15, 2016

nelsonic added a commit that referenced this issue Jun 15, 2016

@nelsonic

This comment has been minimized.

Member

nelsonic commented Jun 15, 2016

Attempt to run the selenium jar file as a background process:
http://stackoverflow.com/questions/12102270/run-java-jar-file-on-a-server-as-background-process

nelsonic added a commit that referenced this issue Jun 15, 2016

nelsonic added a commit that referenced this issue Jun 15, 2016

@nelsonic

This comment has been minimized.

Member

nelsonic commented Jun 15, 2016

Attempt to use https://github.com/angular/webdriver-manager to run selenium...

nelsonic added a commit that referenced this issue Jun 15, 2016

nelsonic added a commit that referenced this issue Jun 15, 2016

@nelsonic

This comment has been minimized.

nelsonic added a commit that referenced this issue Jun 15, 2016

@nelsonic

This comment has been minimized.

Member

nelsonic commented Jun 15, 2016

nelsonic added a commit that referenced this issue Jun 15, 2016

nelsonic added a commit that referenced this issue Jun 15, 2016

@nelsonic

This comment has been minimized.

Member

nelsonic commented Jun 15, 2016

Selenium is Running! https://travis-ci.org/nelsonic/learn-nightwatch/builds/137849262
travis-loads-selenium

But I cannot access it!
travis-cannot-connect-to-selenium

@amilajack

This comment has been minimized.

Contributor

amilajack commented Jul 12, 2016

@nelsonic would a PR for this still be welcome? Think I might give it a go.

@amilajack

This comment has been minimized.

Contributor

amilajack commented Jul 12, 2016

I'm getting the error:

TypeError: Path must be a string. Received { url: 'http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.0.jar'

Seems like env2 isn't configured properly in the config.

@nelsonic

This comment has been minimized.

Member

nelsonic commented Jul 13, 2016

@amilajack I think the error relates to the latest version of download not working with node v6 see: #24
we first need make selenium-download compatible with node v6.x ... I forked the repo: https://github.com/dwyl/selenium-download and started to debug why it wasn't working ... (you are a contributor if you want to take a look)

@nelsonic

This comment has been minimized.

Member

nelsonic commented Oct 25, 2016

@Danwhy & @SimonLab what are you doing differently to run your Nightwatch tests on Travis-CI ?
They appear to run without issues: https://travis-ci.org/TheScienceMuseum/collectionsonline/builds/169499325#L1957
running this command: https://github.com/TheScienceMuseum/collectionsonline/blob/master/package.json#L71
CC: @Conorc1000

@Danwhy

This comment has been minimized.

Member

Danwhy commented Oct 25, 2016

It could be because we're running ours through saucelabs

@nelsonic

This comment has been minimized.

Member

nelsonic commented Oct 26, 2016

@Danwhy next time we're in the same room please walk me through it so I understand. thanks! 😉

@justinmc

This comment has been minimized.

justinmc commented Oct 26, 2016

For whatever it's worth, I seem to have gotten my project to work with Nightwatch tests on Travis using this guide, but I had to settle with only using phantomjs: Autodesk/molecule-2d-for-react#15

@nelsonic

This comment has been minimized.

Member

nelsonic commented Oct 26, 2016

@justinmc nice work! thanks for confirming you got it working with PhantomJS! 👍

@nelsonic

This comment has been minimized.

Member

nelsonic commented Nov 3, 2016

@jackcarlisle this is how I log progress in a "Spike"... it lets someone else see what has been attempted and can pick up the baton...

@jackcarlisle

This comment has been minimized.

Member

jackcarlisle commented Nov 3, 2016

@nelsonic 👍 I'll do the same for the karma spike

@gregorybesson

This comment has been minimized.

gregorybesson commented Dec 4, 2016

Hello guys,

I've been able to make it work with Chrome in Travis: https://github.com/abecms/abecms/blob/master/.travis.yml

  1. You have to use the beta build from travis
sudo: required
dist: trusty
  1. You launch xvfb + install the last stable version of Chrome
before_install:
 - export CHROME_BIN=/usr/bin/google-chrome
 - export DISPLAY=:99.0
 - sh -e /etc/init.d/xvfb start
 - sudo apt-get update
 - sudo apt-get install -y libappindicator1 fonts-liberation
 - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
 - sudo dpkg -i google-chrome*.deb
  1. last but not least, switch to the last version of jdk:
script:
  - jdk_switcher use oraclejdk8

The nightwatch config file is here:https://github.com/AdFabConnect/abejs/blob/master/nightwatch.conf.js

Hope it will work for you ;)

@Conorc1000

This comment has been minimized.

Member

Conorc1000 commented Dec 17, 2016

Since this issue was made this short piece has been added to the readme.
"Running your Nightwatch tests on CircleCi."

@qacwnfq

This comment has been minimized.

qacwnfq commented Dec 19, 2016

@gregorybesson
Thanks, it works!
For me the deciding part seems to have been export DISPLAY and starting xvfb.

@gregorybesson

This comment has been minimized.

gregorybesson commented Jan 16, 2017

@qacwnfq U welcome. Indeed, we must start xvfb for chrome to be able to launch

@nelsonic nelsonic removed their assignment Feb 11, 2017

@ritz078

This comment has been minimized.

Contributor

ritz078 commented Mar 14, 2017

@nelsonic Tests running on Travis with saucelabs
screen shot 2017-03-15 at 1 27 23 am

Here is the full code ritz078/embed-js#228

@nelsonic

This comment has been minimized.

Member

nelsonic commented Mar 15, 2017

@ritz078 nice one. 👍
If you have time to send us a Pull Request explaining the steps to get it setup using sauce connect, it would be massively appreciated! ❤️
(once PR is merged we can send you PayPal or Amazon credit 😉 )

@ritz078

This comment has been minimized.

Contributor

ritz078 commented Mar 15, 2017

I will create a PR.

@nelsonic

This comment has been minimized.

Member

nelsonic commented Mar 20, 2017

@ritz078 thank you for your fantastic contribution! 👍
I have reviewed & merged your Pull Request.
Please email me to claim your reward! 🥇

tvararu added a commit to alphagov/accessible-autocomplete that referenced this issue May 15, 2017

tvararu added a commit to alphagov/accessible-autocomplete that referenced this issue May 15, 2017

sravan-s added a commit to sravan-s/zeppelin that referenced this issue Jul 11, 2017

@nelsonic nelsonic changed the title from Can we run the e2e tests on TravisCI (or other CI)? to SPIKE Can we run the e2e tests on TravisCI (or other CI)? Nov 1, 2017

@teriu teriu referenced this issue Nov 22, 2017

Closed

Set up E2E testing #47

0 of 6 tasks complete
@kalote

This comment has been minimized.

kalote commented Mar 28, 2018

I just read this full issue that looked like a story ... and that was a super funny one!

Nice job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment