Skip to content

Commit

Permalink
bootnode e2e + translations + new checks in e2e
Browse files Browse the repository at this point in the history
Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
  • Loading branch information
churik committed Apr 23, 2020
1 parent 2a46416 commit 57f1303
Show file tree
Hide file tree
Showing 18 changed files with 78 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/status_im/ui/screens/bootnodes_settings/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 25 additions & 10 deletions test/appium/tests/atomic/account_management/test_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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])
Expand All @@ -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)
Expand All @@ -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
Expand Down
7 changes: 7 additions & 0 deletions test/appium/tests/atomic/chats/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 5 additions & 0 deletions test/appium/tests/atomic/transactions/test_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion test/appium/views/home_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
15 changes: 11 additions & 4 deletions test/appium/views/profile_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -547,7 +553,6 @@ def __init__(self, driver):
"//*[@content-desc='chat-icon']/../android.widget.TextView[2]")



class ProfileView(BaseView):

def __init__(self, driver):
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/appium/views/sign_in_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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()
2 changes: 1 addition & 1 deletion translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion translations/es_419.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion translations/fil.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion translations/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion translations/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion translations/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "名称注册条款",
Expand Down
2 changes: 1 addition & 1 deletion translations/zh_Hans_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "名称注册条款",
Expand Down
2 changes: 1 addition & 1 deletion translations/zh_TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "名稱註冊條款",
Expand Down
2 changes: 1 addition & 1 deletion translations/zh_hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "名称注册条款",
Expand Down

0 comments on commit 57f1303

Please sign in to comment.