Skip to content

Recent Articles


Serenity 1.1 is out!

A brand new version of Serenity is out, with bug features and some very cool new features, including fully-integrated feature coverage reporting and the ability to include both manual and automated tests in your reports!

The Serenity team is proud to announce the release of Serenity version 1.1 (the current exact version is 1.1.1, but as is custom with the Serenity project, we like to release in a regular stream of minor features and bug fixes, so check the latest release numbers on Bintray or Maven Central.)

This new release has several major new features, along with a number of bug fixes and improvements. Major new features include:

  • Smooth integration between test reporting and requirements reporting (living documentation)
  • You can now flag tests (in JUnit, Cucumber or JBehave) as manual (more on this further down)

Fully-integrated Requirements Reporting

Serenity is an automated testing and reporting library that tries to implement many key concepts from the world of Behavior Driven Development (BDD) such as Living Documentation and Feature Coverage. One of the main principles behind Serenity reporting is that the value of an automated test is directly related to the value of the feature it is testing. Automated tests are most useful when they demonstrate both that a feature works and that it is doing something valuable for the customer.

Serenity distinguishes between two distinct views of your test results. The first, the test reports, presents the results from the point of view of what tests were executed:

Test reports

These reports also give you an overview of the test results, in terms of the number of passing and failing tests:

Test reports

This representation is a classic list of test results that will be familiar to testers.

The second focuses less on what tests were executed, and more on what features were delivered. If the definition of done ifor the features you want to deliver is accurately described by the acceptance criteria (one of the cornerstones on BDD), and if you automate these acceptance criteria, then you can get a good idea of whether a feature has indeed been delivered from the results of the automated acceptance criteria.

For this to work, Serenity needs to know how your requirements are structured. A flat requirements structure is a poor representation for all but the most simple projects. Well-designed requirement structures help a reader understand what business goal each feature is helping to deliver, or what capability the feature is helping to provide. For this reason, teams often organize features by capability or in some other meaningful functional grouping.

Doing this in Serenity allows you to present a hierarchical view of the requirements, as illustrated here:

Requirements reports

The simplest way to represent a requirements structure in Serenity is to use a hierarchical directory structure, where each top level directory describes a high level capability or functional domain. You might break these directories down further into sub directories representing more detailed functional areas, or just place feature files directly in these directories:

Requirements directory structure using Cucumber

The same thing works for JUnit, except you use packages instead of directories:

Requirements directory structure using JUnit

To get the JUnit package structure to work, you need to set the serenity.test.root system property to the top level package containing your requirements:


When you organize your tests this way, Serenity will show you where each test belongs in the requirements hierarchy:

Test result showing parent requirements

These breadcrumbs let you go directly to the corresponding requirements pages, as illustrated here:

Test result showing parent requirements

Manual tests It is often useful to be able to flag certain tests as manual tests, which are not consider cost-efficient to automate, but which you would still like to see in the overall test reports.

You can mark a JUnit test as a manual one simply by using the @Manual annotation. For example, the following Serenity test class has two automated tests, and one flagged as manual:

public class SearchByKeyword {

    WebDriver driver;

    BuyerSteps buyer;

    public void search_for_articles_by_keyword() {

    public void search_for_articles_by_shop_name() {
        buyer.should_see_shop_search_result_summary_of("1 shop found for docksmith");

    public void should_respect_standard_look_and_feel() {}


In Cucumber, just use the @manual tag on a scenario:

Scenario: Should respect standard look and feel

You can add the usual Given/When/Then steps if you want some instructions about how to test this scenario in the living documentation, or leave it simply as a place-holder for the tester later on.

And in JBehave, use the @manual tag in the Meta: section of a scenario:

Scenario: Display social media links for a product

Given I have searched for 'Docking station' in my region
When I select item 1
Then I should see social media links

In all cases, the manual test appear in the reports as a special kind of “Pending” test, indicated by a special icon:

Manual tests

Manual tests also have their on tag, making it easy to get a view of all of the manual tests in one place.

Bug fixed and enhancements

There are also a few important bug fixes and enhancements, including:

  • Fixed a thread leak that sometimes caused problems on build servers for large projects.
  • Move the caption for the screenshots to the top of the screen for better readability.
  • Added the deep.step.execution.after.failures system property. This allows you to decide whether @Step methods should simply be skipped after a previous step has failed (the default: this is faster, but it means that only top-level steps will be reported), or if the subsequent steps will be executed in “dry-run” mode (will report on nested steps as well as the top level ones)
  • Upgrades to Appium 3.1.0
  • Improved error and exception reporting for RestAssured tests.

Coming up in the not-so-distant future will be deep JIRA integration, including integration with Zephyr. Older versions of Thucydides supported this integration using the old SOAP API for JIRA and a beta version of the Zephyr API. This has now been completely rewritten using the latest REST APIs for both tools.


A new release of Serenity BDD is out!

Serenity 1.0.47 is out, with a host of improvements and bug fixes. Major items include:

  • Serenity will now automatically detect Cucumber and JBehave requirements directory structures and group the tests according. For Cucumber, feature files are considered to be the lowest level, and directories containing these features will be mapped to capabilities. For JBehave, story files are the lowest level, and produce stories. Directories that contain story files will be mapped to features. Directories above this level will be mapped to capabilities.
  • Added a new containsElements() convenience method to the PageObject class.
  • Added a hasClass() method to the WebElementFacade class, to test whether an element has a particular CSS class.
  • Display the stack trace for failing tests in the test reports.
  • Experimental support for JUnit reports – JUnit-compatible XML reports (usable directly by CI servers like Jenkins) are now generated in the target/site/serenity directory, with the prefix SERENITY-JUNIT.
  • Added support for Cucumber feature files written in non-English language when generating the requirements reports.
  • You can access properties from the Sereniy properties file in a JUnit test simply by declaring a member variable of type `EnvironmentVariables`.
  • Fixed a bug causing screenshots to fail to be recorded in some circumstances.
  • Fixed a bug where tests hung if an invalid selector was used.
  • Many other smaller bug fixes and performance improvements.

The Maven archetypes have also been updated. This new version should be completely backward compatible with previous (recent) versions of Serenity, so take it for a spin and let us know what you think!


Customizing Cucumber Feature File organization with Serenity

Many Cucumber projects organize their feature files in a single directory. This flat structure will work for very small projects, but in real-world project features typically need to be grouped by more high-level concepts, such as capabilities or epics. Serenity BDD makes this very easy
By default, Serenity uses a two-level hierarchy based on capabilities and features. A capability is represented by a directory, and the features associated with that capability are placed inside that directory.
If you use a directory structure like this, the “Requirements” tab in the Serenity reports will display a hierarchy of capabilities and features, and aggregate test results for each capability and feature:
We can customize the hierarchy using the serenity.requirement.types system property. If we wanted epics instead of capabilities, we could add the following line to our file:
serenity.requirement.types = epic, feature
This would produce epics rather than capabilities in the requirements report:
Now suppose you wanted to add a “theme” level above the epics and features. You could organise the features directory like this:
Then you would configure the serenity.requirement.types property as shown here:
serenity.requirement.types = theme, epic, feature
This would add a “Themes” requirements level above your epics in the Requirements reports.
You can also organize your features into releases, iterations, or sprints. You do this using the version tag. For example, the following feature would be scheduled for Release-2:
Feature: Search by keyword
  In order for buyers to find what they are looking for more efficiently
  As a seller
  I want buyers to be able to search for articles by keywords

  Scenario: Search for articles by keyword
    Given I want to buy a wool scarf
    When I search for 'wool'
    Then I should see only articles related to 'wool'
(Note that Cucumber does not like spaces in tags, so you need to write “Release-2” and not “Release 2”).
You can also assign a feature to both a release and a sprint, e.g.
Feature: Add item to shopping cart
  As a buyer
  I want to be able to purchase items online
  So that I can get them faster

  Scenario: Add item to cart
    Given I have searched for 'docking station'
    And I have selected item 2
    When I add it to the cart
    Then the item should appear in the cart
    And the shipping cost should be included in the total price
This will produce a “Releases” tab in the reports, similar to the following:
You can tell Serenity what terms your release organisation uses (e.g. releases then sprints or releases then iterations) using the serenity.release.types system property. For example, if you wanted to use versions, then iterations, you would put the following line in your file:
serenity.release.types = Version,Iteration

Serenity 1.0.42 and the new Timeout API

Serenity core 1.0.42 is out, with a major overhaul to implicit and explicit timeouts, making the timeout behaviour more consistent and more flexible.

Modern AJAX-based web applications add a great deal of complexity to web testing. The basic problem is, when you access a web element on a page, it may not be available yet. So you need to wait a bit. Indeed, many tests contain hard-coded pauses scattered through the code to cater for this sort of thing.

But hard-coded waits are evil. They slow down your test suite, and cause them to fail randomly if they are not long enough. Rather, you need to wait for a particular state or event. Selenium provides great support for this, and Serenity builds on this support to make it easier to use.

Implicit Waits

The first way you can manage how WebDriver handles tardy fields is to use the  webdriver.timeouts.implicitlywait property. This determines how long, in milliseconds, WebDriver will wait if an element it tries to access is not present on the page. To quote the WebDriver documentation:

“An implicit wait is to tell WebDriver to poll the DOM for a certain amount of time when trying to find an element or elements if they are not immediately available.”

The default value in Serenity for this property is currently 2 seconds. This is different from standard WebDriver, where the default is zero.

Let’s look at an example. Suppose we have a PageObject with a field defined like this:

public WebElementFacade slowLoadingField;

This field takes a little while to load, so won’t be ready immediately on the page.

Now suppose we set the webdriver.timeouts.implicitlywait value to 5000, and that our test uses the slowLoadingField:

boolean loadingFinished = slowLoadingField.isDisplayed()

When we access this field, two things can happen. If the field takes less than 5 seconds to load, all will be good. But if it takes more than 5 seconds, a NoSuchElementException (or something similar) will be thrown.

That this timeout also applies for lists. Suppose we have defined a field like this, which takes some time to dynamically load:

@FindBy(css="#elements option")
public List<WebElementFacade> elementItems;

Now suppose we count the values of the element like this:

int itemCount = elementItems.size()

The number of items returned will depend on the implicit wait value. If we set the webdriver.timeouts.implicitlywait value to a very small value, WebDriver may only load some of the values. But if we give the list enough time to load completely, we will get the full list.

The implicit wait value is set globally for each WebDriver instance, but you can override the value yourself. The simplest way to do this from within a Serenity PageObject is to use the setImplicitTimeout() method:

setImplicitTimeout(5, SECONDS)

But remember this is a global configuration, so will also affect other page objects. So once you are done, you should always reset the implicit timeout to its previous value. Serenity gives you a handy method to do this:


See for more details on how the WebDriver implicit waits work.

Explicit Timeouts

You can also wait until an element is in a particular state. For example, we could wait until a field becomes visible:


You can also wait for more arbitrary conditions, e.g.


The default time that Serenity will wait is determined by the webdriver.wait.for.timeout property. The default value for this property is 5 seconds.

Sometimes you want to give WebDriver some more time for a specific operation. From within a PageObject, you can override or extend the implicit timeout by using the withTimeoutOf() method. For example, you could wait for the #elements list to load for up to 5 seconds like this:

withTimeoutOf(5, SECONDS).waitForPresenceOf(By.cssSelector("#elements option"))

You can also specify the timeout for a field. For example, if you wanted to wait for up to 5 seconds for a button to become clickable before clicking on it, you could do the following:

 someButton.withTimeoutOf(5, SECONDS).waitUntilClickable().click()

You can also use this approach to retrieve elements:

elements = withTimeoutOf(5, SECONDS).findAll("#elements option")

Finally, if a specific element a PageObject needs to have a bit more time to load, you can use the timeoutInSeconds attribute in the Serenity @FindBy annotation, e.g.

import net.serenitybdd.core.annotations.findby.FindBy;
@FindBy(name = "country", timeoutInSeconds="10")
public WebElementFacade country;

You can also wait for an element to be in a particular state, and then perform an action on the element. Here we wait for an element to be clickable before clicking on the element:

addToCartButton.withTimeoutOf(5, SECONDS).waitUntilClickable().click()

Or, you can wait directly on a web element:

WebElementFacade facebookIcon;
public WebElementState facebookIcon() {
    return withTimeoutOf(5, TimeUnit.SECONDS).waitFor(facebookIcon);

Or even:

List<WebElementFacade> currencies = withTimeoutOf(5, TimeUnit.SECONDS)

This is just an overview of a few of the ways you can handle asynchronous fields in Serenity – there are many variations around these themes. More detailed documentation will be available soon in the Serenity BDD documentation.


Serenity Core 1.0.38 Released

Serenity Core 1.0.38 includes a number of bug fixes and improvements, including:

  • The CSVReader can now parse special characters like \n,\t etc.
  • Fixed a bug with requirements reporting for @pending Cucumber scenarios
  • Updated to Selenium 2.45.0
  • Fixed an issue in which tests were slowed down after a failing step because Serenity continued to try to take snapshots.

Keep tabs on the latest releases on Bintray!


Handling work-in-progress with Thucydides and JBehave using @pending and @wip tags

Thucydides version 0.9.268 has just been released, with a few very interesting new features. Thucydides is an open source reporting library that helps you write more effective BDD-style automated acceptance criteria, and generate richer test reports, requirements reports and living documentation. In this article, we will look at some of the new ways this version lets you handle work-in-progress or pending scenarios with Thucydides and JBehave. Read more »


BDD Requirements Management with JBehave, Thucydides and JIRA – Part 2

Thucydides is an open source library designed to make practicing Behaviour Driven Development easier. Thucydides plays nicely with BDD tools such as JBehave, or even more traditional tools like JUnit, to make writing automated acceptance tests easier, and to provide richer and more useful living documentation. In this series of articles, we look at the tight one and two-way integration that Thucydides offers with JIRA. The first article discussed basic one-way integration with JIRA. In this article, we will looking at taking that integration further. We will see how to insert links to the Thucydides reports into JIRA, how to update the state of JIRA issues based on the Thucydides test outcomes, and how to report on JIRA versions and releases in the Thucydides reports.

The rest of this article assumes you have some familiarily with Thucydides. For a tutorial introduction to Thucydides, check out the Thucydides Documentation or this article for a quick introduction.

The simplest form of two-way integration between Thucydides and JIRA is to get Thucydides to insert a comment containing links to the Thucydides test reports for each related issue card. To get this to work, you need to tell Thucydides where the reports live. One way to do this is to add a property calledthucydides.public.url to your file with the address of the thucydides reports.


This will tell Thucydides that you not only want links from the Thucydides reports to JIRA, but you also want to include links in the JIRA cards back to the corresponding Thucydides reports. When this property is defined, Thucydides will add a comment like the following to any issues associated with the executed tests:


The thucydides.public.url will typically point to a local web server where you deploy your reports, or to a path within your CI server. For example you could publish the Thucydides reports on Jenkins using theJenkins HTML Publisher Plugin, and then add a line like the following to your file:


If you do not want Thucydides to update the JIRA issues for a particular run (e.g. when running your tests locally), you can also set thucydides.skip.jira.updates to true, e.g.


This will simply write the relevant issue numbers to the log rather than trying to connect to JIRA.

Updating JIRA issue states

You can also configure the plugin to update the status of JIRA issues. This is deactivated by default: to use this option, you need to set the option to true, e.g.

The default configuration will work with the default JIRA workflow: open or in progress issues associated with successful tests will be resolved, and closed or resolved issues associated with failing tests will be reopened. If you are using a customized workflow, or want to modify the way the transitions work, you can write your own workflow configuration. Workflow configuration uses a simple Groovy DSL. The following is an example of the configuration file used for the default workflow:

    when 'Open', {
        'success' should: 'Resolve Issue'

    when 'Reopened', {
        'success' should: 'Resolve Issue'

    when 'Resolved', {
        'failure' should: 'Reopen Issue'

    when 'In Progress', {
        'success' should: ['Stop Progress','Resolve Issue']

    when 'Closed', {
        'failure' should: 'Reopen Issue'

You can write your own configuration file and place it on the classpath of your test project (e.g. in theresources directory). Then you can override the default configuration by using thethucydides.jira.workflow property, e.g.


Alternatively, you can simply create a file called jira-workflow.groovy and place it somewhere on your classpath (e.g. in the src/test/resources directory). Thucydides will then use this workflow. In both these cases, you don’t need to explicitly set the property.

Release management

In JIRA, you can organize your project releases into versions, as illustrated here:


You can and assign cards to one or more versions using the Fix Version/s field:


By default, Thucydides will read version details from the Releases in JIRA. Test outcomes will be associated with a particular version using the “Fixed versions” field. The Releases tab gives you a run-down of the different planned versions, and how well they have been tested so far:


JIRA uses a flat version structure – you can’t have for example releases that are made up of a number of sprints. Thucydides lets you organize these in a hierarchical structure based on a simple naming convention. By default, Thucydides uses “release” as the highest level release, and either “iteration” or “sprint” as the second level. For example, suppose you have the the following list of versions in JIRA – Release 1 – Iteration 1.1 – Iteration 1.2 – Release 2 – Release 3

This will produce Release reports for Release 1, Release 2, and Release 3, with Iteration 1.2 and Iteration 1.2 appearing underneath Release 1. The reports will contain the list of requirements and test outcomes associated with each release. You can drill down into any of the releases to see details about that particular release


You can also customize the names of the types of release usinge the thucydides.release.typesproperty, e.g.

thucydides.release.types=milestone, release, version


Thucydides has powerful one and two-way integration with JIRA. In these articles, we have seen how you can incoporate links from Thucydides to JIRA, from JIRA to Thucyides, and even update the status of issues in JIRA based on the test results. And, if you are managing your versions in JIRA, you can also report on how well each version has been tested, and what remains to be tested before the next release.

Want to learn more? Be sure to check out the Thucydides web site, the Thucydides Blog, or join theThucydides Google Users Group to join the discussion with other Thucydides users.

Wakaleo Consulting, the company behind Thucydides, also runs regular courses in Australia, London and Europe on related topics such as Agile Requirements GatheringBehaviour Driven DevelopmentTest Driven Development, and Automated Acceptance Testing.


New Thucydides release: 0.9.260

This new release integrates Selenium 2.42.2, has improved reporting, a number of improvements to the internal APIs, and addresses a number of issues and improvements. Some of the more notable ones include:

  • THUCYDIDES-242 – Need some way to obtain current TestStep within custom StepListener: You can get (a copy of) the current test step by calling
  • THUCYDIDES-192 – Fixed a reporting issue when multiple features or stories had identical names
  • THUCYDIDES-232 – get page source on step failure: You can retrieve the page source of the latest step using the StepEventBus.getEventBus().getCurrentStep() method.
  • THUCYDIDES-148 – Thucydides.ignoredStep should not be marked as pended: Thucydides now handles failed assumptions (e.g  Assume.assumeThat(true, is(false))) in JUnit correctly. Tests with failing assumptions are marked as skipped and reported with an “assumption violation” error.
  • THUCYDIDES-35 – Allow using multibyte charactor in class name and method name.
  • THUCYDIDES-151 – Report aggregate – Running test with parametrized test data seems to have a limitation of 10 parameter pairs
  • THUCYDIDES-177 – Report groups test cases for data-driven tests using a CSV file
  • THUCYDIDES-214 – thucydides-jira-plugin produces wrong test ID in link posted back to JIRA when using ParameterizedRunner
  • THUCYDIDES-235 – Incorrect result appears in log in case if one “Step” using another “Step” (substep)
  • THUCYDIDES-227 – Show/hide tags on the main report page

Other fixes/improvements include

  • THUCYDIDES-88 logback.groovy in thucydides-core breaks application logging configuration
  • THUCYDIDES-239 Better exception reporting in ResizableImage
  • THUCYDIDES-228 Don`t write qualifier in console log for DDT Tests
  • THUCYDIDES-240 BeanMatcher throws IllegalArgumentException for field names containing dots (or opening parenthesis / square bracket)



BDD Requirements Management with JBehave, Thucydides and JIRA – Part 1

Thucydides is an open source library designed to make practicing Behaviour Driven Development easier. Thucydides plays nicely with BDD tools such as JBehave, or even more traditional tools like JUnit, to make writing automated acceptance tests easier, and to provide richer and more useful living documentation. In a series of two articles, we will look at the tight one and two-way integration that Thucydides offers with JIRA.

The rest of this article assumes you have some familiarily with Thucydides. For a tutorial introduction to Thucydides, check out the Thucydides Documentation or this article for a quick introduction.

Getting started with Thucydides/JIRA integration

Atlassian JIRA

JIRA is a popular issue tracking system that is also often used for Agile project and requirements management. Many teams using JIRA store their requirements electronically in the form of story cards and epics in JIRA

Suppose we are implementing a Frequent Flyer application for an airline. The idea is that travellers will earn points when they fly with our airline, based on the distance they fly. Travellers start out with a “Bronze” status, and can earn a better status by flying more frequently. Travellers with a higher frequent flyer status benefit from advantages such as lounge access, prioritized boarding, and so on. One of the story cards for this feature might look like the following:


This story contains a description following one of the frequently-used formats for user story descriptions (“as a..I that”). It also contains a custom “Acceptance Criteria” field, where we can write down a brief outline of the “definition of done” for this story.

These stories can be grouped into epics, and placed into sprints for project planning, as illustrated in the JIRA Agile board shown here:


As illustrated in the story card, each of these stories has a set of acceptance criteria, which we can build into more detailed scenarios, based on concrete examples. We can then automate these scenarios using a BDD tool like JBehave.

The story in Figure 1 describes how many points members need to earn to be awarded each status level. A JBehave scenario for the story card illustrated earlier might look like this:

Frequent Flyer status is calculated based on points

@issue FH-17

Scenario: New members should start out as Bronze members
Given Jill Smith is not a Frequent Flyer member
When she registers on the Frequent Flyer program
Then she should have a status of Bronze

Scenario: Members should get status updates based on status points earned
Given a member has a status of <initialStatus>
And he has <initialStatusPoints> status points
When he earns <extraPoints> extra status points
Then he should have a status of <finalStatus>
| initialStatus | initialStatusPoints | extraPoints | finalStatus | notes                    |
| Bronze        | 0                   | 300         | Silver      | 300 points for Silver    |
| Silver        | 0                   | 700         | Gold        | 700 points for Gold      |
| Gold          | 0                   | 1500        | Platinum    | 1500 points for Platinum |

Thucydides lets you associate JBehave stories or JUnit tests with a JIRA card using the @issue meta tag (illustrated above), or the equivalent @Issue annotation in JUnit. At the most basic level, this will generate links back to the corresponding JIRA cards in your test reports, as illustrated here:


For this to work, Thucydides needs to know where your JIRA server. The simplest way to do this is to define the following properties in a file called in your project root directory:


You can also set these properties up in your Maven pom.xml file or pass them in as system properties.

Thucydides also supports two-way integration with JIRA. You can also get Thucydides to update the JIRA issue with a comment pointing to the corresponding test result.

Feature Coverage

But test results only report part of the picture. If you are using JIRA to store your stories and epics, you can use these to keep track of progress. But how do you know what automated acceptance tests have been implemented for your stories and epics, and, equally importantly, how do you know which stories or epics have no automated acceptance tests? In agile terms, a story cannot be declared “done” until the automated acceptance tests pass. Furthermore, we need to be confident not only that the tests exist, but they test the right requirements, and that they test them sufficiently well.

We call this idea of measuring the number (and quality) of the acceptance tests for each of the features we want to build “feature coverage”. Thucydides can provide feature coverage reporting in addition to the more conventional test results. If you are using JIRA, you will need to add thucydides-jira-requirements-provider to the dependencies section of your pom.xml file:


(The actual version number might be different for you – always take a look at Maven Central to know what the latest version is).

You will also need to add this dependency to the Thucydides reporting plugin configuration:


Now, when you run the tests, Thucydides will query JIRA to determine the epics and stories that you have defined, and list them in the Requirements page. This page gives you an overview of how many requirements (epics and stories) have passing tests (green), how many have failing (red) or broken (orange) tests, and how many have no tests at all (blue):


If you click on an epic, you can see the stories defined for the epic, including an indicator (in the “Coverage” column) of how well each story has been tested.


From here, you may want to drill down into the details about a given story, including what acceptance tests have been defined for this story, and whether they ran successfully:


Both JIRA and the JIRA-Thucydides integration are quite flexible. We saw earlier that we had configured a custom “Acceptance Criteria” field in our JIRA stories. We have displayed this custom field in the report shown above by including it in the file, like this:

jira.custom.field.1=Acceptance Criteria

Thuydides reads the narrative text appearing in this report (“As a frequent flyer…”) from the Descriptionfield of the corresponding JIRA card. We can override this behavior and get Thucydides to read this value from a different custom field using the jira.custom.narrative.field property. For example, some teams use a custom field called “User Story” to store the narrative text, instead of the Description field. We could get Thucydides to use this field as follows:

jira.custom.narrative.field=User Story


Thucydides has rich and flexible one and two-way integration with JIRA. Not only can you link back to JIRA story cards from your acceptance test reports and display information about stories from JIRA in the test reports, you can also read the requirements structure from JIRA, and report on which features have been tested, and which have not.

In the next article in this series, we will learn how to insert links to the Thucydides reports into the JIRA issues, and how to actively update the state of the JIRA cards based on the outcomes of your tests.

Want to learn more? Be sure to check out the Thucydides web site, the Thucydides Blog, or join theThucydides Google Users Group to join the discussion with other Thucydides users.

Wakaleo Consulting, the company behind Thucydides, also runs regular courses in Australia, London and Europe on related topics such as Agile Requirements GatheringBehaviour Driven DevelopmentTest Driven Development, and Automated Acceptance Testing.


Thucydides version 0.9.235 Released

A new version of Thucydides is out (version 0.9.235), with bug fixes and new features!

Bug fixes

The bug fixes include:

  • THUCYDIDES-226 and THUCYDIDES-224: You can now pass arbitrarily complex chrome switches in the ‘chrome.switches’ property, containing spaces, commas etc, e.g.
    –user-agent=Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B)AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 MobileSafari/535.19

  • THUCYDIDES-215 – Provided drivers can take screenshots
  • THUCYDIDES-225 – The webdriver.timeouts.implicitlywait system property now works to configure the timeout value of a PageObject.
  • THUCYDIDES-223 – You can now pass absolute path values in the thucydides.driver.capabilities system property.
  • Session data and step libraries are cleared between unit tests: A bug in previous versions of Thucydides meant that session data (accessed via the Thucydides.getCurrentSession() method) and step libraries were preserved between session states. This could occasionally cause problems, so session data is now cleared between each test in both JUnit and JBehave. This can be deactivated by setting the ‘thucydides.maintain.session’ property to true. Step libraries are now always reinitialized between scenarios or tests.

    THUCYDIDES-215 deserves some more detail. You can add your own custom WebDriver provider by implementing the DriverSource interface. First, you need to set up the following system properties (e.g. in your ‘’ file):

    webdriver.driver = provided
    webdriver.provided.type = mydriver
    webdriver.provided.mydriver = com.acme.MyPhantomJSDriver
    thucydides.driver.capabilities = mydriver

    Previously, it was hard to configure Thucydides to take screenshots using provided drivers. Now, you implement the DriverSource interface (as before), but with the new takesScreenshots() method:

    public class MyPhantomJSDriver implements DriverSource {
        public WebDriver newDriver() {
            try {
                DesiredCapabilities capabilities = DesiredCapabilities.phantomjs();
                // doesn't work :(
                capabilities.setCapability(CapabilityType.TAKES_SCREENSHOT, true);
                return new PhantomJSDriver(ResolvingPhantomJSDriverService.createDefaultService(),
            catch (IOException e) {
                throw new Error(e);
        public boolean takesScreenshots() {
            return true;

    This driver will now take screenshots normally.

    New Features

    And two cool new features:

    Custom messages for WebElementFacade assertions

    Normally, to check the state of a WebElementFacade, you do something like this:

    WebElementFacade myfield;

    But in this case, the error message was always the same. Now you can also do this:

    myField.expect("My field should be visible").shouldBeVisible();

    This will work for any of the "should"-style methods (shouldBeVisible, shouldContainText, etc.).

    Clever reuse of screenshots

    In previous versions, Thucydides recorded a different set of screenshots for each test run. This could lead to a lot of screenshots and the need for very large disks. Now, if screenshots are identical (i.e. if they have the same MD5 digest), the same file will be used.