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.critical
def test_switch_users_and_add_new_account(self):
sign_in = SignInView(self.driver).create_user()
public_key = sign_in.get_public_key_and_username()
profile = sign_in.get_profile_view()
sign_in = SignInView(self.driver)
home = sign_in.create_user()
public_key = home.get_public_key_and_username()
profile = home.get_profile_view()
profile.logout()
if sign_in.ok_button.is_element_displayed():
sign_in.ok_button.click()

View File

@ -881,7 +881,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
profile_1.confirm_button.click()
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.home_button.click()
@ -902,16 +902,16 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
profile_1.just_fyi('check that can RETRY to connect')
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')
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)
profile_1.element_by_text(mailserver).click()
profile_1.confirm_button.click()
profile_1.home_button.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.verify_no_errors()

View File

@ -569,7 +569,7 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
chat_1.profile_send_message,
chat_1.profile_nickname]:
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':
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):
@marks.testrail_id(6295)
@marks.high
@marks.medium
def test_keycard_send_eth_to_ens(self):
sign_in = SignInView(self.driver)
sender = transaction_senders['E']

View File

@ -243,6 +243,8 @@ class TestBrowsing(SingleDeviceTestCase):
@marks.critical
def test_refresh_button_browsing_app_webview(self):
home = SignInView(self.driver).create_user()
profile = home.profile_button.click()
profile.switch_network()
daap = home.dapp_tab_button.click()
url = 'app.uniswap.org'
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')
initial_amount_STT = wallet_view.get_asset_amount_by_name('STT')
sign_in_view.toggle_airplane_mode()
wallet_view.wait_balance_is_changed('STT', initial_amount_STT)
wallet_view.accounts_status_account.click()

View File

@ -31,7 +31,6 @@ class BaseElement(object):
self.__dict__.update(kwargs)
self.set_locator()
def set_locator(self):
if self.xpath:
self.locator = self.xpath
@ -49,7 +48,7 @@ class BaseElement(object):
self.by = MobileBy.ID
self.locator = self.id
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:
self.locator = self.prefix + self.locator
return self
@ -266,7 +265,6 @@ class EditBox(BaseElement):
class Text(BaseElement):
def __init__(self, driver, **kwargs):
super(Text, self).__init__(driver, **kwargs)
self.set_locator()
@property
def text(self):
@ -288,6 +286,7 @@ class Text(BaseElement):
self.driver.info('*Element %s text is equal to %s*' % (self.name, text))
return
class Button(BaseElement):
def __init__(self, driver, **kwargs):

View File

@ -8,7 +8,7 @@ from tests import emojis
from time import sleep
from views.base_element import Button, EditBox, Text, BaseElement, SilentButton
from views.base_view import BaseView, ProgressBar
from views.profile_view import ProfileView
from views.profile_view import ProfilePictureElement
class SendCommand(Button):
@ -390,7 +390,7 @@ class ChatView(BaseView):
self.remove_group_invite_button = Button(self.driver, accessibility_id="remove-group-button")
# 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_block_contact = ProfileBlockContactButton(self.driver)
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)
class ProfilePictureElement(Button):
def __init__(self, driver):
super().__init__(driver, accessibility_id="chat-icon")
class ProfileView(BaseView):
@ -162,7 +166,7 @@ class ProfileView(BaseView):
self.public_key_text = Text(self.driver, accessibility_id="chat-key")
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.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.confirm_edit_button = Button(self.driver, accessibility_id="done-button")
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):
def __init__(self, driver):
super().__init__(driver, xpath="//*[@text='%s']")
super().__init__(driver, xpath="//*[@text='Status API']")
def click(self):
self.wait_for_visibility_of_element().click()
@ -112,7 +112,7 @@ class StatusTestDAppView(BaseWebView):
self.sign_typed_message_button = TransactionsButton.SignTypedMessageButton(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):
self.driver.info("**Wait %ss for assets in simpledapp**" % wait_time)