webdriverio-boneyard / wdio-cucumber-framework

A WebdriverIO v4 plugin. Adapter for Cucumber testing framework.
MIT License
77 stars 61 forks source link

WDIO test runner ignores all tests if multiple tags are specified in cucumberOpts #47

Closed prasanjitmohanty closed 7 years ago

prasanjitmohanty commented 7 years ago

If I am specifying multiple tags e.g - tags: ['@P1','@P2'], in cucumberOpts the test runner ignores all tests without any error. I have test scenarios for both tags. It only works if only one tag or without any tag.

"webdriverio": ^4.6.2", "wdio-cucumber-framework": "^0.2.5",

cucumberOpts: {
        require: [
        ],        // <string[]> (file/dir) require files before executing features
        backtrace: false,   // <boolean> show full backtrace for errors
        // <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: false,     // <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: ['@P1','@P2'],           // <string[]> (expression) only execute the features or scenarios with tags matching the expression
        timeout: 120000,     // <number> timeout for step definitions
        ignoreUndefinedDefinitions: true, // <boolean> Enable this config to treat undefined definitions as warnings.
    }
prasanjitmohanty commented 7 years ago

It is an issue with "cucumber": "~1.3.1" used which fails in case of multiple tags. The current version is 2.0.0 so my guess is doing a dependency upgrade will fix this for wdio-cucumber-framework.

broder commented 7 years ago

I was struggling with this too and I think the issue is that old-style cucumber tags (e.g. in cucumber-js 1.3.1) are confusing (this is fixed with new-style cucumber tags: https://docs.cucumber.io/tag-expressions/#migrating-from-old-style-tags)

In your case:

christian-bromann commented 7 years ago

We don't support Cucumber v2 and I am not even sure if we ever will as it seems that we are not able to integrate WebdriverIO in a way we are with v1.x. Once v2 is finally released I will take a look again. Until then please use the solution suggested by @broder (thanks!).

prasanjitmohanty commented 7 years ago

Please don't close the issue. As the suggested approach is not working. Looks like wdio-cucumber-framework needs to handle this before passing it to the cucumber

If tags passed as tags: ['@P1 OR @P2'], - It skips all tests If tags passed as tags: '@P1 OR @P2', - ERROR: tagGroupStrings.map is not a function

broder commented 7 years ago

You need to pass tags as tags: ['@P1,@P2']

prasanjitmohanty commented 7 years ago

tags: ['@P1,@P2'] works. Thanks for the help