Behavior-driven development is a software development process that is derived from Test-Driven Development (TDD) concept. BDD enables all the involved parties to work together on the requirements of a project while TDD only gives the developer an understanding of what the system should do.
BDD benefits:
- Strong collaboration with the non-developers all the involved parties have a strong understanding of the project
- High visibility by using a language understood by all
- Lower costs by improving the quality of the code
In this tutorial I have implemented in my project a BDD tool known as Cucumber to test the following two scenarios;
- Check login & logout functionality on demo website available at http://demo.guru99.com/V4/
- Check the reset functionality of the login form
To execute these Cucumber test scenarios, I created Features and Step Definition files.
Cucumber tool is based on the Behavior Driven Development process that bridges the gap between non-developers and developers. It uses a plain text format called Gherkin that non-programmers are able to read.
To make the testing phase even easier I also took advantage of Selenium Framework that is a browser automation tool. Before starting out with the project the following libraries must be referenced inside the project file.
Selenium jar files: (Downloaded from Selenium Official Website)
- Selenium-server-standalone
Cucumber jar files (Downloaded from Maven Repository)
- Cucumber-core
- Cucumber-html
- cobertura code coverage
- Cucumber-java
- Cucumber-junit
- Cucumber-jvm-deps
- Cucumber-reporting
- Hemcrest-core
- Gherkin
- Junit