Skip to content

Commit

Permalink
Merge branch 'master' of github.com:serenity-bdd/serenity-core
Browse files Browse the repository at this point in the history
  • Loading branch information
wakaleo committed Nov 19, 2015
2 parents d4791cd + 52c707b commit 213548e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
boolean beforeAndAfterEachStep() default true;
boolean afterEachStep() default false;
boolean forEachAction() default false;
boolean disabled() default false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ private Optional<TakeScreenshots> methodOverride() {
}

private TakeScreenshots screenshotLevelFrom(Screenshots screenshots) {
if (screenshots.onlyOnFailures()) {
if (screenshots.disabled()) {
return TakeScreenshots.DISABLED;
} else if (screenshots.onlyOnFailures()) {
return TakeScreenshots.FOR_FAILURES;
} else if (screenshots.forEachAction()) {
return TakeScreenshots.FOR_EACH_ACTION;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ public enum TakeScreenshots {
FOR_EACH_ACTION,
BEFORE_AND_AFTER_EACH_STEP,
AFTER_EACH_STEP,
FOR_FAILURES
FOR_FAILURES,
DISABLED
}
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,13 @@ class WhenDecidingWhetherToTakeScreenshots extends Specification {
assert permissions.areAllowed(TakeScreenshots.FOR_FAILURES)
assert !permissions.areAllowed(TakeScreenshots.FOR_EACH_ACTION)
}

@Screenshots(disabled = true)
public void shouldNotTakeScreenshots(Configuration configuration) {
ScreenshotPermission permissions = new ScreenshotPermission(configuration)
assert !permissions.areAllowed(TakeScreenshots.FOR_EACH_ACTION)
assert !permissions.areAllowed(TakeScreenshots.BEFORE_AND_AFTER_EACH_STEP)
assert !permissions.areAllowed(TakeScreenshots.AFTER_EACH_STEP)
assert !permissions.areAllowed(TakeScreenshots.FOR_FAILURES)
}
}

0 comments on commit 213548e

Please sign in to comment.