status-react/test/appium/support/test_data.py

39 lines
1.3 KiB
Python
Raw Normal View History

2022-01-24 11:40:02 +00:00
from typing import Dict
class SingleTestData(object):
def __init__(self, name, testruns, testrail_case_id, geth_paths, grop_name, secured):
self.testrail_case_id = testrail_case_id
self.name = name
self.testruns = testruns
self.geth_paths = geth_paths
self.group_name = grop_name
self.secured = secured
class TestRunData(object):
2022-06-14 14:02:48 +00:00
def __init__(self, steps, jobs, error, first_commands: Dict[str, int], xfail):
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
def create_new_testrun(self):
2022-06-14 14:02:48 +00:00
self.testruns.append(SingleTestData.TestRunData(list(), dict(), None, dict(), xfail=''))
class TestSuiteData(object):
def __init__(self):
self.apk_name = None
self.current_test = None
self.tests = list()
def set_current_test(self, test_name, testrail_case_id, secured):
existing_test = next((test for test in self.tests if test.name == test_name), None)
if existing_test:
self.current_test = existing_test
else:
test = SingleTestData(test_name, list(), testrail_case_id, list(), None, secured)
self.tests.append(test)
self.current_test = test