webdriverio在运行时获取waitfor Timeout的值

时间:2017-01-08 15:08:06

标签: webdriver-io

我有兴趣在执行测试期间获取wdio.conf.js属性waitforTimeout的值,如何实现?

例如:

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

我想用waitforTimeout

中当前的值替换3000

1 个答案:

答案 0 :(得分:1)

如果您传入null而不是号码,它会忽略它并使用默认值:

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

要回答原始问题,您可以使用browser.options对象: http://webdriver.io/guide/testrunner/browserobject.html#Get-wdio-config-options