public class TestDebugger
extends org.junit.rules.TestWatcher
PageObjectSuite
, there's only a
single file generated and it's only generated when all tests have finished executing. Thus if a test hangs there
won't be any file generated and looking at the Jenkins UI it won't be possible to see which tests have executed.
Normally each JUnit Test Runner knows what test is executing and when it's finished and thus can report them in its own console (as this is the case for IDEs for example). Again the issue here is that Jenkins doesn't have any JUnit Test Runner but instead is calling JUnit by delegation to the Maven Surefire plugin.
Constructor and Description |
---|
TestDebugger(org.openqa.selenium.WebDriver driver)
Creates a new test rule that generates debugging information on test failure.
|
Modifier and Type | Method and Description |
---|---|
protected void |
failed(Throwable e,
org.junit.runner.Description description) |
protected void |
starting(org.junit.runner.Description description) |
protected void |
succeeded(org.junit.runner.Description description) |
void |
takeScreenshot(String testName)
Captures a screenshot of the browser window.
|
public TestDebugger(org.openqa.selenium.WebDriver driver)
driver
- the object used to get the debugging information on test failureprotected void starting(org.junit.runner.Description description)
starting
in class org.junit.rules.TestWatcher
protected void succeeded(org.junit.runner.Description description)
succeeded
in class org.junit.rules.TestWatcher
protected void failed(Throwable e, org.junit.runner.Description description)
failed
in class org.junit.rules.TestWatcher
public void takeScreenshot(String testName)
testName
- the name of the file in which the screenshot will be taken. A ".png" suffix will be appendedCopyright © 2004–2021 XWiki. All rights reserved.