webdriverio: Using @wdio/jasmine-framework does not support spec retry on failure

Pre-check

Describe the improvement

I’d like to report

  • Unclear documentation
  • A typo
  • Missing documentation
  • Other

Description of the improvement/report When I use @wdio/jasmine-framework as a plugin for jasmine. The docs say that I can pass test retry count as the last parameter for the spec or hook. But when I try to do that it picking it as a timeout parameter instead of test retry which is the behaviour of jasmine framework.

** package.json

  "dependencies": {
    "@wdio/cli": "^5.7.15",
    "@wdio/jasmine-framework": "^5.7.13",
    "@wdio/local-runner": "^5.7.15",
    "webdriverio": "^5.7.13"
  }

** test.js

describe('Webdriverio', function () {
    it('Testing async function',  async () => {
        // redirect to url so that we can exceed default 1ms timeout
        let title;
        browser.url('https://webdriver.io/docs/retry.html');
        title  = await browser.getUrl();
        browser.url('https://webdriver.io/docs/retry.html');
        title  = await browser.getUrl();
        browser.url('https://webdriver.io/docs/retry.html');
        title  = await browser.getUrl();
        browser.url('https://webdriver.io/docs/retry.html');
        title  = await browser.getUrl();
        browser.url('https://webdriver.io/docs/retry.html');
        title  = await browser.getUrl();
        browser.url('https://webdriver.io/docs/retry.html');
        title  = await browser.getUrl();
        browser.url('https://webdriver.io/docs/retry.html');
        title  = await browser.getUrl();
        browser.url('https://webdriver.io/docs/retry.html');
        title  = await browser.getUrl();
        expect(title).toBeTruthy();
    }, 1);
});

Error from @wdio/jasmine-framework adapter:

 "Error: Timeout - Async callback was not invoked within 1ms (custom timeout)
    at <Jasmine>
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)"

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (14 by maintainers)

Commits related to this issue

Most upvoted comments

To fix the above name-checking, I think we need to check the name of constructor. Below is an example of what I think

  1. (async ()=>{}).name output: ""
  2. (async ()=>{}).constructor.name output: "AsyncFunction"
  3. (async function abc(){}).constructor.name output: "AsyncFunction"
  4. (() => {}).constructor.name output: "Function"

If the above approach is fine then i can send a pr for this