This tutorial uses JBehave 3.x and Selenium 2.x to test Etsy.com (an live online shopping site).
This will run the build and test the etsy.com website:
mvn clean install
You should see Firefox (installed on your system) flicker as it tests Etsy.com
This will run a single story (one contained in a etsy_cart.story file):
mvn clean install -DstoryFilter=etsy_cart
This will run a suite based on the meta filters in the three story files:
mvn clean install -Dmeta.filter="+color red"
In directory target/jbehave/view, a page named 'reports.html' has been generated, which you open that in any browser to the stories that have run and their execution status.
There should be a row for each story. The story reports are clickable to via links on the right-most column.
The tutorial aims to provide a fully-functional project that you can use to model you own project:
- src/main/java/org/jbehave/tutorials/etsy/EtsyDotComStories.java is the entry-point that JBehave uses to run the stories.
- src/main/stories contains the stories run by JBehave via EtsyDotComStories.java.
- src/main/java/org/jbehave/tutorials/etsy/steps/HousekeepingSteps.java contains the steps does housekeeping chores, such as emptying cart between scenarios.
- src/main/java/org/jbehave/tutorials/etsy/steps/EtsyDotComSteps.java contains the steps mapped to the textual steps.
- src/main/java/org/jbehave/tutorials/etsy/pages contains the page-objects used by steps to abstract in a more manageable and maintainable way the interaction with the web pages via Selenium WebDriver.
- src/main/resources/etsy-steps.xml contains the Spring configuration for composition the steps