-
Notifications
You must be signed in to change notification settings - Fork 47
/
AfterScenario.java
39 lines (35 loc) · 1.43 KB
/
AfterScenario.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*----------------------------------------------------------------
* Copyright (c) ThoughtWorks, Inc.
* Licensed under the Apache License, Version 2.0
* See LICENSE.txt in the project root for license information.
*----------------------------------------------------------------*/
package com.thoughtworks.gauge;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Methods annotated with this hook, execute after every scenario execution completes.
* The scenario can be filtered by passing additional attributes.
* <p>
* If there is more than one method annotated with @AfterScenario, the order of execution is as follows:
* <ul>
* <li>Hooks which are not filtered by tags.
* <li>Hooks filtered by tags.
* </ul>
* If there is more than one hook of these categories, they are executed in reverse alphabetical order based on method names.
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface AfterScenario {
/**
* @return Array of tags to filter which scenarios the hook runs after.
*/
String[] tags() default {};
/**
* @return OR: if hook should run for a scenario containing any of the tags provided
* AND: if hook should run for a scenario containing all of the tags provided
* Default is AND
*/
Operator tagAggregation() default Operator.AND;
}