diff --git a/src/status_im/ui/screens/home/sheet/views.cljs b/src/status_im/ui/screens/home/sheet/views.cljs index 23b7458d04..2cc6b60f1f 100644 --- a/src/status_im/ui/screens/home/sheet/views.cljs +++ b/src/status_im/ui/screens/home/sheet/views.cljs @@ -21,11 +21,12 @@ [quo/text {:size :large :weight :bold} (i18n/label :t/open-home)] - [quo/button {:type :icon - :theme :icon - :on-press #(hide-sheet-and-dispatch - [::qr-scanner/scan-code - {:handler ::qr-scanner/on-scan-success}])} + [quo/button {:type :icon + :theme :icon + :accessibility-label :universal-qr-scanner + :on-press #(hide-sheet-and-dispatch + [::qr-scanner/scan-code + {:handler ::qr-scanner/on-scan-success}])} :main-icons/qr]] [quo/list-item {:theme :accent diff --git a/test/appium/tests/__init__.py b/test/appium/tests/__init__.py index fe5d5efc6a..537e1f9cda 100644 --- a/test/appium/tests/__init__.py +++ b/test/appium/tests/__init__.py @@ -52,6 +52,7 @@ camera_access_error_text = "To grant the required camera permission, please go t photos_access_error_text = "To grant the required photos permission, please go to your system settings " \ "and make sure that Status > Photos is selected." +delete_alert_text = "Warning: If you don’t have your seed phrase written down, you will lose access to your funds after you delete your profile" connection_not_secure_text = "Connection is not secure! " \ "Do not sign transactions or send personal data on this site." diff --git a/test/appium/tests/atomic/account_management/test_profile.py b/test/appium/tests/atomic/account_management/test_profile.py index d035243b79..2850afe1fd 100644 --- a/test/appium/tests/atomic/account_management/test_profile.py +++ b/test/appium/tests/atomic/account_management/test_profile.py @@ -2,7 +2,7 @@ import re from tests import marks, bootnode_address, mailserver_address, camera_access_error_text, \ photos_access_error_text, test_dapp_url, test_dapp_name, mailserver_ams, mailserver_gc, \ - mailserver_hk, used_fleet, common_password + mailserver_hk, used_fleet, common_password, delete_alert_text from tests.base_test_case import SingleDeviceTestCase, MultipleDeviceTestCase from tests.users import transaction_senders, basic_user, ens_user, ens_user_ropsten from views.sign_in_view import SignInView @@ -26,6 +26,55 @@ class TestProfileSingleDevice(SingleDeviceTestCase): if not profile_view.profile_picture.is_element_image_equals_template('sauce_logo_profile.png'): self.driver.fail('Profile picture was not updated') + @marks.testrail_id(6318) + @marks.medium + def test_can_delete_several_multiaccounts(self): + sign_in = SignInView(self.driver) + sign_in.create_user() + profile = sign_in.profile_button.click() + profile.logout() + if sign_in.ok_button.is_element_displayed(): + sign_in.ok_button.click() + sign_in.your_keys_more_icon.click() + sign_in.generate_new_key_button.click() + sign_in.generate_key_button.click() + sign_in.next_button.click() + sign_in.next_button.click() + sign_in.create_password_input.set_value(common_password) + sign_in.next_button.click() + sign_in.confirm_your_password_input.set_value(common_password) + sign_in.next_button.click() + sign_in.maybe_later_button.click_until_presence_of_element(sign_in.lets_go_button) + sign_in.lets_go_button.click() + + sign_in.just_fyi('Delete 2nd multiaccount') + public_key, username = sign_in.get_public_key_and_username(return_username=True) + profile.privacy_and_security_button.click() + profile.delete_my_profile_button.click() + for element in (username, delete_alert_text): + if not profile.element_by_text(delete_alert_text).is_element_displayed(): + self.errors.append('Required %s is not shown when deleting multiaccount' % element) + profile.delete_profile_button.click() + if profile.element_by_text('Profile deleted').is_element_displayed(): + self.driver.fail('Profile is deleted without confirmation with password') + profile.delete_my_profile_password_input.set_value(common_password) + profile.delete_profile_button.click_until_presence_of_element(profile.element_by_text('Profile deleted')) + profile.ok_button.click() + + sign_in.just_fyi('Delete last multiaccount') + sign_in.sign_in() + sign_in.profile_button.click() + profile.privacy_and_security_button.click() + profile.delete_my_profile_button.click() + profile.delete_my_profile_password_input.set_value(common_password) + profile.delete_profile_button.click() + profile.ok_button.click() + if not sign_in.get_started_button.is_element_displayed(): + self.errors.append('No redirected to carousel view after deleting last multiaccount') + self.errors.verify_no_errors() + + + @marks.testrail_id(5741) @marks.high def test_mobile_data_usage_popup_continue_syncing(self): 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 4f28d7512a..416e0cbb9a 100644 --- a/test/appium/tests/atomic/account_management/test_wallet_management.py +++ b/test/appium/tests/atomic/account_management/test_wallet_management.py @@ -156,22 +156,6 @@ class TestWalletManagement(SingleDeviceTestCase): self.errors.append('Collectibles can be sent from wallet') self.errors.verify_no_errors() - @marks.testrail_id(5467) - @marks.medium - def test_deny_camera_access_scanning_wallet_adders(self): - sign_in = SignInView(self.driver) - sign_in.create_user() - wallet = sign_in.wallet_button.click() - wallet.set_up_wallet() - wallet.accounts_status_account.click() - send_transaction = wallet.send_transaction_button.click() - send_transaction.chose_recipient_button.click() - send_transaction.scan_qr_code_button.click() - send_transaction.deny_button.click() - send_transaction.element_by_text(camera_access_error_text).wait_for_visibility_of_element(3) - send_transaction.ok_button.click() - send_transaction.scan_qr_code_button.click() - send_transaction.deny_button.wait_for_visibility_of_element(2) @marks.testrail_id(5435) @marks.medium @@ -248,6 +232,7 @@ class TestWalletManagement(SingleDeviceTestCase): wallet_view.set_up_wallet() wallet_view.accounts_status_account.click() wallet_view.collectibles_button.click() + wallet_view.cryptokitties_in_collectibles_button.wait_for_element(60) wallet_view.cryptokitties_in_collectibles_button.click() web_view = wallet_view.view_in_cryptokitties_button.click() web_view.element_by_text('cryptokitties.co').click() diff --git a/test/appium/tests/atomic/chats/test_chats_management.py b/test/appium/tests/atomic/chats/test_chats_management.py index da80ed5a9f..cd54d5fbec 100644 --- a/test/appium/tests/atomic/chats/test_chats_management.py +++ b/test/appium/tests/atomic/chats/test_chats_management.py @@ -1,6 +1,6 @@ import time -from tests import marks, camera_access_error_text +from tests import marks, camera_access_error_text, photos_access_error_text from tests.users import basic_user, dummy_user, ens_user_ropsten from tests.base_test_case import SingleDeviceTestCase, MultipleDeviceTestCase from views.sign_in_view import SignInView @@ -188,19 +188,80 @@ class TestChatManagement(SingleDeviceTestCase): if not warning_text.is_element_displayed(): self.driver.fail('Error is not shown for invalid public key') - @marks.testrail_id(5466) + + @marks.testrail_id(6319) @marks.medium - def test_deny_camera_access_scanning_contact_code(self): + def test_deny_access_camera_and_gallery(self): sign_in = SignInView(self.driver) home = sign_in.create_user() + + home.just_fyi("Denying access to camera in universal qr code scanner") + home.plus_button.click() + home.universal_qr_scanner_button.click() + home.deny_button.click() + home.element_by_text(camera_access_error_text).wait_for_visibility_of_element(3) + home.ok_button.click() + home.get_back_to_home_view() + + home.just_fyi("Denying access to camera in scan chat key view") home.plus_button.click() contacts_view = home.start_new_chat_button.click() contacts_view.scan_contact_code_button.click() contacts_view.deny_button.click() contacts_view.element_by_text(camera_access_error_text).wait_for_visibility_of_element(3) contacts_view.ok_button.click() - contacts_view.scan_contact_code_button.click() - contacts_view.deny_button.wait_for_visibility_of_element(2) + home.get_back_to_home_view() + + home.just_fyi("Denying access to gallery at attempt to send image") + chat = home.add_contact(basic_user['public_key']) + chat.show_images_button.click() + chat.deny_button.click() + chat.image_from_gallery_button.click() + chat.deny_button.click() + contacts_view.element_by_text(photos_access_error_text).wait_for_visibility_of_element(3) + contacts_view.ok_button.click() + home.get_back_to_home_view() + + home.just_fyi("Denying access to camera in wallet view") + wallet = home.wallet_button.click() + wallet.set_up_wallet() + wallet.scan_qr_button.click() + wallet.deny_button.click() + wallet.element_by_text(camera_access_error_text).wait_for_visibility_of_element(3) + wallet.ok_button.click() + + home.just_fyi("Denying access to camera in send transaction > scan address view") + wallet.accounts_status_account.click() + send_transaction = wallet.send_transaction_button.click() + send_transaction.chose_recipient_button.click() + send_transaction.scan_qr_code_button.click() + send_transaction.deny_button.click() + send_transaction.element_by_text(camera_access_error_text).wait_for_visibility_of_element(3) + send_transaction.ok_button.click() + wallet.back_button.click() + + home.just_fyi("Allow access to camera in universal qr code scanner and check it in other views") + wallet.home_button.click() + home.plus_button.click() + home.universal_qr_scanner_button.click() + home.allow_button.click() + if not home.element_by_text('Scan QR code').is_element_displayed(): + self.errors.append('Scan QR code is not opened after denying and allowing permission to the camera') + home.cancel_button.click() + wallet = home.wallet_button.click() + wallet.scan_qr_button.click() + if not home.element_by_text('Scan QR code').is_element_displayed(): + self.errors.append('Scan QR code is not opened after allowing permission to the camera from univesal QR code' + ' scanner view') + wallet.cancel_button.click() + wallet.home_button.click() + home.get_chat(basic_user['username']).click() + chat.show_images_button.click() + chat.allow_button.click() + if not chat.first_image_from_gallery.is_element_displayed(): + self.errors.append('Image previews are not shown after denying and allowing access to gallery') + self.errors.verify_no_errors() + @marks.testrail_id(5757) @marks.medium @@ -590,10 +651,9 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase): device_1.just_fyi("check that PNs are still enabled in profile after closing 'background notification centre' " "message and relogin") - home_1.profile_button.click() - profile_1.push_notification_toggle.scroll_to_element() - if not profile_1.push_notification_toggle.is_element_image_equals_template('enabled_toggle.png'): - self.errors.append('Toggle is not enabled') + device_1.open_notification_bar() + if not device_1.element_by_text_part("Background notification service").is_element_displayed(): + self.errors.append("Background notification service is not started after relogin") self.errors.verify_no_errors() diff --git a/test/appium/tests/atomic/dapps_and_browsing/test_browsing.py b/test/appium/tests/atomic/dapps_and_browsing/test_browsing.py index 0d59f9f0be..f091053d49 100644 --- a/test/appium/tests/atomic/dapps_and_browsing/test_browsing.py +++ b/test/appium/tests/atomic/dapps_and_browsing/test_browsing.py @@ -230,5 +230,6 @@ class TestBrowsing(SingleDeviceTestCase): dapp_view.confirm() dapp_view.progress_bar.wait_for_invisibility_of_element(20) if not dapp_view.web_page.is_element_image_equals_template(urls[url]): - self.driver.fail('Web page does not match expected template %s' % urls[url]) + self.errors.append('Web page does not match expected template %s' % urls[url]) dapp_view.cross_icon.click() + self.errors.verify_no_errors() diff --git a/test/appium/tests/atomic/dapps_and_browsing/test_dapps.py b/test/appium/tests/atomic/dapps_and_browsing/test_dapps.py index 1af3d2b9f3..0de57fde41 100644 --- a/test/appium/tests/atomic/dapps_and_browsing/test_dapps.py +++ b/test/appium/tests/atomic/dapps_and_browsing/test_dapps.py @@ -105,19 +105,3 @@ class TestDApps(SingleDeviceTestCase): self.errors.append("Subaccount is not selected after relogin in Dapps!") self.errors.verify_no_errors() - @marks.testrail_id(5654) - @marks.low - def test_can_proceed_dapp_usage_after_transacting_it(self): - user = basic_user - sign_in_view = SignInView(self.driver) - home_view = sign_in_view.recover_access(passphrase=user['passphrase']) - chat = home_view.join_public_chat(home_view.get_random_chat_name()) - chat.back_button.click() - status_test_dapp = home_view.open_status_test_dapp() - status_test_dapp.wait_for_d_aap_to_load() - status_test_dapp.assets_button.click() - send_transaction_view = status_test_dapp.request_stt_button.click() - send_transaction_view.ok_got_it_button.click() - send_transaction_view.sign_transaction() - if not status_test_dapp.assets_button.is_element_displayed(): - self.driver.fail('Oops! Cannot proceed to use Status Test Dapp.') diff --git a/test/appium/views/elements_templates/url_1.png b/test/appium/views/elements_templates/url_1.png index f3b28ef97f..bbed32470c 100644 Binary files a/test/appium/views/elements_templates/url_1.png and b/test/appium/views/elements_templates/url_1.png differ diff --git a/test/appium/views/home_view.py b/test/appium/views/home_view.py index af5739487a..1df94b3ad6 100644 --- a/test/appium/views/home_view.py +++ b/test/appium/views/home_view.py @@ -22,6 +22,11 @@ class DeleteChatButton(BaseButton): super(DeleteChatButton, self).__init__(driver) self.locator = self.Locator.accessibility_id("delete-chat-button") +class UniversalQrCodeScannerButton(BaseButton): + def __init__(self, driver): + super(UniversalQrCodeScannerButton, self).__init__(driver) + self.locator = self.Locator.accessibility_id("universal-qr-scanner") + class ClearHistoryButton(BaseButton): def __init__(self, driver): @@ -174,6 +179,7 @@ class HomeView(BaseView): self.chat_url_text = ChatUrlText(self.driver) self.start_new_chat_button = StartNewChatButton(self.driver) + self.universal_qr_scanner_button = UniversalQrCodeScannerButton(self.driver) self.new_group_chat_button = NewGroupChatButton(self.driver) self.join_public_chat_button = JoinPublicChatButton(self.driver) self.invite_friends_button = InviteFriendsButton(self.driver) diff --git a/test/appium/views/profile_view.py b/test/appium/views/profile_view.py index 278b36eda7..8be6dd37b5 100644 --- a/test/appium/views/profile_view.py +++ b/test/appium/views/profile_view.py @@ -557,6 +557,24 @@ class PrivacyAndSecurityButton(BaseButton): super(PrivacyAndSecurityButton, self).__init__(driver) self.locator = self.Locator.accessibility_id('privacy-and-security-settings-button') + +class DeleteMyProfileButton(BaseButton): + def __init__(self, driver): + super(DeleteMyProfileButton, self).__init__(driver) + self.locator = self.Locator.text_selector('Delete my profile') + + +class DeleteMyProfilePasswordInput(BaseEditBox): + def __init__(self, driver): + super(DeleteMyProfilePasswordInput, self).__init__(driver) + self.locator = self.Locator.xpath_selector('//android.widget.EditText') + + +class DeleteProfileButton(BaseButton): + def __init__(self, driver): + super(DeleteProfileButton, self).__init__(driver) + self.locator = self.Locator.xpath_selector('(//*[@text="Delete profile"])[2]') + class UseMobileDataToggle(BaseButton): def __init__(self, driver): super(UseMobileDataToggle, self).__init__(driver) @@ -629,6 +647,9 @@ class ProfileView(BaseView): self.dapp_permissions_button = DappPermissionsButton(self.driver) self.revoke_access_button = RevokeAccessButton(self.driver) self.privacy_and_security_button = PrivacyAndSecurityButton(self.driver) + self.delete_my_profile_button = DeleteMyProfileButton(self.driver) + self.delete_my_profile_password_input = DeleteMyProfilePasswordInput(self.driver) + self.delete_profile_button = DeleteProfileButton(self.driver) # Backup recovery phrase self.backup_recovery_phrase_button = BackupRecoveryPhraseButton(self.driver)