Skip to content

Add support for skipped robot tests #358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion allure-robotframework/src/listener/robot_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from allure_commons.types import Severity
from allure_commons.utils import platform_label
from robot.libraries.BuiltIn import BuiltIn
from allure_robotframework.types import RobotKeywordType, RobotLogLevel
from allure_robotframework.types import RobotKeywordType, RobotLogLevel, RobotStatus
from allure_robotframework import utils
from allure_robotframework.allure_listener import AllureListener

Expand Down Expand Up @@ -107,6 +107,8 @@ def start_new_test(self, name, attributes):
def stop_current_test(self, name, attributes):
uuid = self.stack.pop()
test = self.reporter.get_test(uuid)
if 'skipped' in [tag.lower() for tag in attributes['tags']]:
attributes['status'] = RobotStatus.SKIPPED
test.status = utils.get_allure_status(attributes.get('status'))
test.labels.extend(utils.get_allure_suites(attributes.get('longname')))

Expand Down
1 change: 1 addition & 0 deletions allure-robotframework/src/listener/types.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class RobotStatus(object):
FAILED = 'FAIL'
PASSED = 'PASS'
SKIPPED = 'SKIP'


class RobotKeywordType(object):
Expand Down
8 changes: 6 additions & 2 deletions allure-robotframework/src/listener/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@


def get_allure_status(status):
return Status.PASSED if status == RobotStatus.PASSED else Status.FAILED

if status == RobotStatus.PASSED:
return Status.PASSED
elif status == RobotStatus.SKIPPED:
return Status.SKIPPED
else:
return Status.FAILED

def get_allure_parameters(parameters):
return [Parameter(name="arg{}".format(i + 1), value=param) for i, param in enumerate(parameters)]
Expand Down