commit 4e4e7ee5fd9e03f786ce820e8752c7074837ed83
Author: Tigrenka <[email protected]>
AuthorDate: Thu, 7 Nov 2013 01:15:21 +0300
Commit: Mauro Talevi <[email protected]>
CommitDate: Fri, 8 Nov 2013 08:27:46 +0100
JBEHAVE-433: Added invocation for scenario type EXAMPLE in
WebDriverScreenshotOnFailure.
diff --git
a/web-selenium/src/main/java/org/jbehave/web/selenium/WebDriverScreenshotOnFailure.java
b/web-selenium/src/main/java/org/jbehave/web/selenium/WebDriverScreenshotOnFailure.java
index 306ed65..c6b7fcf 100644
---
a/web-selenium/src/main/java/org/jbehave/web/selenium/WebDriverScreenshotOnFailure.java
+++
b/web-selenium/src/main/java/org/jbehave/web/selenium/WebDriverScreenshotOnFailure.java
@@ -5,6 +5,7 @@ import java.text.MessageFormat;
import java.util.UUID;
import org.jbehave.core.annotations.AfterScenario;
import org.jbehave.core.annotations.AfterScenario.Outcome;
+import org.jbehave.core.annotations.ScenarioType;
import org.jbehave.core.failures.PendingStepFound;
import org.jbehave.core.failures.UUIDExceptionWrapper;
import org.jbehave.core.reporters.StoryReporterBuilder;
@@ -34,7 +35,12 @@ public class WebDriverScreenshotOnFailure extends
WebDriverSteps {
this.screenshotPathPattern = screenshotPathPattern;
}
- @AfterScenario(uponOutcome = Outcome.FAILURE)
+ @AfterScenario(uponType = ScenarioType.EXAMPLE, uponOutcome =
Outcome.FAILURE)
+ public void afterScenarioWithExamplesFailure(UUIDExceptionWrapper
uuidWrappedFailure) throws Exception {
+ afterScenarioFailure(uuidWrappedFailure);
+ }
+
+ @AfterScenario(uponType = ScenarioType.NORMAL, uponOutcome =
Outcome.FAILURE)
public void afterScenarioFailure(UUIDExceptionWrapper uuidWrappedFailure)
throws Exception {
if (uuidWrappedFailure instanceof PendingStepFound) {
return; // we don't take screen-shots for Pending Steps