webdriverio get value of waitfor Timeout in runtime

561 views Asked by At

I am interested to get the value of the wdio.conf.js property waitforTimeout during execution of the test, how this can be achieved ?

for example :

browser.waitUntil(function () {
            var alertText = browser.alertText();
            return alertText && alertText != "";
        }, **3000**, `Alert is expected to be displayed, but actually did not appear`);

I want to replace the 3000 with the value currently in waitforTimeout

1

There are 1 answers

0
Kevin Lamping On BEST ANSWER

If you pass in null instead of a number, it will ignore it and use the default:

browser.waitUntil(function () {
    var alertText = browser.alertText();
    return alertText && alertText != "";
}, null, `Alert is expected to be displayed, but actually did not appear`);

To answer your original question, you can use the browser.options object: http://webdriver.io/guide/testrunner/browserobject.html#Get-wdio-config-options