1

I am using WDIO with Jasmine and Chai.

I am getting the below error and I have been trying to find the root cause for more than a day now.

Error: Timeout - Async function did not complete within 10000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)

Code:

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();
  }

I noticed console.log('DEBUG : I am waiting...') is not printed on console.

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 values:

waitforTimeout: 10000,
    connectionRetryTimeout: 90000,
    connectionRetryCount: 3,
    wdioRetries:3,

jasmineNodeOpts: {
        defaultTimeoutInterval: (24 * 60 * 60 * 1000),
        expectationResultHandler: function(passed, assertion) {
            // do something
        }
    },
Afsal
  • 133
  • 1
  • 14
  • I am thinking there is something wrong with `this.appLauncher().waitForExist`. Do you see the logs of `DEBUG : I am waiting...` and more importantly `[TEST STEP INFO]: Click on App Launcher`? – AliF50 Apr 13 '21 at 12:36
  • It doesn't reach this.appLauncher().waitForExist. Doesn't even print "DEBUG : I am waiting..." . . Fails with error: [0-0] [TEST STEP INFO]: Verify App launcher icon is present. [0-0] Error in "Verify validation" Error: Timeout - Async function did not complete within 10000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL) at at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7) ``` – Afsal Apr 13 '21 at 13:51
  • Okay, then I am thinking you have to check if it is getting stuck on `open` and `login`. – AliF50 Apr 13 '21 at 14:46
  • It is not. Now I see it reaches console.log("[TEST STEP INFO]: Verify App launcher icon is present. "), and then fails. I doubt it's a code issue. Anything to do with WDIO waits? – Afsal Apr 13 '21 at 14:57
  • By the looks of it, it looks like something is getting stuck for `10s`. Does any operation take longer than 10s? – AliF50 Apr 13 '21 at 16:57

3 Answers3

3

I came across this as well while trying to upgrade WDIO to v7. While looking into this further, I noticed that the name to specify jasmine options in wdio config has changed from jasmineNodeOpts to jasmineOpts. It is in their updated documentation as well. Once I updated that in my wdio configs, it is now good with v7.

Dharman
  • 21,838
  • 18
  • 57
  • 107
MushfiqR
  • 31
  • 1
0

I found this to be an issue with wdio/jasmine V7 and up. Revert it to 6.something and it should work (6.7.2 works for me). You can put a debug at the very beginning of the test and it will still fail - might want to report this on the wdio git

LucianS
  • 1
  • 1
0

Looks like the difference was jasmineOpts vs jasmineNodeOpts after the latest update (https://webdriver.io/docs/frameworks/#intercept-assertion).

I just changed from jasmineNodeOpts to jasmineOpts. And everything worked like before the upgrade.