protractor icon indicating copy to clipboard operation
protractor copied to clipboard

timeout: timed out after 30000 msec waiting for spec to complete

Open iwoogy opened this issue 12 years ago • 5 comments

Hello,

I'm quite new to protractor and I love the concept of it. I plan to implement systematically protractor on all my angular projects.

But on my first tests, I got a reccuring issue with timeout 30000 ms from selenium. My angular projects contain a lot of files small modules, that's why it takes so long to load each page. On production, I compile of those files into one, but in dev mode, it's not that possible.

I've searched through the web to find a solution that may help, but I didn't find anything that was working for my case.

image

I'm also using astrolabe to make it easier to use page_objects.

Can anyone help me understand how to fix this issue ?

iwoogy avatar Apr 23 '14 07:04 iwoogy

Change the "defaultTimeoutInterval: " to highest value. It can be set on the config file.

jasmineNodeOpts: { onComplete: null, isVerbose: true, showColors: true, includeStackTrace: true, defaultTimeoutInterval: 360000 },

I think you currently have 30000 set on your config file

smahalingam avatar Apr 23 '14 16:04 smahalingam

Hello

It solved my issue.

Thanks for your help.

Bobby

iwoogy avatar Apr 24 '14 03:04 iwoogy

Good to hear it solved your issue

smahalingam avatar Apr 24 '14 08:04 smahalingam

So I was having this same issue but it just kept hanging...

So it turned out I had copied some code that passed the done variable to one of my test functions...

Took me 8 hours of fruitless debugging and googling until I asked a friend that happend to have worked with protractor...

Turns out you have to call done() at the end of the test. like this

describe('Example Specifcation', function() {
    it('should be able to find the rails test server', function(done) {

    expect(true).toBeTruthy();
        done()
    })
});

Very frustrating that it didnt come up from all of the googling that I did.

So hopefully this comment will help the next poor soul in that predicament

As a matter of fact I think this is important enough to go in you guys time out faq

https://github.com/angular/protractor/blob/master/docs/timeouts.md

williscool avatar Aug 13 '14 06:08 williscool

That's only needed if you want to work with async tests. Both of these will work:

yours:

describe('Example Specifcation', function() {
    it('should be able to find the rails test server', function(done) {
      expect(true).toBeTruthy();
      done()
    })
});

without done:

describe('Example Specifcation', function() {
    it('should be able to find the rails test server', function() {
      expect(true).toBeTruthy();
    })
});

hankduan avatar Aug 14 '14 19:08 hankduan