From 059ff3c0f3a36d98963705bf9561cda1927b3a23 Mon Sep 17 00:00:00 2001 From: Churikova Tetiana Date: Sat, 30 Apr 2022 07:53:21 +0200 Subject: [PATCH] e2e: conft --- test/appium/tests/conftest.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/test/appium/tests/conftest.py b/test/appium/tests/conftest.py index 00aa50a1a8..704cde68b1 100644 --- a/test/appium/tests/conftest.py +++ b/test/appium/tests/conftest.py @@ -216,16 +216,16 @@ def should_save_device_stats(config): def pytest_runtest_makereport(item, call): outcome = yield report = outcome.get_result() - # if "xdist_group" in item.keywords._markers and report.when == "setup" and report.failed: - # test_suite_data.set_current_test(item.name, testrail_case_id=get_testrail_case_id(item)) - # test_suite_data.current_test.create_new_testrun() - # test_suite_data.current_test.group_name = item.instance.__class__.__name__ - # error = report.longreprtext - # exception = re.findall('E.*Message:|E.*Error:|E.*Failed:', error) - # if exception: - # error = error.replace(re.findall('E.*Message:|E.*Error:|E.*Failed:', report.longreprtext)[0], '') - # test_suite_data.current_test.testruns[-1].error = "Test setup failed: \n" + error - # github_report.save_test(test_suite_data.current_test) + if "xdist_group" in item.keywords._markers and report.when == "setup" and report.failed: + test_suite_data.set_current_test(item.name, testrail_case_id=get_testrail_case_id(item)) + test_suite_data.current_test.create_new_testrun() + test_suite_data.current_test.group_name = item.instance.__class__.__name__ + error = report.longreprtext + exception = re.findall('E.*Message:|E.*Error:|E.*Failed:', error) + if exception: + error = error.replace(re.findall('E.*Message:|E.*Error:|E.*Failed:', report.longreprtext)[0], '') + test_suite_data.current_test.testruns[-1].error = "Test setup failed: \n" + error + github_report.save_test(test_suite_data.current_test) if report.when == 'call': is_sauce_env = item.config.getoption('env') == 'sauce' current_test = test_suite_data.current_test @@ -292,9 +292,9 @@ def pytest_runtest_protocol(item, nextitem): for i in range(rerun_count): reports = runtestprotocol(item, nextitem=nextitem) for report in reports: - is_in_group = [i for i in item.iter_markers(name='xdist_group')] - if report.failed and should_rerun_test(report.longreprtext) and not is_in_group: - # if report.failed and should_rerun_test(report.longreprtext): + # is_in_group = [i for i in item.iter_markers(name='xdist_group')] + # if report.failed and should_rerun_test(report.longreprtext) and not is_in_group: + if report.failed and should_rerun_test(report.longreprtext): break # rerun else: return True # no need to rerun