Logo

Automated
Acceptance Testing with
Style

  • Home
  • OVERVIEW
    • Credits
  • DOWNLOADS
  • DOCUMENTATION
  • Learn
  • Wakaleo
    • About Us
    • Contact Us
  • HELP
Tool Integration
  • JUnit
  • JBehave
  • EasyB
  • JIRA
Tags
atdd bdd jbehave selenium web testing
Sample Reports
Home JBehave

Thucydides JBehave Integration

Details
Aug15
Written by Super User

JBehaveis an open source BDD framework originally written by Dan North, the inventor of BDD. It is strongly integrated into the JVM world, and widely used by Java development teams wanting to implement BDD practices in their projects.

In JBehave, you write automate your acceptance criteria by writing test stories and scenarios using the familiar BDD "given-when-then" notation, as shown in the following example:

Scenario: Searching by keyword and category

Given Sally wants to buy some antique stamps for her son
When she looks for ads in the 'Antiques' category containing 'stamps'
Then she should obtain a list of ads related to 'stamps' from the 'Antiques' category

You then implement the test steps in Java, e.g.

public class SearchScenarioSteps {
    @Steps
    BuyerSteps buyer;

    @Given("Sally wants to buy a $present for her son")
    public void buyingAPresent(String present) {
        buyer.opens_home_page();
    }

    @When("she looks for ads in the $category category containing $keyword in $region")
    public void adSearchByCategoryAndKeywordInARegion(String category,String keyword,String region){
        buyer.chooses_region(region);
        buyer.chooses_category_and_keywords(category, keyword);
        buyer.performs_search();
    }

    @Then("she should obtain a list of $category ads containing the word $keyword from advertisers in $region")
    public void resultsForACategoryAndKeywordInARegion(String category,String keyword,String region){
        buyer.should_only_see_results_with_titles_containing(keyword);
        buyer.should_only_see_results_from_region(region);
        buyer.should_only_see_results_in_category(category);
    }
}

Learn more about the Thuydides JBehave integration in the User's manual.

  • < Prev
  • Next >
Events
More News
  • JavaOne 2012: Behavior-Driven Development on the JVM: A State of the Union

    Super User -Fri, Aug, 2012

Documentation
  • Official Thucydides Blog
  • Thucydides on Github
  • Thucydides User Manual
  • The Thucydides Company
Thucydides Release 0.8.31 - enhancements and bug fixes
Aug 03
Thucydides Release 0.8.31 is primarily a bug fix and enhancement release but goes a long way in making Thucydides more robust. We have added a couple of minor features and fixed issues related with... Read More...

Help and Support

...

Copyright © 2007 - 2012 Wakaleo Consulting

Thucydides development is lead and supported by Wakaleo Consulting,
a Sydney-based company that helps organisations optimize their software
development process. We provide consulting, training and mentoring
services in Agile Development Practices such as Continuous Integration,
Test-Driven Development, Acceptance-Test Driven Development,
Build Automation, Code Quality Practices and Automated Web Testing.

  • Home
  • OVERVIEW
  • DOWNLOADS
  • DOCUMENTATION
  • Learn
  • Wakaleo
  • HELP