Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Very strange jasmine.DEFAULT_TIMEOUT_INTERVAL error

I'm trying to run some e2e tests using protractor and phantomjs. When I run the test I get the error:

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

The test is:

import { browser, element, by } from 'protractor';

describe('example test', () => {

  it('stupid test', () => {
    console.log('in test');
    expect(true).toBe(true);
  });    

});

Any idea what the problem is ? any help is welcomed :)

like image 682
user3719857 Avatar asked Nov 09 '22 00:11

user3719857


1 Answers

For me (using karma), the specified port in the Karma config file did not match up with the specified port in the protractor config file.

exports.config = {
...,
baseUrl: 'http://localhost:9876/',//<--This port should match the port in your Karma (test runner) config file
framework: 'jasmine',
jasmineNodeOpts: {
  defaultTimeoutInterval: 3000,
  print: function() {}
}

This answer seemed obvious after I found it, but the ports had gotten changed in source control and the fix wasn't immediately apparent.

like image 154
joey8oro Avatar answered Nov 15 '22 06:11

joey8oro