You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that Cucumber.js has BeforeAll and AfterAll hooks, would it make sense to expose world parameters to them?
import{BeforeAll,Before}from'@cucumber/cucumber';BeforeAll(function(){console.log(this.parameters.baseUrl);// throws an error, parameters undefined});Before(function(){console.log(this.parameters.baseUrl);// works fine});
Consider the following use case:
Cucumber test suite interacts with a system that's deployed to multiple environments, each with its own URL
I'd like the test suite to be configurable to point to any of those environments, ideally using a parameter when invoking Cucumber (i.e. cucumber-js --world-parameters='{"baseUrl":"prod.example.com"}'; this could be put into a profile, but the idea is the same)
Let's also assume that the integration client I use to talk to those environments is expensive to create (say a DB connection), so I'd prefer to do the configuration step only once for all the scenarios, ideally in a BeforeAll hook.
What I'd love is to use the same this.parameters object that's available in all the other Cucumber steps in BeforeAll and AfterAll hooks. However, before proposing a PR I wanted to discuss the idea with you first @davidjgoss@charlierudolph@jbpros
Do you think we should have this functionality implemented in Cucumber.js? Does it make sense? Is there a better way to accomplish this goal?
The text was updated successfully, but these errors were encountered:
Hi team!
Now that Cucumber.js has
BeforeAll
andAfterAll
hooks, would it make sense to expose world parameters to them?Consider the following use case:
cucumber-js --world-parameters='{"baseUrl":"prod.example.com"}'
; this could be put into a profile, but the idea is the same)BeforeAll
hook.What I'd love is to use the same
this.parameters
object that's available in all the other Cucumber steps inBeforeAll
andAfterAll
hooks. However, before proposing a PR I wanted to discuss the idea with you first @davidjgoss @charlierudolph @jbprosDo you think we should have this functionality implemented in Cucumber.js? Does it make sense? Is there a better way to accomplish this goal?
The text was updated successfully, but these errors were encountered: