Configure Thucydides (Report for JBehave) – BDD

What is ?

Basically, this report of your scenarios/features:

Screen Shot 2015-06-17 at 12.34.50


Project Structure

+ src
   + main
      + java
         + com.mycompany.pages

   + test
      + java
         + com.mycompany.pages
            + requirements
            + steps

      + stories
         + com.wakaleo.webtests.wikipedia
            - SearchingForCats.story



If you have maven installed, go to the terminal or IDE and:

– Create a new project:

mvn archetype:generate -Dfilter=thucydides

– Open your settings.xml and write:

<?xml version="1.0" encoding="UTF-8"?>

– In the pom.xml file, update the default JUnit dependency to at least 4.11

– Add a dependency to hamcrest-all and thucydides-junit. Thucydides uses SLF4J for its logging, so add an SLF4J implementation (e.g. slf4j-simple) as well.

– If you are not using Maven 3, make sure you configure the Maven compiler plugin to use Java 5.

– Finally, add the thucydides-maven-plugin, which provides the Thucydides reporting services. The resulting pom.xml file should look something like this:






– Run this command to be sure that everything it is running correctly: mvn package

– Create a new class contains the list of “features” that make up the application, and stories related to each feature. These stories are not the tests themselves – rather they are used to model the application requirements.

– Writing your first test:

public class Application {
	    public class Search {
	        public class SearchByKeyword {}
	        public class SearchByAnimalRelatedKeyword {}
	        public class SearchByFoodRelatedKeyword {}
	        public class SearchByMultipleKeywords {}
	        public class SearchForQuote{}

	    public class Backend {
	        public class ProcessSales {}
	        public class ProcessSubscriptions {}

	    public class Contribute {
	        public class AddNewArticle {}
	        public class EditExistingArticle {}


– Create a new test class in a package of your choice

public class SearchByKeywordStoryTest {

    @Managed(uniqueSession = true)
    public WebDriver webdriver;

    @ManagedPages(defaultUrl = "")
    public Pages pages;

    public EndUserSteps endUser;

    public void should_display_article_about_cats() {
        endUser.should_see_article_with_title("Cat - Wikipedia, the free


PS: @Managed and  @ManagedPages are required to take care of our page objects.


– Create a step library called EndUserSteps:

public class EndUserSteps extends ScenarioSteps {

    public EndUserSteps(Pages pages) {

    public void searches_by_keyword(String keyword) {

    public void enters(String keyword) {

    public void performs_search() {

    public void should_see_article_with_title(String title) {

    public void is_on_the_wikipedia_home_page() {


– You will need create your own classes inside of each Step.

– Run the command to generate your report: mvn verify thucydides:aggregate

– Your report will be in target/thucydides directory, open the home.html


If you want to see a complete model, go to this link.

If you want to learn more about maven commands, go to this link.

If you want to see the post of John Smart with his complete example, go to this link.


Thank you guys  🙂