My first Cucumber example (part 1)
Objective: running your first Cucumber project
Project reference: LINK
1 - Requirements:
If you are using:
- Eclipse, you need to install the Cucumber plugin like the CUCUMBER NATURAL plugin
- IntelliJ, you need to enable the Cucumber plugins
In the second step, create a simple MAVEN project in your IDE and add the dependencies:
2 - Theory:
Cucumber uses the Gherkin syntax language to write test cases. For example:
We can do an analogy about the vocabulary used by Cucumber and the test domain:
PRACTICAL CODE:
Create the following packages and files in your project, under the TEST folder
ATTENTION: Look at the file extension FEATURE, it is the file where we write the tests using Gherkin.
Fill your files:
More theory:
In the feature file, you write the tests in high-level syntax, in the step definitions the java implementation of the sentences created, and finally, the test runner link the Gherkin and Java file.
The Cucumber uses Java annotations to mark and run their features.
3 - Conclusion:
Run the Maven "mvn verify" and look at the GREEN BAR.
Coordenador de Práticas e Performance na @RD Saúde | Gest?o de Dados | Gest?o de Projetos e Produtos Digitais
4 年Joao Vale teria algum material sobre cucumber que possa compartilhar para quem está iniciando ?