WDIO test runner unable to find cucumber step definitions

See original GitHub issue

When executing the WDIO test runner with

$ ./node_modules/.bin/wdio wdio.conf.js

a new Chrome window (as I have configured) pops up briefly and I get:

ERROR: ENOENT: no such file or directory, lstat '/Users/me/path/to/app/features/step_definitions/**'

Meanwhile, I have:

  1. Installed the Cucumber framework: wdio-cucumber-framework
  2. Set wdio.conf.js file to framework: 'cucumber'
  3. Am using the default wdio generated cucumberOpts, except for require where I used step_definitions instead of step-definitions:
    cucumberOpts: {
        require: ['./features/step_definitions/**/*.js'],        // <string[]> (file/dir) require files before executing features
        backtrace: false,   // <boolean> show full backtrace for errors
        compiler: [],       // <string[]> ("extension:module") require files with the given EXTENSION after requiring MODULE (repeatable)
        dryRun: false,      // <boolean> invoke formatters without executing steps
        failFast: false,    // <boolean> abort the run on first failure
        format: ['pretty'], // <string[]> (type[:path]) specify the output format, optionally supply PATH to redirect formatter output (repeatable)
        colors: true,       // <boolean> disable colors in formatter output
        snippets: true,     // <boolean> hide step definition snippets for pending steps
        source: true,       // <boolean> hide source uris
        profile: [],        // <string[]> (name) specify the profile to use
        strict: false,      // <boolean> fail if there are any undefined or pending steps
        tags: [],           // <string[]> (expression) only execute the features or scenarios with tags matching the expression
        timeout: 20000,     // <number> timeout for step definitions
        ignoreUndefinedDefinitions: false, // <boolean> Enable this config to treat undefined definitions as warnings.
    },

If I were to run $ cucumber.js from the command line it would read my file: features/step_definitions/auth/login.js

Yet, the WDIO test runner doesn’t appear to be able to do this, and from the error message, it appears the search path is truncated since I don’t see a /*.js

What can I do here to get cucumber to read my step definitions using the WDIO test runner? Thanks.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
igniteramcommented, Nov 5, 2017

ahh, I see. ok I think this issue still exists in wdio-cucumber-framework. I will definitely look at it!

1reaction
christian-bromanncommented, Nov 1, 2017

@cheungkayip with support of cucumber v2 you now need to apply the actual file instead of the folder.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CucumberJs cannot find steps using webdriverio5
When I have same path for step definitions defined on main wdio.conf.js file then it works. My main wdio.conf.js file is located in...
Read more >
webdriverio/webdriverio - Gitter
Hi guys, I'm starting with webdriverio using cucumber as a framework, but I have a huge need, how can I get the stepsdefinitions...
Read more >
FAQ - Cucumber Documentation
If Cucumber is telling you that your steps are undefined, when you have defined step definitions, this means that Cucumber cannot find your...
Read more >
Was unable to find a step for “”: Mapping stepDefinitions to ...
While working with cucumber, when steps are not mapped completely with the feature files, it usually gives this as a warning.
Read more >
What are Cucumber Hooks And How to Use ... - Tools QA
Test Hooks with Single Scenario · An important thing to note about the after hook is that even in case of test fail,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found