Fix scroll and key to locate eth

Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
Serhy 2020-07-14 19:32:47 +03:00
parent cd04acde3a
commit f5675b640d
No known key found for this signature in database
GPG Key ID: 5D7C4B9E2B6F500B
5 changed files with 10 additions and 7 deletions

View File

@ -5,6 +5,7 @@ from tests import marks, camera_access_error_text, common_password
from tests.base_test_case import SingleDeviceTestCase
from tests.users import wallet_users, transaction_senders, basic_user, ens_user
from views.sign_in_view import SignInView
import time
@marks.all
@ -478,6 +479,8 @@ class TestWalletManagement(SingleDeviceTestCase):
wallet.manage_assets_button.click()
for keyword in search_list_assets:
home.search_by_keyword(keyword)
# TODO: remove time sleep after 10957 is closed
time.sleep(5)
if keyword == 'ad':
search_elements = wallet.all_assets_full_names.find_elements()
else:

View File

@ -93,7 +93,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
send_transaction_view.sign_with_keycard_button.click()
keycard_view = send_transaction_view.sign_with_keycard_button.click()
keycard_view.enter_default_pin()
if not keycard_view.element_by_text('0x123').is_element_displayed():
if not keycard_view.element_by_text_part('0xde3048417').is_element_displayed():
self.driver.fail('Typed message was not signed')
@marks.testrail_id(6287)

View File

@ -145,7 +145,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet_view.get_account_by_name(account_name).click()
wallet_view.send_transaction_button.click()
wallet_view.back_button.click()
balance_after_receiving_tx = float(wallet_view.get_asset_amount_by_name('ETHro'))
balance_after_receiving_tx = float(wallet_view.get_asset_amount_by_name('ETH'))
expected_balance = self.network_api.get_rounded_balance(balance_after_receiving_tx, transaction_amount)
if balance_after_receiving_tx != expected_balance:
self.driver.fail('New account balance %s does not match expected %s after receiving a transaction' % (
@ -179,7 +179,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
send_transaction.back_button.click()
balance_of_sub_account = float(self.network_api.get_balance(sub_account_address)) / 1000000000000000000
balance_of_status_account = float(self.network_api.get_balance(status_account_address)) / 1000000000000000000
total_eth_from_two_accounts = float(wallet_view.get_asset_amount_by_name('ETHro'))
total_eth_from_two_accounts = float(wallet_view.get_asset_amount_by_name('ETH'))
expected_balance = self.network_api.get_rounded_balance(total_eth_from_two_accounts,
(balance_of_status_account + balance_of_sub_account))

View File

@ -120,7 +120,7 @@ class BaseElement(object):
if direction == 'down':
self.driver.swipe(500, size["height"]*0.4, 500, size["height"]*0.05)
else:
self.driver.swipe(500, size["height"]*0.1, 500, size["height"]*0.8)
self.driver.swipe(500, size["height"]*0.25, 500, size["height"]*0.8)
else:
raise NoSuchElementException(
"Device %s: '%s' is not found on the screen" % (self.driver.number, self.name)) from None

View File

@ -453,7 +453,7 @@ class WalletView(BaseView):
def verify_currency_balance(self, expected_rate: int, errors: list):
usd = self.get_usd_total_value()
eth = self.get_asset_amount_by_name('ETHro')
eth = self.get_asset_amount_by_name('ETH')
expected_usd = round(eth * expected_rate, 2)
percentage_diff = abs((usd - expected_usd) / ((usd + expected_usd) / 2)) * 100
if percentage_diff > 2:
@ -461,7 +461,7 @@ class WalletView(BaseView):
else:
self.driver.info('Current USD balance %s is ok' % usd)
def wait_balance_is_equal_expected_amount(self, asset ='ETHro', expected_balance=0.1, wait_time=300):
def wait_balance_is_equal_expected_amount(self, asset ='ETH', expected_balance=0.1, wait_time=300):
counter = 0
while True:
if counter >= wait_time:
@ -565,7 +565,7 @@ class WalletView(BaseView):
self.receive_transaction_button.click()
send_transaction_view = self.send_transaction_request.click()
send_transaction_view.select_asset_button.click()
asset_name = kwargs.get('asset_name', 'ETHro').upper()
asset_name = kwargs.get('asset_name', 'ETH').upper()
asset_button = send_transaction_view.asset_by_name(asset_name)
send_transaction_view.select_asset_button.click_until_presence_of_element(asset_button)
asset_button.click()