fix e2e and align to new 11465

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2020-11-26 18:33:43 +01:00
parent 88889930ae
commit f47c816ce0
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
9 changed files with 28 additions and 12 deletions

View File

@ -356,6 +356,7 @@ class TestCreateAccount(SingleDeviceTestCase):
sign_in.sign_in(position=2, keycard=True)
sign_in.wallet_button.click()
wallet_view.set_up_wallet()
wallet_view.wait_balance_is_changed('ETH')
wallet_view.accounts_status_account.click()
transaction_amount_keycard = wallet_view.get_unique_amount()
wallet_view.send_transaction(amount=transaction_amount_keycard, recipient=recipient, keycard=True, sign_transaction=True)

View File

@ -109,6 +109,7 @@ class TestWalletManagement(SingleDeviceTestCase):
@marks.testrail_id(5358)
@marks.medium
@marks.transaction
def test_backup_recovery_phrase_warning_from_wallet(self):
sign_in = SignInView(self.driver)
sign_in.create_user()
@ -274,8 +275,7 @@ class TestWalletManagement(SingleDeviceTestCase):
@marks.testrail_id(6244)
@marks.high
def test_add_and_delete_watch_only_account_to_multiaccount_instance(self):
sign_in_view = SignInView(self.driver)
sign_in_view.create_user()
sign_in_view = SignInView(self.driver).create_user()
wallet_view = sign_in_view.wallet_button.click()
wallet_view.set_up_wallet()
@ -314,6 +314,10 @@ class TestWalletManagement(SingleDeviceTestCase):
wallet_view.yes_button.click()
if account_button.is_element_displayed():
self.driver.fail('Account was not deleted')
# forcing app to update balance
wallet_view.put_app_to_background_and_back()
for asset in ('ETH', 'ADI', 'STT'):
wallet_view.wait_balance_is_equal_expected_amount(asset, 0)

View File

@ -594,11 +594,8 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
additional_text = 'and more'
chat_1.send_as_keyevent(additional_text)
chat_1.send_message_button.click()
chat_1.chat_element_by_text('%s %s' % (nickname, additional_text)).click()
for element in (chat_1.element_by_text(username_2), chat_1.remove_from_contacts):
if not element.is_element_displayed():
self.errors.append('Was not redirected to user profile after tapping on mention by nickname!')
chat_1.get_back_to_home_view()
if not chat_1.chat_element_by_text('%s %s' % (nickname, additional_text)).is_element_displayed():
self.errors.append("Nickname is not resolved on send message")
device_1.just_fyi('check contact list in Profile after setting nickname')
profile_1 = chat_1.profile_button.click()

View File

@ -104,6 +104,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
self.errors.verify_no_errors()
@marks.testrail_id(6292)
@marks.transaction
@marks.medium
def test_keycard_send_funds_between_accounts_in_multiaccount_instance(self):
sign_in_view = SignInView(self.driver)

View File

@ -238,6 +238,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
self.driver.fail("Connection status text '%s' doesn't match expected 'Offline'" % connection_text)
@marks.testrail_id(6225)
@marks.transaction
@marks.medium
def test_send_funds_between_accounts_in_multiaccount_instance(self):
sign_in_view = SignInView(self.driver)
@ -462,6 +463,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet_view.asset_by_name(symbol).scroll_to_element()
if not wallet_view.asset_by_name(symbol).is_element_displayed():
self.errors.append('Custom token is not shown on Wallet view')
wallet_view.accounts_status_account.scroll_to_element(direction='up')
wallet_view.accounts_status_account.click()
recipient = "0x" + basic_user['address']
amount = '0.0%s' % str(random.randint(10000, 99999)) + '1'

View File

@ -515,6 +515,11 @@ class BaseView(object):
for _ in range(times):
self.driver.press_keycode(4)
def put_app_to_background_and_back(self, time_in_background=1):
self.driver.press_keycode(187)
time.sleep(time_in_background)
self.status_in_background_button.click()
def click_system_home_button(self):
self.driver.info('Press system Home button')
self.driver.press_keycode(3)
@ -706,7 +711,7 @@ class BaseView(object):
profile_view.share_my_profile_button.click()
profile_view.public_key_text.wait_for_visibility_of_element()
public_key = profile_view.public_key_text.text
self.close_share_popup()
self.click_system_back_button()
user_data = (public_key, default_username) if return_username else public_key
return user_data

View File

@ -425,6 +425,11 @@ class ChatElementByText(BaseElement):
except NoSuchElementException:
ChatView(self.driver).reconnect()
def click_on_text(self):
self.locator = self.Locator.xpath_selector(self.message_locator +
"/ancestor::android.view.ViewGroup[@content-desc='chat-item']/android.view.ViewGroup")
self.click()
@property
@ -611,7 +616,7 @@ class StikerMessageItem(BaseElement):
class ImageChatItem(BaseElement):
def __init__(self, driver):
super().__init__(driver)
self.locator = self.Locator.xpath_selector('//*[@content-desc="chat-item"]//android.widget.ImageView')
self.locator = self.Locator.accessibility_id('message-image')
class HistoryTimeMarker(BaseText):

View File

@ -375,7 +375,7 @@ class SendTransactionView(BaseView):
self.chose_recipient_button.click()
self.enter_recipient_address_input.set_value(address)
self.enter_recipient_address_input.click()
self.done_button.click()
self.done_button.click_until_absense_of_element(self.done_button)
def sign_transaction(self, sender_password: str = common_password, keycard=False, default_gas_price=True):
if not default_gas_price:

View File

@ -493,7 +493,8 @@ class WalletView(BaseView):
elif self.asset_by_name(asset).is_element_present() and self.get_asset_amount_by_name(asset) == initial_balance:
counter += 10
time.sleep(10)
self.swipe_down()
# temp until Refresh button will be included in pull-to refresh
self.put_app_to_background_and_back()
self.driver.info('Waiting %s seconds for %s to update' % (counter,asset))
elif not self.asset_by_name(asset).is_element_present(10):
# temp until Refresh button will be included in pull-to refresh
@ -585,7 +586,7 @@ class WalletView(BaseView):
else:
send_transaction_view.set_recipient_address(kwargs.get('recipient'))
if kwargs.get('sign_transaction', True):
send_transaction_view.sign_transaction_button.click()
send_transaction_view.sign_transaction_button.click_until_presence_of_element(send_transaction_view.network_fee_button)
send_transaction_view.sign_transaction(keycard=kwargs.get('keycard', False),
default_gas_price=kwargs.get('default_gas_price', False),
sender_password=kwargs.get('sender_password', common_password))