Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 21571c8

Browse filesBrowse files
authored
Set testCaseId for all test results produced by allure_robotframework (#884)
1 parent 466b1dd commit 21571c8
Copy full SHA for 21571c8

2 files changed

+37-1Lines changed: 37 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎allure-robotframework/src/listener/allure_listener.py‎

Copy file name to clipboardExpand all lines: allure-robotframework/src/listener/allure_listener.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ def start_test(self, name, attributes):
132132
test_result.name = name
133133
test_result.fullName = long_name
134134
test_result.titlePath = attributes.get("titlepath", [])
135-
test_result.historyId = md5(long_name)
135+
test_result.testCaseId = md5(long_name)
136+
test_result.historyId = test_result.testCaseId
136137
test_result.start = now()
137138

138139
for container in self.lifecycle.containers():
Collapse file
+35Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from hamcrest import assert_that
2+
from hamcrest import all_of
3+
from hamcrest import contains_string
4+
from tests.allure_robotframework.robot_runner import AllureRobotRunner
5+
from allure_commons_test.report import has_test_case
6+
from allure_commons_test.result import has_full_name
7+
from allure_commons_test.result import has_test_case_id
8+
from allure_commons_test.result import has_history_id
9+
10+
11+
def test_identifiers_are_set(docstring, robot_runner: AllureRobotRunner):
12+
"""
13+
*** Test Cases ***
14+
Foo
15+
No Operation
16+
"""
17+
18+
robot_runner.run_robotframework(
19+
suite_literals={"Bar.robot": docstring}
20+
)
21+
22+
assert_that(
23+
robot_runner.allure_results,
24+
has_test_case(
25+
"Foo",
26+
has_full_name(
27+
all_of(
28+
contains_string("Foo"),
29+
contains_string("Bar"),
30+
),
31+
),
32+
has_test_case_id(),
33+
has_history_id(),
34+
)
35+
)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.