com.atlassian.webdriver.testing.rule
Class WebDriverScreenshotRule

java.lang.Object
  extended by org.junit.rules.TestWatcher
      extended by com.atlassian.webdriver.testing.rule.WebDriverScreenshotRule
All Implemented Interfaces:
org.junit.rules.TestRule

public class WebDriverScreenshotRule
extends org.junit.rules.TestWatcher

A rule for taking screen-shots when a WebDriver test fails. It will also dump the html source of the page to the target/webDriverTests directory.

Since:
2.1

Constructor Summary
  WebDriverScreenshotRule()
           
  WebDriverScreenshotRule(com.google.common.base.Supplier<? extends org.openqa.selenium.WebDriver> driverSupplier)
           
  WebDriverScreenshotRule(com.google.common.base.Supplier<? extends org.openqa.selenium.WebDriver> driverSupplier, File artifactDir)
           
  WebDriverScreenshotRule(org.openqa.selenium.WebDriver webDriver)
           
  WebDriverScreenshotRule(WebDriverDebug webDriverDebug)
           
protected WebDriverScreenshotRule(WebDriverDebug webDriverDebug, File artifactDir)
           
protected WebDriverScreenshotRule(WebDriverSupport<? extends org.openqa.selenium.WebDriver> support, File artifactDir)
           
 
Method Summary
protected  void failed(Throwable e, org.junit.runner.Description description)
           
protected  void starting(org.junit.runner.Description description)
           
 
Methods inherited from class org.junit.rules.TestWatcher
apply, finished, skipped, succeeded
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebDriverScreenshotRule

protected WebDriverScreenshotRule(@Nonnull
                                  WebDriverDebug webDriverDebug,
                                  @Nonnull
                                  File artifactDir)

WebDriverScreenshotRule

protected WebDriverScreenshotRule(@Nonnull
                                  WebDriverSupport<? extends org.openqa.selenium.WebDriver> support,
                                  @Nonnull
                                  File artifactDir)

WebDriverScreenshotRule

public WebDriverScreenshotRule(@Nonnull
                               com.google.common.base.Supplier<? extends org.openqa.selenium.WebDriver> driverSupplier,
                               @Nonnull
                               File artifactDir)

WebDriverScreenshotRule

public WebDriverScreenshotRule(@Nonnull
                               com.google.common.base.Supplier<? extends org.openqa.selenium.WebDriver> driverSupplier)

WebDriverScreenshotRule

public WebDriverScreenshotRule(@Nonnull
                               org.openqa.selenium.WebDriver webDriver)

WebDriverScreenshotRule

@Inject
public WebDriverScreenshotRule(@Nonnull
                                      WebDriverDebug webDriverDebug)

WebDriverScreenshotRule

public WebDriverScreenshotRule()
Method Detail

starting

protected void starting(@Nonnull
                        org.junit.runner.Description description)
Overrides:
starting in class org.junit.rules.TestWatcher

failed

protected void failed(@Nonnull
                      Throwable e,
                      @Nonnull
                      org.junit.runner.Description description)
Overrides:
failed in class org.junit.rules.TestWatcher


Copyright © 2014 Atlassian. All rights reserved.