Santhosh Palan
Santhosh Palan

Reputation: 47

How to separate data from test cases/scenarios in Behat / Mink

How can I maintain separate data files for different environments such as development, staging and production environment in Behat with Mink Extension.

Example : login credentials, order numbers , shipping address etc?

Upvotes: 2

Views: 157

Answers (1)

enkrates
enkrates

Reputation: 626

You can use different configurations in different environments in several different ways (each detailed here):

  1. You can use a different behat config file per environment and use them with the --config flag. For example, behat --config dev-config.yml.
  2. You can use environment variables to set parameters that differ, for example (taken from the documentation): export BEHAT_PARAMS='{"extensions" : {"Behat\\MinkExtension" : {"base_url" : "https://www.example.com/"}}}'

Ideally, you would not run behat in production. Tests like these should confirm behavior in development and staging. By them time your code is in production, these behaviors should be well established.

Upvotes: 1

Related Questions