bootnode e2e + translations + new checks in e2e

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2020-04-23 17:42:20 +02:00
parent 2a4641684f
commit 57f1303c5f
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
18 changed files with 78 additions and 41 deletions

View File

@ -49,6 +49,7 @@
[text-input/text-input-with-label
{: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
@ -61,6 +62,7 @@
{: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 %])}

View File

@ -25,6 +25,7 @@
[react/view {:flex 1}
[topbar/topbar {:title :t/bootnodes-settings
: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

View File

@ -224,6 +224,11 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
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 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
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 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
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

View File

@ -35,8 +35,15 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
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()

View File

@ -29,6 +29,11 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
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()

View File

@ -164,7 +164,7 @@ class ChatUrlText(BaseText):
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):

View File

@ -163,6 +163,13 @@ class ShareButton(BaseButton):
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 @@ class ENSUsernameInChatSettings(BaseElement):
"//*[@content-desc='chat-icon']/../android.widget.TextView[2]")
class ProfileView(BaseView):
def __init__(self, driver):
@ -615,6 +620,7 @@ class ProfileView(BaseView):
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 @@ class ProfileView(BaseView):
# 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)

View File

@ -260,6 +260,7 @@ class SignInView(BaseView):
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 @@ class SignInView(BaseView):
def open_weblink_and_login(self, url_weblink):
self.open_universal_web_link(url_weblink)
self.rooted_device_continue()
self.sign_in()