cucumber Flashcards
BDD
Goal
Emphasis
an agile software development methodology .
The main goal of BDD is to improve communication and understanding among team members by focusing on the behavior of the software rather than just its implementation.
BDD places emphasis on defining and specifying the desired behavior of the software through examples and scenarios, often written in a natural language that can be understood by both technical and non-technical individuals.
Cucumber
Cucumber is a software tool that supports behavior-driven development (BDD).
Central to the Cucumber BDD approach is its ordinary plain-text language parser called Gherkin.
step def
is a method with an expression that links it to one or more Gherkin steps.
DataTable methods
+ way of accessing the values
1) io.cucumber.datatable.DT class: cell(x,y)
2)List<Map<String,String»:
uses POJO + DTtransformer @datatabletype
Runner Class
used to execute Cucumber scenarios and features in a Java-based testing framework, such as JUnit.
The Runner Class acts as an entry point for running Cucumber tests and helps manage the configuration and execution of the tests.
Cucumber reports
In the context of Cucumber and JUnit, the cucumber.plugin configuration in the junit-platform.properties file is used to specify the types of reports you want to generate after running Cucumber tests.
cucumber.plugin types of reports
1)Pretty Console Output (pretty):
cucumber.plugin=pretty
The pretty plugin generates a human-readable output of the test execution on the console. This is particularly useful during development and debugging to quickly see the status of each scenario.
2) HTML Report (html):
html:target/SystemTestReports/report.html
The html plugin generates an HTML report that provides a detailed and visually appealing representation of the test results. The generated HTML report will be stored in the target/SystemTestReports directory with the filename report.html.
3) JSON Report (json):
json:target/SystemTestReports/report.json
The json plugin generates a JSON-formatted report that can be used for various purposes, such as integrating with other tools or services that consume JSON reports. The generated JSON report will be stored in the target/SystemTestReports directory with the filename report.json.
4) JUnit XML Report (junit):
junit:target/SystemTestReports/junit.xml
The junit plugin generates a report in JUnit XML format. This format is commonly used for integrating test results with continuous integration systems, such as Jenkins or TeamCity. The generated JUnit XML report will be stored in the target/SystemTestReports directory with the filename junit.xml.