2

I would like to add integration tests to an (Backbone.js) application I am maintaining, and considering what strategy is preferable and upsides and downsides for each:

  1. Running tests on the client side, with something like jasmine-jquery. Ideally I would like something like ember test helpers which allows writing simple synchronous looking code (while actually running async).
  2. Running tests on the server side using selenium drivers, for example Nightwatch.js.

It is hard to tell which approach has more community and tooling around it, and which projects are more mature. Additionally, I am getting the feeling that running tests on the client side might allow better isolation of tests, while running on the server side, might create tests which run longer and heavier (also to maintain?) but allow to simulate more complex real-user scenarios

Any thoughts would be appreciated

Alon Burg
  • 2,500
  • 2
  • 27
  • 32
  • IMHO you need both. Take a look at http://stackoverflow.com/questions/4904096/whats-the-difference-between-unit-functional-acceptance-and-integration-test – u.k Jun 03 '15 at 02:43
  • BTW: I ended up setting Capybara + Selenium with WebMock, which allows simulating scenarios very nicely. One of the problems I encountered is in order to speed tests, I canceled the session resetting (full browser refresh on each test) and am using a utility function to navigate and reset state, but still encountering isolation problems. – Alon Burg Aug 25 '16 at 14:51

1 Answers1

2

If you care about browser compatibility, then you'll want to run end-to-end tests on different browsers on different platforms, possibly using a cloud-based cross-browser testing service such as SauceLabs, BrowserStack, TestingBot or CrossBrowserTesting.

Since you're using Backbone and are familiar with JavaScript, you might want to pick a JavaScript client for Selenium WebDriver. There are quite a few choices, with Intern leading the pack by far.

Dan Dascalescu
  • 143,271
  • 52
  • 317
  • 404