【发布时间】:2022-01-01 10:54:29
【问题描述】:
当我在 JavaScript 中使用 WebdriverIO 定义 Cucumber 步骤并调用时:
browser.debug();
...它在 10 秒后超时,这永远不够长。一些文档和博客文章建议类似this answer's “注意:.debug() 命令的默认超时时间很短。请确保增加它。” 但没有人明确说明如何做到这一点.
我尝试过类似的方法:
browser.debug({wait: 120000});
...还有这个,wdio.conf.js:
exports.config = merge(configs, {
waitforTimeout: 120000,
connectionRetryTimeout: 90000,
framework: 'cucumber',
cucumberOpts: {
timeout: 60000,
这些(以及类似的尝试)都没有延长调试超时时间。
如何在 Cucumber 步骤定义中延长 browser.debug 超时?
【问题讨论】:
-
The docs 建议您增加测试框架的超时时间,而不是命令(可能没有自己的超时时间,这没有意义)。 webdriver.io/docs/timeouts/#framework-related-timeouts 建议应该适用于 Cucumber,你得到什么输出?
-
谢谢,@jonrsharpe。正如您的链接所建议的那样,我的框架超时时间为 60 秒(参见上面的
cucumberOpts.timeout)。但是debug仍然会在 10 秒后超时。我看到的唯一输出是`函数超时,确保承诺在 10000 毫秒内解决` -
...但是今天,它正在工作。 :head_scratch:
cucumberOpts.timeout像宣传的那样工作。猜猜我昨天有一些其他的电线交叉。
标签: javascript cucumber timeout webdriver-io