Skip to content

Commit 17154da

Browse files
authored
robot framework skipped tests (via #392)
2 parents 3122776 + 70e45f7 commit 17154da

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

allure-robotframework/src/listener/robot_listener.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from allure_commons.utils import platform_label
1515
from allure_robotframework import utils
1616
from allure_robotframework.allure_listener import AllureListener
17-
from allure_robotframework.types import RobotKeywordType, RobotLogLevel
17+
from allure_robotframework.types import RobotKeywordType, RobotLogLevel, RobotStatus
1818
from allure_robotframework.utils import allure_labels, allure_links, allure_tags
1919
from robot.libraries.BuiltIn import BuiltIn
2020

@@ -116,6 +116,8 @@ def start_new_test(self, name, attributes):
116116
def stop_current_test(self, name, attributes):
117117
uuid = self.stack.pop()
118118
test = self.reporter.get_test(uuid)
119+
if 'skipped' in [tag.lower() for tag in attributes['tags']]:
120+
attributes['status'] = RobotStatus.SKIPPED
119121
test.status = utils.get_allure_status(attributes.get('status'))
120122
test.labels.extend(utils.get_allure_suites(attributes.get('longname')))
121123

allure-robotframework/src/listener/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
class RobotStatus(object):
22
FAILED = 'FAIL'
33
PASSED = 'PASS'
4+
SKIPPED = 'SKIP'
45

56

67
class RobotKeywordType(object):

allure-robotframework/src/listener/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66

77

88
def get_allure_status(status):
9-
return Status.PASSED if status == RobotStatus.PASSED else Status.FAILED
9+
if status == RobotStatus.PASSED:
10+
return Status.PASSED
11+
elif status == RobotStatus.SKIPPED:
12+
return Status.SKIPPED
13+
else:
14+
return Status.FAILED
1015

1116

1217
def get_allure_parameters(parameters):

0 commit comments

Comments
 (0)