File tree 1 file changed +12
-7
lines changed
allure-robotframework/src/listener
1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change 8
8
class allure_testplan (SuiteVisitor ):
9
9
def __init__ (self ):
10
10
self .testplan = get_testplan ()
11
+ self .allure_ids = [test ["id" ] for test in self .testplan ] if self .testplan else []
12
+ self .selectors = [test ["selector" ] for test in self .testplan ] if self .testplan else []
11
13
12
14
def start_suite (self , suite ):
13
15
if self .testplan :
14
- # included_tests = [test["selector"] for test in self.testplan]
15
- included_tests = self .included_tests (suite )
16
- if included_tests :
17
- suite .filter (included_tests = self .included_tests (suite ))
16
+ suite .tests = self .included_tests (suite )
18
17
19
18
def included_tests (self , suite ):
20
19
included_tests = []
20
+
21
21
for test in suite .tests :
22
22
allure_id = None
23
23
for label in allure_labels (test .tags ):
24
24
if label .name == LabelType .ID :
25
25
allure_id = str (label .value )
26
- if allure_id and any ([allure_id == item .get ("id" , None ) for item in self .testplan ]):
27
- included_tests .append (test .name )
26
+ if allure_id and allure_id in self .allure_ids :
27
+ included_tests .append (test )
28
+ elif test .longname in self .selectors :
29
+ included_tests .append (test )
30
+
31
+ return included_tests
28
32
29
- return included_tests or [test ["selector" ] for test in self .testplan ]
33
+ def end_suite (self , suite ):
34
+ suite .suites = [s for s in suite .suites if s .test_count > 0 ]
You can’t perform that action at this time.
0 commit comments