From 2ff57ec8cdd9ebd78d674b73da90714d2f85a9bd Mon Sep 17 00:00:00 2001 From: Churikova Tetiana Date: Mon, 23 May 2022 17:30:24 +0200 Subject: [PATCH] e2e: all medium 2-driver e2e refactored --- test/appium/support/testrail_report.py | 6 +- .../critical/chats/test_1_1_public_chats.py | 11 +- .../{chats/test_chats.py => test_chats_m.py} | 216 ++++++++- .../tests/medium/test_multiple_devices.py | 426 ------------------ .../appium/tests/medium/test_single_device.py | 44 ++ .../views/elements_templates/ment_new.png | Bin 0 -> 3100 bytes test/appium/views/home_view.py | 2 +- test/appium/views/wallet_view.py | 10 +- 8 files changed, 263 insertions(+), 452 deletions(-) rename test/appium/tests/medium/{chats/test_chats.py => test_chats_m.py} (80%) delete mode 100644 test/appium/tests/medium/test_multiple_devices.py create mode 100644 test/appium/views/elements_templates/ment_new.png diff --git a/test/appium/support/testrail_report.py b/test/appium/support/testrail_report.py index 1cb45c66e8..1e0f2afcf5 100644 --- a/test/appium/support/testrail_report.py +++ b/test/appium/support/testrail_report.py @@ -118,8 +118,7 @@ class TestrailReport(BaseTestReport): test_cases['pr']['ens'] = 50827 test_cases['pr']['sync'] = 50834 test_cases['pr']['browser'] = 50812 - test_cases['pr']['permissions'] = 50843 - test_cases['pr']['scan qr'] = 50844 + ## Nightly e2e test_cases['nightly']['medium'] = 736 test_cases['nightly']['chat'] = 50811 @@ -133,6 +132,9 @@ class TestrailReport(BaseTestReport): test_cases['nightly']['activity_center'] = 50833 test_cases['nightly']['timeline'] = 50842 test_cases['nightly']['community'] = 50841 + test_cases['nightly']['permissions'] = 50843 + test_cases['nightly']['scan qr'] = 50844 + test_cases['nightly']['mentions'] = 50845 ## Upgrade e2e test_cases['upgrade']['general'] = 881 diff --git a/test/appium/tests/critical/chats/test_1_1_public_chats.py b/test/appium/tests/critical/chats/test_1_1_public_chats.py index 124d203603..b8cf4d7035 100644 --- a/test/appium/tests/critical/chats/test_1_1_public_chats.py +++ b/test/appium/tests/critical/chats/test_1_1_public_chats.py @@ -1086,11 +1086,17 @@ class TestEnsStickersMultipleDevicesMerged(MultipleSharedDeviceTestCase): @marks.testrail_id(702156) def test_ens_mention_push_highlighted_public_chat(self): [home.home_button.double_click() for home in (self.home_1, self.home_2)] + self.home_2.get_chat('#%s' % self.pub_chat_name).click() + text = "From ENS name user!" + self.chat_2.send_message(text) + self.chat_2.home_button.click() + self.home_2.put_app_to_background() self.home_2.open_notification_bar() self.home_1.just_fyi('check that can mention user with ENS name') - self.home_1.get_chat(self.ens).click() + self.home_1.get_chat('#%s' % self.pub_chat_name).click() + self.chat_1.wait_ens_name_resolved_in_chat(message=text, username_value='@%s' % self.reciever['ens']) self.chat_1.select_mention_from_suggestion_list(self.reciever['ens']) if self.chat_1.chat_message_input.text != self.ens + ' ': self.errors.append( @@ -1098,14 +1104,13 @@ class TestEnsStickersMultipleDevicesMerged(MultipleSharedDeviceTestCase): self.chat_1.send_message_button.click() self.home_2.just_fyi('check that PN is received and after tap you are redirected to chat, mention is highligted') - # TODO: issue #11003 pn = self.home_2.get_pn(self.reciever['username']) if pn: pn.click() else: self.errors.append('No PN on mention in public chat! ') self.home_2.click_system_back_button(2) - if self.home_2.element_starts_with_text(self.reciever['ens']).is_element_differs_from_template('mentioned.png', 2): + if self.home_2.element_starts_with_text(self.reciever['ens']).is_element_differs_from_template('ment_new.png'): self.errors.append('Mention is not highlighted!') self.errors.verify_no_errors() diff --git a/test/appium/tests/medium/chats/test_chats.py b/test/appium/tests/medium/test_chats_m.py similarity index 80% rename from test/appium/tests/medium/chats/test_chats.py rename to test/appium/tests/medium/test_chats_m.py index ef78c35363..4cdfce6bf7 100644 --- a/test/appium/tests/medium/chats/test_chats.py +++ b/test/appium/tests/medium/test_chats_m.py @@ -2,24 +2,14 @@ import random from time import sleep import emoji import pytest - -from tests import marks -from tests.users import ens_user -from tests.base_test_case import create_shared_drivers, MultipleSharedDeviceTestCase, MultipleDeviceTestCase -from views.sign_in_view import SignInView - -from views.chat_view import CommunityView -import pytest -from tests import marks from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers -from views.sign_in_view import SignInView -import time -from tests import bootnode_address, mailserver_address, mailserver_ams, mailserver_hk, used_fleet, common_password -from tests.users import transaction_senders, basic_user, ens_user + +from tests import bootnode_address, mailserver_address, mailserver_ams, used_fleet, background_service_message +from tests.users import transaction_senders, ens_user from tests import marks -from tests.base_test_case import MultipleDeviceTestCase from views.sign_in_view import SignInView + @pytest.mark.xdist_group(name="two_2") @marks.medium class TestTimelineHistoryNodesBootnodesMultipleDeviceMergedMedium(MultipleSharedDeviceTestCase): @@ -291,7 +281,6 @@ class TestTimelineHistoryNodesBootnodesMultipleDeviceMergedMedium(MultipleShared self.home_1.profile_button.double_click() self.profile_1.sync_settings_button.click() self.profile_1.mail_server_button.click() - #self.profile_1.mail_server_auto_selection_button.click() self.profile_1.element_by_text(server_name).scroll_and_click() self.profile_1.mail_server_delete_button.scroll_and_click() self.profile_1.mail_server_confirm_delete_button.click() @@ -303,7 +292,7 @@ class TestTimelineHistoryNodesBootnodesMultipleDeviceMergedMedium(MultipleShared @pytest.mark.xdist_group(name="three_2") @marks.medium -class TestChatMultipleDevice(MultipleSharedDeviceTestCase): +class TestChatMediumMultipleDevice(MultipleSharedDeviceTestCase): @classmethod def setup_class(cls): @@ -843,3 +832,198 @@ class TestGroupChatMultipleDevice(MultipleSharedDeviceTestCase): self.errors.append('%s is not shown after joining to group chat via invite' % join_system_message) self.errors.verify_no_errors() + +@pytest.mark.xdist_group(name="two_2") +@marks.medium +class TestChatKeycardMentionsMediumMultipleDevice(MultipleSharedDeviceTestCase): + + @classmethod + def setup_class(cls): + cls.drivers, cls.loop = create_shared_drivers(2) + cls.device_1, cls.device_2 = SignInView(cls.drivers[0]), SignInView(cls.drivers[1]) + cls.sender = transaction_senders['ETH_STT_1'] + + cls.device_1.just_fyi('Grab user data for transactions and public chat, set up wallets') + cls.home_1 = cls.device_1.create_user(keycard=True, enable_notifications=True) + cls.device_2.put_app_to_background_and_back() + cls.recipient_public_key, cls.recipient_username = cls.home_1.get_public_key_and_username(return_username=True) + cls.amount = cls.device_1.get_unique_amount() + cls.asset_name = 'STT' + cls.wallet_1 = cls.home_1.wallet_button.click() + cls.wallet_1.select_asset(cls.asset_name) + cls.wallet_1.home_button.click() + + cls.home_2 = cls.device_2.recover_access(passphrase=cls.sender['passphrase'], + keycard=True, enable_notifications=True) + cls.wallet_2 = cls.home_2.wallet_button.click() + cls.initial_amount_stt = cls.wallet_2.get_asset_amount_by_name('STT') + cls.wallet_2.home_button.click() + + cls.device_2.just_fyi('Add recipient to contact and send 1 message') + cls.chat_2 = cls.home_2.add_contact(cls.recipient_public_key) + cls.chat_2.send_message("test message") + cls.chat_1 = cls.home_1.get_chat(cls.sender['username']).click() + + @marks.testrail_id(702294) + def test_chat_1_1_unread_counter_highligted(self): + message_2, message_3 = 'test message2', 'test' + self.home_1.home_button.click() + self.home_1.dapp_tab_button.click() + self.chat_2.send_message(message_2) + + self.home_1.home_button.counter.wait_for_element(30) + if self.home_1.home_button.counter.text != '1': + self.errors.append('New messages counter is not shown on Home button') + self.device_1.home_button.click() + if self.home_1.get_chat(self.sender['username']).new_messages_counter.text != '1': + self.errors.append('New messages counter is not shown on chat element') + self.home_1.get_chat(self.sender['username']).click() + self.chat_1.add_to_contacts.click() + + self.home_1.home_button.double_click() + if self.home_1.home_button.counter.is_element_displayed(): + self.errors.append('New messages counter is shown on Home button for already seen message') + if self.home_1.get_chat(self.sender['username']).new_messages_counter.text == '1': + self.errors.append('New messages counter is shown on chat element for already seen message') + self.home_1.delete_chat_long_press(self.sender['username']) + + self.home_1.just_fyi("Checking preview of message and chat highlighting") + self.chat_2.send_message(message_3) + chat_1_element = self.home_1.get_chat(self.sender['username']) + if chat_1_element.chat_preview.is_element_differs_from_template('highligted_preview.png', 0): + self.errors.append("Preview message is not hightligted or text is not shown! ") + self.home_1.get_chat(self.sender['username']).click() + self.home_1.home_button.double_click() + if not self.home_1.get_chat(self.sender['username']).chat_preview.is_element_differs_from_template('highligted_preview.png', 0): + self.errors.append("Preview message is still highlighted after opening ") + self.errors.verify_no_errors() + + @marks.testrail_id(702295) + def test_keycard_1_1_chat_command_request_and_send_tx_stt_in_1_1_chat_offline_opened_from_push(self): + [home.home_button.double_click() for home in (self.home_1, self.home_2)] + self.home_1.get_chat(self.sender['username']).click() + self.chat_2.toggle_airplane_mode() + self.home_1.just_fyi('Request %s STT in 1-1 chat and check it is visible for sender and receiver' % self.amount) + self.chat_1.commands_button.click() + request_transaction = self.chat_1.request_command.click() + request_transaction.amount_edit_box.set_value(self.amount) + request_transaction.confirm() + asset_button = request_transaction.asset_by_name(self.asset_name) + request_transaction.select_asset_button.click_until_presence_of_element(asset_button) + asset_button.click() + request_transaction.request_transaction_button.click() + chat_1_request_message = self.chat_1.get_incoming_transaction() + if not chat_1_request_message.is_element_displayed(): + self.drivers[0].fail('No incoming transaction in 1-1 chat is shown for recipient after requesting STT') + + self.home_2.just_fyi('Check that transaction message is fetched from offline and sign transaction') + self.chat_2.toggle_airplane_mode() + self.home_2.home_button.click() + self.home_2.connection_offline_icon.wait_for_invisibility_of_element(120) + transaction_request_pn = 'Request transaction' + self.device_2.open_notification_bar() + if not self.device_2.element_by_text(transaction_request_pn).is_element_displayed(60): + self.errors.append("Push notification is not received after going back from offline") + self.home_2.click_system_back_button() + self.home_2.get_chat(self.recipient_username).click() + else: + self.device_2.element_by_text(transaction_request_pn).click() + chat_2_sender_message = self.chat_2.get_outgoing_transaction() + chat_2_sender_message.wait_for_visibility_of_element(60) + chat_2_sender_message.transaction_status.wait_for_element_text(chat_2_sender_message.address_received) + send_message = chat_2_sender_message.sign_and_send.click() + send_message.next_button.click() + send_message.sign_transaction(keycard=True) + self.chat_1.toggle_airplane_mode() + + self.home_2.just_fyi('Check that transaction message is updated with new status after offline') + [chat.toggle_airplane_mode() for chat in (self.chat_1, self.chat_2)] + self.network_api.wait_for_confirmation_of_transaction(self.sender['address'], self.amount, token=True) + for home in (self.home_1, self.home_2): + home.toggle_airplane_mode() + home.home_button.double_click() + self.home_1.get_chat(self.sender['username']).click() + self.home_2.get_chat(self.recipient_username).click() + chat_2_sender_message.transaction_status.wait_for_element_text(chat_2_sender_message.confirmed, wait_time=120) + + self.home_1.just_fyi('Check that can find tx in history and balance is updated after offline') + [home.wallet_button.click() for home in (self.home_1, self.home_2)] + self.wallet_2.wait_balance_is_changed('STT', self.initial_amount_stt) + self.wallet_1.wait_balance_is_changed('STT', scan_tokens=True) + [wallet.find_transaction_in_history(amount=self.amount, asset='STT') for wallet in (self.wallet_1, self.wallet_2)] + self.errors.verify_no_errors() + + @marks.testrail_id(702296) + def test_block_user_from_1_1_chat_header_check_mentions_and_push_notification_service(self): + [home.home_button.double_click() for home in (self.home_1, self.home_2)] + message_before_block_1 = "Before block from recipient" + message_before_block_2 = "Before block from sender" + message_after_block_2 = "After block from sender" + + self.device_1.just_fyi('both devices joining 1-1 chat and exchanging several messages') + self.home_1.get_chat(self.sender['username']).click() + self.home_2.get_chat(self.recipient_username).click() + self.chat_1.send_message(message_before_block_1) + self.chat_2.send_message(message_before_block_2) + + self.home_1.just_fyi('Check there is no random user in different public chat') + [home.home_button.click() for home in (self.home_1, self.home_2)] + chat_name = self.home_1.get_random_chat_name() + [chat_1, chat_2] = [home.join_public_chat(chat_name) for home in (self.home_1, self.home_2)] + chat_1.send_message(message_before_block_1) + self.home_2.home_button.click() + self.home_2.join_public_chat('r-%s' % chat_name) + chat_2.chat_message_input.send_keys('@') + if chat_2.search_user_in_mention_suggestion_list(self.recipient_username).is_element_displayed(): + self.errors.append('Random user from public chat is in mention suggestion list another public chat') + [home.home_button.double_click() for home in (self.home_1, self.home_2)] + + self.device_1.just_fyi('block user') + self.home_1.get_chat(self.sender['username']).click() + self.chat_1.chat_options.click() + self.chat_1.view_profile_button.click() + self.chat_1.block_contact() + self.chat_1.get_back_to_home_view() + + self.home_1.just_fyi('Check there is no blocked user in mentions in public chat ') + self.home_1.get_chat('#%s' % chat_name).click() + self.chat_1.chat_message_input.send_keys('@') + if self.chat_1.search_user_in_mention_suggestion_list(self.recipient_username).is_element_displayed(): + self.errors.append('Blocked user is available in mention suggestion list') + [chat.home_button.click() for chat in (self.chat_1, self.chat_2)] + + self.device_1.just_fyi('no 1-1 message from blocked user') + blocked_chat_user = self.home_1.element_by_text_part(self.sender['username']) + if blocked_chat_user.is_element_displayed(): + self.errors.append("Chat with blocked user is not deleted") + self.home_2.get_chat(self.recipient_username).click() + self.chat_2.send_message(message_after_block_2) + + self.device_1.just_fyi("check that new messages and push notifications don't arrive from blocked user") + self.device_1.open_notification_bar() + if self.device_1.element_by_text_part(message_after_block_2).is_element_displayed(30): + self.errors.append("Push notification is received from blocked user") + self.device_1.element_by_text_part(background_service_message).click() + + if blocked_chat_user.is_element_displayed(): + self.errors.append("Chat with blocked user is reappeared after receiving new messages in home view") + self.device_1.open_notification_bar() + self.home_1.stop_status_service_button.click() + + self.device_2.just_fyi("send messages when device 1 is offline") + self.chat_2.send_message(message_after_block_2) + + self.device_1.just_fyi("reopen app and check that messages from blocked user are not fetched") + self.device_1.click_system_home_button() + self.device_1.driver.launch_app() + self.device_1.sign_in(keycard=True) + if blocked_chat_user.is_element_displayed(): + self.errors.append("Chat with blocked user is reappeared after fetching new messages from offline") + + self.device_1.just_fyi("check that PNs are still enabled in profile after closing 'background notification centre' " + "message and relogin") + self.device_1.open_notification_bar() + if not self.device_1.element_by_text_part(background_service_message).is_element_displayed(): + self.errors.append("Background notification service is not started after relogin") + + self.errors.verify_no_errors() \ No newline at end of file diff --git a/test/appium/tests/medium/test_multiple_devices.py b/test/appium/tests/medium/test_multiple_devices.py deleted file mode 100644 index c1266ac228..0000000000 --- a/test/appium/tests/medium/test_multiple_devices.py +++ /dev/null @@ -1,426 +0,0 @@ -import random -import emoji -import time -from tests import background_service_message -from views.chat_view import CommunityView - - -from tests import bootnode_address, mailserver_address, mailserver_ams, mailserver_hk, used_fleet, common_password -from tests.users import transaction_senders, basic_user, ens_user -from tests import marks -from tests.base_test_case import MultipleDeviceTestCase -from views.sign_in_view import SignInView -from views.chat_view import ChatView - - -@marks.medium -class TestChatManagementMultipleDevice(MultipleDeviceTestCase): - @marks.testrail_id(5763) - # TODO: check main e2e about block; if the difference is only in place where user is blocked, split it and remove - # duplicates - def test_contact_block_user_from_one_to_one_header_check_push_notification_service(self): - self.create_drivers(2) - device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) - message_before_block_1 = "Before block from %s" % device_1.driver.number - message_before_block_2 = "Before block from %s" % device_2.driver.number - message_after_block_2 = "After block from %s" % device_2.driver.number - home_1, home_2 = device_1.create_user(enable_notifications=True), device_2.create_user() - profile_1 = home_1.profile_button.click() - device_2_public_key = home_2.get_public_key_and_username() - home_2.home_button.click() - default_username_1 = profile_1.default_username_text.text - profile_1.home_button.click() - - device_1.just_fyi('both devices joining the same public chat and send messages') - chat_name = device_1.get_random_chat_name() - for home in home_1, home_2: - home.join_public_chat(chat_name) - chat_public_1, chat_public_2 = home_1.get_chat_view(), home_2.get_chat_view() - for chat in chat_public_1, chat_public_2: - chat.chat_message_input.send_keys("Before block from %s" % chat.driver.number) - chat.send_message_button.click() - - chat_public_1.get_back_to_home_view() - chat_public_2.get_back_to_home_view() - - device_1.just_fyi('both devices joining 1-1 chat and exchanging several messages') - chat_1 = home_1.add_contact(device_2_public_key) - for _ in range(2): - chat_1.chat_message_input.send_keys(message_before_block_1) - chat_1.send_message_button.click() - - chat_2 = home_2.get_chat(default_username_1).click() - for _ in range(2): - chat_2.chat_message_input.send_keys(message_before_block_2) - chat_2.send_message_button.click() - - device_1.just_fyi('block user') - chat_1.chat_options.click() - chat_1.view_profile_button.click() - chat_1.block_contact() - chat_1.get_back_to_home_view() - chat_1.home_button.click() - - device_1.just_fyi('no 1-1, messages from blocked user are hidden in public chat') - from views.home_view import ChatElement - blocked_chat_user = ChatElement(self.drivers[0], basic_user['username']) - - if blocked_chat_user.is_element_displayed(): - home_1.driver.fail("Chat with blocked user '%s' is not deleted" % device_2.driver.number) - public_chat_after_block_1 = home_1.join_public_chat(chat_name) - if public_chat_after_block_1.chat_element_by_text(message_before_block_2).is_element_displayed(): - self.errors.append( - "Messages from blocked user '%s' are not cleared in public chat '%s'" % (device_2.driver.number, - chat_name)) - device_1.click_system_home_button() - - device_2.just_fyi('send messages to 1-1 and public chat') - for _ in range(2): - chat_2.chat_message_input.send_keys(message_after_block_2) - chat_2.send_message_button.click() - chat_2.get_back_to_home_view() - home_2.join_public_chat(chat_name) - chat_public_2 = home_2.get_chat_view() - [chat_public_2.send_message(message_after_block_2) for _ in range(2)] - - device_1.just_fyi("check that new messages and push notifications don't arrive from blocked user") - device_1.open_notification_bar() - if device_1.element_by_text_part(message_after_block_2).is_element_displayed(): - self.errors.append("Push notification is received from blocked user") - device_1.element_by_text_part(background_service_message).click() - - if public_chat_after_block_1.chat_element_by_text(message_after_block_2).is_element_displayed(): - self.errors.append("Message from blocked user '%s' is received" % device_2.driver.number) - if home_1.notifications_unread_badge.is_element_displayed(): - device_1.driver.fail("Unread badge is shown after receiving new message from blocked user") - if blocked_chat_user.is_element_displayed(): - device_2.driver.fail("Chat with blocked user is reappeared after receiving new messages in home view") - device_1.open_notification_bar() - home_1.stop_status_service_button.click() - - device_2.just_fyi("send messages when device 1 is offline") - for _ in range(2): - chat_public_2.chat_message_input.send_keys(message_after_block_2) - chat_public_2.send_message_button.click() - chat_public_2.get_back_to_home_view() - home_2.get_chat(default_username_1).click() - for _ in range(2): - chat_2.chat_message_input.send_keys(message_after_block_2) - chat_2.send_message_button.click() - - device_1.just_fyi("reopen app and check that messages from blocked user are not fetched") - device_1.click_system_home_button() - self.drivers[0].launch_app() - device_1.sign_in() - public_chat_after_block_1.home_button.double_click() - if home_1.notifications_unread_badge.is_element_displayed(): - device_1.driver.fail("Unread badge is shown after after fetching new messages from offline") - if blocked_chat_user.is_element_displayed(): - self.errors.append("Chat with blocked user is reappeared after fetching new messages from offline") - home_1.join_public_chat(chat_name) - home_1.get_chat_view() - if chat_public_1.chat_element_by_text(message_after_block_2).is_element_displayed(): - self.errors.append("Message from blocked user '%s' is received after fetching new messages from offline" - % device_2.driver.number) - - device_1.just_fyi("check that PNs are still enabled in profile after closing 'background notification centre' " - "message and relogin") - device_1.open_notification_bar() - if not device_1.element_by_text_part(background_service_message).is_element_displayed(): - self.errors.append("Background notification service is not started after relogin") - - self.errors.verify_no_errors() - - @marks.testrail_id(6326) - # TODO: check if no duplicate checks 702155 - def test_chat_mention_users_if_not_in_contacts(self): - self.create_drivers(2) - device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) - sender = ens_user - home_1, home_2 = device_1.create_user(), device_2.recover_access(passphrase=sender['passphrase']) - profile_2 = home_2.profile_button.click() - profile_2.connect_existing_ens(sender['ens']) - profile_2.home_button.double_click() - - device_1.just_fyi('Both devices joining the same public chat and send messages') - chat_name = device_1.get_random_chat_name() - [chat_1, chat_2] = [home.join_public_chat(chat_name) for home in (home_1, home_2)] - message = 'From ' + sender['ens'] + ' message' - chat_2.send_message(message) - username_value = '@' + sender['ens'] - - self.drivers[1].close_app() - self.drivers[1].launch_app() - device_2.back_button.click() - device_2.your_keys_more_icon.click() - device_2.generate_new_key_button.click() - device_2.create_user(second_user=True) - home_2.join_public_chat(chat_name) - newusermessage = 'Newusermessage2' - chat_2.send_message(newusermessage) - random_username = chat_1.chat_element_by_text(newusermessage).username.text - chat_1.wait_ens_name_resolved_in_chat(message=message, username_value=username_value) - - device_1.just_fyi('Set nickname for ENS user') - chat_1.view_profile_long_press(message) - nickname = 'nicknamefortestuser' - chat_1.set_nickname(nickname) - ens_nickname_value = nickname + " @" + sender['ens'] - chat_1.wait_ens_name_resolved_in_chat(message=message, username_value=ens_nickname_value) - - device_1.just_fyi('Check there is ENS+Nickname user in separate 1-1 chat') - chat_1.get_back_to_home_view() - home_1.add_contact(public_key=basic_user['public_key']) - chat_1.chat_message_input.send_keys('@') - if (chat_1.search_user_in_mention_suggestion_list(ens_nickname_value).is_element_displayed() or - chat_1.search_user_in_mention_suggestion_list( - sender['username']).is_element_displayed()): - self.errors.append('ENS-owner user who is not in 1-1 chat is available in mention suggestion list') - - device_1.just_fyi('Check there is no random user in different public chat') - chat_1.get_back_to_home_view() - chat_1 = home_1.join_public_chat(chat_name + "2") - chat_1.chat_message_input.send_keys('@') - if chat_1.search_user_in_mention_suggestion_list(random_username).is_element_displayed(): - self.errors.append('Random user from public chat is in mention suggestion list another public chat') - - device_1.just_fyi('Check there is ENS+Nickname user in Group chat and no random user') - chat_1.get_back_to_home_view() - home_1.add_contact(sender['public_key']) - chat_1.get_back_to_home_view() - home_1.create_group_chat(user_names_to_add=[nickname]) - chat_1.chat_message_input.send_keys('@') - if chat_1.search_user_in_mention_suggestion_list(random_username).is_element_displayed(): - self.errors.append('Random user from public chat is in mention suggestion list of Group chat') - if not (chat_1.search_user_in_mention_suggestion_list(ens_nickname_value).is_element_displayed() or - chat_1.search_user_in_mention_suggestion_list(sender['username']).is_element_displayed()): - self.errors.append('ENS-owner user is not available in mention suggestion list of Group chat') - - device_1.just_fyi('Check there is no blocked user in mentions Group/Public chat ') - home_1.home_button.click() - public_1 = home_1.join_public_chat(chat_name) - public_1.chat_element_by_text(message).member_photo.click() - public_1.block_contact() - public_1.chat_message_input.send_keys('@') - if (chat_1.search_user_in_mention_suggestion_list(ens_nickname_value).is_element_displayed() or - chat_1.search_user_in_mention_suggestion_list(sender['username']).is_element_displayed()): - self.errors.append('Blocked user is available in mention suggestion list') - - self.errors.verify_no_errors() - - @marks.testrail_id(5362) - # TODO: can be moved to TestOneToOneChatMultipleSharedDevices - should be quick e2e - def test_1_1_chat_unread_counter_preview_highlited(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() - profile_2 = home_2.profile_button.click() - default_username_2 = profile_2.default_username_text.text - home_2 = profile_2.home_button.click() - public_key_1 = home_1.get_public_key_and_username() - home_1.home_button.click() - chat_2 = home_2.add_contact(public_key_1) - - message, message_2, message_3 = 'test message', 'test message2', 'test' - chat_2.send_message(message) - home_1.get_chat(default_username_2).click() - home_1.home_button.click() - home_1.dapp_tab_button.click() - chat_2.send_message(message_2) - - home_1.home_button.counter.wait_for_element(30) - if home_1.home_button.counter.text != '1': - self.errors.append('New messages counter is not shown on Home button') - device_1.home_button.click() - if home_1.get_chat(default_username_2).new_messages_counter.text != '1': - self.errors.append('New messages counter is not shown on chat element') - chat_1 = home_1.get_chat(default_username_2).click() - chat_1.add_to_contacts.click() - - home_1.home_button.double_click() - - if home_1.home_button.counter.is_element_displayed(): - self.errors.append('New messages counter is shown on Home button for already seen message') - if home_1.get_chat(default_username_2).new_messages_counter.text == '1': - self.errors.append('New messages counter is shown on chat element for already seen message') - home_1.delete_chat_long_press(default_username_2) - - home_1.just_fyi("Checking preview of message and chat highlighting") - chat_2.send_message(message_3) - chat_1_element = home_1.get_chat(default_username_2) - if chat_1_element.chat_preview.is_element_differs_from_template('highligted_preview.png', 0): - self.errors.append("Preview message is not hightligted or text is not shown! ") - home_1.get_chat(default_username_2).click() - home_1.home_button.double_click() - if not home_1.get_chat(default_username_2).chat_preview.is_element_differs_from_template('highligted_preview.png', 0): - self.errors.append("Preview message is still highlighted after opening ") - self.errors.verify_no_errors() - - @marks.testrail_id(6294) - # TODO: may be merged with 6295 to group and add more tx tests - def test_keycard_1_1_chat_command_request_and_send_tx_stt_in_1_1_chat_offline_opened_from_push(self): - sender = transaction_senders['ETH_STT_1'] - self.create_drivers(2) - device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) - - device_1.just_fyi('Grab user data for transactions and public chat, set up wallets') - home_1 = device_1.create_user(keycard=True) - device_2.put_app_to_background_and_back() - recipient_public_key, recipient_username = home_1.get_public_key_and_username(return_username=True) - amount = device_1.get_unique_amount() - asset_name = 'STT' - wallet_1 = home_1.wallet_button.click() - wallet_1.select_asset(asset_name) - wallet_1.home_button.click() - - home_2 = device_2.recover_access(passphrase=sender['passphrase'], keycard=True, enable_notifications=True) - wallet_2 = home_2.wallet_button.click() - initial_amount_stt = wallet_2.get_asset_amount_by_name('STT') - wallet_2.home_button.click() - - device_2.just_fyi('Add recipient to contact and send 1 message') - chat_2 = home_2.add_contact(recipient_public_key) - chat_2.send_message("Hey there!") - - profile_2 = wallet_2.profile_button.click() - profile_2.airplane_mode_button.click() - device_2.home_button.double_click() - chat_element = home_1.get_chat(sender['username']) - chat_element.wait_for_visibility_of_element(30) - chat_1 = chat_element.click() - - home_1.just_fyi('Request %s STT in 1-1 chat and check it is visible for sender and receiver' % amount) - chat_1.commands_button.click() - request_transaction = chat_1.request_command.click() - request_transaction.amount_edit_box.set_value(amount) - request_transaction.confirm() - asset_button = request_transaction.asset_by_name(asset_name) - request_transaction.select_asset_button.click_until_presence_of_element(asset_button) - asset_button.click() - request_transaction.request_transaction_button.click() - chat_1_request_message = chat_1.get_incoming_transaction() - if not chat_1_request_message.is_element_displayed(): - self.drivers[0].fail('No incoming transaction in 1-1 chat is shown for recipient after requesting STT') - - home_2.just_fyi('Check that transaction message is fetched from offline and sign transaction') - profile_2.airplane_mode_button.click() - transaction_request_pn = 'Request transaction' - device_2.open_notification_bar() - if not device_2.element_by_text(transaction_request_pn).is_element_displayed(60): - self.errors.append("Push notification is not received after going back from offline") - device_2.element_by_text(transaction_request_pn).click() - home_2.connection_offline_icon.wait_for_invisibility_of_element(120) - home_2.get_chat(recipient_username).click() - chat_2_sender_message = chat_2.get_outgoing_transaction() - chat_2_sender_message.wait_for_visibility_of_element(60) - chat_2_sender_message.transaction_status.wait_for_element_text(chat_2_sender_message.address_received) - send_message = chat_2_sender_message.sign_and_send.click() - send_message.next_button.click() - send_message.sign_transaction(keycard=True) - chat_1.toggle_airplane_mode() - - home_2.just_fyi('Check that transaction message is updated with new status after offline') - [chat.toggle_airplane_mode() for chat in (chat_1, chat_2)] - self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, token=True) - for home in (home_1, home_2): - home.toggle_airplane_mode() - home.home_button.double_click() - home_1.get_chat(sender['username']).click() - home_2.get_chat(recipient_username).click() - chat_2_sender_message.transaction_status.wait_for_element_text(chat_2_sender_message.confirmed, wait_time=120) - - home_1.just_fyi('Check that can find tx in history and balance is updated after offline') - [home.wallet_button.click() for home in (home_1, home_2)] - wallet_2.wait_balance_is_changed('STT', initial_amount_stt) - wallet_1.wait_balance_is_changed('STT', scan_tokens=True) - [wallet.find_transaction_in_history(amount=amount, asset='STT') for wallet in (wallet_1, wallet_2)] - self.errors.verify_no_errors() - - @marks.testrail_id(6257) - # TODO: may be removed and couple of checks from it added to TestCommandsMultipleDevicesMerged; - # doesn't make a lot of sense as separate e2e - def test_1_1_chat_command_network_mismatch_for_send_tx_request_in_1_1_chat(self): - sender = transaction_senders['ETH_1'] - self.create_drivers(2) - sign_in_1, sign_in_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) - sign_in_1.recover_access(passphrase=sender['passphrase']) - sign_in_2.create_user() - home_1, home_2 = sign_in_1.get_home_view(), sign_in_2.get_home_view() - wallet_1 = home_1.wallet_button.click() - wallet_1.home_button.click() - profile_2 = home_2.profile_button.click() - username_2 = profile_2.default_username_text.text - profile_2.switch_network() - - chat_2 = home_2.add_contact(sender['public_key']) - chat_2.send_message("Hey there!") - amount = chat_2.get_unique_amount() - - chat_2.commands_button.click() - request_transaction = chat_2.request_command.click() - request_transaction.amount_edit_box.set_value(amount) - request_transaction.confirm() - request_transaction.request_transaction_button.click() - chat_2_request_message = chat_2.get_incoming_transaction() - - chat_2_request_message.long_press_element() - if chat_2.reply_message_button.is_element_displayed(): - self.errors.append('Reply is available on long-tap on Incoming transaction message!') - - chat_1 = home_1.get_chat(username_2).click() - chat_1_sender_message = chat_1.get_outgoing_transaction() - chat_1_sender_message.long_press_element() - if chat_1.reply_message_button.is_element_displayed(): - self.errors.append('Reply is available on long-tap on Outgoing transaction message!') - send_message = chat_1_sender_message.sign_and_send.click() - send_message.next_button.click() - send_message.sign_transaction() - self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount) - chat_1_sender_message.transaction_status.wait_for_element_text(chat_1_sender_message.confirmed) - wallet_2 = chat_2.wallet_button.click() - wallet_2.accounts_status_account.click() - wallet_2.swipe_down() - wallet_2.home_button.click(desired_view="chat") - if chat_2_request_message.transaction_status == chat_1_sender_message.confirmed: - self.errors.append("Transaction is shown as confirmed on mainnet, but was sent on ropsten!") - self.errors.verify_no_errors() - - @marks.testrail_id(6330) - # TODO: can be re-done to 1-driver test (sending between different account) - def test_wallet_can_send_tx_all_tokens_via_max_option(self): - sender = transaction_senders['ETH_STT_2'] - receiver = transaction_senders['ETH_1'] - self.create_drivers(2) - device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) - home_1, home_2 = device_1.recover_access(sender['passphrase']), device_2.recover_access(receiver['passphrase']) - wallet_sender = home_1.wallet_button.click() - wallet_receiver = home_2.wallet_button.click() - - if wallet_receiver.asset_by_name('STT').is_element_present(10): - initial_balance = wallet_receiver.get_asset_amount_by_name("STT") - else: - initial_balance = '0' - - device_1.just_fyi("Sending token amount to device who will use Set Max option for token") - amount = '0.012345678912345678' - wallet_sender.send_transaction(asset_name='STT', amount=amount, recipient=receiver['address']) - wallet_receiver.wait_balance_is_changed(asset='STT', initial_balance=initial_balance, scan_tokens=True) - wallet_receiver.accounts_status_account.click() - - device_1.just_fyi("Send all tokens via Set Max option") - send_transaction = wallet_receiver.send_transaction_button.click() - send_transaction.select_asset_button.click() - asset_name = 'STT' - asset_button = send_transaction.asset_by_name(asset_name) - send_transaction.select_asset_button.click_until_presence_of_element( - send_transaction.eth_asset_in_select_asset_bottom_sheet_button) - asset_button.click() - send_transaction.set_max_button.click() - send_transaction.set_recipient_address(sender['address']) - send_transaction.sign_transaction_button.click() - send_transaction.sign_transaction() - wallet_receiver.close_button.click() - initial_balance = float(initial_balance) + float(amount) - wallet_receiver.wait_balance_is_changed(asset='STT', initial_balance=str(initial_balance), scan_tokens=True) - - diff --git a/test/appium/tests/medium/test_single_device.py b/test/appium/tests/medium/test_single_device.py index e3deebda8d..24ae3768db 100644 --- a/test/appium/tests/medium/test_single_device.py +++ b/test/appium/tests/medium/test_single_device.py @@ -911,6 +911,50 @@ class TestChatManagement(SingleDeviceTestCase): self.errors.append('No redirected to carousel view after deleting last multiaccount') self.errors.verify_no_errors() + @marks.testrail_id(6330) + def test_wallet_send_tx_token_set_max(self): + sender = transaction_senders['ETH_STT_2'] + receiver = transaction_senders['ETH_1'] + sign_in = SignInView(self.driver) + home_1 = sign_in.recover_access(sender['passphrase']) + wallet = home_1.wallet_button.click() + wallet.wait_balance_is_changed('STT') + + home_1.just_fyi("Sending token amount to account who will use Set Max option for token") + amount = wallet.get_unique_amount() + wallet.send_transaction(asset_name='STT', amount=amount, recipient=receiver['address']) + self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, token=True) + wallet.wallet_button.double_click() + + home_1.just_fyi('Add account restored from seed phrase') + account_name = 'subaccount' + wallet.add_account_button.click() + wallet.enter_a_seed_phrase_button.click() + wallet.enter_your_password_input.send_keys(common_password) + wallet.enter_seed_phrase_input.set_value(receiver['passphrase']) + wallet.account_name_input.send_keys(account_name) + wallet.add_account_generate_account_button.click() + account_button = wallet.get_account_by_name(account_name) + account_button.click() + wallet.wait_balance_is_changed('STT', navigate_to_home=False) + + home_1.just_fyi("Send all tokens via Set Max option") + send_transaction = wallet.send_transaction_button.click() + send_transaction.select_asset_button.click() + asset_name = 'STT' + asset_button = send_transaction.asset_by_name(asset_name) + send_transaction.select_asset_button.click_until_presence_of_element( + send_transaction.eth_asset_in_select_asset_bottom_sheet_button) + asset_button.click() + send_transaction.set_max_button.click() + send_transaction.set_recipient_address(sender['address']) + send_transaction.sign_transaction_button.click() + send_transaction.sign_transaction() + wallet.close_button.click() + wallet.wallet_button.double_click() + wallet.get_account_by_name(account_name).click() + wallet.wait_balance_is_equal_expected_amount(asset='STT', expected_balance=0, main_screen=False) + @marks.testrail_id(6225) # TODO: can be added as last e2e in wallet group (to group with several accounts as prerequiste) def test_wallet_send_tx_between_accounts_in_multiaccount_instance(self): diff --git a/test/appium/views/elements_templates/ment_new.png b/test/appium/views/elements_templates/ment_new.png new file mode 100644 index 0000000000000000000000000000000000000000..cb0488db2ab6450f90b4347a0cd92b98dadaf95c GIT binary patch literal 3100 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