diff --git a/test/appium/tests/atomic/account_management/test_wallet_management.py b/test/appium/tests/atomic/account_management/test_wallet_management.py index d45168bb40..fedab4e1b9 100644 --- a/test/appium/tests/atomic/account_management/test_wallet_management.py +++ b/test/appium/tests/atomic/account_management/test_wallet_management.py @@ -89,6 +89,7 @@ class TestWalletManagement(SingleDeviceTestCase): self.driver.fail('Transaction hash was not copied') @marks.testrail_id(5346) + @marks.flaky @marks.high def test_collectible_from_wallet(self): passphrase = wallet_users['F']['passphrase'] diff --git a/test/appium/tests/atomic/chats/test_group_chat.py b/test/appium/tests/atomic/chats/test_group_chat.py index 2b54a65e7e..9f872bb907 100644 --- a/test/appium/tests/atomic/chats/test_group_chat.py +++ b/test/appium/tests/atomic/chats/test_group_chat.py @@ -423,4 +423,4 @@ class TestCommandsSingleDevices(SingleDeviceTestCase): if not group_info_view.element_by_text_part('20 members').is_element_displayed(): self.errors.append('Amount of users is not shown on Group info screen') - self.errors.verify_no_errors() + self.errors.verify_no_errors() \ No newline at end of file diff --git a/test/appium/tests/atomic/chats/test_one_to_one.py b/test/appium/tests/atomic/chats/test_one_to_one.py index c2e395382e..7843bc24fa 100644 --- a/test/appium/tests/atomic/chats/test_one_to_one.py +++ b/test/appium/tests/atomic/chats/test_one_to_one.py @@ -201,7 +201,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase): def test_edit_delete_message_in_one_to_one_and_public_chats(self): self.create_drivers(2) device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) - home_1, home_2 = device_1.create_user(), device_2.create_user() + home_1, home_2 = device_1.create_user(enable_notifications=True), device_2.create_user() device_2.just_fyi("Create public chat on Device1, send message and edit it then") public_key_1, username_1 = home_1.get_public_key_and_username(return_username=True) @@ -248,6 +248,17 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase): if home_1.element_by_text(message_after_edit_1_1).is_element_displayed(): self.errors.append("Deleted message is shown on chat element on home screen") + device_2.just_fyi("Send one more message and check that PN will be deleted with message deletion") + message_to_delete = 'DELETE ME' + home_1.put_app_to_background() + chat_private_2.send_message(message_to_delete) + home_1.open_notification_bar() + home_1.get_pn(message_to_delete).wait_for_element(30) + chat_private_2.delete_message_in_chat(message_to_delete) + if not home_1.get_pn(message_to_delete).is_element_disappeared(30): + self.errors.append("Push notification was not removed after initial message deletion") + home_1.click_system_back_button(2) + chat_private_2.just_fyi("Check for that edited message is shown for Device 2 and delete message in public chat") [home.home_button.double_click() for home in (home_1, home_2)] public_chat_1, public_chat_2 = home_1.get_chat('#%s' %chat_name).click(), home_2.join_public_chat(chat_name) diff --git a/test/appium/tests/atomic/test_upgrade.py b/test/appium/tests/atomic/test_upgrade.py index 04098dde92..3e7735f149 100644 --- a/test/appium/tests/atomic/test_upgrade.py +++ b/test/appium/tests/atomic/test_upgrade.py @@ -258,7 +258,7 @@ class TestUpgradeMultipleApplication(MultipleDeviceTestCase): home.upgrade_app() home = device_1.sign_in() - device_1.just_fyi("**Check messages in 1-1 chat**") + device_1.just_fyi("Check messages in 1-1 chat") command_username = 'Royal Defensive Solenodon' messages = chat_data.chats[command_username]['messages'] home.swipe_up() diff --git a/test/appium/views/base_element.py b/test/appium/views/base_element.py index 28a2f3e7c1..5f1397e2f4 100644 --- a/test/appium/views/base_element.py +++ b/test/appium/views/base_element.py @@ -153,7 +153,7 @@ class BaseElement(object): self.driver.swipe(500, size["height"]*0.25, 500, size["height"]*0.8) else: raise NoSuchElementException( - "Device %s: %s by %s:* `%s` is not found on the screen" % (self.driver.number, self.name, self.by, self.locator)) from None + "Device %s: %s by %s: `%s` is not found on the screen" % (self.driver.number, self.name, self.by, self.locator)) from None def scroll_and_click(self, direction='down'): self.scroll_to_element(direction=direction) @@ -171,6 +171,12 @@ class BaseElement(object): except TimeoutException: return False + def is_element_disappeared(self, sec=20): + try: + return self.wait_for_invisibility_of_element(sec) + except TimeoutException: + return False + @property def text(self): return self.find_element().text diff --git a/test/appium/views/chat_view.py b/test/appium/views/chat_view.py index e016a8f909..922be92788 100644 --- a/test/appium/views/chat_view.py +++ b/test/appium/views/chat_view.py @@ -751,8 +751,9 @@ class ChatView(BaseView): return self def chat_element_by_text(self, text): - self.driver.info("Looking for a message by text: %s" % text) - return ChatElementByText(self.driver, text) + chat_element = ChatElementByText(self.driver, text) + self.driver.info("Looking for a message by text: %s" % chat_element.exclude_emoji(text)) + return chat_element def verify_message_is_under_today_text(self, text, errors): self.driver.info("Verifying that '%s' is under today" % text) diff --git a/test/appium/views/sign_in_view.py b/test/appium/views/sign_in_view.py index c80db1f0e7..7813343cc7 100644 --- a/test/appium/views/sign_in_view.py +++ b/test/appium/views/sign_in_view.py @@ -175,10 +175,12 @@ class SignInView(BaseView): self.driver.info("## Creating new multiaccount (password:'%s', keycard:'%s')" % (password, str(keycard)), device=False) if not second_user: self.accept_tos_checkbox.click() - self.get_started_button.click() + self.get_started_button.click_until_presence_of_element(self.generate_key_button) + if not self.generate_key_button.is_element_displayed(): + [button.click() for button in + [self.accept_tos_checkbox, self.get_started_button, self.generate_key_button]] self.generate_key_button.click() - if not self.next_button.is_element_displayed(): - [button.click() for button in [self.accept_tos_checkbox, self.get_started_button,self.generate_key_button]] + self.next_button.click_until_absense_of_element(self.element_by_translation_id("intro-wizard-title2")) if keycard: keycard_flow = self.keycard_storage_button.click()