Skip to content

[🐛 Bug]: Cucumber Step Definition Timeout #11873

@viktor-silakov

Description

@viktor-silakov

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

8.23.1

Node.js Version

v18.15.0

Mode

WDIO Testrunner

Which capabilities are you using?

{
     maxInstances: 5,
     browserName: 'chrome',
}

What happened?

Local Timeout for step definitions doesn't work:

    // wdio config
    cucumberOpts: {
        timeout: 20,
    } as WebdriverIO.CucumberOpts,
// step definition file
When(/^I debug$/, { timeout: 1000000 }, async function () {
    await browser.pause(1000);
});

error:

 Error in "0: When I debug"
Error: Timeout
    at listOnTimeout (node:internal/timers:569:17)
    at processTimers (node:internal/timers:512:7)

What is your expected behavior?

Timeout must be taken into account

How to reproduce the bug.

use mvp repo - https://github.com/viktor-silakov/wdio-sd-timeout

run:

npm i 
npx wdio wdio.conf.ts  --spec ./src/features/debug.feature

Relevant log output

npx wdio wdio.conf.ts  --spec ./src/features/debug.feature             

Execution of 1 workers started at 2023-12-15T14:30:19.477Z

[0-0] RUNNING in chrome - file:///src/features/debug.feature
[0-0] Error in "0: When I debug"
Error: Timeout
    at listOnTimeout (node:internal/timers:569:17)
    at processTimers (node:internal/timers:512:7)
[0-0] FAILED in chrome - file:///src/features/debug.feature

 "spec" Reporter:
------------------------------------------------------------------
[chrome 120.0.6099.109 mac #0-0] Running: chrome (v120.0.6099.109) on mac
[chrome 120.0.6099.109 mac #0-0] Session ID: 5f608cbe98a4a1cea8665d0d426a82ce
[chrome 120.0.6099.109 mac #0-0]
[chrome 120.0.6099.109 mac #0-0] » /src/features/debug.feature
[chrome 120.0.6099.109 mac #0-0] Debug
[chrome 120.0.6099.109 mac #0-0] Debug
[chrome 120.0.6099.109 mac #0-0]     When I debug
[chrome 120.0.6099.109 mac #0-0]
[chrome 120.0.6099.109 mac #0-0] 1 failing (1.1s)
[chrome 120.0.6099.109 mac #0-0]
[chrome 120.0.6099.109 mac #0-0] 1) Debug When I debug
[chrome 120.0.6099.109 mac #0-0] Error: Timeout
[chrome 120.0.6099.109 mac #0-0] Error: Timeout
[chrome 120.0.6099.109 mac #0-0]     at listOnTimeout (node:internal/timers:569:17)
[chrome 120.0.6099.109 mac #0-0]     at processTimers (node:internal/timers:512:7)


Spec Files:      0 passed, 1 failed, 1 total (100% completed) in 00:00:06

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 🐛help wantedIssues that are free to take by anyone interested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions