![](/img/trans.png)
[英]WEBDRIVERIO / CUCUMBER : Function timeout , Ensure Promise resolves within 10000 milliseconds
[英]WebdriverIO-Jasmine Async function did not complete within 10000ms
我正在使用帶有 Jasmine 和 Chai 的 WDIO。
我收到以下錯誤,並且我已經嘗試找到根本原因超過一天了。
錯誤:超時 - 異步 function 未在 10000 毫秒內完成(由 jasmine.DEFAULT_TIMEOUT_INTERVAL 設置)
代碼:
describe('Lead Routing Functionality', () => {
beforeEach(function () {
LightningLeadPage.open();
LightningLeadPage.login();
console.log('[TEST STEP INFO]: Checking Header: ');
});
it('Verify validation', () => {
LightningLeadPage.click_app_launcher();
});
*************
export default class Lightning_Page {
click_app_launcher() {
console.log("[TEST STEP INFO]: Verify App launcher icon is present. ");
console.log('DEBUG : I am waiting...')
this.appLauncher().waitForExist(this.waitDuration());
console.log("[TEST STEP INFO]: Clicking on App Launcher");
this.appLauncher().click();
}
我注意到 console.log('DEBUG: I am waiting...') 沒有打印在控制台上。
Error log:
[0-0] Error in "Verify validation"
Error: Timeout - Async function did not complete within 10000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)
at <Jasmine>
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
[0-0] DEPRECATION: An asynchronous before/it/after function took a done callback but also returned a promise. This is not supported and will stop working in the future. Either remove the done callback (recommended) or change the function to not return a promise.
config.js 值:
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
wdioRetries:3,
jasmineNodeOpts: {
defaultTimeoutInterval: (24 * 60 * 60 * 1000),
expectationResultHandler: function(passed, assertion) {
// do something
}
},
我在嘗試將 WDIO 升級到 v7 時也遇到了這個問題。 在進一步研究時,我注意到在 wdio 配置中指定 jasmine 選項的名稱已從jasmineNodeOpts
更改為jasmineOpts
。 它也在他們更新的文檔中。 一旦我在我的 wdio 配置中更新了它,現在 v7 就很好了。
我發現這是 wdio/jasmine V7 及更高版本的問題。 將其恢復為 6.something 並且它應該可以工作(6.7.2 對我有用)。 您可以在測試開始時進行調試,但它仍然會失敗 - 可能想在 wdio git 上報告此問題
在最新更新( https://webdriver.io/docs/frameworks/#intercept-assertion )之后,看起來區別是 jasmineOpts 與 jasmineNodeOpts 。
我剛剛從 jasmineNodeOpts 更改為 jasmineOpts。 一切都像升級前一樣工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.