-
Notifications
You must be signed in to change notification settings - Fork 405
Expand file tree
/
Copy pathReducingMethod.java
More file actions
81 lines (75 loc) · 3.08 KB
/
ReducingMethod.java
File metadata and controls
81 lines (75 loc) · 3.08 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package net.masterthought.cucumber.reducers;
/**
* Supported reducing methods.
* This list contains supported methods that allow to modify the way how reports are displayed.
*
* @author Damian Szczepanik (damianszczepanik@github)
*/
public enum ReducingMethod {
/**
* Merge features with different JSON files that have same ID so scenarios are be stored in single feature.
*/
MERGE_FEATURES_BY_ID,
/**
* Merge features and scenarios from different JSON files of different runs
* into a single report by features' and scenarios' ids.
*
* Merging rules:
* - Every new feature which is not in the result list is appended to the end.
*
* - When the results list already has a feature with such Id then we go down and apply the rules below to the scenarios:
*
* 1. if there is no scenario with a given Id in the feature's elements list
* then add the scenario to the end of the list.
*
* 2. if there are no scenario with a background (which is a previous element in the elements list)
* then both elements are added to the end of the current feature's elements list.
* As the feature file has a structure like:
* {
* elements: [
* {
* name: ...
* type: "background";
* },
* {
* name: ...
* type: "scenario";
* },
* {
* name: ...
* type: "background";
* },
* {
* name: ...
* type: "scenario";
* }
* ....
* ]
* }
*
* 3. if there is a scenario with a given Id then:
* scenario + background case: replace both elements (existing element with Id and its background with new ones)
* scenario only: replace only given scenario by index in the array.
*
* Example:
* Original cucumber report is "cucumber.json". Let's look a situation when couple of tests failed there.
* Cucumber runner generates a new report, for example, cucumber-rerun.json as a result of rerun the failed tests.
*
* In that case you will have a merged report where all failed tests from the original cucumber.json file
* are overridden with the results from the cucumber-rerun.json.
*/
MERGE_FEATURES_WITH_RETEST,
/**
* Skip empty JSON reports. If this flag is not selected then report generation fails on empty file.
*/
SKIP_EMPTY_JSON_FILES,
/**
* Does not display hooks (@Before and @After) which do not have attachment or error message.
*/
HIDE_EMPTY_HOOKS,
/**
* Keep only the very latest scenario runs. This is useful in situations where you did retries of a
* flaky scenario and the subsequent attempt(s) passed. In this case you will want to disregard the first few failures.
*/
KEEP_ONLY_LATEST_SCENARIO_RUNS
}