Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option do define feature order without workaround #2297

Closed
punkratz312 opened this issue May 6, 2021 · 3 comments
Closed

Option do define feature order without workaround #2297

punkratz312 opened this issue May 6, 2021 · 3 comments

Comments

@punkratz312
Copy link

please add the possibility to define hard coded execution oder as last workaround. its not hard to implement and wont break general approach that tests need to be independent 💯 right.

As always there might be an exception in case of an initial password change its mandatory that the update password scenario runs first. As otherwise all the other tests would need to deal with this situation too and thats not practicable.

Please implement the feature options they are interpreted all over the internet even tho it has not any effect at all, to define multiple feature blocks. Still the ugly number_prefix workaround must be used to workaround this special case...

Desired solution:

image

Actual workaround:

image

https://forum.katalon.com/t/how-to-run-multiple-feature-files-in-a-specific-sequence-using-cucumber-runner-class/24327

@aslakhellesoy
Copy link
Contributor

please add the possibility to define hard coded execution oder as last workaround. its not hard to implement and wont break general approach that tests need to be independent 💯 right.

Please submit a pull request if you want to see this added to Cucumber.

@aslakhellesoy aslakhellesoy transferred this issue from cucumber/common May 9, 2021
@aslakhellesoy aslakhellesoy added the 🙏 help wanted Help wanted - not prioritized by core team label May 9, 2021
@mpkorstanje
Copy link
Contributor

mpkorstanje commented May 13, 2021

Given that @punkratz312 is using cucumber-serenity rather then cucumber-jvm I reckon this request is addressed to the wrong project.

I also don't think this feature is desirable. It will be rather complicated and counter-intuitive to explain and document how this order will be resolved. For example:

com/example/feature-001.feature
com/example/ #contains features 01-999
com/example/feature-099.feature

This creates the suggestion that feature 001 should go first and feature 099 last, and all other features 002-098, 100-999 in between. But because is 099 part of com/example/ is clearly shouldn't go last.

Finally the use case for this feature also isn't something we're looking to support. The assumption is that scenarios are independent. The typical solution to the problem is to create a new account for each scenario -- preferably through an API to speed things up. When real world resources are involved it is not always possible to make scenarios truly independent but the complexity of dealing with that should be dealt with by the user rather then framework.

One approach here would be to bring the account in a usable state once before it is used.

static boolean passwordReset = false;

@Before
public void resetPassword(){
  if(passwordReset){
   return;
  }
  // reset password here
  
  passwordReset = true;
}

And some of this complexity will go away once #1876 is released.

@mpkorstanje mpkorstanje removed the 🙏 help wanted Help wanted - not prioritized by core team label May 13, 2021
@punkratz312
Copy link
Author

punkratz312 commented May 14, 2021 via email

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

No branches or pull requests

3 participants