webdriverio-boneyard / wdio-cucumber-framework

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

Enhancement : Ability to use cucumber profiles #9

Open sherbhachu opened 8 years ago

sherbhachu commented 8 years ago

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] .. }

si-mikey commented 8 years ago

any update on this issue?

christian-bromann commented 8 years ago

PRs are welcome 😉

emartinpi commented 8 years ago

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

christian-bromann commented 7 years ago

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

wvankuipers commented 7 years ago

@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?

batje commented 7 years ago

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.

christian-bromann commented 7 years ago

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

esclapes commented 7 years ago

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.

christian-bromann commented 7 years ago

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

Sure, happy to review the PR

christian-bromann commented 6 years ago

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