Cucumber is an automated testing tool that can understand test cases described in common languages and support behavior-driven development (BDD). It is written in Ruby and supports multiple development languages such as Java and. net.
Cucumber:
- Features
- Step_definitions
- Cucumber command
Feature is described in a simple natural language. A feature consists of the following parts:
- One title
- A description statement in any format
- Any number of scenarios
- Each scenario can contain any number of steps.
- The step definition must start with the keyword given, when, then, and
- The feature file must be suffixed with. feature.
Step_definitions writes the corresponding test code based on the step defined in the feature file. The programming language used can be consistent with the tested application programming language.
Cucumber command. When you run the cucumber command, cucumber analyzes the step defined in the feature file and then goes to step_definitions to find the matching step. if it finds the matching step, it executes the code in the step. Run the command and enter the cucumber project directory \ Features \ file name. feature in the command line.
Cucumber development process (from http://cukes.info /):
1: Describe behaviour in plain text2: Write a step definition in ruby3: run and watch it fail4. write code to make the step pass5. run again and see the step pass6. Repeat 2-5 until green like a cuke7. repeat 1-6 until the money runs out
Automated test cucumber