From 6387bba9f506f79ece86e5f55cc39da0c83cc9ab Mon Sep 17 00:00:00 2001 From: Serhy Date: Mon, 20 Sep 2021 18:23:06 +0300 Subject: [PATCH] Update testrailreport and threads Signed-off-by: Serhy --- test/appium/support/testrail_report.py | 8 ++++---- test/appium/tests/__init__.py | 6 ++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/test/appium/support/testrail_report.py b/test/appium/support/testrail_report.py index 76267f5216..bb93eaeefe 100644 --- a/test/appium/support/testrail_report.py +++ b/test/appium/support/testrail_report.py @@ -143,7 +143,7 @@ class TestrailReport(BaseTestReport): ids_failed_test.append(test.testrail_case_id) case_title = '\n' case_title += '-------\n' - case_title += "### %s) ID %s: [%s](%s) \n" % (i + 1, test.testrail_case_id, test.name, test_rail_link) + case_title += "## %s) ID %s: [%s](%s) \n" % (i + 1, test.testrail_case_id, test.name, test_rail_link) error ="```%s```\n" % last_testrun.error[:255] for job_id, f in last_testrun.jobs.items(): case_info = "Logs for device %d: [steps](%s), [failure screenshot](%s)"\ @@ -160,7 +160,7 @@ class TestrailReport(BaseTestReport): def get_run_results(self): - return self.get('get_results_for_run/%s' % self.run_id) + return self.get('get_results_for_run/%s' % self.run_id)['results'] def is_run_successful(self): for test in self.get_run_results(): @@ -171,7 +171,7 @@ class TestrailReport(BaseTestReport): def get_test_result_link(self, test_run_id, test_case_id): try: - test_id = self.get('get_results_for_case/%s/%s' % (test_run_id, test_case_id))[0]['test_id'] + test_id = self.get('get_results_for_case/%s/%s' % (test_run_id, test_case_id))['results'][0]['test_id'] return '%stests/view/%s' % (self.url, test_id) except KeyError: - return None \ No newline at end of file + return None diff --git a/test/appium/tests/__init__.py b/test/appium/tests/__init__.py index 3157a19f4d..056eaa4d44 100644 --- a/test/appium/tests/__init__.py +++ b/test/appium/tests/__init__.py @@ -6,14 +6,12 @@ import json from support.appium_container import AppiumContainer from support.test_data import TestSuiteData - -@asyncio.coroutine -def start_threads(quantity: int, func: type, returns: dict, *args): +async def start_threads(quantity: int, func: type, returns: dict, *args): loop = asyncio.get_event_loop() for i in range(quantity): returns[i] = loop.run_in_executor(None, func, *args) for k in returns: - returns[k] = yield from returns[k] + returns[k] = await returns[k] return returns