File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
allure-robotframework/src/listener Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change 88class allure_testplan (SuiteVisitor ):
99 def __init__ (self ):
1010 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 []
1113
1214 def start_suite (self , suite ):
1315 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 )
1817
1918 def included_tests (self , suite ):
2019 included_tests = []
20+
2121 for test in suite .tests :
2222 allure_id = None
2323 for label in allure_labels (test .tags ):
2424 if label .name == LabelType .ID :
2525 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
2832
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