From fd5be21207e3afe61dd8831afdde664a7c363641 Mon Sep 17 00:00:00 2001 From: Churikova Tetiana Date: Thu, 3 Dec 2020 13:59:20 +0100 Subject: [PATCH] e2e: TODO resolve Signed-off-by: Churikova Tetiana --- test/appium/tests/__init__.py | 6 +- .../atomic/account_management/test_keycard.py | 3 - .../atomic/account_management/test_profile.py | 162 +++++++++--------- .../atomic/account_management/test_recover.py | 16 +- .../test_wallet_management.py | 47 ----- .../atomic/chats/test_chats_management.py | 1 - .../tests/atomic/chats/test_commands.py | 21 ++- .../tests/atomic/chats/test_one_to_one.py | 53 +++--- test/appium/views/base_element.py | 4 +- test/appium/views/base_view.py | 8 +- test/appium/views/chat_view.py | 3 + test/appium/views/profile_view.py | 8 +- test/appium/views/send_transaction_view.py | 2 + 13 files changed, 154 insertions(+), 180 deletions(-) diff --git a/test/appium/tests/__init__.py b/test/appium/tests/__init__.py index 7a3da68c91..c8c9ec5190 100644 --- a/test/appium/tests/__init__.py +++ b/test/appium/tests/__init__.py @@ -36,9 +36,9 @@ pair_code= '000000' bootnode_address = "enode://a8a97f126f5e3a340cb4db28a1187c325290ec08b2c9a6b1f19845ac86c46f9fac2ba13328822590" \ "fd3de3acb09cc38b5a05272e583a2365ad1fa67f66c55b34@167.99.210.203:30404" -# referred to https://github.com/status-im/status-react/blob/1ea49a80fc915aa3174ecfd9649c3bab6480d30d/src/status_im/constants.cljs#L40 -mailserver_address = "enode://ee2b53b0ace9692167a410514bca3024695dbf0e1a68e1dff9716da620efb195f04a4b9e873fb9b74ac84de80" \ - "1106c465b8e2b6c4f0d93b8749d1578bfcaf03e:status-offline-inbox@104.197.238.144:443" +# referred to https://github.com/status-im/status-react/blob/develop/resources/config/fleets.json +mailserver_address = "enode://69f72baa7f1722d111a8c9c68c39a31430e9d567695f6108f31ccb6cd8f0adff4991e7fdca8fa770e75bc8a511" \ + "a87d24690cbc80e008175f40c157d6f6788d48:status-offline-inbox@206.189.240.16:443" staging_fleet = 'eth.staging' prod_fleet = 'eth.prod' # This fleet is used in the tests diff --git a/test/appium/tests/atomic/account_management/test_keycard.py b/test/appium/tests/atomic/account_management/test_keycard.py index 1b625100a8..54135c3e0d 100644 --- a/test/appium/tests/atomic/account_management/test_keycard.py +++ b/test/appium/tests/atomic/account_management/test_keycard.py @@ -288,9 +288,6 @@ class TestCreateAccount(SingleDeviceTestCase): account_button = wallet_view.get_account_by_name(account_name) if not account_button.is_element_displayed(): self.driver.fail('Account was not added') - # TODO: not working in keycard - token balance is fetched. blecked due to issue - # if wallet_view.asset_by_name('ADI').is_element_displayed(): - # self.errors.append('Tokens are visible after adding account on cellular network!') wallet_view.just_fyi('Check that balance is changed after go back to WI-FI') sign_in.toggle_mobile_data() diff --git a/test/appium/tests/atomic/account_management/test_profile.py b/test/appium/tests/atomic/account_management/test_profile.py index 1c07b44584..5e8d5063ce 100644 --- a/test/appium/tests/atomic/account_management/test_profile.py +++ b/test/appium/tests/atomic/account_management/test_profile.py @@ -804,10 +804,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase): profile_1.just_fyi('disable autoselection') profile_1.sync_settings_button.click() profile_1.mail_server_button.click() - mailserver_1 = profile_1.return_mailserver_name(mailserver_hk, used_fleet) - mailserver_2 = profile_1.return_mailserver_name(mailserver_ams, used_fleet) - # TODO: temporary pin mailserver to avoid issue 9269 - should be disabled after fix - mailserver = mailserver_1 if profile_1.element_by_text(mailserver_2).is_element_present() else mailserver_2 + mailserver = profile_1.return_mailserver_name(mailserver_hk, used_fleet) profile_1.mail_server_auto_selection_button.click() profile_1.mail_server_by_name(mailserver).click() profile_1.confirm_button.click() @@ -815,59 +812,58 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase): profile_1.plus_button.click() server_name = 'test' profile_1.save_button.click() - if profile_1.element_by_text(mailserver_ams).is_element_displayed(): + if profile_1.element_by_text(mailserver).is_element_displayed(): self.errors.append('Could add custom mailserver with empty address and name') profile_1.specify_name_input.set_value(server_name) profile_1.mail_server_address_input.set_value(mailserver_address[:-3]) profile_1.save_button.click() - if profile_1.element_by_text(mailserver_2).is_element_displayed(): + if not profile_1.element_by_text_part("Invalid format").is_element_displayed(): self.errors.append('could add custom mailserver with invalid address') profile_1.mail_server_address_input.clear() profile_1.mail_server_address_input.set_value(mailserver_address) profile_1.save_button.click() - # TODO: disabled due to 10065 - # profile_1.mail_server_by_name(server_name).click() - # profile_1.mail_server_connect_button.click() - # profile_1.confirm_button.click() - # if profile_1.element_by_text_part("Error connecting").is_element_displayed(40): - # profile_1.retry_to_connect_to_mailserver() - # profile_1.get_back_to_home_view() - # profile_1.home_button.click() + profile_1.mail_server_by_name(server_name).click() + profile_1.mail_server_connect_button.click() + profile_1.confirm_button.click() + if profile_1.element_by_text_part("Error connecting").is_element_displayed(40): + profile_1.retry_to_connect_to_mailserver() + profile_1.get_back_to_home_view() + profile_1.home_button.click() - # profile_1.just_fyi('start chat with user2 and check that all messages are delivered') - # chat_1 = home_1.add_contact(public_key) - # message = 'test message' - # chat_1.chat_message_input.send_keys(message) - # chat_1.send_message_button.click() - # chat_2 = home_2.get_chat(username_1).click() - # chat_2.chat_element_by_text(message).wait_for_visibility_of_element() - # message_1 = 'new message' - # chat_2.chat_message_input.send_keys(message_1) - # chat_2.send_message_button.click() - # chat_1.chat_element_by_text(message_1).wait_for_visibility_of_element() - # - # profile_1.just_fyi('delete custom mailserver') - # chat_1.profile_button.click() - # profile_1.sync_settings_button.click() - # profile_1.mail_server_button.click() - # profile_1.element_by_text(mailserver).scroll_to_element() - # profile_1.element_by_text(mailserver).click() - # profile_1.confirm_button.click() - # profile_1.element_by_text(server_name).scroll_to_element() - # profile_1.element_by_text(server_name).click() - # profile_1.mail_server_delete_button.scroll_to_element() - # profile_1.mail_server_delete_button.click() - # profile_1.mail_server_confirm_delete_button.click() - # if profile_1.element_by_text(server_name).is_element_displayed(): - # self.errors.append('Deleted custom mailserver is shown') - # profile_1.get_back_to_home_view() - # profile_1.relogin() - # chat_1.profile_button.click() - # profile_1.sync_settings_button.click() - # profile_1.mail_server_button.click() - # if profile_1.element_by_text(server_name).is_element_displayed(): - # self.errors.append('Deleted custom mailserver is shown after relogin') + profile_1.just_fyi('start chat with user2 and check that all messages are delivered') + chat_1 = home_1.add_contact(public_key) + message = 'test message' + chat_1.chat_message_input.send_keys(message) + chat_1.send_message_button.click() + chat_2 = home_2.get_chat(username_1).click() + chat_2.chat_element_by_text(message).wait_for_visibility_of_element() + message_1 = 'new message' + chat_2.chat_message_input.send_keys(message_1) + chat_2.send_message_button.click() + chat_1.chat_element_by_text(message_1).wait_for_visibility_of_element() + + profile_1.just_fyi('delete custom mailserver') + chat_1.profile_button.click() + profile_1.sync_settings_button.click() + profile_1.mail_server_button.click() + profile_1.element_by_text(mailserver).scroll_to_element() + profile_1.element_by_text(mailserver).click() + profile_1.confirm_button.click() + profile_1.element_by_text(server_name).scroll_to_element() + profile_1.element_by_text(server_name).click() + profile_1.mail_server_delete_button.scroll_to_element() + profile_1.mail_server_delete_button.click() + profile_1.mail_server_confirm_delete_button.click() + if profile_1.element_by_text(server_name).is_element_displayed(): + self.errors.append('Deleted custom mailserver is shown') + profile_1.get_back_to_home_view() + profile_1.relogin() + chat_1.profile_button.click() + profile_1.sync_settings_button.click() + profile_1.mail_server_button.click() + if profile_1.element_by_text(server_name).is_element_displayed(): + self.errors.append('Deleted custom mailserver is shown after relogin') self.errors.verify_no_errors() @@ -876,59 +872,55 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase): @marks.flaky def test_can_not_connect_to_mailserver(self): self.create_drivers(2) - sign_in_1, sign_in_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) - home_1, home_2 = sign_in_1.create_user(), sign_in_2.create_user() + home_1, home_2= SignInView(self.drivers[0]).create_user(), SignInView(self.drivers[1]).create_user() profile_1 = home_1.profile_button.click() profile_1.just_fyi('add non-working mailserver and connect to it') profile_1.sync_settings_button.click() profile_1.mail_server_button.click() + profile_1.mail_server_auto_selection_button.click() profile_1.plus_button.click() server_name = 'test' profile_1.specify_name_input.set_value(server_name) profile_1.mail_server_address_input.set_value(mailserver_address.replace('4','5')) profile_1.save_button.click() - profile_1.mail_server_auto_selection_button.click() profile_1.mail_server_by_name(server_name).click() profile_1.mail_server_connect_button.click() profile_1.confirm_button.click() - if not profile_1.element_by_text_part('Error connecting').is_element_displayed(30): - sign_in_1.driver.fail("No popup with 'Error connecting' is shown") - profile_1.element_by_text('CANCEL').click() - # TODO: blocked by 10065 - # profile_1.home_button.click() - # home_2.just_fyi('send several messages to public channel') - # public_chat_name = home_2.get_random_chat_name() - # message = 'test_message' - # public_chat_2 = home_2.join_public_chat(public_chat_name) - # public_chat_2.chat_message_input.send_keys(message) - # public_chat_2.send_message_button.click() - # public_chat_2.back_button.click() - # - # profile_1.just_fyi('join same public chat and try to reconnect via "Tap to reconnect" and check "Connecting"') - # profile_1.home_button.click() - # home_1.join_public_chat(public_chat_name) - # public_chat_1 = home_1.get_chat_view() - # chat_state = 'Could not connect to mailserver. Tap to reconnect' - # public_chat_1.element_by_text(chat_state).click() - # if not public_chat_1.element_by_text_part('Connecting').is_element_displayed(): - # self.errors.append("Indicator doesn't show 'Connecting'") + profile_1.just_fyi('check that popup "Error connecting" will not reappear if tap on "Cancel"') + profile_1.find_element_by_translation_id('mailserver-error-title').wait_for_element(30) + profile_1.cancel_button.click() + profile_1.home_button.click() - # profile_1.just_fyi('check that can RETRY to connect') - # for _ in range(2): - # public_chat_1.element_by_text('RETRY').wait_for_element(30) - # public_chat_1.element_by_text('RETRY').click() - # - # profile_1.just_fyi('check that can pick another mailserver and receive messages') - # public_chat_1.element_by_text('PICK ANOTHER').is_element_displayed(30) - # public_chat_1.element_by_text_part('PICK ANOTHER').click() - # mailserver = profile_1.return_mailserver_name(mailserver_ams, used_fleet) - # profile_1.element_by_text(mailserver).click() - # profile_1.confirm_button.click() - # profile_1.home_button.click() - # if not public_chat_1.chat_element_by_text(message).is_element_displayed(30): - # self.errors.append("Chat history wasn't fetched") + home_2.just_fyi('send several messages to public channel') + public_chat_name = home_2.get_random_chat_name() + message = 'test_message' + public_chat_2 = home_2.join_public_chat(public_chat_name) + public_chat_2.chat_message_input.send_keys(message) + public_chat_2.send_message_button.click() + public_chat_2.back_button.click() + + profile_1.just_fyi('join same public chat and try to reconnect via "Tap to reconnect" and check "Connecting"') + profile_1.home_button.click() + public_chat_1 = home_1.join_public_chat(public_chat_name) + public_chat_1.relogin() + if not public_chat_1.element_by_text_part("Connecting").is_element_displayed(20): + self.errors.append("Indicator doesn't show 'Connecting'") + + profile_1.just_fyi('check that can RETRY to connect') + for _ in range(2): + public_chat_1.find_element_by_translation_id('mailserver-retry', 'button', uppercase=True).wait_and_click() + + profile_1.just_fyi('check that can pick another mailserver and receive messages') + public_chat_1.find_element_by_translation_id('mailserver-pick-another', 'button', uppercase=True).wait_and_click() + mailserver = profile_1.return_mailserver_name(mailserver_ams, used_fleet) + profile_1.element_by_text(mailserver).click() + profile_1.confirm_button.click() + profile_1.home_button.click() + home_1.get_chat(public_chat_name).click() + if not public_chat_1.chat_element_by_text(message).is_element_displayed(30): + self.errors.append("Chat history wasn't fetched") self.errors.verify_no_errors() diff --git a/test/appium/tests/atomic/account_management/test_recover.py b/test/appium/tests/atomic/account_management/test_recover.py index bc6c999fd9..d2339d81b8 100644 --- a/test/appium/tests/atomic/account_management/test_recover.py +++ b/test/appium/tests/atomic/account_management/test_recover.py @@ -51,24 +51,24 @@ class TestRecoverAccountSingleDevice(SingleDeviceTestCase): signin_view.access_key_button.click() recover_access_view = RecoverAccessView(self.driver) validations = [ - # empty value { + 'case': 'empty value', 'phrase': ' ', 'element to check': recover_access_view.warnings.invalid_recovery_phrase, 'validation message': 'Required field', 'words count': 1, 'popup': False }, - # invalid seed phrase { + 'case': '1 word seed', 'phrase': 'a', 'element to check': recover_access_view.warnings.invalid_recovery_phrase, - 'validation message': 'Seed phrase is invalid', + 'validation message': '', 'words count': 1, 'popup' : False }, - # mnemonic but checksum validation fails { + 'case': 'mnemonic but checksum validation fails', 'phrase': 'one two three four five six seven eight nine ten eleven twelve', 'element to check': recover_access_view.warnings.invalid_recovery_phrase, 'validation message': '', @@ -84,8 +84,8 @@ class TestRecoverAccountSingleDevice(SingleDeviceTestCase): self.errors.append("Possible to create account with empty seed phrase") signin_view = SignInView(self.driver, skip_popups=False) - # we're performing the same steps changing only phrase per attempt for validation in validations: + recover_access_view.just_fyi("Checking %s" % validation.get('case')) phrase, elm, msg, words_count, popup = validation.get('phrase'), \ validation.get('element to check'), \ validation.get('validation message'), \ @@ -98,9 +98,9 @@ class TestRecoverAccountSingleDevice(SingleDeviceTestCase): recover_access_view.send_as_keyevent(phrase) - # TODO: still disabled because tooltips are not visible - # if msg and not elm.is_element_displayed(): - # self.errors.append('"{}" message is not shown'.format(msg)) + if msg: + if not recover_access_view.element_by_text(msg).is_element_displayed(): + self.errors.append('"{}" message is not shown'.format(msg)) recover_access_view.just_fyi('check that words count is shown') if words_count == 1: diff --git a/test/appium/tests/atomic/account_management/test_wallet_management.py b/test/appium/tests/atomic/account_management/test_wallet_management.py index 29d6be7c41..a07c392654 100644 --- a/test/appium/tests/atomic/account_management/test_wallet_management.py +++ b/test/appium/tests/atomic/account_management/test_wallet_management.py @@ -153,51 +153,6 @@ class TestWalletManagement(SingleDeviceTestCase): self.errors.verify_no_errors() - @marks.testrail_id(5435) - @marks.medium - @marks.skip - # TODO: e2e blocker: 9225 (should be updated and enabled) - def test_filter_transactions_history(self): - user = wallet_users['C'] - sign_in_view = SignInView(self.driver) - sign_in_view.recover_access(passphrase=user['passphrase']) - wallet_view = sign_in_view.wallet_button.click() - wallet_view.set_up_wallet() - wallet_view.accounts_status_account.click() - transaction_history = wallet_view.transaction_history_button.click() - transaction_history.filters_button.click() - for filter_name in 'Outgoing', 'Pending', 'Failed': - transaction_history.filter_checkbox(filter_name).click() - wallet_view.done_button.click() - for i in range(transaction_history.transactions_table.get_transactions_number()): - details = transaction_history.transactions_table.transaction_by_index(i).click() - if details.get_recipient_address() != '0x' + user['address'] \ - or details.element_by_text('Failed').is_element_displayed(): - self.driver.fail('Incoming transactions are not filtered') - details.back_button.click() - - transaction_history.filters_button.click() - for filter_name in 'Outgoing', 'Incoming': - transaction_history.filter_checkbox(filter_name).click() - wallet_view.done_button.click() - for i in range(transaction_history.transactions_table.get_transactions_number()): - details = transaction_history.transactions_table.transaction_by_index(i).click() - if details.get_sender_address() != '0x' + user['address'] \ - or details.element_by_text('Failed').is_element_displayed(): - self.driver.fail('Outgoing transactions are not filtered') - details.back_button.click() - - transaction_history.filters_button.click() - for filter_name in 'Outgoing', 'Failed': - transaction_history.filter_checkbox(filter_name).click() - wallet_view.done_button.click() - for i in range(transaction_history.transactions_table.get_transactions_number()): - details = transaction_history.transactions_table.transaction_by_index(i).click() - if not details.element_by_text('Failed').is_element_displayed(): - self.driver.fail('Failed transactions are not filtered') - details.back_button.click() - self.errors.verify_no_errors() - @marks.testrail_id(5381) @marks.high def test_user_can_see_all_own_assets_after_account_recovering(self): @@ -458,8 +413,6 @@ class TestWalletManagement(SingleDeviceTestCase): wallet.manage_assets_button.click() for keyword in search_list_assets: home.search_by_keyword(keyword) - # TODO: remove time sleep after 10957 is closed - time.sleep(5) if keyword == 'ad': search_elements = wallet.all_assets_full_names.find_elements() else: diff --git a/test/appium/tests/atomic/chats/test_chats_management.py b/test/appium/tests/atomic/chats/test_chats_management.py index 0dd84668a6..9dda3d1aba 100644 --- a/test/appium/tests/atomic/chats/test_chats_management.py +++ b/test/appium/tests/atomic/chats/test_chats_management.py @@ -784,7 +784,6 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase): device_1.just_fyi("reopen app and check that messages from blocked user are not fetched") device_1.click_system_home_button() self.drivers[0].launch_app() - # device_1.accept_agreements() device_1.sign_in() if home_1.get_chat(basic_user['username']).is_element_displayed(): self.errors.append("Chat with blocked user is reappeared after fetching new messages from offline") diff --git a/test/appium/tests/atomic/chats/test_commands.py b/test/appium/tests/atomic/chats/test_commands.py index fed92a16e2..90d6ca8da8 100644 --- a/test/appium/tests/atomic/chats/test_commands.py +++ b/test/appium/tests/atomic/chats/test_commands.py @@ -56,8 +56,13 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase): sender = transaction_senders['A'] self.create_drivers(2) device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) - home_1 = device_1.recover_access(passphrase=sender['passphrase']) - home_2 = device_2.create_user() + home_1 = device_1.recover_access(passphrase=sender['passphrase'], enable_notifications=True) + home_2 = device_2.create_user(enable_notifications=True) + for home in home_1, home_2: + profile = home.profile_button.click() + profile.profile_notifications_button.click() + profile.wallet_push_notifications.click() + recipient_public_key, recipient_username = home_2.get_public_key_and_username(return_username=True) wallet_1, wallet_2 = home_1.wallet_button.click(), home_2.wallet_button.click() for wallet in (wallet_1, wallet_2): @@ -115,11 +120,19 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase): wallet_1.accounts_status_account.click() transactions_view = wallet_1.transaction_history_button.click() transactions_view.transactions_table.find_transaction(amount=amount) - self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount) - wallet_1.home_button.click(desired_view="chat") + for wallet in wallet_1, wallet_2: + wallet.put_app_to_background() + self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount) + device_1.open_notification_bar() + device_1.element_by_text_part('You sent %s ETH' % amount).click() + if not wallet_1.transaction_history_button.is_element_displayed(): + self.errors.append('Was not redirected to transaction history after tapping on PN') + + wallet_1.home_button.click(desired_view="chat") home_1.just_fyi("Check 'Confirmed' state for sender") chat_1_sender_message.transaction_status.wait_for_element_text('Confirmed') + # TODO: should be added PNs for receiver agter getting more stable feature self.errors.verify_no_errors() @marks.testrail_id(6263) diff --git a/test/appium/tests/atomic/chats/test_one_to_one.py b/test/appium/tests/atomic/chats/test_one_to_one.py index 2005957852..3396557a48 100644 --- a/test/appium/tests/atomic/chats/test_one_to_one.py +++ b/test/appium/tests/atomic/chats/test_one_to_one.py @@ -289,19 +289,20 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase): device_1_home.just_fyi('set status in profile') device_1_status = 'Hey hey hey' timeline = device_1.status_button.click() - timeline.set_new_status(device_1_status) - if not timeline.element_by_text(device_1_status).is_element_displayed(): - self.drivers[0].fail('Status is not set') + timeline.set_new_status(device_1_status, image=True) + for element in timeline.element_by_text(device_1_status), timeline.image_chat_item: + if not element.is_element_displayed(): + self.drivers[0].fail('Status is not set') + device_1_public_key, device_1_username = device_1_profile.get_public_key_and_username(return_username=True) - image_description = 'description' [home.click() for home in [device_1_profile.home_button, device_2_profile.home_button]] device_1_home.just_fyi('start 1-1 chat') device_1_chat = device_1_home.add_contact(device_2_public_key) device_1_home.just_fyi('send image in 1-1 chat from Gallery, check options for sender') + image_description = 'description' device_1_chat.show_images_button.click() - device_1_chat.allow_button.click() device_1_chat.first_image_from_gallery.click() if not device_1_chat.cancel_send_image_button.is_element_displayed(): self.errors.append("Can't cancel sending images, expected image preview is not shown!") @@ -329,8 +330,11 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase): device_2_home.just_fyi('View user profile and check status') device_2_chat.chat_options.click() - device_2_chat.view_profile_button.click() - device_2_chat.element_by_text(device_1_status).scroll_to_element() + timeline_device_1 = device_2_chat.view_profile_button.click() + for element in timeline_device_1.element_by_text(device_1_status), timeline_device_1.image_chat_item: + element.scroll_to_element() + if not element.is_element_displayed(): + self.drivers[0].fail('Status of another user not shown when open another user profile') device_2_chat.back_button.click() device_2_home.just_fyi('check options on long-press image for receiver') @@ -609,9 +613,8 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase): self.errors.append('Timestamp is not displayed in 1-1 chat for the recipient') if device_2_chat.chat_element_by_text(message).member_photo.is_element_displayed(): self.errors.append('Member photo is displayed in 1-1 chat for the recipient') - # TODO: disabled due to issue 'yesterday' is shown, can't emulate manually - # for chat in device_1_chat, device_2_chat: - # chat.verify_message_is_under_today_text(message, self.errors) + for chat in device_1_chat, device_2_chat: + chat.verify_message_is_under_today_text(message, self.errors) device_1_chat.just_fyi('check user picture and timestamps in chat for sender and recipient in public chat') chat_name = device_1_home.get_random_chat_name() @@ -631,9 +634,8 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase): self.errors.append('Timestamp is not displayed in public chat for the recipient') if not device_1_chat.chat_element_by_text(message).member_photo.is_element_displayed(): self.errors.append('Member photo is not displayed in public chat for the recipient') - # TODO: disabled due to issue 'yesterday' is shown, can't emulate manually - # for chat in device_1_chat, device_2_chat: - # chat.verify_message_is_under_today_text(message, self.errors) + for chat in device_1_chat, device_2_chat: + chat.verify_message_is_under_today_text(message, self.errors) self.errors.verify_no_errors() @@ -650,7 +652,9 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase): chat = sign_in.get_chat_view() message_text = {'text_message': 'mmmeowesage_text'} formatted_message = {'message_with_link':'https://status.im', - 'message_with_tag': '#successishere'} + #TODO: blocked with 11161 + #'message_with_tag': '#successishere' + } message_input = chat.chat_message_input message_input.send_keys(message_text['text_message']) chat.send_message_button.click() @@ -662,19 +666,18 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase): self.errors.append('Message %s text was not copied in a public chat' % message_text['text_message']) message_input.clear() - #TODO: uncomment after #11168 and 11161 is fixed - #for message in formatted_message: - # message_input.send_keys(formatted_message[message]) - # chat.send_message_button.click() + for message in formatted_message: + message_input.send_keys(formatted_message[message]) + chat.send_message_button.click() - # message_bubble = chat.chat_element_by_text(formatted_message[message]) - # message_bubble.timestamp_message.long_press_element() - # chat.element_by_text('Copy').click() + message_bubble = chat.chat_element_by_text(formatted_message[message]) + message_bubble.timestamp_message.long_press_element() + 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() + 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() diff --git a/test/appium/views/base_element.py b/test/appium/views/base_element.py index 968918735e..459a99f67f 100644 --- a/test/appium/views/base_element.py +++ b/test/appium/views/base_element.py @@ -48,8 +48,10 @@ class BaseElement(object): return cls(MobileBy.XPATH, xpath_expression) @classmethod - def translation_id_selector(cls, id, suffix=''): + def translation_id_selector(cls, id, suffix='', uppercase = False): text = transl[id] + if uppercase: + text = transl[id].upper() return BaseElement.Locator.xpath_selector('//*[@text="' + text + '"]' + suffix) def __str__(self, *args, **kwargs): diff --git a/test/appium/views/base_view.py b/test/appium/views/base_view.py index f3a58cd493..9274ac2068 100644 --- a/test/appium/views/base_view.py +++ b/test/appium/views/base_view.py @@ -524,6 +524,10 @@ class BaseView(object): self.driver.info('Press system Home button') self.driver.press_keycode(3) + def put_app_to_background(self): + self.driver.info('App to background') + self.driver.press_keycode(187) + def cut_text(self): self.driver.info('Cut text') self.driver.press_keycode(277) @@ -586,10 +590,10 @@ class BaseView(object): element.locator = element.Locator.xpath_selector("//*[starts-with(@text,'%s')]" % text) return element - def find_element_by_translation_id(self, id, element_type='base'): + def find_element_by_translation_id(self, id, element_type='base', uppercase=False): self.driver.info("Looking element by id: '%s'" % id) element = self.element_types[element_type](self.driver) - element.locator = element.Locator.translation_id_selector(id) + element.locator = element.Locator.translation_id_selector(id, uppercase=uppercase) return element def wait_for_element_starts_with_text(self, text, wait_time=60): diff --git a/test/appium/views/chat_view.py b/test/appium/views/chat_view.py index b0884bd5bb..1821b6ddd1 100644 --- a/test/appium/views/chat_view.py +++ b/test/appium/views/chat_view.py @@ -349,6 +349,9 @@ class ViewProfileButton(BaseButton): super(ViewProfileButton, self).__init__(driver) self.locator = self.Locator.translation_id_selector('view-profile') + def navigate(self): + return ChatView(self.driver) + class ViewProfileByAvatarButton(BaseButton): def __init__(self, driver): super(ViewProfileByAvatarButton, self).__init__(driver) diff --git a/test/appium/views/profile_view.py b/test/appium/views/profile_view.py index 0f29966720..44bad8ef94 100644 --- a/test/appium/views/profile_view.py +++ b/test/appium/views/profile_view.py @@ -444,7 +444,7 @@ class MailServerConfirmDeleteButton(BaseButton): def __init__(self, driver): super(MailServerConfirmDeleteButton, self).__init__(driver) - self.locator = self.Locator.text_selector('DELETE MAILSERVER') + self.locator = self.Locator.translation_id_selector("delete-mailserver", uppercase=True) class ActiveNetworkName(BaseText): @@ -608,6 +608,11 @@ class PushNotificationToggle(BaseButton): self.locator = self.Locator.xpath_selector( "//*[@content-desc='notifications-button']//*[@content-desc='switch']") +class WalletTransactionsButton(BaseButton): + def __init__(self, driver): + super(WalletTransactionsButton, self).__init__(driver) + self.locator = self.Locator.accessibility_id("notifications-button") + class ENSUsernameInChatSettings(BaseElement): def __init__(self, driver): super(ENSUsernameInChatSettings, self).__init__(driver) @@ -718,6 +723,7 @@ class ProfileView(BaseView): #Push notifications self.push_notification_toggle = PushNotificationToggle(self.driver) + self.wallet_push_notifications = WalletTransactionsButton(self.driver) def switch_network(self, network='Mainnet with upstream RPC'): self.advanced_button.click() diff --git a/test/appium/views/send_transaction_view.py b/test/appium/views/send_transaction_view.py index 66cd87b7f4..a8f221557b 100644 --- a/test/appium/views/send_transaction_view.py +++ b/test/appium/views/send_transaction_view.py @@ -392,6 +392,8 @@ class SendTransactionView(BaseView): self.enter_password_input.send_keys(sender_password) self.sign_button.click_until_absense_of_element(self.sign_button) self.ok_button.wait_for_element(120) + if self.element_by_text_part('Transaction failed').is_element_displayed(): + self.driver.fail('Transaction failed') self.ok_button.click() def get_transaction_fee_total(self):