protractor: Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL

i use the example from “http://www.protractortest.org/#/tutorial

// spec.js
describe('Protractor Demo App', function() {
  it('should have a title', function() {
    browser.get('http://juliemr.github.io/protractor-demo/');

    expect(browser.getTitle()).toEqual('Super Calculator');
  });
});

// conf.js
exports.config = {
  framework: 'jasmine',
  seleniumAddress: 'http://localhost:4444/wd/hub',
  specs: ['spec.js']
}

Now run the test with

protractor conf.js

Then the console display: image

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 26 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Closing stale issues.

@sallojusuresh, the below solution worked. jasmineNodeOpts: { defaultTimeoutInterval: 2500000 }, Question - When we can set a default time as above, where comes the use of setTimeout function in ‘beforeEach’ and done callbacks in ‘it’. Any idea?

I have fixed by the following way

 var originalTimeout;

    beforeEach(function() {
        originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
        jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
    });

    afterEach(function() {
      jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
    });

@juliemr I’m having the same problem and increasing ScriptsTimeout does not work for me. Do you have any solution for this? Thank you.

You can find solution in below post: just go through whole post.

https://github.com/angular/protractor/issues/2941#issuecomment-186104304

im having same problem and the other post dont work for me. @juliemr any solution for this? i tried allScriptsTimeout: 900000 but this dont solve the problem.

In my case, this error was caused by improper use of “fixture.detectChanges()” It seems this method is a event listener (async) which will only respond a callback when changes are detected. If no changes are detected it will not invoke the callback, resulting in a timeout error. Hope this helps 😃

Doesn’t work for me either. increase defaultTimeoutInterval doesn’t solve it

@juliemr Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. this error coming in my test again n again i used before each, after each, browser.sleep, increased the jasmine timeout iterval upto 100000. but my code is not run so please suggest me what could I do.