From 7c1850b901ca6f5669fc3360f73dc7fcd7b7da8c Mon Sep 17 00:00:00 2001 From: Yevheniia Berdnyk Date: Fri, 6 Oct 2023 17:48:13 +0300 Subject: [PATCH] e2e: some fixes and moved old ui tests to a separate dir --- test/appium/support/testrail_report.py | 2 +- .../test_activity_center.py | 0 .../critical/chats/test_1_1_public_chats.py | 818 +---------------- .../tests/critical/chats/test_group_chat.py | 134 --- .../{ => chats}/test_public_chat_browsing.py | 305 +------ .../old_ui/chats/test_1_1_public_chats.py | 822 ++++++++++++++++++ .../tests/old_ui/chats/test_group_chat.py | 140 +++ .../old_ui/chats/test_public_chat_browsing.py | 295 +++++++ .../medium/test_browser_profile.py | 0 .../tests/{ => old_ui}/medium/test_chats_m.py | 0 .../test_deeplink_chat_share_profile.py | 0 .../medium/test_pairing_devices_sync_m.py | 0 .../medium/test_permissions_scan_qr.py | 0 .../{ => old_ui}/medium/test_profile_m.py | 0 .../{ => old_ui}/medium/test_single_device.py | 0 .../medium/test_wallet_keycard_m.py | 0 .../onboarding/test_onboarding_flows.py | 0 .../test_pairing_devices_sync.py | 0 .../test_send_tx_dapp_keycard.py | 0 .../wallet_and_tx/test_wallet.py | 0 test/appium/views/base_view.py | 4 + .../discovery_join_button.png | Bin 5070 -> 6403 bytes test/appium/views/home_view.py | 9 +- 23 files changed, 1276 insertions(+), 1253 deletions(-) rename test/appium/tests/{medium => activity_center}/test_activity_center.py (100%) rename test/appium/tests/critical/{ => chats}/test_public_chat_browsing.py (79%) create mode 100644 test/appium/tests/old_ui/chats/test_1_1_public_chats.py create mode 100644 test/appium/tests/old_ui/chats/test_group_chat.py create mode 100644 test/appium/tests/old_ui/chats/test_public_chat_browsing.py rename test/appium/tests/{ => old_ui}/medium/test_browser_profile.py (100%) rename test/appium/tests/{ => old_ui}/medium/test_chats_m.py (100%) rename test/appium/tests/{ => old_ui}/medium/test_deeplink_chat_share_profile.py (100%) rename test/appium/tests/{ => old_ui}/medium/test_pairing_devices_sync_m.py (100%) rename test/appium/tests/{ => old_ui}/medium/test_permissions_scan_qr.py (100%) rename test/appium/tests/{ => old_ui}/medium/test_profile_m.py (100%) rename test/appium/tests/{ => old_ui}/medium/test_single_device.py (100%) rename test/appium/tests/{ => old_ui}/medium/test_wallet_keycard_m.py (100%) rename test/appium/tests/{critical => old_ui}/onboarding/test_onboarding_flows.py (100%) rename test/appium/tests/{critical => old_ui}/test_pairing_devices_sync.py (100%) rename test/appium/tests/{critical => old_ui}/wallet_and_tx/test_send_tx_dapp_keycard.py (100%) rename test/appium/tests/{critical => old_ui}/wallet_and_tx/test_wallet.py (100%) diff --git a/test/appium/support/testrail_report.py b/test/appium/support/testrail_report.py index 7a424e64d1..cab38a6c65 100644 --- a/test/appium/support/testrail_report.py +++ b/test/appium/support/testrail_report.py @@ -131,7 +131,7 @@ class TestrailReport(BaseTestReport): test_cases['pr']['activity_centre_other'] = 51005 ## Nightly e2e - # test_cases['nightly']['medium'] = 736 + # test_cases['nightly']['activity_center'] = 736 # test_cases['nightly']['chat'] = 50811 # test_cases['nightly']['browser'] = 50826 # test_cases['nightly']['profile'] = 50828 diff --git a/test/appium/tests/medium/test_activity_center.py b/test/appium/tests/activity_center/test_activity_center.py similarity index 100% rename from test/appium/tests/medium/test_activity_center.py rename to test/appium/tests/activity_center/test_activity_center.py 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 ab9c4ac3c3..aaeffa6f70 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 @@ -1,831 +1,15 @@ import random -import time import emoji import pytest from _pytest.outcomes import Failed from selenium.common.exceptions import TimeoutException, NoSuchElementException -from tests import marks, common_password, run_in_parallel, transl +from tests import marks, run_in_parallel, transl from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers -from tests.users import transaction_senders, basic_user, ens_user, ens_user_message_sender from views.sign_in_view import SignInView -@pytest.mark.xdist_group(name="four_2") -@marks.critical -class TestCommandsMultipleDevicesMerged(MultipleSharedDeviceTestCase): - - def prepare_devices(self): - self.drivers, self.loop = create_shared_drivers(2) - self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) - self.sender = transaction_senders['ETH_STT_3'] - self.home_1 = self.device_1.recover_access(passphrase=self.sender['passphrase'], enable_notifications=True) - self.home_2 = self.device_2.create_user() - for home in self.home_1, self.home_2: - profile = home.profile_button.click() - profile.profile_notifications_button.scroll_and_click() - profile.wallet_push_notifications.click() - self.recipient_public_key, self.recipient_username = self.home_2.get_public_key( - return_username=True) - self.wallet_1, self.wallet_2 = self.home_1.wallet_button.click(), self.home_2.wallet_button.click() - [wallet.home_button.click() for wallet in (self.wallet_1, self.wallet_2)] - self.chat_1 = self.home_1.add_contact(self.recipient_public_key) - self.chat_1.send_message("hello!") - self.account_name_1 = self.wallet_1.status_account_name - - @marks.testrail_id(6253) - def test_1_1_chat_command_send_tx_eth_outgoing_tx_push(self): - amount = self.chat_1.get_unique_amount() - self.home_1.just_fyi('Send %s ETH in 1-1 chat and check it for sender and receiver: Address requested' % amount) - self.chat_1.commands_button.click() - send_transaction = self.chat_1.send_command.click() - send_transaction.get_username_in_transaction_bottom_sheet_button(self.recipient_username).click() - if send_transaction.scan_qr_code_button.is_element_displayed(): - self.drivers[0].fail('Recipient is editable in bottom sheet when send ETH from 1-1 chat') - send_transaction.amount_edit_box.send_keys(amount) - send_transaction.confirm() - send_transaction.sign_transaction_button.click() - sender_message = self.chat_1.get_outgoing_transaction(self.account_name_1) - if not sender_message.is_element_displayed(): - self.drivers[0].fail('No message is shown after sending ETH in 1-1 chat for sender') - sender_message.transaction_status.wait_for_element_text(sender_message.address_requested) - - chat_2 = self.home_2.get_chat(self.sender['username']).click() - receiver_message = chat_2.get_incoming_transaction(self.account_name_1) - timestamp_sender = sender_message.timestamp_command_message.text - if not receiver_message.is_element_displayed(): - self.drivers[0].fail('No message about incoming transaction in 1-1 chat is shown for receiver') - receiver_message.transaction_status.wait_for_element_text(receiver_message.address_requested) - - self.home_2.just_fyi('Accept and share address for sender and receiver') - for option in (receiver_message.decline_transaction, receiver_message.accept_and_share_address): - if not option.is_element_displayed(): - self.drivers[0].fail("Required options accept or share are not shown") - - select_account_bottom_sheet = receiver_message.accept_and_share_address.click() - if not select_account_bottom_sheet.get_account_in_select_account_bottom_sheet_button( - self.account_name_1).is_element_displayed(): - self.errors.append('Not expected value in "From" in "Select account": "Status" is expected') - select_account_bottom_sheet.select_button.click() - receiver_message.transaction_status.wait_for_element_text(receiver_message.shared_account) - sender_message.transaction_status.wait_for_element_text(sender_message.address_request_accepted) - - self.home_1.just_fyi("Sign and send transaction and check that timestamp on message is updated") - time.sleep(20) - send_bottom_sheet = sender_message.sign_and_send.click() - send_bottom_sheet.next_button.click() - send_bottom_sheet.sign_transaction() - updated_timestamp_sender = sender_message.timestamp_command_message.text - if updated_timestamp_sender == timestamp_sender: - self.errors.append("Timestamp of message is not updated after signing transaction") - self.chat_1.wallet_button.click() - self.wallet_1.find_transaction_in_history(amount=amount) - - [wallet.put_app_to_background() for wallet in (self.wallet_1, self.wallet_2)] - self.device_1.open_notification_bar() - self.network_api.wait_for_confirmation_of_transaction(self.sender['address'], amount) - pn = self.home_1.get_pn('You sent %s ETH' % amount) - if pn: - pn.click() - if not self.wallet_1.transaction_history_button.is_element_displayed(): - self.errors.append('Was not redirected to transaction history after tapping on PN') - else: - self.home_1.click_system_back_button() - self.home_1.status_in_background_button.click_if_shown() - self.wallet_1.home_button.click(desired_view="chat") - - self.home_1.just_fyi("Check 'Confirmed' state for sender and receiver(use pull-to-refresh to update history)") - chat_2.status_in_background_button.click() - chat_2.wallet_button.click() - self.wallet_2.wait_balance_is_changed() - self.wallet_2.find_transaction_in_history(amount=amount) - self.wallet_2.home_button.click() - self.home_2.get_chat(self.sender['username']).click() - [message.transaction_status.wait_for_element_text(message.confirmed, 60) for message in - (sender_message, receiver_message)] - - # TODO: should be added PNs for receiver after getting more stable feature (rechecked 04.10.22, valid) - self.errors.verify_no_errors() - - @marks.testrail_id(6265) - def test_1_1_chat_command_decline_eth_push_changing_state(self): - [home.driver.background_app(3) for home in (self.home_1, self.home_2)] - self.home_1.home_button.double_click() - self.home_1.get_chat(username=self.recipient_username).click() - - self.home_1.just_fyi('Decline transaction before sharing address and check that state is changed') - self.chat_1.commands_button.click() - send_transaction = self.chat_1.send_command.click() - amount = self.chat_1.get_unique_amount() - send_transaction.amount_edit_box.send_keys(amount) - send_transaction.confirm() - send_transaction.sign_transaction_button.click() - chat_1_sender_message = self.chat_1.get_outgoing_transaction() - self.home_1.click_system_home_button() - - self.home_2.home_button.double_click() - chat_2 = self.home_2.get_chat(self.sender['username']).click() - chat_2_receiver_message = chat_2.get_incoming_transaction() - chat_2_receiver_message.decline_transaction.click() - self.home_1.open_notification_bar() - self.home_1.element_by_text_part('Request address for transaction declined').wait_and_click() - - [message.transaction_status.wait_for_element_text(message.declined) for message in - (chat_1_sender_message, chat_2_receiver_message)] - - self.home_1.just_fyi('Decline transaction request and check that state is changed') - request_amount = self.chat_1.get_unique_amount() - self.chat_1.commands_button.click() - request_transaction = self.chat_1.request_command.click() - request_transaction.amount_edit_box.send_keys(request_amount) - request_transaction.confirm() - request_transaction.request_transaction_button.click() - chat_1_request_message = self.chat_1.get_incoming_transaction() - chat_2_sender_message = chat_2.get_outgoing_transaction() - chat_2_sender_message.decline_transaction.click() - [message.transaction_status.wait_for_element_text(message.declined) for message in - (chat_2_sender_message, chat_1_request_message)] - - self.errors.verify_no_errors() - - @marks.testrail_id(6263) - def test_1_1_chat_command_request_and_send_tx_stt_in_1_1_chat_offline(self): - [home.driver.background_app(2) for home in (self.home_1, self.home_2)] - asset_name = 'STT' - amount = self.device_1.get_unique_amount() - - self.device_1.just_fyi('Grab user data for transactions and public chat, set up wallets') - self.home_2.get_back_to_home_view() - self.home_2.wallet_button.click() - self.wallet_2.select_asset(asset_name) - self.wallet_2.home_button.click() - self.home_1.wallet_button.double_click() - initial_amount_stt = self.wallet_1.get_asset_amount_by_name('STT') - app_package = self.home_1.driver.current_package - self.home_1.driver.terminate_app(app_package) - - self.home_2.just_fyi('Request %s STT in 1-1 chat and check it is visible for sender and receiver' % amount) - chat_2 = self.home_2.get_chat(username=self.sender['username']).click() - chat_2.commands_button.click() - request_transaction = chat_2.request_command.click() - request_transaction.amount_edit_box.send_keys(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_2_request_message = chat_2.get_incoming_transaction() - if not chat_2_request_message.is_element_displayed(): - self.drivers[1].fail('No incoming transaction in 1-1 chat is shown for recipient after requesting STT') - - self.home_1.just_fyi('Check that transaction message is fetched from offline and sign transaction') - self.device_1.driver.activate_app(app_package) - self.device_1.sign_in() - self.home_1.connection_offline_icon.wait_for_invisibility_of_element(30) - self.home_1.get_chat(self.recipient_username).click() - chat_1_sender_message = self.chat_1.get_outgoing_transaction() - if not chat_1_sender_message.is_element_displayed(): - self.drivers[0].fail('No outgoing transaction in 1-1 chat is shown for sender after requesting STT') - chat_1_sender_message.transaction_status.wait_for_element_text(chat_1_sender_message.address_received) - send_message = chat_1_sender_message.sign_and_send.click() - send_message.next_button.click() - send_message.sign_transaction() - - 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, chat_2)] - self.network_api.wait_for_confirmation_of_transaction(self.sender['address'], amount, token=True) - for home in (self.home_1, self.home_2): - home.toggle_airplane_mode() - home.home_button.double_click() - home.connection_offline_icon.wait_for_invisibility_of_element(100) - self.home_2.get_chat(self.sender['username']).click() - self.home_1.get_chat(self.recipient_username).click() - [message.transaction_status.wait_for_element_text(message.confirmed, wait_time=120) for message in - (chat_1_sender_message, chat_2_request_message)] - - self.home_1.just_fyi('Check that can find tx in history and balance is updated after offline') - self.home_1.wallet_button.click() - self.wallet_1.wait_balance_is_changed('STT', initial_amount_stt) - self.wallet_1.find_transaction_in_history(amount=amount, asset=asset_name) - - self.errors.verify_no_errors() - - -@pytest.mark.xdist_group(name="one_2") -@marks.critical -class TestOneToOneChatMultipleSharedDevices(MultipleSharedDeviceTestCase): - - def prepare_devices(self): - self.drivers, self.loop = create_shared_drivers(2) - self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) - self.home_1 = self.device_1.create_user(enable_notifications=True) - self.home_2 = self.device_2.create_user(enable_notifications=True) - self.profile_1 = self.home_1.profile_button.click() - self.default_username_1 = self.profile_1.default_username_text.text - self.profile_1.home_button.click() - self.public_key_2, self.default_username_2 = self.home_2.get_public_key() - self.chat_1 = self.home_1.add_contact(self.public_key_2) - self.chat_1.send_message('hey') - self.home_2.home_button.double_click() - self.chat_2 = self.home_2.get_chat(self.default_username_1).click() - - @marks.testrail_id(6316) - def test_1_1_chat_audio_message_with_push(self): - self.home_2.just_fyi("Put app on background (to check Push notification received for audio message)") - self.home_2.click_system_home_button() - - self.home_2.just_fyi("Sending audio message to device who is on background") - self.chat_1.record_audio_message(message_length_in_seconds=65) - if not self.chat_1.element_by_text("Maximum recording time reached").is_element_displayed(): - self.drivers[0].fail("Exceeded 1 min limit of recording time.") - - self.chat_1.ok_button.click() - if self.chat_1.audio_message_recorded_time.text != "0:59": - self.errors.append("Timer exceed 2 minutes") - self.chat_1.send_message_button.click() - - self.device_2.open_notification_bar() - chat_2 = self.home_2.click_upon_push_notification_by_text("Audio") - - listen_time = 5 - - self.device_2.home_button.click() - self.home_2.get_chat(self.default_username_1).click() - chat_2.play_audio_message(listen_time) - if chat_2.audio_message_in_chat_timer.text not in ("00:05", "00:06", "00:07", "00:08"): - self.errors.append("Listened 5 seconds but timer shows different listened time in audio message") - - self.errors.verify_no_errors() - - @marks.testrail_id(5387) - # think about priority of this - def test_1_1_chat_delete_via_delete_button_relogin(self): - self.home_1.driver.quit() - self.home_2.home_button.click() - self.home_2.get_chat(username=self.default_username_1).click() - - self.home_2.just_fyi("Deleting chat via delete button and check it will not reappear after relaunching app") - self.chat_2.delete_chat() - self.chat_2.get_back_to_home_view() - - if self.home_2.get_chat_from_home_view(self.default_username_1).is_element_displayed(): - self.errors.append('Deleted %s chat is shown, but the chat has been deleted' % self.default_username_1) - self.home_2.reopen_app() - if self.home_2.get_chat_from_home_view(self.default_username_1).is_element_displayed(): - self.errors.append( - 'Deleted chat %s is shown after re-login, but the chat has been deleted' % self.default_username_1) - self.errors.verify_no_errors() - - -@pytest.mark.xdist_group(name="two_2") -@marks.critical -class TestContactBlockMigrateKeycardMultipleSharedDevices(MultipleSharedDeviceTestCase): - - def prepare_devices(self): - self.drivers, self.loop = create_shared_drivers(2) - self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) - self.sender = transaction_senders['ETH_2'] - self.nick = "FFOO_brak!1234" - self.message = self.device_1.get_random_message() - self.pub_chat_name = self.device_1.get_random_chat_name() - self.home_1 = self.device_1.recover_access(self.sender['passphrase'], keycard=True) - self.home_2 = self.device_2.create_user() - self.profile_2 = self.home_2.profile_button.click() - self.profile_2.privacy_and_security_button.click() - self.profile_2.backup_recovery_phrase_button.click() - recovery_phrase = self.profile_2.backup_recovery_phrase() - self.recovery_phrase = ' '.join(recovery_phrase.values()) - self.public_key_2, self.default_username_2 = self.home_2.get_public_key() - self.chat_1 = self.home_1.add_contact(self.public_key_2, add_in_contacts=False) - self.chat_1.chat_options.click() - self.chat_1.view_profile_button.click() - self.chat_1.set_nickname(self.nick) - [home.home_button.click() for home in [self.home_1, self.home_2]] - self.home_2.add_contact(self.sender['public_key']) - self.home_2.home_button.click() - [home.join_public_chat(self.pub_chat_name) for home in [self.home_1, self.home_2]] - self.chat_2 = self.home_2.get_chat_view() - self.chat_2.send_message(self.message) - [home.home_button.click() for home in [self.home_1, self.home_2]] - - @marks.testrail_id(702186) - def test_keycard_command_send_tx_eth_1_1_chat(self): - self.home_2.get_chat(self.sender['username']).click() - self.chat_2.send_message("hey on kk!") - self.chat_2.home_button.click() - - amount = self.chat_1.get_unique_amount() - account_name = self.chat_1.status_account_name - - self.chat_1.just_fyi('Send %s ETH in 1-1 chat and check it for sender and receiver: Address requested' % amount) - self.home_1.get_chat(self.nick).click() - self.chat_1.send_message("hello again!") - self.chat_1.commands_button.click() - send_transaction = self.chat_1.send_command.click() - send_transaction.get_username_in_transaction_bottom_sheet_button(self.default_username_2).click() - if send_transaction.scan_qr_code_button.is_element_displayed(): - self.chat_1.driver.fail('Recipient is editable in bottom sheet when send ETH from 1-1 chat') - send_transaction.amount_edit_box.send_keys(amount) - send_transaction.confirm() - send_transaction.sign_transaction_button.click() - sender_message = self.chat_1.get_outgoing_transaction() - if not sender_message.is_element_displayed(): - self.chat_1.driver.fail('No message is shown after sending ETH in 1-1 chat for sender') - sender_message.transaction_status.wait_for_element_text(sender_message.address_requested) - - self.home_2.get_chat(self.sender['username']).click() - receiver_message = self.chat_2.get_incoming_transaction() - timestamp_sender = sender_message.timestamp_command_message.text - if not receiver_message.is_element_displayed(30): - self.chat_2.driver.fail('No message about incoming transaction in 1-1 chat is shown for receiver') - receiver_message.transaction_status.wait_for_element_text(receiver_message.address_requested) - - self.chat_1.just_fyi('Accept and share address for sender and receiver') - for option in (receiver_message.decline_transaction, receiver_message.accept_and_share_address): - if not option.is_element_displayed(): - self.drivers[0].fail("Required options accept or share are not shown") - - select_account_bottom_sheet = receiver_message.accept_and_share_address.click() - if not select_account_bottom_sheet.get_account_in_select_account_bottom_sheet_button( - account_name).is_element_displayed(): - self.errors.append('Not expected value in "From" in "Select account": "Status" is expected') - select_account_bottom_sheet.select_button.click() - receiver_message.transaction_status.wait_for_element_text(receiver_message.shared_account) - sender_message.transaction_status.wait_for_element_text(sender_message.address_request_accepted) - - self.chat_1.just_fyi("Sign and send transaction and check that timestamp on message is updated") - time.sleep(20) - send_message = sender_message.sign_and_send.click() - send_message.next_button.click() - send_message.sign_transaction(keycard=True) - updated_timestamp_sender = sender_message.timestamp_command_message.text - if updated_timestamp_sender == timestamp_sender: - self.errors.append("Timestamp of message is not updated after signing transaction") - - wallet_1 = self.chat_1.wallet_button.click() - wallet_1.find_transaction_in_history(amount=amount) - self.home_2.put_app_to_background_and_back() - self.network_api.wait_for_confirmation_of_transaction(self.sender['address'], amount, confirmations=3) - wallet_1.home_button.click(desired_view='chat') - - self.home_1.just_fyi("Check 'Confirmed' state for sender and receiver(use pull-to-refresh to update history)") - wallet_2 = self.chat_2.wallet_button.click() - wallet_2.find_transaction_in_history(amount=amount) - sender_message.transaction_status.wait_for_element_text(sender_message.confirmed, 120) - self.errors.verify_no_errors() - - @marks.testrail_id(702175) - def test_contact_add_remove_mention_default_username_nickname_public_chat(self): - [home.home_button.double_click() for home in [self.home_1, self.home_2]] - self.chat_1.just_fyi('check that can mention user with 3-random name in public chat') - self.home_1.get_chat('#%s' % self.pub_chat_name).click() - - self.chat_1.just_fyi('Set nickname for user without adding him to contacts, check it in public chat') - chat_element = self.chat_1.chat_element_by_text(self.message) - expected_username = '%s %s' % (self.nick, self.default_username_2) - if chat_element.username.text != expected_username: - self.errors.append('Username %s in public chat does not match expected %s' % ( - chat_element.username.text, expected_username)) - - self.chat_1.just_fyi('Add user to contacts, mention it by nickname check contact list in Profile') - chat_element.member_photo.click() - self.chat_1.profile_add_to_contacts_button.click() - if not self.chat_1.remove_from_contacts.is_element_displayed(): - self.errors.append("'Add to contacts' is not changed to 'Remove from contacts'") - self.chat_1.close_button.click() - - self.chat_1.just_fyi('check that can mention user with nickname or default username in public chat') - self.chat_1.select_mention_from_suggestion_list(username_in_list=self.nick + ' ' + self.default_username_2, - typed_search_pattern=self.nick[0:2]) - if self.chat_1.chat_message_input.text != '@' + self.default_username_2 + ' ': - self.errors.append('Username is not resolved in chat input after selecting it in mention ' - 'suggestions list by nickname!') - self.chat_1.chat_message_input.clear() - for pattern in (self.nick[0:2], self.default_username_2[0:4]): - self.chat_1.select_mention_from_suggestion_list(username_in_list=self.nick + ' ' + self.default_username_2, - typed_search_pattern=pattern) - if self.chat_1.chat_message_input.text != '@' + self.default_username_2 + ' ': - self.errors.append('Username is not resolved in chat input after selecting it in mention suggestions ' - 'list by default username!') - additional_text = 'and more' - self.chat_1.send_as_keyevent(additional_text) - self.chat_1.send_message_button.click() - if not self.chat_1.chat_element_by_text('%s %s' % (self.nick, additional_text)).is_element_displayed(): - self.errors.append("Nickname is not resolved on send message") - self.chat_1.get_back_to_home_view() - - self.chat_1.just_fyi('check contact list in Profile after setting nickname') - profile_1 = self.chat_1.profile_button.click() - userprofile = profile_1.open_contact_from_profile(self.nick) - if not userprofile.remove_from_contacts.is_element_displayed(): - self.errors.append("'Add to contacts' is not changed to 'Remove from contacts' in profile contacts") - profile_1.close_button.click() - profile_1.home_button.double_click() - - self.chat_1.just_fyi( - 'Check that user is added to contacts below "Start new chat" and you redirected to 1-1 on tap') - self.home_1.plus_button.click() - self.home_1.start_new_chat_button.click() - if not self.home_1.element_by_text(self.nick).is_element_displayed(): - self.home_1.driver.fail('List of contacts below "Start new chat" does not contain added user') - self.home_1.element_by_text(self.nick).click() - if not self.chat_1.chat_message_input.is_element_displayed(): - self.chat_1.driver.fail('No redirect to 1-1 chat if tap on Contact below "Start new chat"') - for element in (self.chat_1.chat_message_input, self.chat_1.element_by_text(self.nick)): - if not element.is_element_displayed(): - self.errors.append('Expected element is not found in 1-1 after adding user to contacts from profile') - if self.chat_1.add_to_contacts.is_element_displayed(): - self.errors.append('"Add to contacts" button is shown in 1-1 after adding user to contacts from profile') - - self.chat_1.just_fyi('Remove user from contacts') - self.chat_1.chat_options.click() - self.chat_1.view_profile_button.click() - self.chat_1.remove_from_contacts.click_until_absense_of_element(self.chat_1.remove_from_contacts) - if self.chat_1.profile_nickname.text != self.nick: - self.errors.append("Nickname is changed after removing user from contacts") - - self.chat_1.just_fyi('Check that user is removed from contact list in profile') - self.chat_1.close_button.click() - if not self.chat_1.add_to_contacts.is_element_displayed(): - self.errors.append('"Add to contacts" button is not shown in 1-1 after removing user from contacts') - self.chat_1.profile_button.double_click() - profile_1.contacts_button.click() - if profile_1.element_by_text(self.nick).is_element_displayed(): - self.errors.append('Contact is shown in Profile after removing user from contacts') - self.errors.verify_no_errors() - - @marks.testrail_id(702188) - @marks.xfail( - reason="flaky; issue when sometimes history is not fetched from offline for public chat, needs investigation") - def test_cellular_settings_on_off_public_chat_fetching_history(self): - [home.home_button.double_click() for home in [self.home_1, self.home_2]] - public_chat_name, public_chat_message = 'e2e-started-before', 'message to pub chat' - public_1 = self.home_1.join_public_chat(public_chat_name) - public_1.send_message(public_chat_message) - - self.home_2.just_fyi('set mobile data to "OFF" and check that peer-to-peer connection is still working') - self.home_2.set_network_to_cellular_only() - self.home_2.mobile_connection_off_icon.wait_for_visibility_of_element(20) - for element in (self.home_2.continue_syncing_button, self.home_2.stop_syncing_button, - self.home_2.remember_my_choice_checkbox): - if not element.is_element_displayed(10): - self.drivers[0].fail( - 'Element %s is not not shown in "Syncing mobile" bottom sheet' % element.locator) - self.home_2.stop_syncing_button.click() - if not self.home_2.mobile_connection_off_icon.is_element_displayed(): - self.drivers[0].fail('No mobile connection OFF icon is shown') - self.home_2.mobile_connection_off_icon.click() - for element in self.home_2.connected_to_n_peers_text, self.home_2.waiting_for_wi_fi: - if not element.is_element_displayed(): - self.errors.append("Element '%s' is not shown in Connection status bottom sheet" % element.locator) - self.home_2.click_system_back_button() - public_2 = self.home_2.join_public_chat(public_chat_name) - if public_2.chat_element_by_text(public_chat_message).is_element_displayed(30): - self.errors.append("Chat history was fetched with mobile data fetching off") - public_chat_new_message = 'new message' - public_1.send_message(public_chat_new_message) - if not public_2.chat_element_by_text(public_chat_new_message).is_element_displayed(30): - self.errors.append("Peer-to-peer connection is not working when mobile data fetching is off") - - self.home_2.just_fyi('set mobile data to "ON"') - self.home_2.home_button.click() - self.home_2.mobile_connection_off_icon.click() - self.home_2.use_mobile_data_switch.wait_and_click(30) - if not self.home_2.connected_to_node_text.is_element_displayed(10): - self.errors.append("Not connected to history node after enabling fetching on mobile data") - self.home_2.click_system_back_button() - self.home_2.mobile_connection_on_icon.wait_for_visibility_of_element(10) - self.home_2.get_chat('#%s' % public_chat_name).click() - if not public_2.chat_element_by_text(public_chat_message).is_element_displayed(180): - self.errors.append("Chat history was not fetched with mobile data fetching ON") - - self.home_2.just_fyi('check redirect to sync settings by tapping on "Sync" in connection status bottom sheet') - self.home_2.home_button.click() - self.home_2.mobile_connection_on_icon.click() - self.home_2.connection_settings_button.click() - if not self.home_2.element_by_translation_id("mobile-network-use-mobile").is_element_displayed(): - self.errors.append( - "Was not redirected to sync settings after tapping on Settings in connection bottom sheet") - - self.home_2.just_fyi("Check default preferences in Sync settings") - profile_1 = self.home_1.get_profile_view() - self.home_1.profile_button.double_click() - profile_1.sync_settings_button.click() - if not profile_1.element_by_translation_id("mobile-network-use-wifi").is_element_displayed(): - self.errors.append("Mobile data is enabled by default") - profile_1.element_by_translation_id("mobile-network-use-wifi").click() - if profile_1.ask_me_when_on_mobile_network.text != "ON": - self.errors.append("'Ask me when on mobile network' is not enabled by default") - - profile_1.just_fyi("Disable 'ask me when on mobile network' and check that it is not shown") - profile_1.ask_me_when_on_mobile_network.click() - profile_1.set_network_to_cellular_only() - if profile_1.element_by_translation_id("mobile-network-start-syncing").is_element_displayed(20): - self.errors.append("Popup is shown, but 'ask me when on mobile network' is disabled") - - profile_1.just_fyi("Check 'Restore default' setting") - profile_1.element_by_text('Restore Defaults').click() - if profile_1.use_mobile_data.attribute_value("checked"): - self.errors.append("Mobile data is enabled by default") - if not profile_1.ask_me_when_on_mobile_network.attribute_value("checked"): - self.errors.append("'Ask me when on mobile network' is not enabled by default") - self.errors.verify_no_errors() - - @marks.testrail_id(702177) - def test_restore_account_migrate_multiaccount_to_keycard_db_saved(self): - self.home_1.driver.quit() - self.home_2.profile_button.double_click() - self.profile_2.logout() - - self.device_2.just_fyi("Checking migration to keycard: db saved (1-1 chat, nickname, messages)") - self.device_2.options_button.click() - self.device_2.manage_keys_and_storage_button.click() - self.device_2.move_keystore_file_option.click() - self.device_2.enter_seed_phrase_next_button.click() - self.device_2.seedphrase_input.send_keys(self.recovery_phrase) - self.device_2.choose_storage_button.click() - self.device_2.keycard_required_option.click() - self.device_2.confirm_button.click() - self.device_2.migration_password_input.send_keys(common_password) - self.device_2.confirm_button.click() - from views.keycard_view import KeycardView - keycard = KeycardView(self.device_2.driver) - keycard.begin_setup_button.click() - keycard.connect_card_button.wait_and_click() - keycard.enter_default_pin() - keycard.enter_default_pin() - if not self.device_2.element_by_translation_id("migration-successful").is_element_displayed(30): - self.driver.fail("No popup about successfull migration is shown!") - self.device_2.ok_button.click() - self.home_2.home_button.wait_for_element(30) - if not self.home_2.element_by_text_part(self.pub_chat_name).is_element_displayed(): - self.errors.append("Public chat was removed from home after migration to kk") - self.home_2.get_chat(self.sender['username']).click() - if self.chat_2.add_to_contacts.is_element_displayed(): - self.errors.append("User was removed from contacts after migration to kk") - self.errors.verify_no_errors() - - -@pytest.mark.xdist_group(name="three_2") -@marks.critical -class TestEnsStickersMultipleDevicesMerged(MultipleSharedDeviceTestCase): - - def prepare_devices(self): - self.drivers, self.loop = create_shared_drivers(2) - self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) - self.sender, self.reciever = transaction_senders['ETH_3'], ens_user - self.home_1 = self.device_1.recover_access(passphrase=self.sender['passphrase']) - self.home_2 = self.device_2.recover_access(ens_user['passphrase'], enable_notifications=True) - self.ens = '@%s' % self.reciever['ens'] - self.pub_chat_name = self.home_1.get_random_chat_name() - self.chat_1 = self.home_1.join_public_chat(self.pub_chat_name) - self.chat_2 = self.home_2.join_public_chat(self.pub_chat_name) - [home.home_button.double_click() for home in (self.home_1, self.home_2)] - self.profile_2 = self.home_2.profile_button.click() - self.profile_2.connect_existing_ens(self.reciever['ens']) - self.home_1.add_contact(self.reciever['ens']) - self.home_2.home_button.click() - self.home_2.add_contact(self.sender['public_key']) - # To avoid activity centre for restored users - [chat.send_message("hey!") for chat in (self.chat_1, self.chat_2)] - - self.home_1.just_fyi("Close the ENS banner") - [home.home_button.double_click() for home in (self.home_1, self.home_2)] - [home.ens_banner_close_button.click_if_shown() for home in (self.home_1, self.home_2)] - - @marks.testrail_id(702152) - def test_ens_purchased_in_profile(self): - self.home_2.profile_button.double_click() - ens_name_after_adding = self.profile_2.default_username_text.text - if ens_name_after_adding != '@%s' % ens_user['ens']: - self.errors.append('ENS name is not shown as default in user profile after adding, "%s" instead' % - ens_name_after_adding) - - self.home_2.just_fyi('check ENS name wallet address and public key') - self.home_2.element_by_text(self.reciever['ens']).click() - self.home_2.element_by_text(self.reciever['ens']).click() - for text in (self.reciever['address'].lower(), self.reciever['public_key']): - if not self.home_2.element_by_text_part(text).is_element_displayed(40): - self.errors.append('%s text is not shown' % text) - self.home_2.profile_button.double_click() - - self.home_2.just_fyi('check ENS name is shown on share my profile window') - self.profile_2.share_my_profile_button.click() - if self.profile_2.ens_name_in_share_chat_key_text.text != '%s' % ens_user['ens']: - self.errors.append('No ENS name is shown on tapping on share icon in Profile') - self.profile_2.close_share_popup() - self.errors.verify_no_errors() - - @marks.testrail_id(702153) - def test_ens_command_send_tx_eth_1_1_chat(self): - [home.home_button.double_click() for home in (self.home_1, self.home_2)] - wallet_1 = self.home_1.wallet_button.click() - wallet_1.wait_balance_is_changed() - wallet_1.home_button.click() - self.home_1.get_chat(self.ens).click() - self.chat_1.commands_button.click() - amount = self.chat_1.get_unique_amount() - - self.chat_1.just_fyi("Check sending assets to ENS name from sender side") - send_message = self.chat_1.send_command.click() - send_message.amount_edit_box.send_keys(amount) - send_message.confirm() - send_message.next_button.click() - from views.send_transaction_view import SendTransactionView - send_transaction = SendTransactionView(self.drivers[0]) - send_transaction.ok_got_it_button.click() - send_transaction.sign_transaction() - chat_1_sender_message = self.chat_1.get_outgoing_transaction(transaction_value=amount) - self.home_2.put_app_to_background_and_back() - self.network_api.wait_for_confirmation_of_transaction(self.sender['address'], amount, confirmations=3) - chat_1_sender_message.transaction_status.wait_for_element_text(chat_1_sender_message.confirmed) - - self.chat_2.just_fyi("Check that message is fetched for receiver") - self.home_2.get_chat(self.sender['username']).click() - chat_2_reciever_message = self.chat_2.get_incoming_transaction(transaction_value=amount) - chat_2_reciever_message.transaction_status.wait_for_element_text(chat_2_reciever_message.confirmed, - wait_time=60) - - @marks.testrail_id(702155) - def test_ens_mention_nickname_1_1_chat(self): - [home.home_button.double_click() for home in (self.home_1, self.home_2)] - - self.home_1.just_fyi('Mention user by ENS in 1-1 chat') - message, message_ens_owner = '%s hey!' % self.ens, '%s hey!' % self.reciever['ens'] - self.home_1.get_chat(self.ens).click() - self.chat_1.send_message(message) - - self.home_1.just_fyi('Set nickname and mention user by nickname in 1-1 chat') - russian_nickname = 'МОЙ дорогой ДРУх' - self.chat_1.chat_options.click() - self.chat_1.view_profile_button.click() - self.chat_1.set_nickname(russian_nickname) - self.chat_1.select_mention_from_suggestion_list(russian_nickname + ' ' + self.ens) - - self.chat_1.just_fyi('Check that nickname is shown in preview for 1-1 chat') - updated_message = '%s hey!' % russian_nickname - self.chat_1.home_button.double_click() - if not self.chat_1.element_by_text(updated_message).is_element_displayed(): - self.errors.append('"%s" is not show in chat preview on home screen!' % message) - self.home_1.get_chat(russian_nickname).click() - - self.chat_1.just_fyi('Check redirect to user profile on mention by nickname tap') - self.chat_1.chat_element_by_text(updated_message).click() - if not self.chat_1.profile_block_contact_button.is_element_displayed(): - self.errors.append( - 'No redirect to user profile after tapping on message with mention (nickname) in 1-1 chat') - else: - self.chat_1.profile_send_message_button.click() - - self.chat_2.just_fyi("Check message with mention for ENS owner") - self.home_2.get_chat(self.sender['username']).click() - if not self.chat_2.chat_element_by_text(message_ens_owner).is_element_displayed(): - self.errors.append('Expected %s message is not shown for ENS owner' % message_ens_owner) - - self.chat_1.just_fyi('Check if after deleting nickname ENS is shown again') - self.chat_1.chat_options.click() - self.chat_1.view_profile_button.click() - self.chat_1.profile_nickname_button.click() - self.chat_1.nickname_input_field.clear() - self.chat_1.element_by_text('Done').click() - self.chat_1.close_button.click() - if self.chat_1.user_name_text.text != self.ens: - self.errors.append("Username '%s' is not updated to ENS '%s' after deleting nickname" % - (self.chat_1.user_name_text.text, self.ens)) - - self.errors.verify_no_errors() - - @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('#%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( - 'ENS username is not resolved in chat input after selecting it in mention suggestions list!') - 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') - 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('ment_new_1.png', - 2): - self.errors.append('Mention is not highlighted!') - self.errors.verify_no_errors() - - @marks.testrail_id(702157) - def test_sticker_1_1_public_chat_mainnet(self): - self.home_2.status_in_background_button.click_if_shown() - [home.home_button.double_click() for home in (self.home_1, self.home_2)] - profile_2 = self.home_2.profile_button.click() - profile_2.switch_network() - - self.home_2.just_fyi('Check that can use purchased stickerpack on Mainnet') - self.home_2.get_chat('#%s' % self.pub_chat_name).click() - self.chat_2.install_sticker_pack_by_name('Tozemoon') - self.chat_2.sticker_icon.click() - if not self.chat_2.chat_item.is_element_displayed(): - self.errors.append('Cannot use purchased stickers') - self.home_2.profile_button.click() - profile_2.switch_network('Goerli with upstream RPC') - - self.home_1.just_fyi('Install free sticker pack and use it in 1-1 chat on Goerli') - self.home_1.get_chat(self.ens).click() - self.chat_1.chat_message_input.clear() - self.chat_1.install_sticker_pack_by_name() - self.chat_1.sticker_icon.click() - if not self.chat_1.sticker_message.is_element_displayed(): - self.errors.append('Sticker was not sent') - self.chat_1.swipe_right() - if not self.chat_1.sticker_icon.is_element_displayed(): - self.errors.append('Sticker is not shown in recently used list') - self.chat_1.get_back_to_home_view() - - self.home_1.just_fyi('Send stickers in public chat from Recent') - self.home_1.join_public_chat(self.home_1.get_random_chat_name()) - self.chat_1.show_stickers_button.click() - self.chat_1.sticker_icon.click() - if not self.chat_1.chat_item.is_element_displayed(): - self.errors.append('Sticker was not sent from Recent') - - # self.home_2.just_fyi('Check that can install stickers by tapping on sticker message') - # TODO: disabled because of #13683 (rechecked 04.10.22, valid) - self.home_2.home_button.double_click() - self.home_2.get_chat(self.sender['username']).click() - # self.chat_2.chat_item.click() - # self.chat_2.element_by_text_part('Free').wait_and_click(40) - # if self.chat_2.element_by_text_part('Free').is_element_displayed(): - # self.errors.append('Stickerpack was not installed') - - self.chat_2.just_fyi('Check that can navigate to another user profile via long tap on sticker message') - # self.chat_2.close_sticker_view_icon.click() - self.chat_2.chat_item.long_press_element() - self.chat_2.element_by_text('View Details').click() - self.chat_2.profile_send_message_button.wait_and_click() - self.errors.verify_no_errors() - - @marks.testrail_id(702158) - def test_start_new_chat_public_key_validation(self): - [home.get_back_to_home_view() for home in (self.home_1, self.home_2)] - self.home_2.driver.quit() - public_key = basic_user['public_key'] - self.home_1.plus_button.click() - chat = self.home_1.start_new_chat_button.click() - - self.home_1.just_fyi("Validation: invalid public key and invalid ENS") - for invalid_chat_key in (basic_user['public_key'][:-1], ens_user_message_sender['ens'][:-2]): - chat.public_key_edit_box.clear() - chat.public_key_edit_box.send_keys(invalid_chat_key) - chat.confirm() - if not self.home_1.element_by_translation_id("profile-not-found").is_element_displayed(): - self.errors.append('Error is not shown for invalid public key') - - self.home_1.just_fyi("Check that valid ENS is resolved") - chat.public_key_edit_box.clear() - chat.public_key_edit_box.send_keys(ens_user_message_sender['ens']) - resolved_ens = '%s.stateofus.eth' % ens_user_message_sender['ens'] - if not chat.element_by_text(resolved_ens).is_element_displayed(10): - self.errors.append('ENS name is not resolved after pasting chat key') - self.home_1.close_button.click() - - self.home_1.just_fyi("Check that can paste public key from keyboard and start chat") - self.home_1.get_chat('#%s' % self.pub_chat_name).click() - chat.send_message(public_key) - chat.copy_message_text(public_key) - chat.back_button.click() - self.home_1.plus_button.click() - self.home_1.start_new_chat_button.click() - chat.public_key_edit_box.paste_text_from_clipboard() - if chat.public_key_edit_box.text != public_key: - self.errors.append('Public key is not pasted from clipboard') - if not chat.element_by_text(basic_user['username']).is_element_displayed(): - self.errors.append('3 random-name is not resolved after pasting chat key') - - self.home_1.just_fyi('My_profile button at Start new chat view opens own QR code with public key pop-up') - self.home_1.my_profile_on_start_new_chat_button.click() - account = self.home_1.get_profile_view() - if not (account.public_key_text.is_element_displayed() and account.share_button.is_element_displayed() - and account.qr_code_image.is_element_displayed()): - self.errors.append('No self profile pop-up data displayed after My_profile button tap') - self.errors.verify_no_errors() - - @pytest.mark.xdist_group(name="new_one_2") @marks.new_ui_critical class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase): diff --git a/test/appium/tests/critical/chats/test_group_chat.py b/test/appium/tests/critical/chats/test_group_chat.py index 29f2d1a2c8..1dd4055aac 100644 --- a/test/appium/tests/critical/chats/test_group_chat.py +++ b/test/appium/tests/critical/chats/test_group_chat.py @@ -10,140 +10,6 @@ from views.chat_view import ChatView from views.sign_in_view import SignInView -@pytest.mark.xdist_group(name="one_3") -@marks.critical -class TestGroupChatMultipleDeviceMerged(MultipleSharedDeviceTestCase): - - def prepare_devices(self): - self.drivers, self.loop = create_shared_drivers(3) - self.message_before_adding = 'message before adding new user' - self.message_to_admin = 'Hey, admin!' - - self.homes, self.public_keys, self.usernames, self.chats = {}, {}, {}, {} - for key in self.drivers: - sign_in = SignInView(self.drivers[key]) - self.homes[key] = sign_in.create_user(enable_notifications=True) - SignInView(self.drivers[2]).put_app_to_background_and_back() - self.public_keys[key], self.usernames[key] = sign_in.get_public_key(True) - sign_in.home_button.click() - SignInView(self.drivers[0]).put_app_to_background_and_back() - self.chat_name = self.homes[0].get_random_chat_name() - - self.homes[0].just_fyi('Admin adds future members to contacts') - for i in range(1, 3): - self.homes[0].add_contact(self.public_keys[i]) - self.homes[0].home_button.double_click() - - self.homes[0].just_fyi('Members add admin to contacts to see PNs and put app in background') - for i in range(1, 3): - self.homes[i].handle_contact_request(self.usernames[0]) - self.homes[i].home_button.double_click() - - self.homes[0].just_fyi('Admin creates group chat') - self.chats[0] = self.homes[0].create_group_chat([self.usernames[1]], self.chat_name) - for i in range(1, 3): - self.chats[i] = ChatView(self.drivers[i]) - - self.chats[0].send_message(self.message_before_adding) - - @marks.testrail_id(3994) - def test_group_chat_push_system_messages_when_invited(self): - self.homes[1].just_fyi("Check system messages in PNs") - self.homes[2].put_app_to_background_and_back() - self.homes[1].put_app_to_background() - self.homes[1].open_notification_bar() - pns = [self.chats[0].pn_invited_to_group_chat(self.usernames[0], self.chat_name), - self.chats[0].pn_wants_you_to_join_to_group_chat(self.usernames[0], self.chat_name)] - for pn in pns: - if not self.homes[1].get_pn(pn): - self.errors.append('%s is not shown after invite to group chat' % pn) - if self.homes[1].get_pn(pns[0]): - group_invite_pn = self.homes[1].get_pn(pns[0]) - group_invite_pn.click() - else: - self.homes[1].click_system_back_button(2) - self.homes[1].get_chat(self.chat_name).click() - - self.homes[1].just_fyi("Check system messages in group chat for admin and member") - create_system_message = self.chats[0].create_system_message(self.usernames[0], self.chat_name) - has_added_system_message = self.chats[0].has_added_system_message(self.usernames[0], self.usernames[1]) - - create_for_admin_system_message = 'You created the group %s' % self.chat_name - joined_message = "You've joined %s from invitation by %s" % (self.chat_name, self.usernames[0]) - - for message in [create_for_admin_system_message, create_system_message, has_added_system_message]: - if not self.chats[0].element_by_text(message).is_element_displayed(): - self.errors.append('%s system message is not shown' % message) - - for message in [joined_message, create_system_message, has_added_system_message]: - if not self.chats[1].element_by_text(message).is_element_displayed(): - self.errors.append('%s system message is not shown' % message) - - self.errors.verify_no_errors() - - @marks.testrail_id(700732) - def test_group_chat_add_new_member(self): - [self.homes[i].home_button.double_click() for i in range(3)] - self.homes[0].get_chat(self.chat_name).click() - self.chats[0].add_members_to_group_chat([self.usernames[2]]) - - self.chats[2].just_fyi("Check there will be PN and no unread in AC for a new member") - if self.homes[2].notifications_unread_badge.is_element_displayed(60): - self.drivers[2].fail("Group chat appeared in AC!") - self.homes[2].open_notification_bar() - if not self.homes[2].element_by_text_part(self.usernames[0]).is_element_displayed(): - self.errors.append("PN about group chat invite is not shown when invited by mutual contact") - - self.homes[2].click_system_back_button() - - self.homes[2].just_fyi("Check new group appeared in chat list for a new member") - if not self.homes[2].get_chat(self.chat_name).is_element_displayed(60): - self.drivers[2].fail("New group chat hasn't appeared in chat list") - - self.homes[2].get_chat(self.chat_name).click() - - for message in (self.message_to_admin, self.message_before_adding): - if self.chats[2].chat_element_by_text(message).is_element_displayed(): - self.errors.append('%s is shown for new user' % message) - self.errors.verify_no_errors() - - @marks.testrail_id(5756) - def test_group_chat_highligted(self): - chat_name = 'for_invited' - [self.homes[i].home_button.double_click() for i in range(3)] - self.homes[0].create_group_chat([self.usernames[1]], chat_name) - - self.homes[1].just_fyi("Check that new group chat from contact is highlited") - chat_2_element = self.homes[1].get_chat(chat_name) - if chat_2_element.no_message_preview.is_element_differs_from_template('highligted_preview_group.png', 0): - self.errors.append("Preview message is not hightligted or text is not shown! ") - chat_2 = self.homes[1].get_chat(chat_name).click() - chat_2.home_button.click() - if not chat_2_element.no_message_preview.is_element_differs_from_template('highligted_preview_group.png', 0): - self.errors.append("Preview message is still hightligted after opening! ") - - @marks.testrail_id(3997) - def test_group_chat_leave_relogin(self): - left_system_message = self.chats[1].leave_system_message(self.usernames[0]) - self.drivers[2].quit() - [self.homes[i].home_button.double_click() for i in range(2)] - self.homes[0].home_button.double_click() - self.homes[1].get_chat(self.chat_name).click() - - self.homes[0].just_fyi("Admin deleted chat via long press") - self.homes[0].leave_chat_long_press(self.chat_name) - - self.homes[1].just_fyi('Check that leave system message is presented after user left the group chat') - if not self.chats[1].chat_element_by_text(left_system_message).is_element_displayed(): - self.errors.append('System message when user leaves the chat is not shown') - - self.homes[0].just_fyi("Member sends some message, admin relogins and check chat does not reappear") - self.chats[1].send_message(self.message_to_admin) - self.homes[0].relogin() - if self.homes[0].get_chat_from_home_view(self.chat_name).is_element_displayed(): - self.drivers[0].fail('Deleted %s is present after relaunch app' % self.chat_name) - - @pytest.mark.xdist_group(name="new_one_3") @marks.new_ui_critical class TestGroupChatMultipleDeviceMergedNewUI(MultipleSharedDeviceTestCase): diff --git a/test/appium/tests/critical/test_public_chat_browsing.py b/test/appium/tests/critical/chats/test_public_chat_browsing.py similarity index 79% rename from test/appium/tests/critical/test_public_chat_browsing.py rename to test/appium/tests/critical/chats/test_public_chat_browsing.py index c0b8cc25ee..74059e206a 100644 --- a/test/appium/tests/critical/test_public_chat_browsing.py +++ b/test/appium/tests/critical/chats/test_public_chat_browsing.py @@ -1,306 +1,18 @@ import datetime import random -from datetime import timedelta import emoji import pytest from _pytest.outcomes import Failed -from dateutil import parser from selenium.common.exceptions import NoSuchElementException, TimeoutException -from tests import marks, test_dapp_name, test_dapp_url, run_in_parallel, pytest_config_global, transl +from tests import marks, run_in_parallel, pytest_config_global, transl from tests.base_test_case import create_shared_drivers, MultipleSharedDeviceTestCase from views.chat_view import CommunityView from views.dbs.waku_backup import user as waku_user from views.sign_in_view import SignInView -@pytest.mark.xdist_group(name="three_1") -@marks.critical -class TestPublicChatBrowserOneDeviceMerged(MultipleSharedDeviceTestCase): - - def prepare_devices(self): - self.drivers, self.loop = create_shared_drivers(1) - self.sign_in = SignInView(self.drivers[0]) - - self.home = self.sign_in.create_user() - self.public_chat_name = self.home.get_random_chat_name() - self.chat = self.home.join_public_chat(self.public_chat_name) - - @marks.testrail_id(5675) - def test_public_chat_fetch_more_history(self): - self.home.just_fyi("Check that can fetch previous history for several days") - device_time = parser.parse(self.drivers[0].device_time) - yesterday = (device_time - timedelta(days=1)).strftime("%b %-d, %Y") - before_yesterday = (device_time - timedelta(days=2)).strftime("%b %-d, %Y") - quiet_time_yesterday, quiet_time_before_yesterday = '24 hours', '2 days' - fetch_more = self.home.get_translation_by_key("load-more-messages") - for message in (yesterday, quiet_time_yesterday): - if not self.chat.element_by_text_part(message).is_element_displayed(120): - self.drivers[0].fail('"%s" is not shown' % message) - self.chat.element_by_text_part(fetch_more).wait_and_click(120) - self.chat.element_by_text_part(fetch_more).wait_for_visibility_of_element(180) - for message in (before_yesterday, quiet_time_before_yesterday): - if not self.chat.element_by_text_part(message).is_element_displayed(): - self.drivers[0].fail('"%s" is not shown' % message) - self.home.just_fyi("Check that can fetch previous history for month") - times = { - "three-days": '5 days', - "one-week": '12 days', - "one-month": ['43 days', '42 days', '41 days', '40 days'], - } - profile = self.home.profile_button.click() - profile.sync_settings_button.click() - profile.sync_history_for_button.click() - for period in times: - profile.just_fyi("Checking %s period" % period) - profile.element_by_translation_id(period).click() - profile.home_button.click(desired_view='chat') - self.chat.element_by_text_part(fetch_more).wait_and_click(120) - if period != "one-month": - if not profile.element_by_text_part(times[period]).is_element_displayed(30): - self.errors.append("'Quiet here for %s' is not shown after fetching more history" % times[period]) - else: - variants = times[period] - self.chat.element_by_text_part(fetch_more).wait_for_invisibility_of_element(120) - res = any(profile.element_by_text_part(variant).is_element_displayed(30) for variant in variants) - if not res: - self.errors.append("History is not fetched for one month!") - self.home.profile_button.click(desired_element_text=profile.get_translation_by_key("default-sync-period")) - self.errors.verify_no_errors() - - @marks.testrail_id(5396) - def test_public_chat_navigate_to_chat_when_relaunch(self): - text_message = 'some_text' - self.home.home_button.double_click() - self.home.get_chat('#%s' % self.public_chat_name).click() - self.chat.send_message(text_message) - self.chat.reopen_app() - if not self.chat.chat_element_by_text(text_message).is_element_displayed(30): - self.drivers[0].fail("Not navigated to chat view after reopening app") - - @marks.testrail_id(5317) - def test_public_chat_copy_and_paste_message_in_chat_input(self): - message_text = {'text_message': 'mmmeowesage_text'} - formatted_message = {'message_with_link': 'https://status.im', - # TODO: blocked with 11161 (rechecked 04.10.22, valid) - # 'message_with_tag': '#successishere' - } - message_input = self.chat.chat_message_input - if not message_input.is_element_displayed(): - self.home.get_chat('#%s' % self.public_chat_name).click() - message_input.send_keys(message_text['text_message']) - self.chat.send_message_button.click() - - self.chat.copy_message_text(message_text['text_message']) - - message_input.paste_text_from_clipboard() - if message_input.text != message_text['text_message']: - self.errors.append('Message %s text was not copied in a public chat' % message_text['text_message']) - message_input.clear() - - for message in formatted_message: - message_input.send_keys(formatted_message[message]) - self.chat.send_message_button.click() - - message_bubble = self.chat.chat_element_by_text(formatted_message[message]) - message_bubble.sent_status_checkmark.long_press_element() - self.chat.element_by_text('Copy').click() - - message_input.paste_text_from_clipboard() - if message_input.text != formatted_message[message]: - self.errors.append('Message %s text was not copied in a public chat' % formatted_message[message]) - message_input.clear() - - self.errors.verify_no_errors() - - @marks.testrail_id(700738) - def test_public_chat_tag_message(self): - tag_message = '#wuuut' - self.home.home_button.double_click() - self.home.get_chat('#%s' % self.public_chat_name).click() - self.home.just_fyi("Check that will be redirected to chat view on tap on tag message") - self.chat.send_message(tag_message) - self.chat.element_starts_with_text(tag_message).click() - self.chat.element_by_text_part(self.public_chat_name).wait_for_invisibility_of_element() - if not self.chat.user_name_text.text == tag_message: - self.errors.append('Could not redirect a user to a public chat tapping the tag message.') - self.home.just_fyi("Check that chat is added to home view") - self.chat.home_button.double_click() - if not self.home.element_by_text(tag_message).is_element_displayed(): - self.errors.append('Could not find the public chat in user chat list.') - self.errors.verify_no_errors() - - @marks.testrail_id(700739) - def test_public_chat_open_using_deep_link(self): - self.drivers[0].terminate_app(self.drivers[0].current_package) - chat_name = self.home.get_random_chat_name() - deep_link = 'status-im://%s' % chat_name - self.sign_in.open_weblink_and_login(deep_link) - try: - assert self.chat.user_name_text.text == '#' + chat_name - except (AssertionError, NoSuchElementException): - self.drivers[0].fail("Public chat '%s' is not opened" % chat_name) - - @marks.testrail_id(702072) - def test_browser_blocked_url(self): - dapp = self.home.dapp_tab_button.click() - for url in ('metamask.site', 'cryptokitties.domainname'): - dapp.just_fyi('Checking blocked website %s' % url) - dapp_detail = dapp.open_url(url) - dapp_detail.element_by_translation_id('browsing-site-blocked-title') - if dapp_detail.browser_refresh_page_button.is_element_displayed(): - self.errors.append("Refresh button is present in blocked site") - dapp_detail.go_back_button.click() - dapp_detail.open_tabs_button.click() - dapp.element_by_text_part(url[:8]).click() - dapp_detail.continue_anyway_button.click() - if dapp_detail.element_by_text('This site is blocked').is_element_displayed(): - self.errors.append("Failed to open Dapp after 'Continue anyway' tapped for %s" % url) - dapp_detail.open_tabs_button.click() - dapp_detail.empty_tab_button.click() - self.errors.verify_no_errors() - - @marks.testrail_id(702073) - def test_browser_connection_is_secure_not_secure_warning(self): - dapp = self.home.dapp_tab_button.click() - web_page = dapp.open_url('http://www.dvwa.co.uk') - web_page.url_edit_box_lock_icon.click_until_presence_of_element( - web_page.element_by_translation_id("browser-not-secure")) - web_page.open_tabs_button.click() - web_page.empty_tab_button.click() - dapp.just_fyi('Checking connection is secure for Airswap') - web_page = dapp.open_url('https://instant.airswap.io') - web_page.wait_for_d_aap_to_load() - web_page.url_edit_box_lock_icon.click_until_presence_of_element( - web_page.element_by_translation_id("browser-secure")) - web_page.open_tabs_button.click() - web_page.empty_tab_button.click() - - @marks.testrail_id(702074) - def test_browser_invalid_url(self): - dapp = self.home.dapp_tab_button.click() - browsing_view = dapp.open_url('invalid.takoe') - browsing_view.element_by_translation_id("web-view-error").wait_for_element(20) - - @marks.testrail_id(702075) - def test_browser_offline(self): - dapp = self.home.dapp_tab_button.click() - self.home.toggle_airplane_mode() - browsing_view = dapp.open_url('status.im') - offline_texts = ['Unable to load page', 'ERR_INTERNET_DISCONNECTED'] - for text in offline_texts: - browsing_view.element_by_text_part(text).wait_for_element(15) - self.home.toggle_airplane_mode() - browsing_view.browser_refresh_page_button.click_until_presence_of_element( - browsing_view.element_by_text_part('An Open Source Community')) - - @marks.testrail_id(702076) - def test_browser_delete_close_tabs(self): - dapp = self.home.dapp_tab_button.click() - urls = { - 'google.com': 'Google', - 'status.im': 'Status - Private', - 'bbc.com': 'bbc.com' - } - for url in urls: - web_page = dapp.open_url(url) - web_page.open_tabs_button.click() - web_page.empty_tab_button.click() - - self.home.just_fyi('Delete one tab') - web_page.remove_tab(name=urls['bbc.com']) - web_page.open_tabs_button.wait_for_invisibility_of_element() - web_page.element_by_text_part(urls['bbc.com']).wait_for_invisibility_of_element() - - self.home.just_fyi('Close all tabs via "Close all", relogin and check that it is not reappearing') - web_page.close_all_button.click() - self.home.reopen_app() - web_page.dapp_tab_button.click() - web_page.open_tabs_button.click() - if web_page.element_by_text_part(urls['status.im']).is_element_displayed(): - self.errors.append('Tabs are not closed or reappeared after re-login!') - - self.errors.verify_no_errors() - - @marks.testrail_id(702077) - def test_browser_bookmarks_create_edit_remove(self): - dapp = self.home.dapp_tab_button.click() - - self.home.just_fyi('Add some url to bookmarks with default name') - web_page = dapp.open_url('status.im') - default_bookmark_name = web_page.add_to_bookmarks() - web_page.browser_previous_page_button.click() - if not web_page.element_by_text(default_bookmark_name).is_element_displayed(): - self.errors.append("Bookmark with default name is not added!") - - self.home.just_fyi('Add some url to bookmarks with custom name') - custom_name = 'Custom BBC' - dapp.open_url('bbc.com') - web_page.add_to_bookmarks(custom_name) - web_page.open_tabs_button.click() - web_page.empty_tab_button.click() - if not web_page.element_by_text(custom_name).is_element_displayed(): - self.driver.fail("Bookmark with custom name is not added!") - - self.home.just_fyi('Checking "Open in new tab"') - dapp.browser_entry_long_press(custom_name) - dapp.open_in_new_tab_button.click() - web_page.options_button.click() - if not web_page.element_by_translation_id('remove-favourite').is_element_displayed(): - self.errors.append("Remove favourite is not shown on added bookmark!") - dapp.click_system_back_button() - - self.home.just_fyi('Check deleting bookmark') - web_page.open_tabs_button.click() - web_page.empty_tab_button.click() - dapp.browser_entry_long_press(custom_name) - dapp.delete_bookmark_button.click() - if web_page.element_by_text(custom_name).is_element_displayed(): - self.errors.append("Bookmark with custom name is not deleted!") - - self.home.just_fyi('Check "Edit bookmark" and "Open in new tab"') - edited_name = 'My Fav Status' - dapp.browser_entry_long_press(default_bookmark_name) - dapp.edit_bookmark_button.click() - web_page.edit_bookmark_name(edited_name) - if not web_page.element_by_text(edited_name).is_element_displayed(): - self.driver.fail("Edited bookmark name is not shown!") - - self.errors.verify_no_errors() - - @marks.testrail_id(702078) - def test_browser_web3_permissions_testdapp(self): - self.home.home_button.double_click() - - self.home.just_fyi('open Status Test Dapp, allow all and check permissions in Profile') - web_view = self.home.open_status_test_dapp() - dapp = self.home.dapp_tab_button.click() - profile = self.home.profile_button.click() - profile.privacy_and_security_button.click() - profile.dapp_permissions_button.click() - profile.element_by_text(test_dapp_name).click() - if not profile.element_by_text(self.home.status_account_name).is_element_displayed(): - self.errors.append('Wallet permission was not granted') - if not profile.element_by_translation_id("chat-key").is_element_displayed(): - self.errors.append('Contact code permission was not granted') - - profile.just_fyi('revoke access and check that they are asked second time') - profile.revoke_access_button.click() - profile.get_back_to_home_view() - profile.dapp_tab_button.click() - web_view.open_tabs_button.click() - web_view.empty_tab_button.click() - dapp.open_url(test_dapp_url) - if not dapp.element_by_text_part(self.home.status_account_name).is_element_displayed(): - self.errors.append('Wallet permission is not asked') - if dapp.allow_button.is_element_displayed(): - dapp.allow_button.click(times_to_click=1) - if not dapp.element_by_translation_id("your-contact-code").is_element_displayed(): - self.errors.append('Profile permission is not asked') - self.errors.verify_no_errors() - - @pytest.mark.xdist_group(name="new_one_1") @marks.new_ui_critical class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase): @@ -321,8 +33,6 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase): self.channel = self.community_view.get_channel(self.channel_name).click() @marks.testrail_id(703503) - @marks.xfail( - reason="Request to Join Community button color issue:17295") def test_community_discovery(self): self.home.navigate_back_to_home_view() self.home.communities_tab.click() @@ -330,8 +40,7 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase): self.home.community_card_item.wait_for_visibility_of_element(30) if len(self.home.community_card_item.find_elements()) > 1: - contributors_test_community_attributes = "Contributors' test community", 'test anything here', \ - 'Web3', 'Software dev' + contributors_test_community_attributes = "Test Community", 'Open for anyone', 'Web3', 'Software dev' for text in contributors_test_community_attributes: if not self.home.element_by_text(text).is_element_displayed(10): self.errors.append("'%s' text is not in Discovery!" % text) @@ -1056,9 +765,10 @@ class TestCommunityMultipleDeviceMergedTwo(MultipleSharedDeviceTestCase): self.username_1, self.username_2 = "user_1", "user_2" self.loop.run_until_complete(run_in_parallel(((self.device_1.create_user, {'enable_notifications': True, 'username': self.username_1}), - (self.device_2.create_user, {'username': self.username_2})))) + (self.device_2.create_user, {'enable_notifications': True, + 'username': self.username_2})))) self.homes = self.home_1, self.home_2 = self.device_1.get_home_view(), self.device_2.get_home_view() - self.public_key_2 = self.home_2.get_public_key_via_share_profile_tab() + self.public_key_2 = self.home_2.get_public_key() self.profile_1 = self.home_1.get_profile_view() [home.navigate_back_to_home_view() for home in self.homes] [home.chats_tab.click() for home in self.homes] @@ -1076,12 +786,10 @@ class TestCommunityMultipleDeviceMergedTwo(MultipleSharedDeviceTestCase): self.community_name = "open community" self.channel_name = 'general' self.home_1.create_community(community_type="open") - self.channel_1 = self.home_1.get_to_community_channel_from_home(self.community_name) - self.channel_1.send_message(self.text_message) self.community_1, self.community_2 = self.home_1.get_community_view(), self.home_2.get_community_view() self.community_1.share_community(self.community_name, self.username_2) - self.home_1.get_to_community_channel_from_home(self.community_name) + self.channel_1 = self.home_1.get_to_community_channel_from_home(self.community_name) self.home_2.just_fyi("Send message to contact (need for blocking contact) test") self.chat_2.send_message(self.text_message) @@ -1090,7 +798,6 @@ class TestCommunityMultipleDeviceMergedTwo(MultipleSharedDeviceTestCase): self.channel_2 = self.community_2.get_channel(self.channel_name).click() @marks.testrail_id(702786) - @marks.xfail(reason="Issue with username in PN 17396") def test_community_mentions_push_notification(self): self.home_1.navigate_back_to_home_view() self.device_1.open_notification_bar() diff --git a/test/appium/tests/old_ui/chats/test_1_1_public_chats.py b/test/appium/tests/old_ui/chats/test_1_1_public_chats.py new file mode 100644 index 0000000000..9f6236f9d4 --- /dev/null +++ b/test/appium/tests/old_ui/chats/test_1_1_public_chats.py @@ -0,0 +1,822 @@ +import time + +import pytest + +from tests import marks, common_password +from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers +from tests.users import transaction_senders, basic_user, ens_user, ens_user_message_sender +from views.sign_in_view import SignInView + + +@pytest.mark.xdist_group(name="four_2") +@marks.critical +class TestCommandsMultipleDevicesMerged(MultipleSharedDeviceTestCase): + + def prepare_devices(self): + self.drivers, self.loop = create_shared_drivers(2) + self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) + self.sender = transaction_senders['ETH_STT_3'] + self.home_1 = self.device_1.recover_access(passphrase=self.sender['passphrase'], enable_notifications=True) + self.home_2 = self.device_2.create_user() + for home in self.home_1, self.home_2: + profile = home.profile_button.click() + profile.profile_notifications_button.scroll_and_click() + profile.wallet_push_notifications.click() + self.recipient_public_key, self.recipient_username = self.home_2.get_public_key( + return_username=True) + self.wallet_1, self.wallet_2 = self.home_1.wallet_button.click(), self.home_2.wallet_button.click() + [wallet.home_button.click() for wallet in (self.wallet_1, self.wallet_2)] + self.chat_1 = self.home_1.add_contact(self.recipient_public_key) + self.chat_1.send_message("hello!") + self.account_name_1 = self.wallet_1.status_account_name + + @marks.testrail_id(6253) + def test_1_1_chat_command_send_tx_eth_outgoing_tx_push(self): + amount = self.chat_1.get_unique_amount() + self.home_1.just_fyi('Send %s ETH in 1-1 chat and check it for sender and receiver: Address requested' % amount) + self.chat_1.commands_button.click() + send_transaction = self.chat_1.send_command.click() + send_transaction.get_username_in_transaction_bottom_sheet_button(self.recipient_username).click() + if send_transaction.scan_qr_code_button.is_element_displayed(): + self.drivers[0].fail('Recipient is editable in bottom sheet when send ETH from 1-1 chat') + send_transaction.amount_edit_box.send_keys(amount) + send_transaction.confirm() + send_transaction.sign_transaction_button.click() + sender_message = self.chat_1.get_outgoing_transaction(self.account_name_1) + if not sender_message.is_element_displayed(): + self.drivers[0].fail('No message is shown after sending ETH in 1-1 chat for sender') + sender_message.transaction_status.wait_for_element_text(sender_message.address_requested) + + chat_2 = self.home_2.get_chat(self.sender['username']).click() + receiver_message = chat_2.get_incoming_transaction(self.account_name_1) + timestamp_sender = sender_message.timestamp_command_message.text + if not receiver_message.is_element_displayed(): + self.drivers[0].fail('No message about incoming transaction in 1-1 chat is shown for receiver') + receiver_message.transaction_status.wait_for_element_text(receiver_message.address_requested) + + self.home_2.just_fyi('Accept and share address for sender and receiver') + for option in (receiver_message.decline_transaction, receiver_message.accept_and_share_address): + if not option.is_element_displayed(): + self.drivers[0].fail("Required options accept or share are not shown") + + select_account_bottom_sheet = receiver_message.accept_and_share_address.click() + if not select_account_bottom_sheet.get_account_in_select_account_bottom_sheet_button( + self.account_name_1).is_element_displayed(): + self.errors.append('Not expected value in "From" in "Select account": "Status" is expected') + select_account_bottom_sheet.select_button.click() + receiver_message.transaction_status.wait_for_element_text(receiver_message.shared_account) + sender_message.transaction_status.wait_for_element_text(sender_message.address_request_accepted) + + self.home_1.just_fyi("Sign and send transaction and check that timestamp on message is updated") + time.sleep(20) + send_bottom_sheet = sender_message.sign_and_send.click() + send_bottom_sheet.next_button.click() + send_bottom_sheet.sign_transaction() + updated_timestamp_sender = sender_message.timestamp_command_message.text + if updated_timestamp_sender == timestamp_sender: + self.errors.append("Timestamp of message is not updated after signing transaction") + self.chat_1.wallet_button.click() + self.wallet_1.find_transaction_in_history(amount=amount) + + [wallet.put_app_to_background() for wallet in (self.wallet_1, self.wallet_2)] + self.device_1.open_notification_bar() + self.network_api.wait_for_confirmation_of_transaction(self.sender['address'], amount) + pn = self.home_1.get_pn('You sent %s ETH' % amount) + if pn: + pn.click() + if not self.wallet_1.transaction_history_button.is_element_displayed(): + self.errors.append('Was not redirected to transaction history after tapping on PN') + else: + self.home_1.click_system_back_button() + self.home_1.status_in_background_button.click_if_shown() + self.wallet_1.home_button.click(desired_view="chat") + + self.home_1.just_fyi("Check 'Confirmed' state for sender and receiver(use pull-to-refresh to update history)") + chat_2.status_in_background_button.click() + chat_2.wallet_button.click() + self.wallet_2.wait_balance_is_changed() + self.wallet_2.find_transaction_in_history(amount=amount) + self.wallet_2.home_button.click() + self.home_2.get_chat(self.sender['username']).click() + [message.transaction_status.wait_for_element_text(message.confirmed, 60) for message in + (sender_message, receiver_message)] + + # TODO: should be added PNs for receiver after getting more stable feature (rechecked 04.10.22, valid) + self.errors.verify_no_errors() + + @marks.testrail_id(6265) + def test_1_1_chat_command_decline_eth_push_changing_state(self): + [home.driver.background_app(3) for home in (self.home_1, self.home_2)] + self.home_1.home_button.double_click() + self.home_1.get_chat(username=self.recipient_username).click() + + self.home_1.just_fyi('Decline transaction before sharing address and check that state is changed') + self.chat_1.commands_button.click() + send_transaction = self.chat_1.send_command.click() + amount = self.chat_1.get_unique_amount() + send_transaction.amount_edit_box.send_keys(amount) + send_transaction.confirm() + send_transaction.sign_transaction_button.click() + chat_1_sender_message = self.chat_1.get_outgoing_transaction() + self.home_1.click_system_home_button() + + self.home_2.home_button.double_click() + chat_2 = self.home_2.get_chat(self.sender['username']).click() + chat_2_receiver_message = chat_2.get_incoming_transaction() + chat_2_receiver_message.decline_transaction.click() + self.home_1.open_notification_bar() + self.home_1.element_by_text_part('Request address for transaction declined').wait_and_click() + + [message.transaction_status.wait_for_element_text(message.declined) for message in + (chat_1_sender_message, chat_2_receiver_message)] + + self.home_1.just_fyi('Decline transaction request and check that state is changed') + request_amount = self.chat_1.get_unique_amount() + self.chat_1.commands_button.click() + request_transaction = self.chat_1.request_command.click() + request_transaction.amount_edit_box.send_keys(request_amount) + request_transaction.confirm() + request_transaction.request_transaction_button.click() + chat_1_request_message = self.chat_1.get_incoming_transaction() + chat_2_sender_message = chat_2.get_outgoing_transaction() + chat_2_sender_message.decline_transaction.click() + [message.transaction_status.wait_for_element_text(message.declined) for message in + (chat_2_sender_message, chat_1_request_message)] + + self.errors.verify_no_errors() + + @marks.testrail_id(6263) + def test_1_1_chat_command_request_and_send_tx_stt_in_1_1_chat_offline(self): + [home.driver.background_app(2) for home in (self.home_1, self.home_2)] + asset_name = 'STT' + amount = self.device_1.get_unique_amount() + + self.device_1.just_fyi('Grab user data for transactions and public chat, set up wallets') + self.home_2.get_back_to_home_view() + self.home_2.wallet_button.click() + self.wallet_2.select_asset(asset_name) + self.wallet_2.home_button.click() + self.home_1.wallet_button.double_click() + initial_amount_stt = self.wallet_1.get_asset_amount_by_name('STT') + app_package = self.home_1.driver.current_package + self.home_1.driver.terminate_app(app_package) + + self.home_2.just_fyi('Request %s STT in 1-1 chat and check it is visible for sender and receiver' % amount) + chat_2 = self.home_2.get_chat(username=self.sender['username']).click() + chat_2.commands_button.click() + request_transaction = chat_2.request_command.click() + request_transaction.amount_edit_box.send_keys(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_2_request_message = chat_2.get_incoming_transaction() + if not chat_2_request_message.is_element_displayed(): + self.drivers[1].fail('No incoming transaction in 1-1 chat is shown for recipient after requesting STT') + + self.home_1.just_fyi('Check that transaction message is fetched from offline and sign transaction') + self.device_1.driver.activate_app(app_package) + self.device_1.sign_in() + self.home_1.connection_offline_icon.wait_for_invisibility_of_element(30) + self.home_1.get_chat(self.recipient_username).click() + chat_1_sender_message = self.chat_1.get_outgoing_transaction() + if not chat_1_sender_message.is_element_displayed(): + self.drivers[0].fail('No outgoing transaction in 1-1 chat is shown for sender after requesting STT') + chat_1_sender_message.transaction_status.wait_for_element_text(chat_1_sender_message.address_received) + send_message = chat_1_sender_message.sign_and_send.click() + send_message.next_button.click() + send_message.sign_transaction() + + 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, chat_2)] + self.network_api.wait_for_confirmation_of_transaction(self.sender['address'], amount, token=True) + for home in (self.home_1, self.home_2): + home.toggle_airplane_mode() + home.home_button.double_click() + home.connection_offline_icon.wait_for_invisibility_of_element(100) + self.home_2.get_chat(self.sender['username']).click() + self.home_1.get_chat(self.recipient_username).click() + [message.transaction_status.wait_for_element_text(message.confirmed, wait_time=120) for message in + (chat_1_sender_message, chat_2_request_message)] + + self.home_1.just_fyi('Check that can find tx in history and balance is updated after offline') + self.home_1.wallet_button.click() + self.wallet_1.wait_balance_is_changed('STT', initial_amount_stt) + self.wallet_1.find_transaction_in_history(amount=amount, asset=asset_name) + + self.errors.verify_no_errors() + + +@pytest.mark.xdist_group(name="one_2") +@marks.critical +class TestOneToOneChatMultipleSharedDevices(MultipleSharedDeviceTestCase): + + def prepare_devices(self): + self.drivers, self.loop = create_shared_drivers(2) + self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) + self.home_1 = self.device_1.create_user(enable_notifications=True) + self.home_2 = self.device_2.create_user(enable_notifications=True) + self.profile_1 = self.home_1.profile_button.click() + self.default_username_1 = self.profile_1.default_username_text.text + self.profile_1.home_button.click() + self.public_key_2, self.default_username_2 = self.home_2.get_public_key() + self.chat_1 = self.home_1.add_contact(self.public_key_2) + self.chat_1.send_message('hey') + self.home_2.home_button.double_click() + self.chat_2 = self.home_2.get_chat(self.default_username_1).click() + + @marks.testrail_id(6316) + def test_1_1_chat_audio_message_with_push(self): + self.home_2.just_fyi("Put app on background (to check Push notification received for audio message)") + self.home_2.click_system_home_button() + + self.home_2.just_fyi("Sending audio message to device who is on background") + self.chat_1.record_audio_message(message_length_in_seconds=65) + if not self.chat_1.element_by_text("Maximum recording time reached").is_element_displayed(): + self.drivers[0].fail("Exceeded 1 min limit of recording time.") + + self.chat_1.ok_button.click() + if self.chat_1.audio_message_recorded_time.text != "0:59": + self.errors.append("Timer exceed 2 minutes") + self.chat_1.send_message_button.click() + + self.device_2.open_notification_bar() + chat_2 = self.home_2.click_upon_push_notification_by_text("Audio") + + listen_time = 5 + + self.device_2.home_button.click() + self.home_2.get_chat(self.default_username_1).click() + chat_2.play_audio_message(listen_time) + if chat_2.audio_message_in_chat_timer.text not in ("00:05", "00:06", "00:07", "00:08"): + self.errors.append("Listened 5 seconds but timer shows different listened time in audio message") + + self.errors.verify_no_errors() + + @marks.testrail_id(5387) + # think about priority of this + def test_1_1_chat_delete_via_delete_button_relogin(self): + self.home_1.driver.quit() + self.home_2.home_button.click() + self.home_2.get_chat(username=self.default_username_1).click() + + self.home_2.just_fyi("Deleting chat via delete button and check it will not reappear after relaunching app") + self.chat_2.delete_chat() + self.chat_2.get_back_to_home_view() + + if self.home_2.get_chat_from_home_view(self.default_username_1).is_element_displayed(): + self.errors.append('Deleted %s chat is shown, but the chat has been deleted' % self.default_username_1) + self.home_2.reopen_app() + if self.home_2.get_chat_from_home_view(self.default_username_1).is_element_displayed(): + self.errors.append( + 'Deleted chat %s is shown after re-login, but the chat has been deleted' % self.default_username_1) + self.errors.verify_no_errors() + + +@pytest.mark.xdist_group(name="two_2") +@marks.critical +class TestContactBlockMigrateKeycardMultipleSharedDevices(MultipleSharedDeviceTestCase): + + def prepare_devices(self): + self.drivers, self.loop = create_shared_drivers(2) + self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) + self.sender = transaction_senders['ETH_2'] + self.nick = "FFOO_brak!1234" + self.message = self.device_1.get_random_message() + self.pub_chat_name = self.device_1.get_random_chat_name() + self.home_1 = self.device_1.recover_access(self.sender['passphrase'], keycard=True) + self.home_2 = self.device_2.create_user() + self.profile_2 = self.home_2.profile_button.click() + self.profile_2.privacy_and_security_button.click() + self.profile_2.backup_recovery_phrase_button.click() + recovery_phrase = self.profile_2.backup_recovery_phrase() + self.recovery_phrase = ' '.join(recovery_phrase.values()) + self.public_key_2, self.default_username_2 = self.home_2.get_public_key() + self.chat_1 = self.home_1.add_contact(self.public_key_2, add_in_contacts=False) + self.chat_1.chat_options.click() + self.chat_1.view_profile_button.click() + self.chat_1.set_nickname(self.nick) + [home.home_button.click() for home in [self.home_1, self.home_2]] + self.home_2.add_contact(self.sender['public_key']) + self.home_2.home_button.click() + [home.join_public_chat(self.pub_chat_name) for home in [self.home_1, self.home_2]] + self.chat_2 = self.home_2.get_chat_view() + self.chat_2.send_message(self.message) + [home.home_button.click() for home in [self.home_1, self.home_2]] + + @marks.testrail_id(702186) + def test_keycard_command_send_tx_eth_1_1_chat(self): + self.home_2.get_chat(self.sender['username']).click() + self.chat_2.send_message("hey on kk!") + self.chat_2.home_button.click() + + amount = self.chat_1.get_unique_amount() + account_name = self.chat_1.status_account_name + + self.chat_1.just_fyi('Send %s ETH in 1-1 chat and check it for sender and receiver: Address requested' % amount) + self.home_1.get_chat(self.nick).click() + self.chat_1.send_message("hello again!") + self.chat_1.commands_button.click() + send_transaction = self.chat_1.send_command.click() + send_transaction.get_username_in_transaction_bottom_sheet_button(self.default_username_2).click() + if send_transaction.scan_qr_code_button.is_element_displayed(): + self.chat_1.driver.fail('Recipient is editable in bottom sheet when send ETH from 1-1 chat') + send_transaction.amount_edit_box.send_keys(amount) + send_transaction.confirm() + send_transaction.sign_transaction_button.click() + sender_message = self.chat_1.get_outgoing_transaction() + if not sender_message.is_element_displayed(): + self.chat_1.driver.fail('No message is shown after sending ETH in 1-1 chat for sender') + sender_message.transaction_status.wait_for_element_text(sender_message.address_requested) + + self.home_2.get_chat(self.sender['username']).click() + receiver_message = self.chat_2.get_incoming_transaction() + timestamp_sender = sender_message.timestamp_command_message.text + if not receiver_message.is_element_displayed(30): + self.chat_2.driver.fail('No message about incoming transaction in 1-1 chat is shown for receiver') + receiver_message.transaction_status.wait_for_element_text(receiver_message.address_requested) + + self.chat_1.just_fyi('Accept and share address for sender and receiver') + for option in (receiver_message.decline_transaction, receiver_message.accept_and_share_address): + if not option.is_element_displayed(): + self.drivers[0].fail("Required options accept or share are not shown") + + select_account_bottom_sheet = receiver_message.accept_and_share_address.click() + if not select_account_bottom_sheet.get_account_in_select_account_bottom_sheet_button( + account_name).is_element_displayed(): + self.errors.append('Not expected value in "From" in "Select account": "Status" is expected') + select_account_bottom_sheet.select_button.click() + receiver_message.transaction_status.wait_for_element_text(receiver_message.shared_account) + sender_message.transaction_status.wait_for_element_text(sender_message.address_request_accepted) + + self.chat_1.just_fyi("Sign and send transaction and check that timestamp on message is updated") + time.sleep(20) + send_message = sender_message.sign_and_send.click() + send_message.next_button.click() + send_message.sign_transaction(keycard=True) + updated_timestamp_sender = sender_message.timestamp_command_message.text + if updated_timestamp_sender == timestamp_sender: + self.errors.append("Timestamp of message is not updated after signing transaction") + + wallet_1 = self.chat_1.wallet_button.click() + wallet_1.find_transaction_in_history(amount=amount) + self.home_2.put_app_to_background_and_back() + self.network_api.wait_for_confirmation_of_transaction(self.sender['address'], amount, confirmations=3) + wallet_1.home_button.click(desired_view='chat') + + self.home_1.just_fyi("Check 'Confirmed' state for sender and receiver(use pull-to-refresh to update history)") + wallet_2 = self.chat_2.wallet_button.click() + wallet_2.find_transaction_in_history(amount=amount) + sender_message.transaction_status.wait_for_element_text(sender_message.confirmed, 120) + self.errors.verify_no_errors() + + @marks.testrail_id(702175) + def test_contact_add_remove_mention_default_username_nickname_public_chat(self): + [home.home_button.double_click() for home in [self.home_1, self.home_2]] + self.chat_1.just_fyi('check that can mention user with 3-random name in public chat') + self.home_1.get_chat('#%s' % self.pub_chat_name).click() + + self.chat_1.just_fyi('Set nickname for user without adding him to contacts, check it in public chat') + chat_element = self.chat_1.chat_element_by_text(self.message) + expected_username = '%s %s' % (self.nick, self.default_username_2) + if chat_element.username.text != expected_username: + self.errors.append('Username %s in public chat does not match expected %s' % ( + chat_element.username.text, expected_username)) + + self.chat_1.just_fyi('Add user to contacts, mention it by nickname check contact list in Profile') + chat_element.member_photo.click() + self.chat_1.profile_add_to_contacts_button.click() + if not self.chat_1.remove_from_contacts.is_element_displayed(): + self.errors.append("'Add to contacts' is not changed to 'Remove from contacts'") + self.chat_1.close_button.click() + + self.chat_1.just_fyi('check that can mention user with nickname or default username in public chat') + self.chat_1.select_mention_from_suggestion_list(username_in_list=self.nick + ' ' + self.default_username_2, + typed_search_pattern=self.nick[0:2]) + if self.chat_1.chat_message_input.text != '@' + self.default_username_2 + ' ': + self.errors.append('Username is not resolved in chat input after selecting it in mention ' + 'suggestions list by nickname!') + self.chat_1.chat_message_input.clear() + for pattern in (self.nick[0:2], self.default_username_2[0:4]): + self.chat_1.select_mention_from_suggestion_list(username_in_list=self.nick + ' ' + self.default_username_2, + typed_search_pattern=pattern) + if self.chat_1.chat_message_input.text != '@' + self.default_username_2 + ' ': + self.errors.append('Username is not resolved in chat input after selecting it in mention suggestions ' + 'list by default username!') + additional_text = 'and more' + self.chat_1.send_as_keyevent(additional_text) + self.chat_1.send_message_button.click() + if not self.chat_1.chat_element_by_text('%s %s' % (self.nick, additional_text)).is_element_displayed(): + self.errors.append("Nickname is not resolved on send message") + self.chat_1.get_back_to_home_view() + + self.chat_1.just_fyi('check contact list in Profile after setting nickname') + profile_1 = self.chat_1.profile_button.click() + userprofile = profile_1.open_contact_from_profile(self.nick) + if not userprofile.remove_from_contacts.is_element_displayed(): + self.errors.append("'Add to contacts' is not changed to 'Remove from contacts' in profile contacts") + profile_1.close_button.click() + profile_1.home_button.double_click() + + self.chat_1.just_fyi( + 'Check that user is added to contacts below "Start new chat" and you redirected to 1-1 on tap') + self.home_1.plus_button.click() + self.home_1.start_new_chat_button.click() + if not self.home_1.element_by_text(self.nick).is_element_displayed(): + self.home_1.driver.fail('List of contacts below "Start new chat" does not contain added user') + self.home_1.element_by_text(self.nick).click() + if not self.chat_1.chat_message_input.is_element_displayed(): + self.chat_1.driver.fail('No redirect to 1-1 chat if tap on Contact below "Start new chat"') + for element in (self.chat_1.chat_message_input, self.chat_1.element_by_text(self.nick)): + if not element.is_element_displayed(): + self.errors.append('Expected element is not found in 1-1 after adding user to contacts from profile') + if self.chat_1.add_to_contacts.is_element_displayed(): + self.errors.append('"Add to contacts" button is shown in 1-1 after adding user to contacts from profile') + + self.chat_1.just_fyi('Remove user from contacts') + self.chat_1.chat_options.click() + self.chat_1.view_profile_button.click() + self.chat_1.remove_from_contacts.click_until_absense_of_element(self.chat_1.remove_from_contacts) + if self.chat_1.profile_nickname.text != self.nick: + self.errors.append("Nickname is changed after removing user from contacts") + + self.chat_1.just_fyi('Check that user is removed from contact list in profile') + self.chat_1.close_button.click() + if not self.chat_1.add_to_contacts.is_element_displayed(): + self.errors.append('"Add to contacts" button is not shown in 1-1 after removing user from contacts') + self.chat_1.profile_button.double_click() + profile_1.contacts_button.click() + if profile_1.element_by_text(self.nick).is_element_displayed(): + self.errors.append('Contact is shown in Profile after removing user from contacts') + self.errors.verify_no_errors() + + @marks.testrail_id(702188) + @marks.xfail( + reason="flaky; issue when sometimes history is not fetched from offline for public chat, needs investigation") + def test_cellular_settings_on_off_public_chat_fetching_history(self): + [home.home_button.double_click() for home in [self.home_1, self.home_2]] + public_chat_name, public_chat_message = 'e2e-started-before', 'message to pub chat' + public_1 = self.home_1.join_public_chat(public_chat_name) + public_1.send_message(public_chat_message) + + self.home_2.just_fyi('set mobile data to "OFF" and check that peer-to-peer connection is still working') + self.home_2.set_network_to_cellular_only() + self.home_2.mobile_connection_off_icon.wait_for_visibility_of_element(20) + for element in (self.home_2.continue_syncing_button, self.home_2.stop_syncing_button, + self.home_2.remember_my_choice_checkbox): + if not element.is_element_displayed(10): + self.drivers[0].fail( + 'Element %s is not not shown in "Syncing mobile" bottom sheet' % element.locator) + self.home_2.stop_syncing_button.click() + if not self.home_2.mobile_connection_off_icon.is_element_displayed(): + self.drivers[0].fail('No mobile connection OFF icon is shown') + self.home_2.mobile_connection_off_icon.click() + for element in self.home_2.connected_to_n_peers_text, self.home_2.waiting_for_wi_fi: + if not element.is_element_displayed(): + self.errors.append("Element '%s' is not shown in Connection status bottom sheet" % element.locator) + self.home_2.click_system_back_button() + public_2 = self.home_2.join_public_chat(public_chat_name) + if public_2.chat_element_by_text(public_chat_message).is_element_displayed(30): + self.errors.append("Chat history was fetched with mobile data fetching off") + public_chat_new_message = 'new message' + public_1.send_message(public_chat_new_message) + if not public_2.chat_element_by_text(public_chat_new_message).is_element_displayed(30): + self.errors.append("Peer-to-peer connection is not working when mobile data fetching is off") + + self.home_2.just_fyi('set mobile data to "ON"') + self.home_2.home_button.click() + self.home_2.mobile_connection_off_icon.click() + self.home_2.use_mobile_data_switch.wait_and_click(30) + if not self.home_2.connected_to_node_text.is_element_displayed(10): + self.errors.append("Not connected to history node after enabling fetching on mobile data") + self.home_2.click_system_back_button() + self.home_2.mobile_connection_on_icon.wait_for_visibility_of_element(10) + self.home_2.get_chat('#%s' % public_chat_name).click() + if not public_2.chat_element_by_text(public_chat_message).is_element_displayed(180): + self.errors.append("Chat history was not fetched with mobile data fetching ON") + + self.home_2.just_fyi('check redirect to sync settings by tapping on "Sync" in connection status bottom sheet') + self.home_2.home_button.click() + self.home_2.mobile_connection_on_icon.click() + self.home_2.connection_settings_button.click() + if not self.home_2.element_by_translation_id("mobile-network-use-mobile").is_element_displayed(): + self.errors.append( + "Was not redirected to sync settings after tapping on Settings in connection bottom sheet") + + self.home_2.just_fyi("Check default preferences in Sync settings") + profile_1 = self.home_1.get_profile_view() + self.home_1.profile_button.double_click() + profile_1.sync_settings_button.click() + if not profile_1.element_by_translation_id("mobile-network-use-wifi").is_element_displayed(): + self.errors.append("Mobile data is enabled by default") + profile_1.element_by_translation_id("mobile-network-use-wifi").click() + if profile_1.ask_me_when_on_mobile_network.text != "ON": + self.errors.append("'Ask me when on mobile network' is not enabled by default") + + profile_1.just_fyi("Disable 'ask me when on mobile network' and check that it is not shown") + profile_1.ask_me_when_on_mobile_network.click() + profile_1.set_network_to_cellular_only() + if profile_1.element_by_translation_id("mobile-network-start-syncing").is_element_displayed(20): + self.errors.append("Popup is shown, but 'ask me when on mobile network' is disabled") + + profile_1.just_fyi("Check 'Restore default' setting") + profile_1.element_by_text('Restore Defaults').click() + if profile_1.use_mobile_data.attribute_value("checked"): + self.errors.append("Mobile data is enabled by default") + if not profile_1.ask_me_when_on_mobile_network.attribute_value("checked"): + self.errors.append("'Ask me when on mobile network' is not enabled by default") + self.errors.verify_no_errors() + + @marks.testrail_id(702177) + def test_restore_account_migrate_multiaccount_to_keycard_db_saved(self): + self.home_1.driver.quit() + self.home_2.profile_button.double_click() + self.profile_2.logout() + + self.device_2.just_fyi("Checking migration to keycard: db saved (1-1 chat, nickname, messages)") + self.device_2.options_button.click() + self.device_2.manage_keys_and_storage_button.click() + self.device_2.move_keystore_file_option.click() + self.device_2.enter_seed_phrase_next_button.click() + self.device_2.seedphrase_input.send_keys(self.recovery_phrase) + self.device_2.choose_storage_button.click() + self.device_2.keycard_required_option.click() + self.device_2.confirm_button.click() + self.device_2.migration_password_input.send_keys(common_password) + self.device_2.confirm_button.click() + from views.keycard_view import KeycardView + keycard = KeycardView(self.device_2.driver) + keycard.begin_setup_button.click() + keycard.connect_card_button.wait_and_click() + keycard.enter_default_pin() + keycard.enter_default_pin() + if not self.device_2.element_by_translation_id("migration-successful").is_element_displayed(30): + self.driver.fail("No popup about successfull migration is shown!") + self.device_2.ok_button.click() + self.home_2.home_button.wait_for_element(30) + if not self.home_2.element_by_text_part(self.pub_chat_name).is_element_displayed(): + self.errors.append("Public chat was removed from home after migration to kk") + self.home_2.get_chat(self.sender['username']).click() + if self.chat_2.add_to_contacts.is_element_displayed(): + self.errors.append("User was removed from contacts after migration to kk") + self.errors.verify_no_errors() + + +@pytest.mark.xdist_group(name="three_2") +@marks.critical +class TestEnsStickersMultipleDevicesMerged(MultipleSharedDeviceTestCase): + + def prepare_devices(self): + self.drivers, self.loop = create_shared_drivers(2) + self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) + self.sender, self.reciever = transaction_senders['ETH_3'], ens_user + self.home_1 = self.device_1.recover_access(passphrase=self.sender['passphrase']) + self.home_2 = self.device_2.recover_access(ens_user['passphrase'], enable_notifications=True) + self.ens = '@%s' % self.reciever['ens'] + self.pub_chat_name = self.home_1.get_random_chat_name() + self.chat_1 = self.home_1.join_public_chat(self.pub_chat_name) + self.chat_2 = self.home_2.join_public_chat(self.pub_chat_name) + [home.home_button.double_click() for home in (self.home_1, self.home_2)] + self.profile_2 = self.home_2.profile_button.click() + self.profile_2.connect_existing_ens(self.reciever['ens']) + self.home_1.add_contact(self.reciever['ens']) + self.home_2.home_button.click() + self.home_2.add_contact(self.sender['public_key']) + # To avoid activity centre for restored users + [chat.send_message("hey!") for chat in (self.chat_1, self.chat_2)] + + self.home_1.just_fyi("Close the ENS banner") + [home.home_button.double_click() for home in (self.home_1, self.home_2)] + [home.ens_banner_close_button.click_if_shown() for home in (self.home_1, self.home_2)] + + @marks.testrail_id(702152) + def test_ens_purchased_in_profile(self): + self.home_2.profile_button.double_click() + ens_name_after_adding = self.profile_2.default_username_text.text + if ens_name_after_adding != '@%s' % ens_user['ens']: + self.errors.append('ENS name is not shown as default in user profile after adding, "%s" instead' % + ens_name_after_adding) + + self.home_2.just_fyi('check ENS name wallet address and public key') + self.home_2.element_by_text(self.reciever['ens']).click() + self.home_2.element_by_text(self.reciever['ens']).click() + for text in (self.reciever['address'].lower(), self.reciever['public_key']): + if not self.home_2.element_by_text_part(text).is_element_displayed(40): + self.errors.append('%s text is not shown' % text) + self.home_2.profile_button.double_click() + + self.home_2.just_fyi('check ENS name is shown on share my profile window') + self.profile_2.share_my_profile_button.click() + if self.profile_2.ens_name_in_share_chat_key_text.text != '%s' % ens_user['ens']: + self.errors.append('No ENS name is shown on tapping on share icon in Profile') + self.profile_2.close_share_popup() + self.errors.verify_no_errors() + + @marks.testrail_id(702153) + def test_ens_command_send_tx_eth_1_1_chat(self): + [home.home_button.double_click() for home in (self.home_1, self.home_2)] + wallet_1 = self.home_1.wallet_button.click() + wallet_1.wait_balance_is_changed() + wallet_1.home_button.click() + self.home_1.get_chat(self.ens).click() + self.chat_1.commands_button.click() + amount = self.chat_1.get_unique_amount() + + self.chat_1.just_fyi("Check sending assets to ENS name from sender side") + send_message = self.chat_1.send_command.click() + send_message.amount_edit_box.send_keys(amount) + send_message.confirm() + send_message.next_button.click() + from views.send_transaction_view import SendTransactionView + send_transaction = SendTransactionView(self.drivers[0]) + send_transaction.ok_got_it_button.click() + send_transaction.sign_transaction() + chat_1_sender_message = self.chat_1.get_outgoing_transaction(transaction_value=amount) + self.home_2.put_app_to_background_and_back() + self.network_api.wait_for_confirmation_of_transaction(self.sender['address'], amount, confirmations=3) + chat_1_sender_message.transaction_status.wait_for_element_text(chat_1_sender_message.confirmed) + + self.chat_2.just_fyi("Check that message is fetched for receiver") + self.home_2.get_chat(self.sender['username']).click() + chat_2_reciever_message = self.chat_2.get_incoming_transaction(transaction_value=amount) + chat_2_reciever_message.transaction_status.wait_for_element_text(chat_2_reciever_message.confirmed, + wait_time=60) + + @marks.testrail_id(702155) + def test_ens_mention_nickname_1_1_chat(self): + [home.home_button.double_click() for home in (self.home_1, self.home_2)] + + self.home_1.just_fyi('Mention user by ENS in 1-1 chat') + message, message_ens_owner = '%s hey!' % self.ens, '%s hey!' % self.reciever['ens'] + self.home_1.get_chat(self.ens).click() + self.chat_1.send_message(message) + + self.home_1.just_fyi('Set nickname and mention user by nickname in 1-1 chat') + russian_nickname = 'МОЙ дорогой ДРУх' + self.chat_1.chat_options.click() + self.chat_1.view_profile_button.click() + self.chat_1.set_nickname(russian_nickname) + self.chat_1.select_mention_from_suggestion_list(russian_nickname + ' ' + self.ens) + + self.chat_1.just_fyi('Check that nickname is shown in preview for 1-1 chat') + updated_message = '%s hey!' % russian_nickname + self.chat_1.home_button.double_click() + if not self.chat_1.element_by_text(updated_message).is_element_displayed(): + self.errors.append('"%s" is not show in chat preview on home screen!' % message) + self.home_1.get_chat(russian_nickname).click() + + self.chat_1.just_fyi('Check redirect to user profile on mention by nickname tap') + self.chat_1.chat_element_by_text(updated_message).click() + if not self.chat_1.profile_block_contact_button.is_element_displayed(): + self.errors.append( + 'No redirect to user profile after tapping on message with mention (nickname) in 1-1 chat') + else: + self.chat_1.profile_send_message_button.click() + + self.chat_2.just_fyi("Check message with mention for ENS owner") + self.home_2.get_chat(self.sender['username']).click() + if not self.chat_2.chat_element_by_text(message_ens_owner).is_element_displayed(): + self.errors.append('Expected %s message is not shown for ENS owner' % message_ens_owner) + + self.chat_1.just_fyi('Check if after deleting nickname ENS is shown again') + self.chat_1.chat_options.click() + self.chat_1.view_profile_button.click() + self.chat_1.profile_nickname_button.click() + self.chat_1.nickname_input_field.clear() + self.chat_1.element_by_text('Done').click() + self.chat_1.close_button.click() + if self.chat_1.user_name_text.text != self.ens: + self.errors.append("Username '%s' is not updated to ENS '%s' after deleting nickname" % + (self.chat_1.user_name_text.text, self.ens)) + + self.errors.verify_no_errors() + + @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('#%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( + 'ENS username is not resolved in chat input after selecting it in mention suggestions list!') + 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') + 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('ment_new_1.png', + 2): + self.errors.append('Mention is not highlighted!') + self.errors.verify_no_errors() + + @marks.testrail_id(702157) + def test_sticker_1_1_public_chat_mainnet(self): + self.home_2.status_in_background_button.click_if_shown() + [home.home_button.double_click() for home in (self.home_1, self.home_2)] + profile_2 = self.home_2.profile_button.click() + profile_2.switch_network() + + self.home_2.just_fyi('Check that can use purchased stickerpack on Mainnet') + self.home_2.get_chat('#%s' % self.pub_chat_name).click() + self.chat_2.install_sticker_pack_by_name('Tozemoon') + self.chat_2.sticker_icon.click() + if not self.chat_2.chat_item.is_element_displayed(): + self.errors.append('Cannot use purchased stickers') + self.home_2.profile_button.click() + profile_2.switch_network('Goerli with upstream RPC') + + self.home_1.just_fyi('Install free sticker pack and use it in 1-1 chat on Goerli') + self.home_1.get_chat(self.ens).click() + self.chat_1.chat_message_input.clear() + self.chat_1.install_sticker_pack_by_name() + self.chat_1.sticker_icon.click() + if not self.chat_1.sticker_message.is_element_displayed(): + self.errors.append('Sticker was not sent') + self.chat_1.swipe_right() + if not self.chat_1.sticker_icon.is_element_displayed(): + self.errors.append('Sticker is not shown in recently used list') + self.chat_1.get_back_to_home_view() + + self.home_1.just_fyi('Send stickers in public chat from Recent') + self.home_1.join_public_chat(self.home_1.get_random_chat_name()) + self.chat_1.show_stickers_button.click() + self.chat_1.sticker_icon.click() + if not self.chat_1.chat_item.is_element_displayed(): + self.errors.append('Sticker was not sent from Recent') + + # self.home_2.just_fyi('Check that can install stickers by tapping on sticker message') + # TODO: disabled because of #13683 (rechecked 04.10.22, valid) + self.home_2.home_button.double_click() + self.home_2.get_chat(self.sender['username']).click() + # self.chat_2.chat_item.click() + # self.chat_2.element_by_text_part('Free').wait_and_click(40) + # if self.chat_2.element_by_text_part('Free').is_element_displayed(): + # self.errors.append('Stickerpack was not installed') + + self.chat_2.just_fyi('Check that can navigate to another user profile via long tap on sticker message') + # self.chat_2.close_sticker_view_icon.click() + self.chat_2.chat_item.long_press_element() + self.chat_2.element_by_text('View Details').click() + self.chat_2.profile_send_message_button.wait_and_click() + self.errors.verify_no_errors() + + @marks.testrail_id(702158) + def test_start_new_chat_public_key_validation(self): + [home.get_back_to_home_view() for home in (self.home_1, self.home_2)] + self.home_2.driver.quit() + public_key = basic_user['public_key'] + self.home_1.plus_button.click() + chat = self.home_1.start_new_chat_button.click() + + self.home_1.just_fyi("Validation: invalid public key and invalid ENS") + for invalid_chat_key in (basic_user['public_key'][:-1], ens_user_message_sender['ens'][:-2]): + chat.public_key_edit_box.clear() + chat.public_key_edit_box.send_keys(invalid_chat_key) + chat.confirm() + if not self.home_1.element_by_translation_id("profile-not-found").is_element_displayed(): + self.errors.append('Error is not shown for invalid public key') + + self.home_1.just_fyi("Check that valid ENS is resolved") + chat.public_key_edit_box.clear() + chat.public_key_edit_box.send_keys(ens_user_message_sender['ens']) + resolved_ens = '%s.stateofus.eth' % ens_user_message_sender['ens'] + if not chat.element_by_text(resolved_ens).is_element_displayed(10): + self.errors.append('ENS name is not resolved after pasting chat key') + self.home_1.close_button.click() + + self.home_1.just_fyi("Check that can paste public key from keyboard and start chat") + self.home_1.get_chat('#%s' % self.pub_chat_name).click() + chat.send_message(public_key) + chat.copy_message_text(public_key) + chat.back_button.click() + self.home_1.plus_button.click() + self.home_1.start_new_chat_button.click() + chat.public_key_edit_box.paste_text_from_clipboard() + if chat.public_key_edit_box.text != public_key: + self.errors.append('Public key is not pasted from clipboard') + if not chat.element_by_text(basic_user['username']).is_element_displayed(): + self.errors.append('3 random-name is not resolved after pasting chat key') + + self.home_1.just_fyi('My_profile button at Start new chat view opens own QR code with public key pop-up') + self.home_1.my_profile_on_start_new_chat_button.click() + account = self.home_1.get_profile_view() + if not (account.public_key_text.is_element_displayed() and account.share_button.is_element_displayed() + and account.qr_code_image.is_element_displayed()): + self.errors.append('No self profile pop-up data displayed after My_profile button tap') + self.errors.verify_no_errors() diff --git a/test/appium/tests/old_ui/chats/test_group_chat.py b/test/appium/tests/old_ui/chats/test_group_chat.py new file mode 100644 index 0000000000..d08298f6d9 --- /dev/null +++ b/test/appium/tests/old_ui/chats/test_group_chat.py @@ -0,0 +1,140 @@ +import pytest + +from tests import marks +from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers +from views.chat_view import ChatView +from views.sign_in_view import SignInView + + +@pytest.mark.xdist_group(name="one_3") +@marks.critical +class TestGroupChatMultipleDeviceMerged(MultipleSharedDeviceTestCase): + + def prepare_devices(self): + self.drivers, self.loop = create_shared_drivers(3) + self.message_before_adding = 'message before adding new user' + self.message_to_admin = 'Hey, admin!' + + self.homes, self.public_keys, self.usernames, self.chats = {}, {}, {}, {} + for key in self.drivers: + sign_in = SignInView(self.drivers[key]) + self.homes[key] = sign_in.create_user(enable_notifications=True) + SignInView(self.drivers[2]).put_app_to_background_and_back() + self.public_keys[key], self.usernames[key] = sign_in.get_public_key(True) + sign_in.home_button.click() + SignInView(self.drivers[0]).put_app_to_background_and_back() + self.chat_name = self.homes[0].get_random_chat_name() + + self.homes[0].just_fyi('Admin adds future members to contacts') + for i in range(1, 3): + self.homes[0].add_contact(self.public_keys[i]) + self.homes[0].home_button.double_click() + + self.homes[0].just_fyi('Members add admin to contacts to see PNs and put app in background') + for i in range(1, 3): + self.homes[i].handle_contact_request(self.usernames[0]) + self.homes[i].home_button.double_click() + + self.homes[0].just_fyi('Admin creates group chat') + self.chats[0] = self.homes[0].create_group_chat([self.usernames[1]], self.chat_name) + for i in range(1, 3): + self.chats[i] = ChatView(self.drivers[i]) + + self.chats[0].send_message(self.message_before_adding) + + @marks.testrail_id(3994) + def test_group_chat_push_system_messages_when_invited(self): + self.homes[1].just_fyi("Check system messages in PNs") + self.homes[2].put_app_to_background_and_back() + self.homes[1].put_app_to_background() + self.homes[1].open_notification_bar() + pns = [self.chats[0].pn_invited_to_group_chat(self.usernames[0], self.chat_name), + self.chats[0].pn_wants_you_to_join_to_group_chat(self.usernames[0], self.chat_name)] + for pn in pns: + if not self.homes[1].get_pn(pn): + self.errors.append('%s is not shown after invite to group chat' % pn) + if self.homes[1].get_pn(pns[0]): + group_invite_pn = self.homes[1].get_pn(pns[0]) + group_invite_pn.click() + else: + self.homes[1].click_system_back_button(2) + self.homes[1].get_chat(self.chat_name).click() + + self.homes[1].just_fyi("Check system messages in group chat for admin and member") + create_system_message = self.chats[0].create_system_message(self.usernames[0], self.chat_name) + has_added_system_message = self.chats[0].has_added_system_message(self.usernames[0], self.usernames[1]) + + create_for_admin_system_message = 'You created the group %s' % self.chat_name + joined_message = "You've joined %s from invitation by %s" % (self.chat_name, self.usernames[0]) + + for message in [create_for_admin_system_message, create_system_message, has_added_system_message]: + if not self.chats[0].element_by_text(message).is_element_displayed(): + self.errors.append('%s system message is not shown' % message) + + for message in [joined_message, create_system_message, has_added_system_message]: + if not self.chats[1].element_by_text(message).is_element_displayed(): + self.errors.append('%s system message is not shown' % message) + + self.errors.verify_no_errors() + + @marks.testrail_id(700732) + def test_group_chat_add_new_member(self): + [self.homes[i].home_button.double_click() for i in range(3)] + self.homes[0].get_chat(self.chat_name).click() + self.chats[0].add_members_to_group_chat([self.usernames[2]]) + + self.chats[2].just_fyi("Check there will be PN and no unread in AC for a new member") + if self.homes[2].notifications_unread_badge.is_element_displayed(60): + self.drivers[2].fail("Group chat appeared in AC!") + self.homes[2].open_notification_bar() + if not self.homes[2].element_by_text_part(self.usernames[0]).is_element_displayed(): + self.errors.append("PN about group chat invite is not shown when invited by mutual contact") + + self.homes[2].click_system_back_button() + + self.homes[2].just_fyi("Check new group appeared in chat list for a new member") + if not self.homes[2].get_chat(self.chat_name).is_element_displayed(60): + self.drivers[2].fail("New group chat hasn't appeared in chat list") + + self.homes[2].get_chat(self.chat_name).click() + + for message in (self.message_to_admin, self.message_before_adding): + if self.chats[2].chat_element_by_text(message).is_element_displayed(): + self.errors.append('%s is shown for new user' % message) + self.errors.verify_no_errors() + + @marks.testrail_id(5756) + def test_group_chat_highligted(self): + chat_name = 'for_invited' + [self.homes[i].home_button.double_click() for i in range(3)] + self.homes[0].create_group_chat([self.usernames[1]], chat_name) + + self.homes[1].just_fyi("Check that new group chat from contact is highlited") + chat_2_element = self.homes[1].get_chat(chat_name) + if chat_2_element.no_message_preview.is_element_differs_from_template('highligted_preview_group.png', 0): + self.errors.append("Preview message is not hightligted or text is not shown! ") + chat_2 = self.homes[1].get_chat(chat_name).click() + chat_2.home_button.click() + if not chat_2_element.no_message_preview.is_element_differs_from_template('highligted_preview_group.png', 0): + self.errors.append("Preview message is still hightligted after opening! ") + + @marks.testrail_id(3997) + def test_group_chat_leave_relogin(self): + left_system_message = self.chats[1].leave_system_message(self.usernames[0]) + self.drivers[2].quit() + [self.homes[i].home_button.double_click() for i in range(2)] + self.homes[0].home_button.double_click() + self.homes[1].get_chat(self.chat_name).click() + + self.homes[0].just_fyi("Admin deleted chat via long press") + self.homes[0].leave_chat_long_press(self.chat_name) + + self.homes[1].just_fyi('Check that leave system message is presented after user left the group chat') + if not self.chats[1].chat_element_by_text(left_system_message).is_element_displayed(): + self.errors.append('System message when user leaves the chat is not shown') + + self.homes[0].just_fyi("Member sends some message, admin relogins and check chat does not reappear") + self.chats[1].send_message(self.message_to_admin) + self.homes[0].relogin() + if self.homes[0].get_chat_from_home_view(self.chat_name).is_element_displayed(): + self.drivers[0].fail('Deleted %s is present after relaunch app' % self.chat_name) diff --git a/test/appium/tests/old_ui/chats/test_public_chat_browsing.py b/test/appium/tests/old_ui/chats/test_public_chat_browsing.py new file mode 100644 index 0000000000..4efc6fe32b --- /dev/null +++ b/test/appium/tests/old_ui/chats/test_public_chat_browsing.py @@ -0,0 +1,295 @@ +from datetime import timedelta + +import pytest +from dateutil import parser +from selenium.common.exceptions import NoSuchElementException + +from tests import marks, test_dapp_name, test_dapp_url +from tests.base_test_case import create_shared_drivers, MultipleSharedDeviceTestCase +from views.sign_in_view import SignInView + + +@pytest.mark.xdist_group(name="three_1") +@marks.critical +class TestPublicChatBrowserOneDeviceMerged(MultipleSharedDeviceTestCase): + + def prepare_devices(self): + self.drivers, self.loop = create_shared_drivers(1) + self.sign_in = SignInView(self.drivers[0]) + + self.home = self.sign_in.create_user() + self.public_chat_name = self.home.get_random_chat_name() + self.chat = self.home.join_public_chat(self.public_chat_name) + + @marks.testrail_id(5675) + def test_public_chat_fetch_more_history(self): + self.home.just_fyi("Check that can fetch previous history for several days") + device_time = parser.parse(self.drivers[0].device_time) + yesterday = (device_time - timedelta(days=1)).strftime("%b %-d, %Y") + before_yesterday = (device_time - timedelta(days=2)).strftime("%b %-d, %Y") + quiet_time_yesterday, quiet_time_before_yesterday = '24 hours', '2 days' + fetch_more = self.home.get_translation_by_key("load-more-messages") + for message in (yesterday, quiet_time_yesterday): + if not self.chat.element_by_text_part(message).is_element_displayed(120): + self.drivers[0].fail('"%s" is not shown' % message) + self.chat.element_by_text_part(fetch_more).wait_and_click(120) + self.chat.element_by_text_part(fetch_more).wait_for_visibility_of_element(180) + for message in (before_yesterday, quiet_time_before_yesterday): + if not self.chat.element_by_text_part(message).is_element_displayed(): + self.drivers[0].fail('"%s" is not shown' % message) + self.home.just_fyi("Check that can fetch previous history for month") + times = { + "three-days": '5 days', + "one-week": '12 days', + "one-month": ['43 days', '42 days', '41 days', '40 days'], + } + profile = self.home.profile_button.click() + profile.sync_settings_button.click() + profile.sync_history_for_button.click() + for period in times: + profile.just_fyi("Checking %s period" % period) + profile.element_by_translation_id(period).click() + profile.home_button.click(desired_view='chat') + self.chat.element_by_text_part(fetch_more).wait_and_click(120) + if period != "one-month": + if not profile.element_by_text_part(times[period]).is_element_displayed(30): + self.errors.append("'Quiet here for %s' is not shown after fetching more history" % times[period]) + else: + variants = times[period] + self.chat.element_by_text_part(fetch_more).wait_for_invisibility_of_element(120) + res = any(profile.element_by_text_part(variant).is_element_displayed(30) for variant in variants) + if not res: + self.errors.append("History is not fetched for one month!") + self.home.profile_button.click(desired_element_text=profile.get_translation_by_key("default-sync-period")) + self.errors.verify_no_errors() + + @marks.testrail_id(5396) + def test_public_chat_navigate_to_chat_when_relaunch(self): + text_message = 'some_text' + self.home.home_button.double_click() + self.home.get_chat('#%s' % self.public_chat_name).click() + self.chat.send_message(text_message) + self.chat.reopen_app() + if not self.chat.chat_element_by_text(text_message).is_element_displayed(30): + self.drivers[0].fail("Not navigated to chat view after reopening app") + + @marks.testrail_id(5317) + def test_public_chat_copy_and_paste_message_in_chat_input(self): + message_text = {'text_message': 'mmmeowesage_text'} + formatted_message = {'message_with_link': 'https://status.im', + # TODO: blocked with 11161 (rechecked 04.10.22, valid) + # 'message_with_tag': '#successishere' + } + message_input = self.chat.chat_message_input + if not message_input.is_element_displayed(): + self.home.get_chat('#%s' % self.public_chat_name).click() + message_input.send_keys(message_text['text_message']) + self.chat.send_message_button.click() + + self.chat.copy_message_text(message_text['text_message']) + + message_input.paste_text_from_clipboard() + if message_input.text != message_text['text_message']: + self.errors.append('Message %s text was not copied in a public chat' % message_text['text_message']) + message_input.clear() + + for message in formatted_message: + message_input.send_keys(formatted_message[message]) + self.chat.send_message_button.click() + + message_bubble = self.chat.chat_element_by_text(formatted_message[message]) + message_bubble.sent_status_checkmark.long_press_element() + self.chat.element_by_text('Copy').click() + + message_input.paste_text_from_clipboard() + if message_input.text != formatted_message[message]: + self.errors.append('Message %s text was not copied in a public chat' % formatted_message[message]) + message_input.clear() + + self.errors.verify_no_errors() + + @marks.testrail_id(700738) + def test_public_chat_tag_message(self): + tag_message = '#wuuut' + self.home.home_button.double_click() + self.home.get_chat('#%s' % self.public_chat_name).click() + self.home.just_fyi("Check that will be redirected to chat view on tap on tag message") + self.chat.send_message(tag_message) + self.chat.element_starts_with_text(tag_message).click() + self.chat.element_by_text_part(self.public_chat_name).wait_for_invisibility_of_element() + if not self.chat.user_name_text.text == tag_message: + self.errors.append('Could not redirect a user to a public chat tapping the tag message.') + self.home.just_fyi("Check that chat is added to home view") + self.chat.home_button.double_click() + if not self.home.element_by_text(tag_message).is_element_displayed(): + self.errors.append('Could not find the public chat in user chat list.') + self.errors.verify_no_errors() + + @marks.testrail_id(700739) + def test_public_chat_open_using_deep_link(self): + self.drivers[0].terminate_app(self.drivers[0].current_package) + chat_name = self.home.get_random_chat_name() + deep_link = 'status-im://%s' % chat_name + self.sign_in.open_weblink_and_login(deep_link) + try: + assert self.chat.user_name_text.text == '#' + chat_name + except (AssertionError, NoSuchElementException): + self.drivers[0].fail("Public chat '%s' is not opened" % chat_name) + + @marks.testrail_id(702072) + def test_browser_blocked_url(self): + dapp = self.home.dapp_tab_button.click() + for url in ('metamask.site', 'cryptokitties.domainname'): + dapp.just_fyi('Checking blocked website %s' % url) + dapp_detail = dapp.open_url(url) + dapp_detail.element_by_translation_id('browsing-site-blocked-title') + if dapp_detail.browser_refresh_page_button.is_element_displayed(): + self.errors.append("Refresh button is present in blocked site") + dapp_detail.go_back_button.click() + dapp_detail.open_tabs_button.click() + dapp.element_by_text_part(url[:8]).click() + dapp_detail.continue_anyway_button.click() + if dapp_detail.element_by_text('This site is blocked').is_element_displayed(): + self.errors.append("Failed to open Dapp after 'Continue anyway' tapped for %s" % url) + dapp_detail.open_tabs_button.click() + dapp_detail.empty_tab_button.click() + self.errors.verify_no_errors() + + @marks.testrail_id(702073) + def test_browser_connection_is_secure_not_secure_warning(self): + dapp = self.home.dapp_tab_button.click() + web_page = dapp.open_url('http://www.dvwa.co.uk') + web_page.url_edit_box_lock_icon.click_until_presence_of_element( + web_page.element_by_translation_id("browser-not-secure")) + web_page.open_tabs_button.click() + web_page.empty_tab_button.click() + dapp.just_fyi('Checking connection is secure for Airswap') + web_page = dapp.open_url('https://instant.airswap.io') + web_page.wait_for_d_aap_to_load() + web_page.url_edit_box_lock_icon.click_until_presence_of_element( + web_page.element_by_translation_id("browser-secure")) + web_page.open_tabs_button.click() + web_page.empty_tab_button.click() + + @marks.testrail_id(702074) + def test_browser_invalid_url(self): + dapp = self.home.dapp_tab_button.click() + browsing_view = dapp.open_url('invalid.takoe') + browsing_view.element_by_translation_id("web-view-error").wait_for_element(20) + + @marks.testrail_id(702075) + def test_browser_offline(self): + dapp = self.home.dapp_tab_button.click() + self.home.toggle_airplane_mode() + browsing_view = dapp.open_url('status.im') + offline_texts = ['Unable to load page', 'ERR_INTERNET_DISCONNECTED'] + for text in offline_texts: + browsing_view.element_by_text_part(text).wait_for_element(15) + self.home.toggle_airplane_mode() + browsing_view.browser_refresh_page_button.click_until_presence_of_element( + browsing_view.element_by_text_part('An Open Source Community')) + + @marks.testrail_id(702076) + def test_browser_delete_close_tabs(self): + dapp = self.home.dapp_tab_button.click() + urls = { + 'google.com': 'Google', + 'status.im': 'Status - Private', + 'bbc.com': 'bbc.com' + } + for url in urls: + web_page = dapp.open_url(url) + web_page.open_tabs_button.click() + web_page.empty_tab_button.click() + + self.home.just_fyi('Delete one tab') + web_page.remove_tab(name=urls['bbc.com']) + web_page.open_tabs_button.wait_for_invisibility_of_element() + web_page.element_by_text_part(urls['bbc.com']).wait_for_invisibility_of_element() + + self.home.just_fyi('Close all tabs via "Close all", relogin and check that it is not reappearing') + web_page.close_all_button.click() + self.home.reopen_app() + web_page.dapp_tab_button.click() + web_page.open_tabs_button.click() + if web_page.element_by_text_part(urls['status.im']).is_element_displayed(): + self.errors.append('Tabs are not closed or reappeared after re-login!') + + self.errors.verify_no_errors() + + @marks.testrail_id(702077) + def test_browser_bookmarks_create_edit_remove(self): + dapp = self.home.dapp_tab_button.click() + + self.home.just_fyi('Add some url to bookmarks with default name') + web_page = dapp.open_url('status.im') + default_bookmark_name = web_page.add_to_bookmarks() + web_page.browser_previous_page_button.click() + if not web_page.element_by_text(default_bookmark_name).is_element_displayed(): + self.errors.append("Bookmark with default name is not added!") + + self.home.just_fyi('Add some url to bookmarks with custom name') + custom_name = 'Custom BBC' + dapp.open_url('bbc.com') + web_page.add_to_bookmarks(custom_name) + web_page.open_tabs_button.click() + web_page.empty_tab_button.click() + if not web_page.element_by_text(custom_name).is_element_displayed(): + self.driver.fail("Bookmark with custom name is not added!") + + self.home.just_fyi('Checking "Open in new tab"') + dapp.browser_entry_long_press(custom_name) + dapp.open_in_new_tab_button.click() + web_page.options_button.click() + if not web_page.element_by_translation_id('remove-favourite').is_element_displayed(): + self.errors.append("Remove favourite is not shown on added bookmark!") + dapp.click_system_back_button() + + self.home.just_fyi('Check deleting bookmark') + web_page.open_tabs_button.click() + web_page.empty_tab_button.click() + dapp.browser_entry_long_press(custom_name) + dapp.delete_bookmark_button.click() + if web_page.element_by_text(custom_name).is_element_displayed(): + self.errors.append("Bookmark with custom name is not deleted!") + + self.home.just_fyi('Check "Edit bookmark" and "Open in new tab"') + edited_name = 'My Fav Status' + dapp.browser_entry_long_press(default_bookmark_name) + dapp.edit_bookmark_button.click() + web_page.edit_bookmark_name(edited_name) + if not web_page.element_by_text(edited_name).is_element_displayed(): + self.driver.fail("Edited bookmark name is not shown!") + + self.errors.verify_no_errors() + + @marks.testrail_id(702078) + def test_browser_web3_permissions_testdapp(self): + self.home.home_button.double_click() + + self.home.just_fyi('open Status Test Dapp, allow all and check permissions in Profile') + web_view = self.home.open_status_test_dapp() + dapp = self.home.dapp_tab_button.click() + profile = self.home.profile_button.click() + profile.privacy_and_security_button.click() + profile.dapp_permissions_button.click() + profile.element_by_text(test_dapp_name).click() + if not profile.element_by_text(self.home.status_account_name).is_element_displayed(): + self.errors.append('Wallet permission was not granted') + if not profile.element_by_translation_id("chat-key").is_element_displayed(): + self.errors.append('Contact code permission was not granted') + + profile.just_fyi('revoke access and check that they are asked second time') + profile.revoke_access_button.click() + profile.get_back_to_home_view() + profile.dapp_tab_button.click() + web_view.open_tabs_button.click() + web_view.empty_tab_button.click() + dapp.open_url(test_dapp_url) + if not dapp.element_by_text_part(self.home.status_account_name).is_element_displayed(): + self.errors.append('Wallet permission is not asked') + if dapp.allow_button.is_element_displayed(): + dapp.allow_button.click(times_to_click=1) + if not dapp.element_by_translation_id("your-contact-code").is_element_displayed(): + self.errors.append('Profile permission is not asked') + self.errors.verify_no_errors() diff --git a/test/appium/tests/medium/test_browser_profile.py b/test/appium/tests/old_ui/medium/test_browser_profile.py similarity index 100% rename from test/appium/tests/medium/test_browser_profile.py rename to test/appium/tests/old_ui/medium/test_browser_profile.py diff --git a/test/appium/tests/medium/test_chats_m.py b/test/appium/tests/old_ui/medium/test_chats_m.py similarity index 100% rename from test/appium/tests/medium/test_chats_m.py rename to test/appium/tests/old_ui/medium/test_chats_m.py diff --git a/test/appium/tests/medium/test_deeplink_chat_share_profile.py b/test/appium/tests/old_ui/medium/test_deeplink_chat_share_profile.py similarity index 100% rename from test/appium/tests/medium/test_deeplink_chat_share_profile.py rename to test/appium/tests/old_ui/medium/test_deeplink_chat_share_profile.py diff --git a/test/appium/tests/medium/test_pairing_devices_sync_m.py b/test/appium/tests/old_ui/medium/test_pairing_devices_sync_m.py similarity index 100% rename from test/appium/tests/medium/test_pairing_devices_sync_m.py rename to test/appium/tests/old_ui/medium/test_pairing_devices_sync_m.py diff --git a/test/appium/tests/medium/test_permissions_scan_qr.py b/test/appium/tests/old_ui/medium/test_permissions_scan_qr.py similarity index 100% rename from test/appium/tests/medium/test_permissions_scan_qr.py rename to test/appium/tests/old_ui/medium/test_permissions_scan_qr.py diff --git a/test/appium/tests/medium/test_profile_m.py b/test/appium/tests/old_ui/medium/test_profile_m.py similarity index 100% rename from test/appium/tests/medium/test_profile_m.py rename to test/appium/tests/old_ui/medium/test_profile_m.py diff --git a/test/appium/tests/medium/test_single_device.py b/test/appium/tests/old_ui/medium/test_single_device.py similarity index 100% rename from test/appium/tests/medium/test_single_device.py rename to test/appium/tests/old_ui/medium/test_single_device.py diff --git a/test/appium/tests/medium/test_wallet_keycard_m.py b/test/appium/tests/old_ui/medium/test_wallet_keycard_m.py similarity index 100% rename from test/appium/tests/medium/test_wallet_keycard_m.py rename to test/appium/tests/old_ui/medium/test_wallet_keycard_m.py diff --git a/test/appium/tests/critical/onboarding/test_onboarding_flows.py b/test/appium/tests/old_ui/onboarding/test_onboarding_flows.py similarity index 100% rename from test/appium/tests/critical/onboarding/test_onboarding_flows.py rename to test/appium/tests/old_ui/onboarding/test_onboarding_flows.py diff --git a/test/appium/tests/critical/test_pairing_devices_sync.py b/test/appium/tests/old_ui/test_pairing_devices_sync.py similarity index 100% rename from test/appium/tests/critical/test_pairing_devices_sync.py rename to test/appium/tests/old_ui/test_pairing_devices_sync.py diff --git a/test/appium/tests/critical/wallet_and_tx/test_send_tx_dapp_keycard.py b/test/appium/tests/old_ui/wallet_and_tx/test_send_tx_dapp_keycard.py similarity index 100% rename from test/appium/tests/critical/wallet_and_tx/test_send_tx_dapp_keycard.py rename to test/appium/tests/old_ui/wallet_and_tx/test_send_tx_dapp_keycard.py diff --git a/test/appium/tests/critical/wallet_and_tx/test_wallet.py b/test/appium/tests/old_ui/wallet_and_tx/test_wallet.py similarity index 100% rename from test/appium/tests/critical/wallet_and_tx/test_wallet.py rename to test/appium/tests/old_ui/wallet_and_tx/test_wallet.py diff --git a/test/appium/views/base_view.py b/test/appium/views/base_view.py index 0c53fcc86b..70b7761920 100644 --- a/test/appium/views/base_view.py +++ b/test/appium/views/base_view.py @@ -645,6 +645,10 @@ class BaseView(object): def reopen_app(self, password=common_password, sign_in=True): app_package = self.driver.current_package self.driver.terminate_app(app_package) + for _ in range(3): + if self.driver.query_app_state(app_package) == 1: + break + time.sleep(1) self.driver.activate_app(app_package) if sign_in: sign_in_view = self.get_sign_in_view() diff --git a/test/appium/views/elements_templates/discovery_join_button.png b/test/appium/views/elements_templates/discovery_join_button.png index 8887dc6dea3d02892fc3c1225b8750640010dd99..d610edffd0d902eb01cd6835f3a0a9bbd96cdc55 100644 GIT binary patch literal 6403 zcmX|GcRZVI_s=M*H6BXURu5I9wHj(`?WoZxwKuJz6tQANDY|&9Xk%7|Qmgg~Y5TPH zXpzK>nkDuoB){nUzQ6Ow{kg|E-}Ak$>;9bU+~51Txv2r`IlglM0D#rVP!|ROfU4-{ z=4Tn{$6tB+f&jp!ZX?}W_d>H*C&PlcM+BKR*2P@qfzk!H9-153Be!rw(X07*bIDrH zK~8ON24G1~Ny%BODv`~6y<{ji;>C)FrKoFp_1qa?-3w7$?JuPuG=qsf@ea%AW7>hr z)Z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z`{(6Z$0p+~mw%B}lEgEP;oq+Xnx7M3IN3K?`uz8IiB$%~xks8*Qw+By_6CjGW#;JM z1cP#k3mqK_jE)puM}KorT6MuqK0bSwrM(SVrI#3#2_LV=m2Z2hPm44J>{`t52Mdq5 zgQ)8hB1?0Y(Y}=%53dy-|0|U4;97$;GtErPY-lLm`4`fwnUMW%1*uk@2eXw= zmS5-SoeTF5ZYXWrS(mO`OMWhfO=TI=3^Z3-U2rTsyS-GaTy8$^p9>s%nDR*1v_$SH z?d%Fy3ygMfa`>a1!#H7I(U`6QjIET8*xyU%qKS@Z#WBOL{wB#&Tuz-5j5pP{U)+-M zlfS`O8va-%L~I2{v|)vJ@9T_CVl3EvI$i!+mZ}sOYT4M3oq+Vm3wp`D zKo3tRPFQ23yAwa%ykyVQ+l3Pb6c!gBK>nw^(YtT%F<@y!kf|xV%g^YNc(7&4I?3J@ zR4=Lzm@NO?@MnMlLESBqql@;-0Iv}Mh%@D08r?RrlTZE1;Mi%fB}=`i0Yjr#f64#N zzveQ3kDQ5Y4gZ#wI#pJgsvBQeB~`}y>jQF$OuxD?%8lf)p`OH zJ=K}3dJYCGE@7~1Vv~^Pv|9aBmrQU7vM2j>zHRskb3MSqg|pg)^KUF5UxnL^l^#72 z;Nbz_R2O#gY}>t!OFjiwui~_et4+%e;r2W@NxDTvvI6@-UanMc?=So?!XZ9i1P8!8 z+L5Ra5x2OPvG z5vz~?*@GSW5qQLCWSSX!e{#a(%Lr4xnXt4;+4*B3Z=~FQn`T7cAfV E4^Fz(&;S4c diff --git a/test/appium/views/home_view.py b/test/appium/views/home_view.py index 2695de7e1e..0b0544ef2f 100644 --- a/test/appium/views/home_view.py +++ b/test/appium/views/home_view.py @@ -361,8 +361,11 @@ class HomeView(BaseView): def handle_contact_request(self, username: str, action='accept'): if self.toast_content_element.is_element_displayed(10): self.toast_content_element.wait_for_invisibility_of_element() - if self.notifications_unread_badge.is_element_displayed(30): - self.open_activity_center_button.click_until_presence_of_element(self.close_activity_centre) + try: + self.notifications_unread_badge.wait_for_visibility_of_element(30) + except TimeoutException: + pass + self.open_activity_center_button.click_until_presence_of_element(self.close_activity_centre) chat_element = ActivityCenterElement(self.driver, username[:25]) try: if action == 'accept': @@ -376,6 +379,8 @@ class HomeView(BaseView): chat_element.cancel_contact_request() else: self.driver.fail("Illegal option for CR!") + except NoSuchElementException: + self.driver.fail("No contact request received from %s" % username) finally: self.close_activity_centre.wait_for_rendering_ended_and_click() self.chats_tab.wait_for_visibility_of_element()