Environment-Specific Step Definitions
A common request is to run the scenarios differently depending on the environment they’re running in. For example, we may not have access to external web services or production databases from our CI environment, so we’ll want to use test doubles when we run our scenarios there. On the other hand, we’ll use the real systems when we run our scenarios in system integration test (SIT) or user acceptance test (UAT) environments.
We’ll pass Cucumber an environment variable to let our step definitions know how to behave. It’s up to us to build the conditional logic that implements that behavior, using standard software development techniques.
Creating the Seam
Michael Feathers introduces the concept of a seam ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access