diff --git a/test/appium/tests/__init__.py b/test/appium/tests/__init__.py index aca59605a0..16ddf5799c 100644 --- a/test/appium/tests/__init__.py +++ b/test/appium/tests/__init__.py @@ -38,8 +38,8 @@ background_service_message = 'Background service for notifications' bootnode_address = "enode://a8a97f126f5e3a340cb4db28a1187c325290ec08b2c9a6b1f19845ac86c46f9fac2ba13328822590" \ "fd3de3acb09cc38b5a05272e583a2365ad1fa67f66c55b34@167.99.210.203:30404" # referred to https://github.com/status-im/status-react/blob/develop/resources/config/fleets.json -mailserver_address = "enode://69f72baa7f1722d111a8c9c68c39a31430e9d567695f6108f31ccb6cd8f0adff4991e7fdca8fa770e75bc8a511" \ - "a87d24690cbc80e008175f40c157d6f6788d48:status-offline-inbox@206.189.240.16:443" +mailserver_address = 'enode://b74859176c9751d314aeeffc26ec9f866a412752e7ddec91b19018a18e7cca8d637cfe2cedcb972f8eb64d81' \ + '6fbd5b4e89c7e8c7fd7df8a1329fa43db80b0bfe:pass@47.52.90.156:443' staging_fleet = 'eth.staging' prod_fleet = 'eth.prod' # This fleet is used in the tests diff --git a/test/appium/tests/atomic/account_management/test_profile.py b/test/appium/tests/atomic/account_management/test_profile.py index 6061dc62fc..a8918bc2f8 100644 --- a/test/appium/tests/atomic/account_management/test_profile.py +++ b/test/appium/tests/atomic/account_management/test_profile.py @@ -591,13 +591,9 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase): if not one_to_one_chat_2.user_profile_image_in_mentions_list( default_username_1).is_element_image_similar_to_template(logo_default): self.errors.append('Profile picture was not updated in 1-1 chat mentions list') + home_1.reopen_app() one_to_one_chat_2.get_back_to_home_view() - profile_1.just_fyi('Send message to user to move it to online state') - profile_1.home_button.double_click() - one_to_one_chat_1 = home_1.get_chat(default_username_2).click() - one_to_one_chat_1.send_message('hey') - profile_1.just_fyi('Check profile image is updated in Group chat view') profile_2 = one_to_one_chat_2.profile_button.click() profile_2.contacts_button.click() @@ -606,7 +602,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase): if not profile_2.profile_picture.is_element_image_similar_to_template('new_profile_online.png'): self.errors.append('Profile picture was not updated on user Profile view') profile_2.close_button.click() - [home.home_button.click() for home in (profile_2, home_1)] + home_2.home_button.double_click() if not home_2.get_chat(default_username_1).chat_image.is_element_image_similar_to_template(logo_chats): self.errors.append('User profile picture was not updated on Chats view') @@ -824,15 +820,11 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase): profile_1.plus_button.click() server_name = 'test' profile_1.specify_name_input.set_value(server_name) - profile_1.mail_server_address_input.set_value(mailserver_address.replace('4', '5')) + profile_1.mail_server_address_input.set_value('%s%s' % (mailserver_address[:-3], '553')) profile_1.save_button.click() profile_1.mail_server_by_name(server_name).click() profile_1.mail_server_connect_button.wait_and_click() profile_1.confirm_button.wait_and_click() - if profile_1.save_button.is_element_displayed(): - profile_1.save_button.click() - sign_in_1 = home_1.get_sign_in_view() - sign_in_1.sign_in() profile_1.just_fyi('check that popup "Error connecting" will not reappear if tap on "Cancel"') profile_1.element_by_translation_id('mailserver-error-title').wait_for_element(120) @@ -849,7 +841,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase): profile_1.just_fyi('join same public chat and try to reconnect via "Tap to reconnect" and check "Connecting"') profile_1.home_button.click() public_chat_1 = home_1.join_public_chat(public_chat_name) - public_chat_1.relogin() + public_chat_1.reopen_app() profile_1.just_fyi('check that still connected to custom mailserver after relogin') home_1.profile_button.click() @@ -858,20 +850,19 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase): self.drivers[0].fail("Not connected to custom mailserver after re-login") profile_1.just_fyi('check that can RETRY to connect') - # TODO: blocked due to 11786 (rechecked 23.11.21, valid) - # profile_1.element_by_translation_id('mailserver-error-title').wait_for_element(120) - # public_chat_1.element_by_translation_id('mailserver-retry', uppercase=True).wait_and_click(60) - # - # profile_1.just_fyi('check that can pick another mailserver and receive messages') - # profile_1.element_by_translation_id('mailserver-error-title').wait_for_element(120) - # profile_1.element_by_translation_id('mailserver-pick-another', uppercase=True).wait_and_click(120) - # mailserver = profile_1.return_mailserver_name(mailserver_ams, used_fleet) - # profile_1.element_by_text(mailserver).click() - # profile_1.confirm_button.click() - # profile_1.home_button.click() - # home_1.get_chat('#%s' % public_chat_name).click() - # if not public_chat_1.chat_element_by_text(message).is_element_displayed(60): - # self.errors.append("Chat history wasn't fetched") + profile_1.element_by_translation_id('mailserver-error-title').wait_for_element(120) + public_chat_1.element_by_translation_id('mailserver-retry', uppercase=True).wait_and_click(60) + + profile_1.just_fyi('check that can pick another mailserver and receive messages') + profile_1.element_by_translation_id('mailserver-error-title').wait_for_element(120) + profile_1.element_by_translation_id('mailserver-pick-another', uppercase=True).wait_and_click(120) + mailserver = profile_1.return_mailserver_name(mailserver_ams, used_fleet) + profile_1.element_by_text(mailserver).click() + profile_1.confirm_button.click() + profile_1.home_button.click() + home_1.get_chat('#%s' % public_chat_name).click() + if not public_chat_1.chat_element_by_text(message).is_element_displayed(60): + self.errors.append("Chat history wasn't fetched") self.errors.verify_no_errors() diff --git a/test/appium/tests/atomic/test_public_chat_browsing.py b/test/appium/tests/atomic/test_public_chat_browsing.py index 64984ecbf2..e0cecf9141 100644 --- a/test/appium/tests/atomic/test_public_chat_browsing.py +++ b/test/appium/tests/atomic/test_public_chat_browsing.py @@ -112,7 +112,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase): @marks.testrail_id(700718) def test_public_chat_unread_messages_counter_for_mention_relogin(self): message = 'test message2' - [chat.home_button.double_click() for chat in (self.chat_1, self.chat_2)] + [chat.get_back_to_home_view() for chat in (self.chat_1, self.chat_2)] chat_element = self.home_1.get_chat('#' + self.public_chat_name) self.home_2.get_chat('#' + self.public_chat_name).click() self.chat_2.select_mention_from_suggestion_list(self.username_1, self.username_1[:2]) @@ -136,7 +136,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase): @marks.testrail_id(5319) def test_public_chat_delete_chat_long_press(self): - [chat.home_button.double_click() for chat in (self.chat_1, self.chat_2)] + [chat.get_back_to_home_view() for chat in (self.chat_1, self.chat_2)] self.home_1.delete_chat_long_press('#%s' % self.pub_chat_delete_long_press) self.home_2.just_fyi("Send message to deleted chat") self.deleted_chat_2 = self.home_2.join_public_chat(self.pub_chat_delete_long_press) @@ -149,7 +149,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase): @marks.testrail_id(700736) def test_public_chat_link_send_open(self): - [chat.home_button.double_click() for chat in (self.chat_1, self.chat_2)] + [chat.get_back_to_home_view() for chat in (self.chat_1, self.chat_2)] [home.get_chat('#' + self.public_chat_name).click() for home in (self.home_1, self.home_2)] url_message = 'http://status.im' self.chat_2.send_message(url_message) @@ -160,7 +160,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase): @marks.testrail_id(700737) def test_public_chat_links_with_previews_github_youtube_twitter_gif_send_enable(self): - [chat.home_button.double_click() for chat in (self.chat_1, self.chat_2)] + [chat.get_back_to_home_view() for chat in (self.chat_1, self.chat_2)] [home.get_chat('#' + self.public_chat_name).click() for home in (self.home_1, self.home_2)] giphy_url = 'https://giphy.com/gifs/this-is-fine-QMHoU66sBXqqLqYvGO' preview_urls = {'github_pr': {'url': 'https://github.com/status-im/status-react/pull/11707', @@ -203,7 +203,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase): @marks.testrail_id(6270) def test_public_chat_mark_all_messages_as_read(self): - [chat.home_button.double_click() for chat in (self.chat_1, self.chat_2)] + [chat.get_back_to_home_view() for chat in (self.chat_1, self.chat_2)] self.home_2.get_chat('#' + self.public_chat_name).click() self.chat_2.send_message(self.text_message) if not self.home_1.home_button.public_unread_messages.is_element_displayed(): diff --git a/test/appium/tests/atomic/zzz_multiple_drivers_tests/test_multiple_driver_tests.py b/test/appium/tests/atomic/zzz_multiple_drivers_tests/test_multiple_driver_tests.py index 0a6d4890f5..8ec1cea4cd 100644 --- a/test/appium/tests/atomic/zzz_multiple_drivers_tests/test_multiple_driver_tests.py +++ b/test/appium/tests/atomic/zzz_multiple_drivers_tests/test_multiple_driver_tests.py @@ -268,7 +268,7 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase): profile_1.discover_and_advertise_device(name_1) profile_1.get_toggle_device_by_name(name_2).wait_and_click() profile_1.sync_all_button.click() - profile_1.sync_all_button.wait_for_visibility_of_element(15) + profile_1.sync_all_button.wait_for_visibility_of_element(20) [device.profile_button.click() for device in (profile_1, profile_2)] device_2.just_fyi('Contacts (secondary device): check contacts + blocked users after initial sync') diff --git a/test/appium/views/base_element.py b/test/appium/views/base_element.py index c07929a913..50415673f9 100644 --- a/test/appium/views/base_element.py +++ b/test/appium/views/base_element.py @@ -340,7 +340,7 @@ class EditBox(BaseElement): action.press(x=x + 25, y=y - 50).release().perform() def cut_text(self): - self.driver.info("Cut text in '%s'" % self.name) + self.driver.info("Cut text in `%s`" % self.name) location = self.find_element().location x, y = location['x'], location['y'] action = TouchAction(self.driver) @@ -356,7 +356,7 @@ class Text(BaseElement): @property def text(self): text = self.find_element().text - self.driver.info("'%s' is '%s'" % (self.name, text)) + self.driver.info("`%s` is `%s`" % (self.name, text)) return text diff --git a/test/appium/views/base_view.py b/test/appium/views/base_view.py index 06f32e1a99..53d58e41eb 100644 --- a/test/appium/views/base_view.py +++ b/test/appium/views/base_view.py @@ -4,10 +4,8 @@ import base64 import random import re import string -from PIL import Image from appium.webdriver.common.touch_action import TouchAction from datetime import datetime -from io import BytesIO from selenium.common.exceptions import NoSuchElementException, TimeoutException from support.device_apps import start_web_browser