Open 0xmichalis opened 5 years ago
Hi, read the godoc. If you wanted it as a background step in gherkin, then change it.
Though, your gherkin looks ugly with these environment variables, why it cannot just take it from the step as Given my production database is running
the step could read production
as an argument, translate it to DB_HOST
use the production
database name and work on it.
@l3pp4rd the only inputs to the test are the variables passed through the arguments which makes it easier to reason about the actual requirements needed for the test to run. If I start mapping a word in a step with a source of inputs that I need to get in my tests via a different way, eg. environment variables then the test is more complicated to setup and run across all envs because now apart from setting up the features files appropriately I need to:
I need to do something like the following:
Then in a BeforeSuite step I want to seed my database, then I can run different scenarios in parallel that depend on the seeded data. I need to have DB_HOST configurable to enable my tests to run across environments (eg. a db deployed locally is going to have a different hostname from a db deployed on Kubernetes).