0

I am in the process of creating some end to end tests for my website using selenium webdriver and jasmine. I tried searching for good beginners tutorial. I ended up with this tutorial which helped me to progress till the step of running the end to end tests. I have tried to follow the tutorial exactly the way it is described there including same directory names. I am using Chrome browser and installed chromedriver. When I run the tests using

$ jasmine spec\integration-test.js

as stated there, I get a bunch of timeout errors as follows. It also opens up two Chrome windows with data:, as URL. I spent some time trying to figure it out, but seem to be going no where. Any help would be appreciated. Please let me know if any more information is required.

Started
FF

Failures:
1) Selenium Tutorial Should be on the home page
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)

2) Selenium Tutorial Has a working nav
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by
jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)

1 Answer 1

1

Add this to your jasmine config: (increase as necessary)

"default_timeout_interval": 5000
Sign up to request clarification or add additional context in comments.

5 Comments

I should explain more: Chrome isn't loading the page fast enough and Jasmine thinks it's timing out. Adding this will let Chrome actually load the page before the test starts.
Thanks for the response Andy Poquette, I actually happened to move on to an alternative approach using Phantomjs and Mocha for now. Only reason for that choice was that it gave me a quicker starting point with some exact code samples that i needed for my use case. I still would like to get my selenium webdriver-jasmine code working. If i remember correctly i did try increasing the time to a very large number, but i will check it again in couple of days to make sure i really did that and post back if i am able to get it working with your suggestion.
Changing this value to 20000 did work for me. I thought i tried it previously, it seems that i was mistaken somewhere. But it works now :-). Thanks a ton Andy Poquette.
It's an odd problem as sometimes that number seems to work and sometimes it doesn't. I think you can also set: jasmine.DEFAULT_TIMEOUT_INTERVAL = 40000
Another thing to mention is to make sure you add the -timeout parameter when you start your selenium server, and increase that as necessary.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.