This example project demonstrates how one could simplify functional testing and enhance business => developer communication by combining the Selenium Web Testing Framework with Cucumber.io.
This project uses Cucumber.io to define scenarios
that are then carried out by Selenium. Add
your feature files to the features directory in 'src/test/resources'. Next,
Run mvn test
. That's it.
Imagine you are developing a system to keep score of a bowling game. You would define your behavior similar to the following:
Given I have a new frame
When I knock down all the pins
Then I score a strike
We call this a Scenario. The scenario has a precondition - the 'Given', an action - the 'When', and a test - the 'Then'. For our test to pass our system must score a strike when all the pins are knocked down in a new frame.
Cucumber is a framework for Behavior Driven Development , or BDD. BDD is a method for developing software in which you define the behavior you want the software to perform as tests.
BDD uses a language called Gherkin to describe the behavior. Gherkin's purpose is to be an simple, business readable language. In this example, we will use Gherkin to describe the behavior of webpages under test.
If you want to know more about Cucumber, visit Cucumber.io.
Selenium is a tool for automating web browser testing. It provides a simple API to perform everything a human could do when navigating a web site.