I prototyped a few different approaches to e2e tests and in the end my recommendation is to use casperjs.
- It seems to have the simplest API.
- Runs the most reliably.
- Runs fast.
- Requires little additional set up (selenium standalone), just phantom prebuilt
- 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
Parallel might be possible https://github.com/alcaitiff/casper-parallel
npm test 3.19s user 0.55s system 23% cpu 15.743 total
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)
- 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
npm test 1.33s user 0.19s system 10% cpu 15.191 total
- 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
16.94s user 5.69s system 80% cpu 28.162 total