Skip to content

Commit 866f0f3

Browse files
Added ability to pass testCaseId for testItem
1 parent 625fef5 commit 866f0f3

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

reportportal_client/helpers.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
limitations under the License.
1313
"""
1414
import logging
15+
import time
1516
import uuid
1617
from pkg_resources import DistributionNotFound, get_distribution
1718
from platform import machine, processor, system
@@ -132,3 +133,8 @@ def verify_value_length(attributes):
132133
except TypeError:
133134
continue
134135
return attributes
136+
137+
138+
def timestamp():
139+
"""Return string representation of the current time in milliseconds."""
140+
return str(int(time.time() * 1000))

reportportal_client/helpers.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ def get_package_version(package_name: Text) -> Text: ...
1717

1818
def verify_value_length(
1919
attributes: Union[List[Dict], None]) -> Union[List[Dict], None]: ...
20+
21+
def timestamp() -> str: ...

reportportal_client/service.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ def start_test_item(self,
323323
parent_item_id=None,
324324
has_stats=True,
325325
code_ref=None,
326+
test_case_id=None,
326327
**kwargs):
327328
"""
328329
Item_type can be.
@@ -353,7 +354,8 @@ def start_test_item(self,
353354
"type": item_type,
354355
"parameters": parameters,
355356
"hasStats": has_stats,
356-
"codeRef": code_ref
357+
"codeRef": code_ref,
358+
"testCaseId": test_case_id,
357359
}
358360
if parent_item_id:
359361
url = uri_join(self.base_url_v2, "item", parent_item_id)

tests/test_service.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ def test_start_item(self, rp_service):
251251
'launchUuid': 111,
252252
'type': 'STORY', 'parameters': None,
253253
'hasStats': True,
254-
'codeRef': None},
254+
'codeRef': None,
255+
'testCaseId': None},
255256
url='http://endpoint/api/v2/project/item',
256257
verify=True)
257258

@@ -295,7 +296,8 @@ def test_start_item_code_optional_params(self, rp_service, field_name,
295296
'launchUuid': 111,
296297
'type': 'STORY', 'parameters': None,
297298
'hasStats': True,
298-
'codeRef': None},
299+
'codeRef': None,
300+
'testCaseId': None},
299301
url='http://endpoint/api/v2/project/item',
300302
verify=True)
301303
expected_result['json'][expected_name] = expected_value

0 commit comments

Comments
 (0)