Fix e2e fails in develop

Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
Serhy 2021-01-27 12:19:03 +02:00
parent eba6b63258
commit ff961bbfe8
No known key found for this signature in database
GPG Key ID: 5D7C4B9E2B6F500B
10 changed files with 24 additions and 17 deletions

View File

@ -11,9 +11,10 @@ class TestCreateAccount(SingleDeviceTestCase):
@marks.testrail_id(5356) @marks.testrail_id(5356)
@marks.critical @marks.critical
def test_switch_users_and_add_new_account(self): def test_switch_users_and_add_new_account(self):
sign_in = SignInView(self.driver).create_user() sign_in = SignInView(self.driver)
public_key = sign_in.get_public_key_and_username() home = sign_in.create_user()
profile = sign_in.get_profile_view() public_key = home.get_public_key_and_username()
profile = home.get_profile_view()
profile.logout() profile.logout()
if sign_in.ok_button.is_element_displayed(): if sign_in.ok_button.is_element_displayed():
sign_in.ok_button.click() sign_in.ok_button.click()

View File

@ -881,7 +881,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
profile_1.confirm_button.click() profile_1.confirm_button.click()
profile_1.just_fyi('check that popup "Error connecting" will not reappear if tap on "Cancel"') profile_1.just_fyi('check that popup "Error connecting" will not reappear if tap on "Cancel"')
profile_1.element_by_translation_id('mailserver-error-title').wait_for_element(30) profile_1.element_by_translation_id(id='mailserver-error-title').wait_for_element(60)
profile_1.cancel_button.click() profile_1.cancel_button.click()
profile_1.home_button.click() profile_1.home_button.click()
@ -902,16 +902,16 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
profile_1.just_fyi('check that can RETRY to connect') profile_1.just_fyi('check that can RETRY to connect')
for _ in range(2): for _ in range(2):
public_chat_1.element_by_translation_id('mailserver-retry', 'button', uppercase=True).wait_and_click() public_chat_1.element_by_translation_id('mailserver-retry', 'button', uppercase=True).wait_and_click(60)
profile_1.just_fyi('check that can pick another mailserver and receive messages') profile_1.just_fyi('check that can pick another mailserver and receive messages')
public_chat_1.element_by_translation_id('mailserver-pick-another', 'button', uppercase=True).wait_and_click() public_chat_1.element_by_translation_id('mailserver-pick-another', 'button', uppercase=True).wait_and_click(60)
mailserver = profile_1.return_mailserver_name(mailserver_ams, used_fleet) mailserver = profile_1.return_mailserver_name(mailserver_ams, used_fleet)
profile_1.element_by_text(mailserver).click() profile_1.element_by_text(mailserver).click()
profile_1.confirm_button.click() profile_1.confirm_button.click()
profile_1.home_button.click() profile_1.home_button.click()
home_1.get_chat('#%s' % public_chat_name).click() home_1.get_chat('#%s' % public_chat_name).click()
if not public_chat_1.chat_element_by_text(message).is_element_displayed(30): if not public_chat_1.chat_element_by_text(message).is_element_displayed(60):
self.errors.append("Chat history wasn't fetched") self.errors.append("Chat history wasn't fetched")
self.errors.verify_no_errors() self.errors.verify_no_errors()

View File

@ -569,7 +569,7 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
chat_1.profile_send_message, chat_1.profile_send_message,
chat_1.profile_nickname]: chat_1.profile_nickname]:
if not element.scroll_to_element(): if not element.scroll_to_element():
self.errors.append('%s is not visible' % element.name) self.errors.append('%s (locator is %s ) is not visible' % (element.name, element.locator))
if chat_1.profile_nickname.text != 'None': if chat_1.profile_nickname.text != 'None':
self.errors.append('Default nickname is %s instead on "None"' % chat_1.profile_nickname.text) self.errors.append('Default nickname is %s instead on "None"' % chat_1.profile_nickname.text)

View File

@ -158,7 +158,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
class TestCommandsSingleDevices(SingleDeviceTestCase): class TestCommandsSingleDevices(SingleDeviceTestCase):
@marks.testrail_id(6295) @marks.testrail_id(6295)
@marks.high @marks.medium
def test_keycard_send_eth_to_ens(self): def test_keycard_send_eth_to_ens(self):
sign_in = SignInView(self.driver) sign_in = SignInView(self.driver)
sender = transaction_senders['E'] sender = transaction_senders['E']

View File

@ -243,6 +243,8 @@ class TestBrowsing(SingleDeviceTestCase):
@marks.critical @marks.critical
def test_refresh_button_browsing_app_webview(self): def test_refresh_button_browsing_app_webview(self):
home = SignInView(self.driver).create_user() home = SignInView(self.driver).create_user()
profile = home.profile_button.click()
profile.switch_network()
daap = home.dapp_tab_button.click() daap = home.dapp_tab_button.click()
url = 'app.uniswap.org' url = 'app.uniswap.org'
element_on_start_page = daap.element_by_text('ETH') element_on_start_page = daap.element_by_text('ETH')

View File

@ -65,6 +65,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
sign_in_view.just_fyi('Change that balance is updated and transaction is appeared in history') sign_in_view.just_fyi('Change that balance is updated and transaction is appeared in history')
initial_amount_STT = wallet_view.get_asset_amount_by_name('STT') initial_amount_STT = wallet_view.get_asset_amount_by_name('STT')
sign_in_view.toggle_airplane_mode() sign_in_view.toggle_airplane_mode()
wallet_view.wait_balance_is_changed('STT', initial_amount_STT) wallet_view.wait_balance_is_changed('STT', initial_amount_STT)
wallet_view.accounts_status_account.click() wallet_view.accounts_status_account.click()

View File

@ -31,7 +31,6 @@ class BaseElement(object):
self.__dict__.update(kwargs) self.__dict__.update(kwargs)
self.set_locator() self.set_locator()
def set_locator(self): def set_locator(self):
if self.xpath: if self.xpath:
self.locator = self.xpath self.locator = self.xpath
@ -49,7 +48,7 @@ class BaseElement(object):
self.by = MobileBy.ID self.by = MobileBy.ID
self.locator = self.id self.locator = self.id
elif self.webview: elif self.webview:
self.locator = '//*[@text="{0}"] | //*[@content-desc="{desc}"]'.format(self.webview, desc=self.webview) self.locator = '//*[@text="{0}"] | //*[@content-desc="{desc}"]'.format(self.webview, desc=self.webview)
if self.prefix: if self.prefix:
self.locator = self.prefix + self.locator self.locator = self.prefix + self.locator
return self return self
@ -266,7 +265,6 @@ class EditBox(BaseElement):
class Text(BaseElement): class Text(BaseElement):
def __init__(self, driver, **kwargs): def __init__(self, driver, **kwargs):
super(Text, self).__init__(driver, **kwargs) super(Text, self).__init__(driver, **kwargs)
self.set_locator()
@property @property
def text(self): def text(self):
@ -288,6 +286,7 @@ class Text(BaseElement):
self.driver.info('*Element %s text is equal to %s*' % (self.name, text)) self.driver.info('*Element %s text is equal to %s*' % (self.name, text))
return return
class Button(BaseElement): class Button(BaseElement):
def __init__(self, driver, **kwargs): def __init__(self, driver, **kwargs):

View File

@ -8,7 +8,7 @@ from tests import emojis
from time import sleep from time import sleep
from views.base_element import Button, EditBox, Text, BaseElement, SilentButton from views.base_element import Button, EditBox, Text, BaseElement, SilentButton
from views.base_view import BaseView, ProgressBar from views.base_view import BaseView, ProgressBar
from views.profile_view import ProfileView from views.profile_view import ProfilePictureElement
class SendCommand(Button): class SendCommand(Button):
@ -390,7 +390,7 @@ class ChatView(BaseView):
self.remove_group_invite_button = Button(self.driver, accessibility_id="remove-group-button") self.remove_group_invite_button = Button(self.driver, accessibility_id="remove-group-button")
# Contact's profile # Contact's profile
self.contact_profile_picture = ProfileView(self.driver).profile_picture self.contact_profile_picture = ProfilePictureElement(self.driver)
self.profile_send_message = ProfileSendMessageButton(self.driver) self.profile_send_message = ProfileSendMessageButton(self.driver)
self.profile_block_contact = ProfileBlockContactButton(self.driver) self.profile_block_contact = ProfileBlockContactButton(self.driver)
self.confirm_block_contact_button = Button(self.driver, accessibility_id="block-contact-confirm") self.confirm_block_contact_button = Button(self.driver, accessibility_id="block-contact-confirm")

View File

@ -151,6 +151,10 @@ class PrivacyPolicyButton(Button):
return BaseWebView(self.driver) return BaseWebView(self.driver)
class ProfilePictureElement(Button):
def __init__(self, driver):
super().__init__(driver, accessibility_id="chat-icon")
class ProfileView(BaseView): class ProfileView(BaseView):
@ -162,7 +166,7 @@ class ProfileView(BaseView):
self.public_key_text = Text(self.driver, accessibility_id="chat-key") self.public_key_text = Text(self.driver, accessibility_id="chat-key")
self.default_username_text = Text(self.driver, accessibility_id="default-username") self.default_username_text = Text(self.driver, accessibility_id="default-username")
self.share_my_profile_button = Button(self.driver, accessibility_id="share-header-button") self.share_my_profile_button = Button(self.driver, accessibility_id="share-header-button")
self.profile_picture = Button(self.driver, accesibility_id="chat-icon") self.profile_picture = ProfilePictureElement(self.driver)
self.edit_picture_button = Button(self.driver, accessibility_id="edit-profile-photo-button") self.edit_picture_button = Button(self.driver, accessibility_id="edit-profile-photo-button")
self.confirm_edit_button = Button(self.driver, accessibility_id="done-button") self.confirm_edit_button = Button(self.driver, accessibility_id="done-button")
self.select_from_gallery_button = Button(self.driver, translation_id="profile-pic-pick") self.select_from_gallery_button = Button(self.driver, translation_id="profile-pic-pick")

View File

@ -77,7 +77,7 @@ class TransactionsButton(Button):
class StatusAPIButton(Button): class StatusAPIButton(Button):
def __init__(self, driver): def __init__(self, driver):
super().__init__(driver, xpath="//*[@text='%s']") super().__init__(driver, xpath="//*[@text='Status API']")
def click(self): def click(self):
self.wait_for_visibility_of_element().click() self.wait_for_visibility_of_element().click()
@ -112,7 +112,7 @@ class StatusTestDAppView(BaseWebView):
self.sign_typed_message_button = TransactionsButton.SignTypedMessageButton(self.driver) self.sign_typed_message_button = TransactionsButton.SignTypedMessageButton(self.driver)
self.status_api_button = StatusAPIButton(self.driver) self.status_api_button = StatusAPIButton(self.driver)
self.request_contact_code_button = Button(self.driver, xpath="//*[contains(text(),'Request contact code']") self.request_contact_code_button = Button(self.driver, xpath="//*[@text='Request contact code (public key)']")
def wait_for_d_aap_to_load(self, wait_time=10): def wait_for_d_aap_to_load(self, wait_time=10):
self.driver.info("**Wait %ss for assets in simpledapp**" % wait_time) self.driver.info("**Wait %ss for assets in simpledapp**" % wait_time)