Skip to content

Posts from the ‘News’ Category

9
Mar

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!

Advertisements
10
Jul

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
    StepEventBus.getEventBus().getCurrentStep()
  • 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)

Enjoy!

7
Mar

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 ‘thucydides.properties’ 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 {
    
        @Override
        public WebDriver newDriver() {
            try {
                DesiredCapabilities capabilities = DesiredCapabilities.phantomjs();
    
                // doesn't work :(
                capabilities.setCapability(CapabilityType.TAKES_SCREENSHOT, true);
    
                return new PhantomJSDriver(ResolvingPhantomJSDriverService.createDefaultService(),
                        capabilities);
            }
            catch (IOException e) {
                throw new Error(e);
            }
        }     
    
    	@Override
        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:

    @FindBy(css=".whatever")
    WebElementFacade myfield;
    ...
    myField.shouldBeVisible();

    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.

29
Jan

Thucydides Release 0.9.94 – More improvements to reports and some bug fixes


We released version 0.9.94 of Thucydides over the weekend.

Improved reports home page

Reports home page now shows two pie charts, one with the overall tests count and another with the test count weighted by number of steps.

Screen Shot 2013-01-30 at 6.27.24 AM

 

 

 

Screen Shot 2013-01-30 at 6.27.33 AM

 

 

The first pie chart gives an overall status of the tests as it shows how many tests have passed, failed or are still pending. The second pie-chart gives the test status weighted by number of steps which could be used to deduce the nature/criticality of test failures.

There are also some minor improvements to the requirements reporting page.

Updated Selenium version to 2.29.0

Selenium version has been updated to 2.29.0 (Selenium Release notes)

Minor enhancements and bug Fixes

  • #Thucydides-122: Added thucydides.verbose.steps property, that provides more detailed logging of WebElementFacade steps.
  • #Thucydides-125: Fixed a bug that caused reports to fail for parameterized tests with new line characters in the test data.
  • #Thucydides-130: Fixed a bug due to which PageObject.upload was not working for files on classpath.
17
Jan

Thucydides Release 0.9.92 – Improved Requirements reporting, screenshot blurring and bug fixes


Release 0.9.92 is now available and contains the following enhancements:

Improved requirements reporting

The Requirements reporting tab has been enhanced to show test results at a requirements level. This provides an overall view of the progress of the project by making it easier to view not only what stories have been implemented, but also features and capabilities that remain to be done. Here’s a screenshot.

Requirements Reporting tab

Requirements Reporting tab

You can read more about Thucydides’ approach to requirements reporting in this excellent blog post – Functional Test Coverage – Taking BDD Reporting To The Next Level

Blurring screenshots (Thucydides-116)

For security/privacy reasons, it may be required to blur sensitive screenshots in Thucydides reports. This is now possible by annotating the test methods or steps with the annotation @BlurScreenshots. When defined on a test, all screenshots for that test will be blurred. When defined on a step, only the screenshot for that step will be blurred. @BlurredScreenshot takes a string parameter with values LIGHT, MEDIUM or HEAVY to indicate the amount of blurring. For example,

 @Test
 @BlurScreenshots("HEAVY")
 public void looking_up_the_definition_of_pineapple_should_display_the_corresponding_article() {
     endUser.is_the_home_page();
     endUser.looks_for("pineapple");
     endUser.should_see_definition_containing_words("A thorny fruit");
 }

This feature is currently available for junit stories but we’ll extend it shortly to jbehave and easyb.

Other enhancements and bug fixes

  • Uninstantiated page objects in step libraries are now automatically instantiated.
  • Fixed a bug that caused tests to wait unnecessarily in subsequent steps after a step had failed.
  • A custom requirements tag provider, if specified, will be given preference over the default file system based requirements provider.

Keep watching this space for more updates and announcements.

4
Jan

Thucydides Release 0.9.90 – Improved reporting format for jBehave data-driven tests


Improved jBhave examples reporting

Our latest release (0.9.90) introduces a more user friendly report format for data-driven (example-driven) jBehave tests.

The following screenshots will explain the changes in detail.

All examples are displayed in a table.

All examples are displayed in a table on top.


The top level step shows example data for easy reference

The top level step shows example data for easy reference.


Error Steps are highlighted in red for easy identification.

Error Steps are highlighted in red for easy identification.


Currently, this feature is available only for jBehave tests but will soon be integrated with jUnit and easyb tests as well.

Support for iPhone and Android Selenium web drivers

Basic support for iPhone and Android web drivers is now available in Thucydides. Set the property webdriver.driver to ‘iPhone’ or ‘Android’ when running your tests.

Bug Fixes

  • Thucydides-117: Fixed a regression defect that had caused thucydides.take.screenshots to break in the previous release.

19
Dec

Thucydides Release 0.9.88 – jBehave archetype, improved jBehave Integration and other enhancements


Another spanking new release (0.9.88) of Thucydides is out now.  Some of the highlights of this release are as follows:

New jBehave Maven archetype

A new archetype for jBehave is now available to help jumpstart a Thucydides jBehave project. Here’s an example of how to create a sample project with this archetype.

mvn archetype:generate -DarchetypeGroupId=net.thucydides -DarchetypeArtifactId=thucydides-jbehave-archetype -DgroupId=com.testing.app -DartifactId=SampleJBehaveProject

Improved jBehave integration

  • All web tests can now be run in a single browser using either the thucydides.use.unique.browser system property or programmatically using runThucydides().inASingleSession() inside the junit runner.
  • Thucydides-115: Fixed a bug due to which JBehave environment properties such as metafilter and ignore.failue.in.stories etc. were not getting set on the configured Embedder.
  • Added support for the thucydides.restart.browser.frequency system property, which restarts the browser periodically for data-driven tests. This is helpful as firefox may sometimes hang after too many data-driven tests.

Other enhancements

  • Thucydides-112: Added a new property, thucydides.locator.factory  to override the default locator factory with another locator factory (for ex., AjaxElementLocatorFactory or DefaultElementLocatorFactory). By default, Thucydides uses a custom locator factory called DisplayedElementLocatorFactory.
  • You can now set custom web driver capabilities by passing a semi-colon separated list of capabilities in the property thucydides.driver.capabilities. For example,
    "build:build-1234; max-duration:300; single-window:true; tags:[tag1,tag2,tag3]"
  • Added new system property, security.enable_java to enable java support in Firefox browser. This is disabled by default as this slows down the web driver.

Bug Fixes

  • Thucydides-86: Fixed a bug that caused tests with pending steps to fail if a subsequent step called a public non-step method.
  • Thucydides-110: Removed the extra dot from system property webdriver.remote. and renamed it to webdriver.remote.driver
  • Thucydides-100: Fixed a bug due to which Requirements Tab in Thucydides Report was not correctly generated when running Thucydides tests in sub-module of a Maven multi-module project. A new property, thucydides.test.requirements.basedir can now be used to specify the base directory fo the sub module where the acceptance tests are kept.
29
Nov

Thucydides Release 0.9.77 – Finer control on screenshots management


We have released another version of Thucydides today. Release 0.9.77 contains the following features and bug fixes:

Finer screenshots control (Thucydides-105)

Whenever a step is executed, Thucydides saves a screenshot which is displayed in the report. In order to manage disk space better, some users require finer control on when and how many screenshots are generated and stored. Thucydides provided some support for this in the past by allowing users to set the properties thucydides.only.save.failing.screenshots for saving screenshots for only failed steps and thucydides.verbose.screenshots for saving screenshots at every web element action (like click(), typeAndEnter(), type(), typeAndTab() etc.).

In the latest release, these properties are deprecated and replaced with a new property thucydides.take.screenshots which can have the following values:

  • FOR_EACH_ACTION : Similar to thucydides.verbose.screenshots
  • BEFORE_AND_AFTER_EACH_STEP,
  • AFTER_EACH_STEP, and
  • FOR_FAILURES : Similar to thucydides.only.save.failing.screenshots

An even more granular level of control is now possible using annotations. You can annotate any test or step method (or any method used by a step or test) with the @Screenshots annotation to override the number of screenshots taken within this step (or sub-step). Some sample uses are shown here:

@Step
@Screenshots(onlyOnFailures=true)
public void screenshots_will_only_be_taken_for_failures_from_here_on() {…}

@Test
@Screenshots(forEachStep=true)
public void should_take_screenshots_for_each_step_in_this_test() {…}

@Test
@Screenshots(forEachAction=true)
public void should_take_screenshots_for_each_action_in_this_test() {…}

Other minor Bug fixes

  • Thucydides-89 : Fixed problem with tests failing randomly on Windows while building Thucydides.
  • Thucydides-96 : Fixed a bug that caused tests annotated with @WithDriver(“firefox”) to open in Internet Explorer browser.
  • Thucydides-108: Fixed a bug that caused Stories and Feature links on All Available tags section of Dashboard (report) to not work due to broken links.
25
Nov

Thucydides Release 0.9.75 – Bug fixes, improvements and more…


Release 0.9.75 is now available to download and includes the following improvements:

Support for Safari webdriver

Safari webdriver is now supported: just set the webdriver.driver property to “safari”. Make sure you follow the instructions here to install the Selenium SafariDriver extension first.

Support for FluentLenium (experimental)

This release also brings the awesomeness of FluentLenium‘s fluent API to Thucydides. The best way to use FluentLenium within Thucydides is to use ThucydidesFluentAdapter which is available in PageObject. Here’s an example of the same PageObject written in the traditional style and with FluentLenium.

Traditional style:

import ch.lambdaj.function.convert.Converter;
import net.thucydides.core.annotations.DefaultUrl;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

import net.thucydides.core.pages.PageObject;

import java.util.List;

import static ch.lambdaj.Lambda.convert;

@DefaultUrl("http://en.wiktionary.org/wiki/Wiktionary:Main_Page")
public class DictionaryPage extends PageObject {

    @FindBy(name="search")
    private WebElement searchTerms;

    @FindBy(name="go")
    private WebElement lookupButton;

    public DictionaryPage(WebDriver driver) {
        super(driver);
    }

    public void enter_keywords(String keyword) {
        element(searchTerms).type(keyword);
    }

    public void lookup_terms() {
        element(lookupButton).click();
    }

    public List getDefinitions() {
        WebElement definitionList = getDriver().findElement(By.tagName("ol"));
        List results = definitionList.findElements(By.tagName("li"));
        return convert(results, toStrings());
    }

    private Converter<WebElement, String> toStrings() {
        return new Converter<WebElement, String>() {
            public String convert(WebElement from) {
                return from.getText();
            }
        };
    }
}

and with FluentLenium…

import ch.lambdaj.function.convert.Converter;
import net.thucydides.core.annotations.DefaultUrl;
import net.thucydides.core.pages.PageObject;
import org.fluentlenium.core.domain.FluentList;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

import java.util.List;

import static ch.lambdaj.Lambda.convert;
import static org.fluentlenium.core.filter.FilterConstructor.withName;

@DefaultUrl("http://en.wiktionary.org/wiki/Wiktionary:Main_Page")
public class FluentDictionaryPage extends PageObject {

    public FluentDictionaryPage(WebDriver driver) {
        super(driver);
    }

    public void enter_keywords(String keyword) {
        fluent().fill("input", withName("search")).with(keyword);
    }

    public void lookup_terms() {
        fluent().click("input", withName("go"));
    }

    public List getDefinitions() {
        FluentList results = fluent().findFirst("ol").find("li");
        return results.getTexts();
    }
}

A special shout-out to MathildeLemee for helping with the integration.

Shortcut for the element() method

Another new experimental feature introduces the ability to replace the commonly-used element() method with ‘$’, as illustrated in the following examples:

    ...
    @FindBy(name="search")
    private WebElement searchTerms;

    @FindBy(name="go")
    private WebElement lookupButton;

    public DictionaryPage(WebDriver driver) {
        super(driver);
    }

    public void enter_keywords(String keyword) {
        $(searchTerms).type(keyword);
    }

    public void lookup_terms() {
        $(lookupButton).click();
    }

    public void click_on_article(int articleNumber) {
        $("//section[@id='searchResults']/article[" + articleNumber + "]//a").click();
    }

    public String getHeading() {
        return $("section>h1").getText()
    }
}

Bug fixes

  • #Thucydides-93: PageObject.containsText() now returns true only if the text is visible on the page. Earlier this method returned true even if the text was not visible (for example, if CSS property display:none was set)
  • #Thucydides-99: The screenshots names now use SHA instead of MD5 for hashing to prevent name collision in some situations.
  • #Thucydides-106: Fixed SLF4J binding issue.

As usual, we encourage you to get in touch via this blog, our mailing lists or Jira tracker for any queries or comments.

15
Aug

Thucydides Release 0.9.12 – jBehave Integration


A new update to Thucydides was just released – Release 0.9.12.  This release integrates a popular BDD framework, jBehave, with Thucydides.

jBehave Integration

jBehave is one of the most widely used BDD frameworks in Java.  Our latest release lets you define user stories in jBehave. These stories can then be implemented using Thucydides step libraries. When the stories are run, Thucydides will provide a rich set of reports that help you see how the stories are progressing. To learn more, check out the Writing Acceptance Tests with JBehave section of the documentation.

Other minor enhancements and fixes

  • Jira issues can now be specified using both full and abbreviated JIRA links (e.g. MYPROJECT-123 and #123).
  • Multiple file paths can now be specified in the @UseTestDataFrom annotation for data driven tests. Earlier, this annotation supported only a single path. You can now specify several paths (separated by the usual path separators – colon, semi-colon or comma).
  • Reports now open Jira links in a new window or tab.
  • The HtmlTable class can now be used to read tables without headers (i.e., <th> elements) . Earlier  this was not possible.  But you can now specify your won headings using the new withColumnsmethod. For example,
    List<Map<Object, String>> tableRows =
                        HtmlTable.withColumns("First Name","Last Name", "Favorite Colour")
                                 .readRowsFrom(page.table_with_no_headings);

Thucydides is a very active project with frequent releases. Keep watching this space for more announcements. Meanwhile, if you have any queries, shoot us an email using the official mailing list or report a bug in Jira.