2022-01-24 11:40:02 +00:00
|
|
|
from typing import Dict
|
2018-08-10 10:09:19 +00:00
|
|
|
|
|
|
|
|
2018-04-28 09:02:39 +00:00
|
|
|
class SingleTestData(object):
|
2024-09-17 19:31:34 +00:00
|
|
|
def __init__(self, name, testruns, testrail_case_id, logs_paths, grop_name, secured):
|
2018-04-28 09:02:39 +00:00
|
|
|
self.testrail_case_id = testrail_case_id
|
|
|
|
self.name = name
|
|
|
|
self.testruns = testruns
|
2024-09-17 19:31:34 +00:00
|
|
|
self.logs_paths = logs_paths
|
2022-04-14 12:59:14 +00:00
|
|
|
self.group_name = grop_name
|
2024-04-17 00:46:59 +00:00
|
|
|
self.secured = secured
|
2018-04-28 09:02:39 +00:00
|
|
|
|
|
|
|
class TestRunData(object):
|
2022-06-14 14:02:48 +00:00
|
|
|
def __init__(self, steps, jobs, error, first_commands: Dict[str, int], xfail):
|
2018-04-28 09:02:39 +00:00
|
|
|
self.steps = steps
|
|
|
|
self.jobs = jobs
|
|
|
|
self.error = error
|
2022-01-24 11:40:02 +00:00
|
|
|
self.first_commands = first_commands
|
2022-06-14 14:02:48 +00:00
|
|
|
self.xfail = xfail
|
2018-04-28 09:02:39 +00:00
|
|
|
|
|
|
|
def create_new_testrun(self):
|
2022-06-14 14:02:48 +00:00
|
|
|
self.testruns.append(SingleTestData.TestRunData(list(), dict(), None, dict(), xfail=''))
|
2018-04-28 09:02:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
class TestSuiteData(object):
|
|
|
|
def __init__(self):
|
|
|
|
self.apk_name = None
|
|
|
|
self.current_test = None
|
|
|
|
self.tests = list()
|
|
|
|
|
2024-04-17 00:46:59 +00:00
|
|
|
def set_current_test(self, test_name, testrail_case_id, secured):
|
2018-04-28 09:02:39 +00:00
|
|
|
existing_test = next((test for test in self.tests if test.name == test_name), None)
|
|
|
|
if existing_test:
|
|
|
|
self.current_test = existing_test
|
|
|
|
else:
|
2024-04-17 00:46:59 +00:00
|
|
|
test = SingleTestData(test_name, list(), testrail_case_id, list(), None, secured)
|
2018-04-28 09:02:39 +00:00
|
|
|
self.tests.append(test)
|
2022-04-14 12:59:14 +00:00
|
|
|
self.current_test = test
|