Given I have the following class (See Parallelized Runner for more information on parallel runs):
@RunWith(Parallelized.class)
public class TopicTest {
String topic;
public TopicTest(String topic) {
this.topic = topic;
}
@Test
public void testTopicPage() {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.mysite.com/topics/" + topic + "/");
TopicPage topicPage = PageFactory.initElements(driver, TopicPage.class);
Assert.assertTrue("No items were located on this topic page <" + topic + ">", topicPage.elementsFound());
driver.quit();
}
@Parameters
public static Collection<Object []> topics() {
List<Object []> parameters = new ArrayList<Object []>();
for(String s : new String [] { "topic1", "topic2", "invalidTopic" }) {
parameters.add(new Object [] { s });
}
return parameters;
}
public static class TopicPage {
@FindBy(className = "result-set-a")
private List<WebElement> items;
public boolean elementsFound() {
return items != null && items.size() > 0;
}
}
}
Is there anyway that I can get more information out of my test run other than pass / fail status? I can get the following information on my failed runs due to the assertion error:
junit.framework.AssertionFailedError: No recipes were located on this topic page <invalidTopic>
Is there a way that I could get more information out from our passing tests for reporting purposes?