From 57f1303c5fef0da096bbec8da74ba34c04d19207 Mon Sep 17 00:00:00 2001 From: Churikova Tetiana Date: Thu, 23 Apr 2020 17:42:20 +0200 Subject: [PATCH] bootnode e2e + translations + new checks in e2e Signed-off-by: Churikova Tetiana --- .../edit_bootnode/views.cljs | 28 ++++++++------- .../ui/screens/bootnodes_settings/views.cljs | 5 +-- .../atomic/account_management/test_profile.py | 35 +++++++++++++------ .../tests/atomic/chats/test_commands.py | 7 ++++ .../tests/atomic/transactions/test_wallet.py | 5 +++ test/appium/views/home_view.py | 2 +- test/appium/views/profile_view.py | 15 +++++--- test/appium/views/sign_in_view.py | 2 +- translations/es.json | 2 +- translations/es_419.json | 2 +- translations/fil.json | 2 +- translations/fr.json | 2 +- translations/id.json | 2 +- translations/it.json | 2 +- translations/zh.json | 2 +- translations/zh_Hans_CN.json | 2 +- translations/zh_TW.json | 2 +- translations/zh_hans.json | 2 +- 18 files changed, 78 insertions(+), 41 deletions(-) diff --git a/src/status_im/ui/screens/bootnodes_settings/edit_bootnode/views.cljs b/src/status_im/ui/screens/bootnodes_settings/edit_bootnode/views.cljs index 25dd6ad678b..97577a18c8b 100644 --- a/src/status_im/ui/screens/bootnodes_settings/edit_bootnode/views.cljs +++ b/src/status_im/ui/screens/bootnodes_settings/edit_bootnode/views.cljs @@ -47,23 +47,25 @@ [react/scroll-view {:keyboard-should-persist-taps :handled} [react/view styles/edit-bootnode-view [text-input/text-input-with-label - {:label (i18n/label :t/name) - :placeholder (i18n/label :t/specify-name) - :style styles/input - :container styles/input-container - :default-value name - :on-change-text #(re-frame/dispatch [:bootnodes.ui/input-changed :name %]) - :auto-focus true}] + {:label (i18n/label :t/name) + :placeholder (i18n/label :t/specify-name) + :accessibility-label :bootnode-name + :style styles/input + :container styles/input-container + :default-value name + :on-change-text #(re-frame/dispatch [:bootnodes.ui/input-changed :name %]) + :auto-focus true}] [react/view {:flex 1} [text-input/text-input-with-label (merge - {:label (i18n/label :t/bootnode-address) - :placeholder (i18n/label :t/bootnode-format) - :style styles/input - :container styles/input-container - :default-value url - :on-change-text #(re-frame/dispatch [:bootnodes.ui/input-changed :url %])} + {:label (i18n/label :t/bootnode-address) + :placeholder (i18n/label :t/bootnode-format) + :style styles/input + :accessibility-label :bootnode-address + :container styles/input-container + :default-value url + :on-change-text #(re-frame/dispatch [:bootnodes.ui/input-changed :url %])} (when-not platform/desktop? {:content qr-code}))] (when (and (not (string/blank? url)) invalid-url?) [tooltip/tooltip (i18n/label :t/invalid-format diff --git a/src/status_im/ui/screens/bootnodes_settings/views.cljs b/src/status_im/ui/screens/bootnodes_settings/views.cljs index 3ee1091886a..3cc10b4b2cc 100644 --- a/src/status_im/ui/screens/bootnodes_settings/views.cljs +++ b/src/status_im/ui/screens/bootnodes_settings/views.cljs @@ -24,8 +24,9 @@ bootnodes [:custom-bootnodes/network-bootnodes]] [react/view {:flex 1} [topbar/topbar {:title :t/bootnodes-settings - :accessories [{:icon :main-icons/add - :handler #(navigate-to-add-bootnode nil)}]}] + :accessories [{:icon :main-icons/add + :accessibility-label :add-bootnode + :handler #(navigate-to-add-bootnode nil)}]}] [react/view styles/switch-container [profile.components/settings-switch-item {:label-kw :t/bootnodes-enabled diff --git a/test/appium/tests/atomic/account_management/test_profile.py b/test/appium/tests/atomic/account_management/test_profile.py index 0af2287dce8..98f690f20ba 100644 --- a/test/appium/tests/atomic/account_management/test_profile.py +++ b/test/appium/tests/atomic/account_management/test_profile.py @@ -224,6 +224,11 @@ def test_can_add_existing_ens(self): self.errors.append('No ENS name is shown in own profile after adding') if not dapp_view.element_by_text('%s.stateofus.eth' % ens_user['ens']).is_element_displayed(): self.errors.append('No ENS name is shown in own profile after adding') + profile.share_my_profile_button.click() + if profile.ens_name_in_share_chat_key_text.text != '%s.stateofus.eth' % ens_user['ens']: + self.errors.append('No ENS name is shown on tapping on share icon in Profile') + profile.close_share_popup() + self.errors.verify_no_errors() @marks.testrail_id(5475) @@ -606,8 +611,6 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase): @marks.testrail_id(5432) @marks.medium - @marks.skip - # TODO: e2e blocker 9135: no force-logout after enabling bootnode (enable after fix) def test_custom_bootnodes(self): self.create_drivers(2) sign_in_1, sign_in_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) @@ -616,15 +619,25 @@ def test_custom_bootnodes(self): profile_1, profile_2 = home_1.profile_button.click(), home_2.profile_button.click() username_1, username_2 = profile_1.default_username_text.text, profile_2.default_username_text.text + + profile_1.just_fyi('Add custom bootnode, enable bootnodes and check validation') profile_1.advanced_button.click() profile_1.bootnodes_button.click() - profile_1.plus_button.click() + profile_1.add_bootnode_button.click() profile_1.specify_name_input.set_value('test') + profile_1.bootnode_address_input.set_value('invalid_bootnode_address') + if not profile_1.element_by_text_part('Invalid format').is_element_displayed(): + self.errors.append('Validation message about invalid format of bootnode is not shown') + profile_1.save_button.click() + if profile_1.add_bootnode_button.is_element_displayed(): + self.errors.append('User was navigated to another screen when tapped on disabled "Save" button') + profile_1.bootnode_address_input.clear() profile_1.bootnode_address_input.set_value(bootnode_address) profile_1.save_button.click() profile_1.enable_bootnodes.click() - sign_in_1.sign_in() + profile_1.home_button.click() + profile_1.just_fyi('Add contact and send first message') chat_1 = home_1.add_contact(public_key) message = 'test message' chat_1.chat_message_input.send_keys(message) @@ -634,18 +647,20 @@ def test_custom_bootnodes(self): chat_2.chat_element_by_text(message).wait_for_visibility_of_element() chat_2.add_to_contacts.click() - chat_1.get_back_to_home_view() - home_1.profile_button.click() - profile_1.advanced_button.click() - profile_1.bootnodes_button.click() + profile_1.just_fyi('Disable custom bootnodes') + chat_1.profile_button.click() profile_1.enable_bootnodes.click() - sign_in_1.sign_in() + profile_1.home_button.click() + profile_1.just_fyi('Send message and check that it is received after disabling bootnodes') home_1.get_chat(username_2).click() message_1 = 'new message' chat_1.chat_message_input.send_keys(message_1) chat_1.send_message_button.click() - chat_2.chat_element_by_text(message_1).wait_for_visibility_of_element() + for chat in chat_1, chat_2: + if not chat.chat_element_by_text(message_1).is_element_displayed(): + self.errors.append('Message was not received after enabling bootnodes!') + self.errors.verify_no_errors() @marks.testrail_id(5436) @marks.medium diff --git a/test/appium/tests/atomic/chats/test_commands.py b/test/appium/tests/atomic/chats/test_commands.py index ff73b69fae2..99a554c22ed 100644 --- a/test/appium/tests/atomic/chats/test_commands.py +++ b/test/appium/tests/atomic/chats/test_commands.py @@ -35,8 +35,15 @@ def test_network_mismatch_for_send_request_in_1_1_chat(self): request_transaction.request_transaction_button.click() chat_2_request_message = chat_2.chat_element_by_text('↓ Incoming transaction') + chat_2_request_message.long_press_element() + if chat_2.reply_message_button.is_element_displayed(): + self.errors.append('Reply is available on long-tap on Incoming transaction message!') + chat_1 = home_1.get_chat(device_2_username).click() chat_1_sender_message = chat_1.chat_element_by_text('↑ Outgoing transaction') + chat_1_sender_message.long_press_element() + if chat_1.reply_message_button.is_element_displayed(): + self.errors.append('Reply is available on long-tap on Outgoing transaction message!') send_message = chat_1_sender_message.sign_and_send.click() send_message.next_button.click() send_message.sign_transaction() diff --git a/test/appium/tests/atomic/transactions/test_wallet.py b/test/appium/tests/atomic/transactions/test_wallet.py index 76569d5c202..6f02aac6d19 100644 --- a/test/appium/tests/atomic/transactions/test_wallet.py +++ b/test/appium/tests/atomic/transactions/test_wallet.py @@ -29,6 +29,11 @@ def test_send_eth_from_wallet_to_address(self): send_transaction.confirm() send_transaction.chose_recipient_button.click() send_transaction.enter_recipient_address_button.click() + send_transaction.enter_recipient_address_input.set_value('0xDE709F2102306220921060314715629080E2fB77') + send_transaction.done_button.click() + if not send_transaction.element_by_text_part('Invalid address').is_element_displayed(): + self.errors.append('Invalid EIP55 address is resolved correctly') + send_transaction.ok_button.click() send_transaction.enter_recipient_address_input.set_value(recipient['address']) send_transaction.done_button.click() send_transaction.sign_transaction_button.click() diff --git a/test/appium/views/home_view.py b/test/appium/views/home_view.py index 720e61e0539..ca7ac4454e3 100644 --- a/test/appium/views/home_view.py +++ b/test/appium/views/home_view.py @@ -164,7 +164,7 @@ def __init__(self, driver): class SearchChatInput(BaseEditBox): def __init__(self, driver): super().__init__(driver) - self.locator = self.Locator.xpath_selector('//android.widget.EditText') + self.locator = self.Locator.text_selector('Search') class HomeView(BaseView): diff --git a/test/appium/views/profile_view.py b/test/appium/views/profile_view.py index 6b20752a376..2f4c7a3a555 100644 --- a/test/appium/views/profile_view.py +++ b/test/appium/views/profile_view.py @@ -163,6 +163,13 @@ def __init__(self, driver): self.locator = self.Locator.accessibility_id('share-my-contact-code-button') +class ENSUsernameInShareChatKeyPopup(BaseText): + + def __init__(self, driver): + super(ENSUsernameInShareChatKeyPopup, self).__init__(driver) + self.locator = self.Locator.accessibility_id('ens-username') + + class AdvancedButton(BaseButton): def __init__(self, driver): @@ -345,15 +352,14 @@ class AddBootnodeButton(BaseButton): def __init__(self, driver): super(AddBootnodeButton, self).__init__(driver) - self.locator = self.Locator.xpath_selector("(//*[@content-desc='icon'])[2]") + self.locator = self.Locator.accessibility_id("add-bootnode") class BootnodeAddressInput(BaseEditBox): def __init__(self, driver): super(BootnodeAddressInput, self).__init__(driver) - self.locator = self.Locator.xpath_selector( - "//*[@text='Bootnode address']/following-sibling::*[1]/android.widget.EditText") + self.locator = self.Locator.accessibility_id("bootnode-address") class EnableBootnodesToggle(BaseEditBox): @@ -547,7 +553,6 @@ def __init__(self, driver): "//*[@content-desc='chat-icon']/../android.widget.TextView[2]") - class ProfileView(BaseView): def __init__(self, driver): @@ -615,6 +620,7 @@ def __init__(self, driver): self.bootnodes_button = BootnodesButton(self.driver) self.bootnode_address_input = BootnodeAddressInput(self.driver) self.enable_bootnodes = EnableBootnodesToggle(self.driver) + self.add_bootnode_button = AddBootnodeButton(self.driver) # Mailservers self.mail_server_button = MailServerButton(self.driver) @@ -635,6 +641,7 @@ def __init__(self, driver): # ENS self.username_in_ens_chat_settings_text = ENSUsernameInChatSettings(self.driver) self.ens_usernames_button = ENSusernames(self.driver) + self.ens_name_in_share_chat_key_text = ENSUsernameInShareChatKeyPopup(self.driver) # Mobile Data self.use_mobile_data = UseMobileDataToggle(self.driver) diff --git a/test/appium/views/sign_in_view.py b/test/appium/views/sign_in_view.py index fd14c50a796..545062cf9d7 100644 --- a/test/appium/views/sign_in_view.py +++ b/test/appium/views/sign_in_view.py @@ -260,6 +260,7 @@ def recover_access(self, passphrase: str, password: str = common_password): return self.get_home_view() def sign_in(self, password=common_password, keycard=False): + self.rooted_device_continue() self.multi_account_on_login_button.wait_for_visibility_of_element(5) self.multi_account_on_login_button.click() if keycard: @@ -282,5 +283,4 @@ def get_account_by_position(self, position: int): def open_weblink_and_login(self, url_weblink): self.open_universal_web_link(url_weblink) - self.rooted_device_continue() self.sign_in() diff --git a/translations/es.json b/translations/es.json index cff423ba6c7..7cb06ffc98d 100644 --- a/translations/es.json +++ b/translations/es.json @@ -373,7 +373,7 @@ "ens-release-username": "Liberar nombre de usuario", "ens-remove-hints": "La eliminación separará el nombre de usuario de tu clave.", "ens-remove-username": "Eliminar nombre de usuario", - "ens-saved": "ahora está conectado con tu clave de chat y se puede usar en Status.", + "ens-saved": " ahora está conectado con tu clave de chat y se puede usar en Status.", "ens-saved-title": "Nombre de usuario agregado", "ens-show-username": "Mostrar mi nombre de usuario ENS en los chats", "ens-terms-header": "Términos de registro de nombre", diff --git a/translations/es_419.json b/translations/es_419.json index 3423d6b8031..97502f12820 100644 --- a/translations/es_419.json +++ b/translations/es_419.json @@ -375,7 +375,7 @@ "ens-release-username": "Liberar nombre de usuario", "ens-remove-hints": "La eliminación separará el nombre de usuario de tu clave.", "ens-remove-username": "Eliminar nombre de usuario", - "ens-saved": "ahora está conectado con tu clave de chat y se puede usar en Status.", + "ens-saved": " ahora está conectado con tu clave de chat y se puede usar en Status.", "ens-saved-title": "Nombre de usuario agregado", "ens-show-username": "Mostrar mi nombre de usuario ENS en los chats", "ens-terms-header": "Términos de registro de nombre", diff --git a/translations/fil.json b/translations/fil.json index 7e7e3f9e1db..0447bdf22c3 100644 --- a/translations/fil.json +++ b/translations/fil.json @@ -401,7 +401,7 @@ "ens-release-username": "Bitawan ang username", "ens-remove-hints": "Ang pagtanggal ay tatanggalin ang username mula sa iyong susi.", "ens-remove-username": "Alisin ang username", - "ens-saved": "ay konektado ngayon sa iyong susi sa chat at maaaring magamit sa Katayuan.", + "ens-saved": " ay konektado ngayon sa iyong susi sa chat at maaaring magamit sa Katayuan.", "ens-saved-title": "Idinagdag ang username", "ens-show-username": "Ipakita ang aking pangalan ng ENS sa mga chat", "ens-terms-header": "Mga tuntunin ng pagpaparehistro ng pangalan", diff --git a/translations/fr.json b/translations/fr.json index 8ad79e831e1..9d71041ffee 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -377,7 +377,7 @@ "ens-release-username": "Nom d'utilisateur libre", "ens-remove-hints": "La suppression séparera le nom d'utilisateur de votre clé.", "ens-remove-username": "Supprimer le nom d'utilisateur", - "ens-saved": "est maintenant connecté avec votre code de contact et peut être utilisé sur Status.", + "ens-saved": " est maintenant connecté avec votre code de contact et peut être utilisé sur Status.", "ens-saved-title": "Nom d'utilisateur ajouté", "ens-show-username": "Afficher mon nom d'utilisateur ENS dans les chats", "ens-terms-header": "Conditions d'enregistrement des noms", diff --git a/translations/id.json b/translations/id.json index 5edd30bae25..e234e0d66e4 100644 --- a/translations/id.json +++ b/translations/id.json @@ -368,7 +368,7 @@ "ens-release-username": "Lepaskan nama pengguna", "ens-remove-hints": "Menghapus akan melepaskan nama pengguna dari kunci Anda.", "ens-remove-username": "Hapus nama pengguna", - "ens-saved": "sekarang terhubung dengan kunci obrolan Anda dan dapat digunakan dalam Status.", + "ens-saved": " sekarang terhubung dengan kunci obrolan Anda dan dapat digunakan dalam Status.", "ens-saved-title": "Nama pengguna ditambahkan", "ens-show-username": "Tampilkan nama pengguna ENS saya dalam obrolan", "ens-terms-header": "Ketentuan registrasi nama", diff --git a/translations/it.json b/translations/it.json index b30be629453..adbce044e99 100644 --- a/translations/it.json +++ b/translations/it.json @@ -377,7 +377,7 @@ "ens-release-username": "Rilascia nome utente", "ens-remove-hints": "La rimozione scollegherà il nome utente dalla chiave.", "ens-remove-username": "Rimuovi nome utente", - "ens-saved": "è ora collegato con la chiave di chat e può essere utilizzato in Status.", + "ens-saved": " è ora collegato con la chiave di chat e può essere utilizzato in Status.", "ens-saved-title": "Nome utente aggiunto", "ens-show-username": "Mostra il mio nome utente ENS nelle chat", "ens-terms-header": "Termini di registrazione del nome", diff --git a/translations/zh.json b/translations/zh.json index e5577527518..02175f0a9b7 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -371,7 +371,7 @@ "ens-release-username": "释放用户名", "ens-remove-hints": "删除将从密钥中分离用户名。", "ens-remove-username": "删除用户名", - "ens-saved": "现在已与您的聊天码相关联,可以在Status中使用了。", + "ens-saved": " 现在已与您的聊天码相关联,可以在Status中使用了。", "ens-saved-title": "用户名已添加", "ens-show-username": "在聊天中显示我的ENS用户名", "ens-terms-header": "名称注册条款", diff --git a/translations/zh_Hans_CN.json b/translations/zh_Hans_CN.json index 79f62d1bd66..3e7f6ec8b55 100644 --- a/translations/zh_Hans_CN.json +++ b/translations/zh_Hans_CN.json @@ -334,7 +334,7 @@ "ens-release-username": "释放用户名", "ens-remove-hints": "删除将从密钥中分离用户名。", "ens-remove-username": "删除用户名", - "ens-saved": "现在已与您的密钥相关联,可以在Status中使用了。", + "ens-saved": " 现在已与您的密钥相关联,可以在Status中使用了。", "ens-saved-title": "用户名已添加", "ens-show-username": "在聊天中显示我的ENS用户名", "ens-terms-header": "名称注册条款", diff --git a/translations/zh_TW.json b/translations/zh_TW.json index b5e8db0fa6d..dfc8c57281f 100644 --- a/translations/zh_TW.json +++ b/translations/zh_TW.json @@ -371,7 +371,7 @@ "ens-release-username": "釋出用戶名稱", "ens-remove-hints": "刪除會將用戶名稱從您的金鑰中分離。", "ens-remove-username": "刪除用戶名稱", - "ens-saved": "現在已與您的聊天金鑰連結,可以在\"Status\"中使用。", + "ens-saved": " 現在已與您的聊天金鑰連結,可以在\"Status\"中使用。", "ens-saved-title": "用戶名已新增", "ens-show-username": "在聊天中顯示我的ENS用戶名", "ens-terms-header": "名稱註冊條款", diff --git a/translations/zh_hans.json b/translations/zh_hans.json index 9652e8fddde..1a2b3b83348 100644 --- a/translations/zh_hans.json +++ b/translations/zh_hans.json @@ -312,7 +312,7 @@ "ens-release-username": "释放用户名", "ens-remove-hints": "删除将从密钥中分离用户名。", "ens-remove-username": "删除用户名", - "ens-saved": "现在已与您的密钥相关联,可以在Status中使用了。", + "ens-saved": " 现在已与您的密钥相关联,可以在Status中使用了。", "ens-saved-title": "用户名已添加", "ens-show-username": "在聊天中显示我的ENS用户名", "ens-terms-header": "名称注册条款",