Can you spot the Cucumber Diseases in this code? We’ll explore the code smells lurking in Gherkin and Cucumber. 🧪👃 These subtle yet impactful issues can creep into our test scenarios, affecting readability, maintainability, and overall quality.
Refactor this code, take small steps, run the tests often. See how small and beautiful can make it.
For the workshop Java 17 or later is a pre-requisite for building und runnnig the Cucumber features. It needs to be installed before the local setup.
- Clone the repository localy
- Import the repository in your favourite IDE and configure the Maven build
- Install a Cucumber extension or plugin in you IDE
The VC Code Cucumber extension fails on any Unix distribution. It's recommended to use VS Code on Windows.
Restrictions of missing Cucumber extension on Unix:
- You won't have Gherkin support
- You can't generate step definition
- There is NO linkage between your feature files and step definition implementation
- You are still able to edit all file and execute your Unit Tests.
Since gitpod.io uses Linux, the same restrictions as on any other Unix distribution apply.
-
Create a new workspace at Gitpod. This usually takes a little while, just be patient.
-
At the bottom there is a Terminal window executing the Maven build the of project. Wait until BUILD SUCCESS apprears in the log.
-
Open from the file tree on the left and wait for the Java installation to finish.
-
After the installation is done, you can open files via the Java Project explorer, edit the code, and select Run Tests on either the test folder or the RunAllCucumberTests class file.
The code contains multiple Cucumber smells. It's recommended to follow the suggested order. Each smell and exercise is described in a seperate assingment.