-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
worldParameters not modifiable using Before and After hooks after updating to the latest versions after v10.0.1 #2395
Comments
I backtracked and saw this: #2362, which is understandable. However in my case, I'm using the worldParameters to modify states that are being used across the feature files executed. One use case for this is when I create a test case, where its information is dependent of the previous test cases (chaining). If I merge the test cases into one to avoid chaining, the test case will become super long and will be hard to maintain, and a possibility of pushing huge updates on my current tests. Another one would be the possibility of temporarily changing base URL set in world parameter in the middle of test execution. Is there a way for me to store a mutable world parameter that stores and modifies state of tests without it being cleared after the next scenario? |
Tagging @davidjgoss here since you made the changes for this. Thank you 🙏 |
Sorry another small issue I saw regarding documentation here:
Which is not true anymore after the changes were released in v10.1.0 right? |
Sorry for the late reply @xenbartolokath. As you've noticed, the recent changes were to prevent world parameters being mutable and those changes leaking across scenarios which was considered a bug. When each scenario starts, the world parameters should be reset to what they were after the last
The above statement is still true as it refers to the "world" which is a class instance that lives and dies with the scenario. The world parameters are passed to the world and can be modified in |
👓 What did you see?
Hello!
I've been relying on worldParameters to store environment data since it's labelled as repeatable, as stated in here and here, and it can be modifiable using hooks. However, after upgrading from v10.0.1 to a more latest version, seems like it's not repeatable and modifiable with any steps or hooks anymore, but rather only modifiable using BeforeAll hook.
✅ What did you expect to see?
I am still able to modify world parameters using any available hooks (Before, After) in v10.0.1. However after v10.1.0 was released (coincidentally the feature worldParameters can be added to BeforeAll hooks), the ability to store worldParameters on Before and After hooks are gone.
📦 Which tool/library version are you using?
node v21.5.0 and @cucumber/cucumber v10.0.1
🔬 How could we reproduce it?
📚 Any additional context?
Would appreciate if we can fix this as there are a lot of several important states I need to store in between tests using Before and After hooks. If collectively decided to take the new route, would also appreciate an explanation and also a workaround for this.
The text was updated successfully, but these errors were encountered: