[英]WEBDRIVERIO / CUCUMBER : Function timeout , Ensure Promise resolves within 10000 milliseconds
Hi I am currently working on an application that includes series of page navigation for an user to complete info. 嗨,我目前正在开发一个包含一系列页面导航的应用程序,以供用户完成信息。 In order to navigate to a certain part of the page, I tried creating a generic step definition as a "background" step to cover all the precondition steps. 为了导航到页面的某个部分,我尝试创建一个通用步骤定义作为“背景”步骤,以覆盖所有前提条件步骤。
Background:
Given I am the Page10 of the application
Given(/^I am on a specific Page$/,function(){
//Implementation of Page 1 to Page 9
})
Every such page has its seperate step definition and page object functions .. And in this specfic page10 , I tried including all the page object functions. 每个这样的页面都有其单独的步骤定义和页面对象函数。在这个特定的page10中,我尝试包括所有页面对象函数。 But unfortunately I am getting "function timed out, ensure the promise resolves within 100000 milliseconds" 但是不幸的是,我收到“功能超时,确保诺言在100000毫秒内解决”
Is there a way to fix this? 有没有办法解决这个问题?
timeout: 300000, // <number> timeout for step definitions
As above, I set my wdio.conf.js timeout parameter as 20000 to 300000 , but have to keep increasing it more and more as the page navigation gets wider. 如上所述,我将wdio.conf.js的timeout参数设置为20000到300000,但是随着页面导航的扩大,必须不断增加它。 Also, I feel this is not a right approach. 另外,我觉得这不是正确的方法。 As the light weight steps would then wait for a longer period to throw error messages 由于重量轻,踏板将等待更长的时间以引发错误消息
Please let me know the best way to fix this? 请让我知道解决此问题的最佳方法吗?
PS: As I reckon this issue self explanatory and hence no code added. PS:我认为这个问题不言自明,因此没有添加任何代码。 Let me know if you need more information. 如果您需要更多信息,请与我们联系。
You can specify a specific timeout for your background step: 您可以为后台步骤指定一个特定的超时:
Given('your step', { timeout: 70000 }, function () {
// your code here
})
Please let me know if that's not the answer you were looking for. 如果不是您要的答案,请告诉我。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.