Skip to content

Instantly share code, notes, and snippets.

@JuanCaicedo
Last active September 5, 2016 17:05
Show Gist options
  • Save JuanCaicedo/a52eb6e9ad3ee3c8e21015fe5acd1d91 to your computer and use it in GitHub Desktop.
Save JuanCaicedo/a52eb6e9ad3ee3c8e21015fe5acd1d91 to your computer and use it in GitHub Desktop.
A summary of some e2e tools I researched

e2e testing with node

Recommendation: CasperJs

I prototyped a few different approaches to e2e tests and in the end my recommendation is to use casperjs.

Pros

  • It seems to have the simplest API.
  • Runs the most reliably.
  • Runs fast.
  • Requires little additional set up (selenium standalone), just phantom prebuilt

Cons

  • output is not clear to understand
  • docs are not great
  • es6 features not tied to node (phantomjs doesn't support es6)
  • Not easy to parallel

Notes

Parallel might be possible https://github.com/alcaitiff/casper-parallel

Time

npm test 3.19s user 0.55s system 23% cpu 15.743 total

Other approaches, browser

selenium-webdriver

http://marmelab.com/blog/2016/04/19/e2e-testing-with-node-and-es6.html http://bites.goodeggs.com/posts/selenium-webdriver-nodejs-tutorial/

  • Manually using webdriver is hard
  • If you use phantomjs, a lot of logging comes through. I couldn't find a way to disable the built in phantom logging
  • Tests are not reliable (one case consistently failed even though the webpage is correct. Othercases failed randomly)

webdriver.io

  • Needs you to separately launch phantomjs, it cannot do it as part of the node script
  • Tests fail unpredictably
  • Not any faster than anything else
  • Selectors sometimes return additional elements, like if only one result is expected, might get ['get', ''] instead

Time

npm test  1.33s user 0.19s system 10% cpu 15.191 total

nightmare

  • API is nice, though queuing actions and then executing them with .end(), which

is then followed by .then() can be a little confusing

  • Tests time out unpredictably

Time

16.94s user 5.69s system 80% cpu 28.162 total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment