Skip to content

Rf skipped tests #392

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

Merged
merged 2 commits into from
Jul 23, 2019
Merged
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 @@ -14,7 +14,7 @@
from allure_commons.utils import platform_label
from allure_robotframework import utils
from allure_robotframework.allure_listener import AllureListener
from allure_robotframework.types import RobotKeywordType, RobotLogLevel
from allure_robotframework.types import RobotKeywordType, RobotLogLevel, RobotStatus
from allure_robotframework.utils import allure_labels, allure_links, allure_tags
from robot.libraries.BuiltIn import BuiltIn

Expand Down Expand Up @@ -116,6 +116,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
7 changes: 6 additions & 1 deletion allure-robotframework/src/listener/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,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):
Expand Down