Our latest release (0.9.95) brings the example reporting format changes (released last month for jBehave) to parametric junit tests. A few cosmetic changes have also been done for better organization of information and improved readability.
Let's look at these changes in detail.
As the screenshot above demonstrates, the test table on main report page reduces clutter by showing test results at a test-method level instead of a separate row for each parameter set.
The details page will list all parameter sets in a table. By default, the parameters are names "Parameter 1", "Parameter 2" and so on. But this can be configured with a comma separated list of column headings passed as an attribute to the @TestData annotation.
[sourcecode language="java"]
@TestData(columnNames = "Word,Definition")
public static Collection<Object[]> testData() {
return Arrays.asList(new Object[][]{
{"apple", "A common, round fruit"},
{"banana", "An elongated curved fruit"}
});
}
[/sourcecode]
Further, the steps section will show a collapsed view with a row for each parameter set. The
icon can be clicked to expand the top level step to reveal all the steps and corresponding screenshots. Failed test examples will be highlighted in red.
A new property firefox.preferences can be used to supply a semicolon separated list of Firefox configuration settings. For ex.,
-Dfirefox.preferences="browser.download.folderList=2;browser.download.manager.showWhenStarting=false;browser.download.dir=c:\downloads"
Integer and boolean values will be converted to the corresponding types in the Firefox preferences; all other values will be treated as Strings. You can set a boolean value to true by simply specifying the property name, e.g. -Dfirefox.preferences=app.update.silent.
For the lazy, here's a complete reference to Firefox's configuration settings - http://kb.mozillazine.org/Firefox_:_FAQs_:_About:config_Entries
Thucydides makes it possible to split the web tests into smaller batches, and to run each batch on a different machine or different virtual display. This is achieved by specifying two parameters when you run each build: the total number of batches being run (thucydides.batch.count), and the number of the batch being run in this build (thucydides.batch.number).
For example, the following will divide the test cases into 3 batches (thucydides.batch.count), and only run the first test in each batch (thucydides.batch.number):
mvn verify -Dthucydides.batch.count=3 -Dthucydides.batch.number=1
However, this strategy divides the test cases equally among batches. This could be inefficient if some of your test cases have more tests than others. This release adds a new batching strategy based on number of tests in the test cases. The strategy is implemented with the help of a TestCountBasedBatchManager which evenly distributes test cases across batches based on number of test methods in each test case.
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.