wdio-cucumber-framework icon indicating copy to clipboard operation
wdio-cucumber-framework copied to clipboard

Enhancement : Ability to use cucumber profiles

Open sherbhachu opened this issue 8 years ago • 10 comments

Currently, we can pass in things like tags, and supposedly profiles at runtime, but I have been unable to get profiles working.

so you can do this... wdio wdio.conf.js --cucumberOpts.tags some_tags

but the following fails to do anything... wdio wdio.conf.js --cucumberOpts.profile something

I have a seperate file that contains my profiles...

//cucumber.js
common = '--strict --format rerun:@rerun.txt'
module.exports = {
    'default': common + '--format summary',
    dry: '--dry-run',
    progress: '--format progress',
    something: '--tags @some_tag'
};

I require this in my wdio.conf.js file var profiles = require("./features/support/cucumber.js");

Even setting the cucumberOpts in config file explicitly fails to have any affect... cucumberOpts: { .. profile: [profiles.something] .. }

sherbhachu avatar Apr 21 '16 10:04 sherbhachu

any update on this issue?

si-mikey avatar Sep 19 '16 21:09 si-mikey

PRs are welcome 😉

christian-bromann avatar Sep 19 '16 21:09 christian-bromann

I know PR's are welcome but... does anyone know if there is any update with this issue?? 😉

emartinpi avatar Dec 04 '16 14:12 emartinpi

@dcypherthis @wvankuipers do you guys have an idea on how to apply profiles in cucumber?

christian-bromann avatar Mar 11 '17 15:03 christian-bromann

@christian-bromann No I have not, but I now use multiple wdio.*.js config files the same way. What could be the use case for supporting profiles?

wvankuipers avatar Mar 13 '17 06:03 wvankuipers

My scenario is that I would like to pass in username & password dynamically, from the command prompt. Then run the tests in Jenkins, using different baseURLs and username/password combinations. And I dont like to commit passwords to source control.

batje avatar May 29 '17 14:05 batje

@batje just pass in username and password as environment variables and use them in your test script

christian-bromann avatar May 29 '17 15:05 christian-bromann

I am currently using cucumber profiles via cucumber cli and, as reported here, cucumberOpts.profile does not have any effect.

From quickly looking at the code we are passing options to Cucumber.runtime but I believe cucumber only loads the profile when using the cli and then passes the parsed options to the runtime.

I guess the underlying functions could be reused to support profiles here, but I doubt it is worth the effort. As noted by @wvankuipers, using different wdio.*.js does work and covers the same use case with even better DX (for a cucumber profile is just a string of command line arguments).

My suggestion would be to update the default config and README to avoid confusion. If that is ok with @christian-bromann I am happy to help.

esclapes avatar Sep 27 '17 19:09 esclapes

If that is ok with @christian-bromann I am happy to help.

Sure, happy to review the PR

christian-bromann avatar Sep 27 '17 21:09 christian-bromann

We just updated to latest cucumber-js version, can someone check if this issues is fixed by that?

christian-bromann avatar Mar 28 '18 15:03 christian-bromann