|
5 | 5 | from allure_commons.reporter import AllureReporter |
6 | 6 | from allure_commons.utils import uuid4 |
7 | 7 | from allure_commons.utils import now |
| 8 | +from allure_commons.utils import platform_label |
8 | 9 | from allure_commons.types import LabelType, AttachmentType |
9 | 10 | from allure_commons.model2 import TestResult |
10 | 11 | from allure_commons.model2 import TestStepResult |
|
21 | 22 | from allure_behave.utils import fixture_status, fixture_status_details |
22 | 23 | from allure_behave.utils import step_table |
23 | 24 |
|
| 25 | + |
24 | 26 | BEFORE_FIXTURES = ['before_all', 'before_tag', 'before_feature', 'before_scenario'] |
25 | 27 | AFTER_FIXTURES = ['after_all', 'after_tag', 'after_feature', 'after_scenario'] |
26 | 28 | FIXTURES = BEFORE_FIXTURES + AFTER_FIXTURES |
@@ -84,20 +86,15 @@ def start_test(self, parent_uuid, uuid, name, parameters, context): |
84 | 86 | self.execution_context.append(uuid) |
85 | 87 |
|
86 | 88 | test_case = TestResult(uuid=uuid, start=now()) |
87 | | - |
88 | 89 | test_case.name = scenario_name(scenario) |
89 | 90 | test_case.historyId = scenario_history_id(scenario) |
90 | 91 | test_case.description = '\n'.join(scenario.description) |
91 | | - |
92 | | - labels = [] |
93 | | - feature_label = Label(name=LabelType.FEATURE.value, value=scenario.feature.name) |
94 | | - severity = (Label(name=LabelType.SEVERITY.value, value=scenario_severity(scenario).value)) |
95 | | - labels.append(feature_label) |
96 | | - labels.append(severity) |
97 | | - labels += [Label(name=LabelType.TAG.value, value=tag) for tag in scenario_tags(scenario)] |
98 | | - |
99 | 92 | test_case.parameters = scenario_parameters(scenario) |
100 | | - test_case.labels = labels |
| 93 | + test_case.labels.extend([Label(name=LabelType.TAG, value=tag) for tag in scenario_tags(scenario)]) |
| 94 | + test_case.labels.append(Label(name=LabelType.SEVERITY, value=scenario_severity(scenario).value)) |
| 95 | + test_case.labels.append(Label(name=LabelType.FEATURE, value=scenario.feature.name)) |
| 96 | + test_case.labels.append(Label(name=LabelType.FRAMEWORK, value='behave')) |
| 97 | + test_case.labels.append(Label(name=LabelType.LANGUAGE, value=platform_label())) |
101 | 98 |
|
102 | 99 | self.logger.schedule_test(uuid, test_case) |
103 | 100 |
|
|
0 commit comments