Skip to content

Archive for

26
May

Thucydides Release 0.8.20 – More simplified tagging


We think tagging is such a useful feature that we simplified it further in our latest release (Release 0.8.20) by creating the following convenient annotations for junit tests:

@WithTag("feature:my feature")

will create a feature tag called my feature. This is a short cut for

@WithTag(name="my feature", type="feature")

In fact, feature tags are so common that we even decided to make feature the default tag type. In other words, the following line is equivalent to the above:

@WithTag("my feature")

Perhaps even more useful is the new @WithTagValuesOf annotation which is a more expressive alternative to the @WithTags notation. For example,

@WithTags (
        {
                @WithTag(name="lookups", type="feature"),
                @WithTag(name="release-2", type="release")

        }
)

can now be more succinctly written as

@WithTagValuesOf({"lookups", "release:release-2"})

Release 0.8.20 also addresses the following minor bugs and enhancements

  • The history chart now uses jqplot instead of Google charts. This means the history charts can now be viewed offline too.
  • (#Thucydides-70) : Upper case parameters in parametrized tests will not cause broken links in the test reports.
  • The report files now use hash codes instead of names to avoid problems with very long file names.

Keep watching this space for more features and improvements to Thucydides.


											
15
May

Thucydides Release 0.8.15 – Adding tag support to easyb stories


Thucydides Release 0.8.15 is now out. This release brings tagging support to Thucydides easyb stories.

Tag support for easyb stories

You can now group your easyb stories by adding tags in the form of thucydides.tests.<group> to the stories. For example,

thucydides.tests.feature "history reports"
thucydides.tests.epic "reporting"
thucydides.tests.epic "audit"
thucydides.tests.priority "high"

… and so on. A story tag is added to all stories by default. Tag groups are dynamic and you can add as many groups as you wish.

This will enable you to group the stories by the tags in Thucydides reports. Each “group” will appear as a separate tab in the reports. In the above case, the tags will appear in the reports as follows.

Tags are also supported in Junit tests using the @WithTag and @WithTags annotations. The following will create a feature tag called lookups and a release tag called release-2.

@WithTags (
        {
                @WithTag(name="lookups", type="feature"),
                @WithTag(name="release-2", type="release")

        }
)

Customize names of step libraries in easyb stories

easyb now supports the ability to customize the step library name in a story. Example:

thucydides.user_steps_from BuyerSteps 
thucydides.uses_steps_named("bob").from BuyerSteps

scenario "List all the ads in the 'Garden and Plants' category", {
    given "Bob is looking for a second-hand shovel", {
        bob.opens_home_page()
    }
    when "he selects the 'Garden and Plants' ad category", {
        bob.chooses_category_classification "Garden & Plants"
    }
    then "he should see a list of ads relating to Garden and Plants", {
        bob.should_see_search_results_for "Garden & Plants"
    }
}

Other minor changes and bug fixes

  • If no thucydides.project.key property is provided, the current working directory will be used instead. So if your project is in a directory called
    /home/jill/projects/mykillerap, the default project id will be mykillerap. This avoids a lot of messy configuration in your build script to pass the project key to JUnit/easyb etc.
  • Test statistics reports now use previous 10 tests instead of 5 to calculate test stability.

 

Your feedback and suggestions are welcome. Please use the official issue tracker or mailing list to get in touch.

3
May

Thucydides Release 0.8.8 – A more fluent API for Page Objects


We released a new version of Thucydides (0.8.8) yesterday with an exciting new feature and some bug fixes. Here’s a list of what went in.

A fluent API for Page objects

The Page Object API has been enhanced for a more readable, fluent interface with new methods like ‘find’, ‘findBy’ , ‘then’ and ‘waitFor’ etc.

For example, you can use webdriver ‘By’ finders as follows:

page.find(By.name("demo")).then(By.name("specialField")).getValue();

or

page.findBy("#demo").then("#specialField").getValue();

The new method ‘waitFor’ and its derivatives ‘waitForPresenceOf’ and ‘waitForAbsenceOf’ offer more concise and expressive alternatives to the existing wait methods. These methods take a String argument representing the xpath or css selector and can be used as follows:

page.waitFor("#city");
page.waitForPresenceOf("#firstname");

Other changes and Bug Fixes

  • Performance improvement: screenshots are now written to the disk in the background, so as not to slow down the tests.
  • (#THUCYDIDES-61) You can now define Thucydides properties in a thucydides.properties file in the working directory.
  • (#THUCYDIDES-60) A new system option, ‘thucydides.jquery.integration’, has been added to deactivate JQuery integration.
  • (#THUCYDIDES-59) Duplicated screen shots are now removed.
  • (#THUCYDIDES-57)  If there are two or more consecutive steps with the same name, second and next screen shots were not presented in the report due to this bug. Now there will be at least one screen shot for each step.
  • (#THUCYDIDES-56) Added the withActions() method to the PageObject class to support the WebDriver Actions API. You can also invoke WebDriver Actions directly e.g.,
    Actions builder = new Actions(page.getDriver());
    builder.moveToElement(page.firstName).perform();
  • (#THUCYDIDES-55) You can now call the JavascriptExecutorFacade directly with the driver obtained from the PageObject class e.g.,
    	
    JavascriptExecutorFacade js = new JavascriptExecutorFacade(page.getDriver());
    js.executeScript("$('#firstname').focus();");

    The executeScript() method also supports passing parameters to the Javascript function

  • (#THUCYDIDES-53) Fixed a bug that was causing report files to get split in two directories  when maven “build directory” was changed.
  • (#THUCYDIDES-54) Fixed NullpointerException in Android emulator.
  • (#THUCYDIDES-50) A minor bug with inconsistent naming of reports for data driven tests has been fixed.
  • (#THUCYDIDES-13,15) All tests in a given unit test now run in a single browser session.
  • Statistics are now tied to a project, so that multiple projects can be logged in the same database.

Let us know how the changes look.