In the previous post, we set up our Cucumber Ruby project. In this post, we prepare configuration variables and env.rb file to run future scenarios.
In this pull request, you can explore changed files for Chapter 02.
The entry point for settings variables that are no secret. We have SITE, HEADLESS, and BROWSER that are described in readme.md
This clumsy path is a development decision in the Cucumber gem library. This is the central entry point for the Cucumber project. Here you require all Ruby gems that you need to use. After that, we read application variables and set where webdrivers gem will automatically keep up to date webdriver files.
Before and After the scenario is called before/after scenario steps run. Something like setup, teardown in Junit. Before the scenario, we instantiate selected browsers in maximal screen resolution and in selected headless mode. If the scenario fails, we embed a screenshot in the HTML test report. This is also a Watir feature. In the end, we close the browser.
Run cucumber. Nothing happens because we do not have a scenario with steps. We are ready for chapter 03!