e2e:nightly fixes

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2020-12-09 17:37:47 +01:00
parent e167773258
commit 5259de7423
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
4 changed files with 41 additions and 34 deletions

View File

@ -671,33 +671,37 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
@marks.medium
@marks.flaky
def test_use_pinned_mailserver(self):
sign_in_view = SignInView(self.driver)
home_view = sign_in_view.create_user()
profile_view = home_view.profile_button.click()
home = SignInView(self.driver).create_user()
profile = home.profile_button.click()
profile_view.just_fyi('pin mailserver')
profile_view.sync_settings_button.click()
mailserver_1 = profile_view.return_mailserver_name(mailserver_gc, used_fleet)
mailserver_2 = profile_view.return_mailserver_name(mailserver_ams, used_fleet)
# TODO: temporary to avoid issue 9269 - should be disabled after fix
mailserver = mailserver_1 if profile_view.element_by_text(mailserver_2).is_element_present() else mailserver_2
profile_view.mail_server_button.click()
profile_view.mail_server_auto_selection_button.click()
profile_view.mail_server_by_name(mailserver).click()
profile_view.confirm_button.click()
profile.just_fyi('pin history node')
profile.sync_settings_button.click()
node_gc, node_ams, node_hk = [profile.return_mailserver_name(history_node_name, used_fleet) for history_node_name in (mailserver_gc, mailserver_ams, mailserver_hk)]
h_node = node_ams
profile.mail_server_button.click()
profile.mail_server_auto_selection_button.click()
profile.mail_server_by_name(h_node).click()
profile.confirm_button.click()
if profile.find_element_by_translation_id("mailserver-error-title").is_element_displayed(10):
h_node = node_hk
profile.find_element_by_translation_id("mailserver-pick-another", uppercase=True).click()
profile.mail_server_by_name(h_node).click()
profile.confirm_button.click()
if profile.find_element_by_translation_id("mailserver-error-title").is_element_displayed(10):
self.driver.fail("Couldn't connect to any history node")
profile_view.just_fyi('check that mailserver is pinned')
profile_view.back_button.click()
if not profile_view.element_by_text(mailserver).is_element_displayed():
self.errors.append('"%s" mailserver is not pinned' % mailserver)
profile_view.get_back_to_home_view()
profile.just_fyi('check that history node is pinned')
profile.back_button.click()
if not profile.element_by_text(h_node).is_element_displayed():
self.errors.append('"%s" history node is not pinned' % h_node)
profile.get_back_to_home_view()
profile_view.just_fyi('Relogin and check that settings are preserved')
home_view.relogin()
home_view.profile_button.click()
profile_view.sync_settings_button.click()
if not profile_view.element_by_text(mailserver).is_element_displayed():
self.errors.append('"%s" mailserver is not pinned' % mailserver)
profile.just_fyi('Relogin and check that settings are preserved')
home.relogin()
home.profile_button.click()
profile.sync_settings_button.click()
if not profile.element_by_text(h_node).is_element_displayed():
self.errors.append('"%s" history node is not pinned' % h_node)
self.errors.verify_no_errors()
@ -918,7 +922,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
profile_1.element_by_text(mailserver).click()
profile_1.confirm_button.click()
profile_1.home_button.click()
home_1.get_chat(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):
self.errors.append("Chat history wasn't fetched")

View File

@ -107,12 +107,10 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
@marks.transaction
@marks.medium
def test_keycard_send_funds_between_accounts_in_multiaccount_instance(self):
sign_in_view = SignInView(self.driver)
sign_in_view.create_user(keycard=True)
sign_in_view = SignInView(self.driver).create_user(keycard=True)
wallet_view = sign_in_view.wallet_button.click()
wallet_view.set_up_wallet()
status_account_address = wallet_view.get_wallet_address()[2:]
wallet_view.back_button.click()
self.network_api.get_donate(status_account_address, external_faucet=True)
wallet_view.wait_balance_is_changed()
account_name = 'subaccount'
@ -145,7 +143,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet_view.wait_balance_is_changed()
send_transaction = wallet_view.send_transaction(account_name=wallet_view.status_account_name,
amount=transaction_amount_1,
keycard=True)
keycard=True,
default_gas_price=True)
send_transaction.back_button.click()
sub_account_address = wallet_view.get_wallet_address(account_name)[2:]
self.network_api.wait_for_confirmation_of_transaction(sub_account_address, transaction_amount_1)

View File

@ -133,7 +133,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
wallet_view.accounts_status_account.click()
amount = '0.000%s' % str(random.randint(10000, 99999)) + '1'
amount = '0.000%s' % str(random.randint(100, 999)) + '1'
wallet_view.send_transaction(amount=amount,
recipient='0x%s' % recipient['address'],
asset_name='ADI')
@ -246,7 +246,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet_view = sign_in_view.wallet_button.click()
wallet_view.set_up_wallet()
status_account_address = wallet_view.get_wallet_address()[2:]
wallet_view.back_button.click()
# wallet_view.back_button.click()
self.network_api.get_donate(status_account_address, external_faucet=True)
wallet_view.wait_balance_is_changed()
account_name = 'subaccount'
@ -277,7 +277,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
updated_balance = self.network_api.get_balance(status_account_address)
transaction_amount_1 = round(float(transaction_amount) * 0.1, 12)
send_transaction = wallet_view.send_transaction(account_name=wallet_view.status_account_name,
amount=transaction_amount_1)
amount=transaction_amount_1,
default_gas_price=True)
send_transaction.back_button.click()
sub_account_address = wallet_view.get_wallet_address(account_name)[2:]
self.network_api.wait_for_confirmation_of_transaction(status_account_address, transaction_amount)

View File

@ -485,15 +485,18 @@ class WalletView(BaseView):
self.driver.info('Balance for %s is equal to %s' % (asset, expected_balance))
return
def wait_balance_is_changed(self, asset ='ETH', initial_balance=0, wait_time=300, scan_tokens=False):
def wait_balance_is_changed(self, asset ='ETH', initial_balance=0, wait_time=400, scan_tokens=False):
counter = 0
while True:
if counter >= wait_time:
self.driver.fail('Balance is not changed during %s seconds!' % wait_time)
elif self.asset_by_name(asset).is_element_present() and self.get_asset_amount_by_name(asset) == initial_balance:
if not self.transaction_history_button.is_element_displayed():
self.wallet_account_by_name(self.status_account_name).click()
self.swipe_down()
counter += 10
time.sleep(10)
self.put_app_to_background_and_back()
[self.wallet_button.click() for _ in range(2)]
self.driver.info('Waiting %s seconds for %s to update' % (counter,asset))
elif not self.asset_by_name(asset).is_element_present(10):
counter += 10