Webdriverio: Timeout of 10000ms exceeded even when timeout is give as 30000

Created on 17 Mar 2016  ·  14Comments  ·  Source: webdriverio/webdriverio

Task for the test:

gulp.task('mds', ['default', 'selenium'], function() {
    return gulp.src('wdio.conf.js')
    .pipe(webdriver({
        waitforTimeout: 30000,
        reporter: 'spec'
    })).on('error', function() {
        seleniumServer.kill();
        process.exit(1);
    });
});

Config file:
waitforTimeout: 30000,

At both places I'm giving timeout as 30000, but still the test will timeout at 10000.

[18:28:53] spawn wdio with these attributes:
 /Usxxxers/xxx/xxx/xxxx/xxxxxx/public_html/tests/wdio.conf.js
--waitforTimeout=30000
--reporter=spec

Most helpful comment

As you can get from the docs the waitforTimeout sets the default timeout for all waitForXXX commands. If you want to increase the test timeout you need to set it in your framework options like in Mocha:

// wdio.conf.js
// ...
mochaOpts: {
    timeout: 99999999
}
// ...

All 14 comments

Can you provide the error that's outputted? thanks

I'm having the same error, this is the error output. I also configured the waitforTimeout setting to 30000

should have the right title - the fancy generator way:
timeout of 10000ms exceeded. Ensure the done() callback is being called in this test.
running chrome
Error: timeout of 10000ms exceeded. Ensure the done() callback is being called in this test.
    at null.<anonymous> (C:\projects\DOD\dod-repo\tests\node_modules\mocha\lib\runnable.js:215:19)
    at Timer.listOnTimeout (timers.js:92:15)

As you can get from the docs the waitforTimeout sets the default timeout for all waitForXXX commands. If you want to increase the test timeout you need to set it in your framework options like in Mocha:

// wdio.conf.js
// ...
mochaOpts: {
    timeout: 99999999
}
// ...

Thanks for the clarification, changed the mocha timeout settings and is all working as expected now.

@christian-bromann You might want to change timeput to timeout in your answer.

@prewk good catch 👍

There should be a warning for repeated config settings. WebStorm highlights the object key when there is a duplicate declaration it would be nice if the "testing" framework shows these kinds of mistakes.

P.S. Looking at Apache configuration it would not be out of scope to add a warning for syntax errors when the test starts. Seems pretty basic to me.

it would be nice if the "testing" framework shows these kinds of mistakes

This is not the responsibility of the testing framework. It should be caught by your IDE!

@christian-bromann Right, that is exactly the response my P.S. comment addresses. When I am configuring Apache and make a mistake I get warnings. It is not out of scope to do basic sanity checks. When I am building my project, I get some TS Lint errors, how do I attach linting features to wdio run test ?

It is not out of scope to do basic sanity checks

We do these but not on that level. If you have duplicate property keys in your config, WebdriverIO couldn't even detect those.

@christian-bromann After doing some research, I don't see a way for Nodejs to report this error either. Is this normal to have 1 IDE that correctly evaluates code, but then those evaluations aren't available from within the compiler? That seems odd that an IDE does something a compiler does not.

Is this normal to have 1 IDE that correctly evaluates code, but then those evaluations aren't available from within the compiler?

I don't know. What I know is that WebdriverIO can't do anything here.

@christian-bromann where i added the below script in node js

mochaOpts: {
timeout: 99999999
}

in your wdio.conf.js as shown in the example

Was this page helpful?
0 / 5 - 0 ratings