Integration test not working


I have a very simple integration test in my Ember App kit. Issue is the andThen function is never called and the test cases remains stuck, none of the next test cases are executed. Also the click is never called and doesnt work. But if I put a debugger before click then it works, not sure whats going on. Even wrapping the click and andThen inside doesnt work. The control never goes inside the later function. I am guessing this is related to some issue but not sure what. I dont see any errors at all. :frowning:

 test('renders', function(){
    var clickPromise = click('.nav-tabs > li:nth-child(2) > a');
      var table = find('.dashboard-table table thead tr th:nth-child(1)');
      equal(table.text(), 'Name');


Tried using setTimeout too… no luck. not sure whats wrong


Try the following format instead and see if that helps.

visit('/dashboard').then(function() {
  click('...').then(function() {
    equal(find('...').text(), 'Name');


Thanks Kgish, have tried that too but no luck. My unit tests works just fine too.


Strange indeed. Perhaps you could provide more details and/or a reproducible test set to look into.


Yes, have a lot of ember experts look at it with no leads. I wish I could provide any link, its an internal project and not reproducible on other projects. Its based of ember app kit. I know it will be hard to get help without the code. :frowning: I might end up using some other test framework for my integration test.


You say that the click is never called, try setting a breakpoint just before and see what happens by stepping through the code.


yep did that…goes all the way to settimer code… but the timer is never executed…:frowning:


What do you mean settimer code, don’t see that in your example.

Maybe you could share something on jsbin?


Do you have some kind of thing that gets triggered in an interval? something for polling maybe? I had a similiar issue once which was caused by an for a clock service. The async helper functions work in a way that they just wait for everything in the run loop to complete and if you have something that retriggers the runloop continiously the async helpers won’t resolve.


yeah I had read about that issue. I am suspecting the same that some code of mine is triggering the run loop and its waiting forever. I did comment out one of the code but still no help. Will keep on debugging until I nail this down :).


@kgish not possible. Sorry I meant setTimeout function that ember uses.


i am seeing something similar in ember-cli when i try to run an integration test, andThen or none of my executions/expectations don’t work, only the visit works



Sorry for replying late, was caught up in lot of work. I was able to figure out the issue. It was the sinon-qunit version which I was using creating issues with the promises I think. Upgrading to the latest fixed the issue.

@jcope2013 Check if any other libraries you recently added are creating such an issue.