Implementing tests with Godog
With Godog installed and our first feature outlined, let us turn our attention to the implementation of this test.
The main steps we will be taking for implementing our outlined feature are as follows:
- Creating feature and test files.
- Implementing the test steps for the functionality of our
BookSwap
application. - Running the application as well as the test.
As we previously mentioned, we will use Godog to implement BDD-style E2E tests, so we require the application to be up and running before we run our tests. However, this is not a Godog requirement, so we can write tests at any level with this easy-to-use library.
Creating test files
As previously mentioned, Godog relies on code generation to make developers’ lives easier. The process consists of copying code from the terminal and creating files ourselves. Let us look at the steps involved.
Step 1 – creating a feature file
Feature files are stored...