From 4f4f6cf29eb9d5dd364f06e59571ae8f63796d0a Mon Sep 17 00:00:00 2001 From: Churikova Tetiana Date: Tue, 29 Dec 2020 16:44:08 +0100 Subject: [PATCH] fixed testrail reports and e2e nightly Signed-off-by: Churikova Tetiana --- test/appium/support/github_report.py | 2 +- test/appium/support/testrail_report.py | 19 ++++++++++++++----- .../atomic/chats/test_chats_management.py | 4 ++-- .../tests/atomic/chats/test_group_chat.py | 4 ++-- .../tests/atomic/transactions/test_wallet.py | 3 ++- test/appium/tests/test_performance.py | 1 - 6 files changed, 21 insertions(+), 12 deletions(-) diff --git a/test/appium/support/github_report.py b/test/appium/support/github_report.py index 1e38d6564f..b2f3db5a8c 100644 --- a/test/appium/support/github_report.py +++ b/test/appium/support/github_report.py @@ -30,7 +30,7 @@ class GithubHtmlReport(BaseTestReport): for i, test in enumerate(failed_tests): if test.testrail_case_id: ids_failed_test.append(test.testrail_case_id) - summary_html += 'IDs of failed tests: %s \n' % ', '.join(map(str, ids_failed_test)) + summary_html += 'IDs of failed tests: %s \n' % ','.join(map(str, ids_failed_test)) summary_html += "```\n" if passed_tests: passed_tests_html = self.build_tests_table_html(passed_tests, run_id, failed_tests=False) diff --git a/test/appium/support/testrail_report.py b/test/appium/support/testrail_report.py index 40eacbf2d7..f1c802ec1c 100644 --- a/test/appium/support/testrail_report.py +++ b/test/appium/support/testrail_report.py @@ -6,7 +6,7 @@ import emoji import base64 from os import environ from support.base_test_report import BaseTestReport - +from sys import argv class TestrailReport(BaseTestReport): @@ -87,9 +87,18 @@ class TestrailReport(BaseTestReport): test_cases['medium'] = 736 test_cases['low'] = 737 case_ids = list() - for phase in test_cases: - for case in self.get_cases([test_cases[phase]]): - case_ids.append(case['id']) + for arg in argv: + if "run_testrail_ids" in arg: + key, value = arg.split('=') + case_ids = value.split(',') + if len(case_ids) == 0: + if 'critical or high' in argv: + for case in self.get_cases([test_cases['critical'], test_cases['high']]): + case_ids.append(case['id']) + else: + for phase in test_cases: + for case in self.get_cases([test_cases[phase]]): + case_ids.append(case['id']) return case_ids def add_results(self): @@ -137,7 +146,7 @@ class TestrailReport(BaseTestReport): self.get_sauce_final_screenshot_url(job_id)) description += case_title + error + case_info - description_title += '## Failed tests: %s \n' % ', '.join(map(str, ids_failed_test)) + description_title += '## Failed tests: %s \n' % ','.join(map(str, ids_failed_test)) final_description = description_title + description request_body = {'description': final_description} diff --git a/test/appium/tests/atomic/chats/test_chats_management.py b/test/appium/tests/atomic/chats/test_chats_management.py index af809b020c..7bc8073557 100644 --- a/test/appium/tests/atomic/chats/test_chats_management.py +++ b/test/appium/tests/atomic/chats/test_chats_management.py @@ -998,8 +998,8 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase): dapp_view = profile_2.ens_usernames_button.click() dapp_view.element_by_text('Get started').click() dapp_view.ens_name.set_value(ens_user_message_sender['ens']) - dapp_view.check_ens_name.click() - dapp_view.element_by_text('Ok, got it').click() + dapp_view.check_ens_name.click_until_presence_of_element(dapp_view.find_element_by_translation_id("ens-got-it")) + dapp_view.find_element_by_translation_id("ens-got-it").click() device_1.just_fyi('Both devices joining the same public chat and send messages') chat_name = device_1.get_random_chat_name() diff --git a/test/appium/tests/atomic/chats/test_group_chat.py b/test/appium/tests/atomic/chats/test_group_chat.py index ceb6620767..46f7e56e8f 100644 --- a/test/appium/tests/atomic/chats/test_group_chat.py +++ b/test/appium/tests/atomic/chats/test_group_chat.py @@ -504,8 +504,8 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase): device_1_chat.send_message_button.click() device_1_chat.chat_message_input.click() for chat in device_1_chat, device_2_chat, device_3_chat: - if not chat.image_chat_item.is_element_displayed(): - self.errors.append('Image is not shown in chat after sending for sender') + if not chat.image_chat_item.is_element_displayed(30): + self.errors.append('Image is not shown in chat after sending for %s' % chat.driver.number) device_1.just_fyi('Send audio message to group chat and verify it on all devices') device_1_chat.record_audio_message(message_length_in_seconds=3) diff --git a/test/appium/tests/atomic/transactions/test_wallet.py b/test/appium/tests/atomic/transactions/test_wallet.py index 45ebaa90a6..45017638b7 100644 --- a/test/appium/tests/atomic/transactions/test_wallet.py +++ b/test/appium/tests/atomic/transactions/test_wallet.py @@ -96,7 +96,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase): sign_in_view.just_fyi('Check that transaction is appeared in transaction history') wallet_view.wait_balance_is_changed('STT', initial_amount_STT) - wallet_view.accounts_status_account.click() + if not wallet_view.transaction_history_button.is_element_displayed(): + wallet_view.accounts_status_account.click() transactions_view = wallet_view.transaction_history_button.click() transactions_view.transactions_table.find_transaction(amount=sending_amount, asset='STT') diff --git a/test/appium/tests/test_performance.py b/test/appium/tests/test_performance.py index c4e0988bd1..04da4009d1 100644 --- a/test/appium/tests/test_performance.py +++ b/test/appium/tests/test_performance.py @@ -4,7 +4,6 @@ from views.sign_in_view import SignInView from datetime import datetime import time - class TestPerformance(SingleDeviceTestCase): def get_timestamps_by_event(self, *args):