There is nothing or very little information on integration testing Ember.js apps. Any chance of using Konacha in the book as i have found this works very well and is very quick unlike selenium and full stack testing.
The difficulty is that integration testing is very important but there isn’t much in the way of integration testing libraries that are not dependent on the backend. The Konacha style of using an iframe that can be interacted with via jQuery is a pretty good solution, but as others have noted, it’s unfortunately coupled with Rails.
I’m currently using QUnit for integration testing, running on the command line with phantom.js. I get a handle to the app’s router, then transition to the state I care about in each module. That’s my plan anyway, I’ve only written the first module so far. I like QUnit’s simplicity, and the speed with which I was able to get it working.
As Peter said a lot of the current testing components are being influenced by whatever backend/build system you are using.
I’m inclined to take a test runner like Testem or Karma and work towards using that for tests as its not tied to any backend. There is a split between what style of tests you like to write between qunit, jasmine, and mocha. For integration tests it seems like it really comes down to how they handle async tests. For unit tests I think the most popular has been jasmine. I think qunit has the best async support, but mocha’s async tests are the easiest to grock. Also W/ integration tests you end up fighting between your app wanting to take over the html page and your test runner creating html elements to report results as most apps I’ve seen are attached to the body element. Konacha is great as it uses an iframe to get around this, but too tied to its(rails) backend in my opinion. We have tests being run on the peepcode ordr app using two different runners (“JS Karma, Testem”). It looks like Karma already runs tests in an iframe while testem doesn’t. I’m working on pulling out the iframe runner stuff from Konacha to use it in Karma or Testem w/ a custom setup. In all of this I’d love to see more ways to be able to write integration tests that don’t use timeouts and maybe some kind of DSL to have a simple way to select and trigger input elements on a page.
Just thought I’d do a brain dump on the topic real quick.
Thank you for your responses! I will look into some of these over easter and I will most likely choose one unit testing framework and one integration testing framework to cover. The ideas between most of these testing tools are fairly similar, and I only have about 25-30 pages to cover testing with Ember.js apps I’d really like to cover something that uses phantom.js too though
I would suggest (as @andrewmp1 did) using Testem or Karma as test runners. And chose one of the libraries (jasmine, mocha or qunit). I’m using buster.js. They mainly differ in how tests are written(style).
Testem and Karma can connect to a headless browser like phantom.js. So you get what you want. And you still can test in real browsers (desktop and mobile).
I was unable to do integration tests that way (I haven’t spend too much time in it yet). So, I would be interested in @andrewmp1 findings.