This GitHub repository contains example code to help you learn how to use Cucumber for testing.
Key Features:
- Cucumber 7 and JUnit 5
- cucumber-picocontainer 7.8
- Compatible with Maven
- Requires JDK 17
- Mockito 4.8
- Gherkin and stepDefs in both French (FR) and English (EN), including integration of Examples
- GitHub Actions (Check the .github/workflows) for straightforward Maven compilation and testing.
The branch failure_on_CI shows tests that do not pass.
mvn test
expected result:
[INFO] Results:
[INFO]
[INFO] Tests run: 35, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.456 s
[INFO] Finished at: 2023-08-04T16:39:55+02:00
[INFO] ------------------------------------------------------------------------
- In the martin_fowler package, you will find Martin Fowler's example of injection by constructor and by fields.
- In stock management, tests demonstrate the basic usage of PicoContainer with Cucumber
- The other presents a simplified version of a library demonstration developed by Philippe Collet
https://www.jetbrains.com/help/idea/enabling-cucumber-support-in-project.html
In the martin_fowler package, you will find Martin Fowler's example of injection by constructor and by fields.
- Attention: if the classes defining the steps are not public, they are not accessible during execution.
- Don't forget to adapt RunCucumberTest.java classes to your needs.