Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

Enhancement : Ability to use cucumber profiles #9

Open
sherbhachu opened this issue Apr 21, 2016 · 10 comments
Open

Enhancement : Ability to use cucumber profiles #9

sherbhachu opened this issue Apr 21, 2016 · 10 comments

Comments

@sherbhachu
Copy link

sherbhachu commented Apr 21, 2016

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
Copy link

any update on this issue?

@christian-bromann
Copy link
Contributor

PRs are welcome 😉

@emartinpi
Copy link

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

@christian-bromann
Copy link
Contributor

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

@wvankuipers
Copy link
Contributor

@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
Copy link

batje commented May 29, 2017

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
Copy link
Contributor

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

@esclapes
Copy link

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
Copy link
Contributor

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

Sure, happy to review the PR

@christian-bromann
Copy link
Contributor

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants