简体   繁体   English

WEBDRIVERIO / CUCUMBER:函数超时,确保Promise在10000毫秒内解析

[英]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.

相关问题 错误:function 超时,确保 promise 在 - Cucumber js 内解析 - Error: function timed out, ensure the promise resolves within - Cucumber js TypeScript + Cucumber问题:错误:函数在10000毫秒后超时 - TypeScript + Cucumber Issue : Error: function timed out after 10000 milliseconds 对于异步测试和挂钩,如何解决超时超出错误,请确保调用了“ done()”; 如果返回承诺,请确保其解决 - How to fix Timeout exceeded error for async tests and hooks, ensure “done()” is called; if returning a Promise, ensure it resolves 错误:超时超过30000ms。 对于异步测试和挂钩,请确保调用了“ done()”。 如果返回承诺,请确保其解决 - Error: Timeout of 30000ms exceeded. For async tests and hooks, ensure “done()” is called; if returning a Promise, ensure it resolves 摩卡:错误:超过 2000 毫秒超时。 对于异步测试和钩子,确保调用“done()”; 如果返回 Promise,请确保它已解决 - Mocha: Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves WebdriverIO-Jasmine Async function 未在 10000 毫秒内完成 - WebdriverIO-Jasmine Async function did not complete within 10000ms 函数超时,请确保回调在60000毫秒内执行 - Function timed out, ensure the callback is executed within 60000 milliseconds 摩卡/柴-超时,确保诺言得以解决 - Mocha / Chai - Timeout, ensuring promise resolves FileReader的Promise功能过早解决 - Promise function with FileReader resolves prematurely 如何创建一个函数,返回一个在内部承诺解决后解决的承诺 - How to create a function returning a promise that resolves after inner promise resolves
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM