diff --git a/test/appium/support/testrail_report.py b/test/appium/support/testrail_report.py index 9ba8b84512..0f910071e8 100644 --- a/test/appium/support/testrail_report.py +++ b/test/appium/support/testrail_report.py @@ -1,5 +1,6 @@ import json import requests +import emoji import base64 from os import environ from support.base_test_report import BaseTestReport @@ -68,6 +69,6 @@ class TestrailReport(BaseTestReport): for i, device in enumerate(last_testrun.jobs): devices += "# [Device %d](%s) \n" % (i + 1, self.get_sauce_job_url(device)) data = {'status_id': self.outcomes['undefined_fail'] if last_testrun.error else self.outcomes['passed'], - 'comment': '%s' % ('# Error: \n %s \n' % last_testrun.error) + devices + test_steps if last_testrun.error + 'comment': '%s' % ('# Error: \n %s \n' % emoji.demojize(last_testrun.error)) + devices + test_steps if last_testrun.error else devices + test_steps} self.post(method, data=data) diff --git a/test/appium/tests/test_chat_management.py b/test/appium/tests/test_chat_management.py index 084de06c6a..16c2312f70 100644 --- a/test/appium/tests/test_chat_management.py +++ b/test/appium/tests/test_chat_management.py @@ -1,5 +1,5 @@ import time - +import pytest from tests import transaction_users, marks, group_chat_users, get_current_time from tests.base_test_case import MultipleDeviceTestCase, SingleDeviceTestCase from views.sign_in_view import SignInView @@ -64,11 +64,13 @@ class TestChatManagementMultiple(MultipleDeviceTestCase): time.sleep(5) # Prevent stale element exception for first_account_button device_1_sign_in_view.account_button.click() device_1_sign_in_view.sign_in(self.senders['g_user']['password']) - assert not device_1_home_view.get_chat_with_user(self.senders['h_user']['username']).is_element_present(20) + if device_1_home_view.get_chat_with_user(self.senders['h_user']['username']).is_element_present(20): + pytest.fail('The chat is present after re-login') # Device 1: Start 1-1 chat with device 2 device_1_chat_view = device_1_home_view.start_1_1_chat(self.senders['h_user']['username']) - assert device_1_chat_view.no_messages_in_chat.is_element_present() + if not device_1_chat_view.no_messages_in_chat.is_element_present(): + pytest.fail('Message history is shown in a chat which was previously deleted') self.verify_no_errors() @@ -90,7 +92,8 @@ class TestChatManagement(SingleDeviceTestCase): chat_view.get_back_to_home_view() home_view.swipe_and_delete_chat(recipient['username'][:20]) home_view.relogin() - assert not home_view.get_chat_with_user(recipient['username']).is_element_present(20) + if home_view.get_chat_with_user(recipient['username']).is_element_present(20): + pytest.fail('The chat is present after re-login') @marks.testrail_case_id(3418) def test_swipe_and_delete_group_chat(self): @@ -108,4 +111,5 @@ class TestChatManagement(SingleDeviceTestCase): chat_view.get_back_to_home_view() home_view.swipe_and_delete_chat(chat_name) home_view.relogin() - assert not home_view.get_chat_with_user(chat_name).is_element_displayed() + if home_view.get_chat_with_user(chat_name).is_element_displayed(): + pytest.fail('The chat is present after re-login') diff --git a/test/appium/tests/test_profile.py b/test/appium/tests/test_profile.py index 9c75ea783f..3ad428901c 100644 --- a/test/appium/tests/test_profile.py +++ b/test/appium/tests/test_profile.py @@ -58,7 +58,6 @@ class TestProfileView(SingleDeviceTestCase): sign_in_view = SignInView(self.driver) sign_in_view.create_user() profile_view = sign_in_view.profile_button.click() - profile_view.advanced_button.click() sign_in_view = profile_view.switch_network('Rinkeby with upstream RPC') sign_in_view.click_account_by_position(0) sign_in_view.password_input.set_value('qwerty1234') @@ -77,6 +76,7 @@ class TestProfileView(SingleDeviceTestCase): profile_view.edit_profile_picture(file_name='sauce_logo.png') profile_view.relogin() sign_in_view.profile_button.click() + self.driver.swipe(500, 500, 500, 1000) if not profile_view.profile_picture.is_element_image_equals_template(): pytest.fail('Profile picture was not updated') diff --git a/test/appium/tests/test_transaction.py b/test/appium/tests/test_transaction.py index 7d047a3571..865e7e41a8 100644 --- a/test/appium/tests/test_transaction.py +++ b/test/appium/tests/test_transaction.py @@ -131,6 +131,7 @@ class TestTransaction(SingleDeviceTestCase): base_web_view.find_text_part(transaction_hash) @pytest.mark.pr + @pytest.mark.testrail_case_id(3406) def test_send_stt_from_wallet_via_enter_recipient_address(self): sender = transaction_users_wallet['A_USER'] recipient = transaction_users_wallet['B_USER'] diff --git a/test/appium/views/sign_in_view.py b/test/appium/views/sign_in_view.py index 57f2a1041b..12287280fc 100644 --- a/test/appium/views/sign_in_view.py +++ b/test/appium/views/sign_in_view.py @@ -105,12 +105,9 @@ class SignInView(BaseView): self.confirm_password_input.set_value(password) self.next_button.click() - # bypass StaleElementReferenceException - time.sleep(5) - self.name_input.wait_for_element(10) - self.name_input.click() + self.element_by_text_part('Display name').wait_for_element(10) username = 'user_%s' % get_current_time() - self.send_as_keyevent(username) + self.name_input.send_keys(username) self.next_button.click() self.do_not_share.wait_for_visibility_of_element(10)