Class HarRecorder
- java.lang.Object
-
- org.junit.rules.TestWatcher
-
- org.jenkinsci.test.acceptance.recorder.HarRecorder
-
- All Implemented Interfaces:
org.junit.rules.TestRule
@GlobalRule public class HarRecorder extends org.junit.rules.TestWatcher
The system property RECORD_BROWSER_TRAFFIC can be set to either off, failuresOnly or always to control when browser traffic should be recorded when launching tests. Traffic is recorded as a HAR (HAR file format) file based on all network interactions between the browser and the Jenkins instance and then add it as JUnit attachment to the test result.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HarRecorder.State
-
Constructor Summary
Constructors Constructor Description HarRecorder(FailureDiagnostics diagnostics)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
failed(Throwable e, org.junit.runner.Description description)
static com.browserup.bup.BrowserUpProxy
getProxy(InetAddress networkAddress, String testName)
Create a proxy to record the HAR listening on the specified addressstatic boolean
isCaptureHarEnabled()
protected void
starting(org.junit.runner.Description description)
protected void
succeeded(org.junit.runner.Description description)
-
-
-
Constructor Detail
-
HarRecorder
@Inject public HarRecorder(FailureDiagnostics diagnostics)
-
-
Method Detail
-
getProxy
public static com.browserup.bup.BrowserUpProxy getProxy(InetAddress networkAddress, String testName)
Create a proxy to record the HAR listening on the specified address- Parameters:
networkAddress
- the specific address to bind to, ornull
to bind on all addresses
-
isCaptureHarEnabled
public static boolean isCaptureHarEnabled()
-
succeeded
protected void succeeded(org.junit.runner.Description description)
- Overrides:
succeeded
in classorg.junit.rules.TestWatcher
-
failed
protected void failed(Throwable e, org.junit.runner.Description description)
- Overrides:
failed
in classorg.junit.rules.TestWatcher
-
starting
protected void starting(org.junit.runner.Description description)
- Overrides:
starting
in classorg.junit.rules.TestWatcher
-
-