mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-13 02:04:28 +00:00
Fix scroll and key to locate eth
Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
parent
cd04acde3a
commit
f5675b640d
@ -5,6 +5,7 @@ from tests import marks, camera_access_error_text, common_password
|
|||||||
from tests.base_test_case import SingleDeviceTestCase
|
from tests.base_test_case import SingleDeviceTestCase
|
||||||
from tests.users import wallet_users, transaction_senders, basic_user, ens_user
|
from tests.users import wallet_users, transaction_senders, basic_user, ens_user
|
||||||
from views.sign_in_view import SignInView
|
from views.sign_in_view import SignInView
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
@marks.all
|
@marks.all
|
||||||
@ -478,6 +479,8 @@ class TestWalletManagement(SingleDeviceTestCase):
|
|||||||
wallet.manage_assets_button.click()
|
wallet.manage_assets_button.click()
|
||||||
for keyword in search_list_assets:
|
for keyword in search_list_assets:
|
||||||
home.search_by_keyword(keyword)
|
home.search_by_keyword(keyword)
|
||||||
|
# TODO: remove time sleep after 10957 is closed
|
||||||
|
time.sleep(5)
|
||||||
if keyword == 'ad':
|
if keyword == 'ad':
|
||||||
search_elements = wallet.all_assets_full_names.find_elements()
|
search_elements = wallet.all_assets_full_names.find_elements()
|
||||||
else:
|
else:
|
||||||
|
@ -93,7 +93,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
|
|||||||
send_transaction_view.sign_with_keycard_button.click()
|
send_transaction_view.sign_with_keycard_button.click()
|
||||||
keycard_view = send_transaction_view.sign_with_keycard_button.click()
|
keycard_view = send_transaction_view.sign_with_keycard_button.click()
|
||||||
keycard_view.enter_default_pin()
|
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')
|
self.driver.fail('Typed message was not signed')
|
||||||
|
|
||||||
@marks.testrail_id(6287)
|
@marks.testrail_id(6287)
|
||||||
|
@ -145,7 +145,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
|
|||||||
wallet_view.get_account_by_name(account_name).click()
|
wallet_view.get_account_by_name(account_name).click()
|
||||||
wallet_view.send_transaction_button.click()
|
wallet_view.send_transaction_button.click()
|
||||||
wallet_view.back_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)
|
expected_balance = self.network_api.get_rounded_balance(balance_after_receiving_tx, transaction_amount)
|
||||||
if balance_after_receiving_tx != expected_balance:
|
if balance_after_receiving_tx != expected_balance:
|
||||||
self.driver.fail('New account balance %s does not match expected %s after receiving a transaction' % (
|
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()
|
send_transaction.back_button.click()
|
||||||
balance_of_sub_account = float(self.network_api.get_balance(sub_account_address)) / 1000000000000000000
|
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
|
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,
|
expected_balance = self.network_api.get_rounded_balance(total_eth_from_two_accounts,
|
||||||
(balance_of_status_account + balance_of_sub_account))
|
(balance_of_status_account + balance_of_sub_account))
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ class BaseElement(object):
|
|||||||
if direction == 'down':
|
if direction == 'down':
|
||||||
self.driver.swipe(500, size["height"]*0.4, 500, size["height"]*0.05)
|
self.driver.swipe(500, size["height"]*0.4, 500, size["height"]*0.05)
|
||||||
else:
|
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:
|
else:
|
||||||
raise NoSuchElementException(
|
raise NoSuchElementException(
|
||||||
"Device %s: '%s' is not found on the screen" % (self.driver.number, self.name)) from None
|
"Device %s: '%s' is not found on the screen" % (self.driver.number, self.name)) from None
|
||||||
|
@ -453,7 +453,7 @@ class WalletView(BaseView):
|
|||||||
|
|
||||||
def verify_currency_balance(self, expected_rate: int, errors: list):
|
def verify_currency_balance(self, expected_rate: int, errors: list):
|
||||||
usd = self.get_usd_total_value()
|
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)
|
expected_usd = round(eth * expected_rate, 2)
|
||||||
percentage_diff = abs((usd - expected_usd) / ((usd + expected_usd) / 2)) * 100
|
percentage_diff = abs((usd - expected_usd) / ((usd + expected_usd) / 2)) * 100
|
||||||
if percentage_diff > 2:
|
if percentage_diff > 2:
|
||||||
@ -461,7 +461,7 @@ class WalletView(BaseView):
|
|||||||
else:
|
else:
|
||||||
self.driver.info('Current USD balance %s is ok' % usd)
|
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
|
counter = 0
|
||||||
while True:
|
while True:
|
||||||
if counter >= wait_time:
|
if counter >= wait_time:
|
||||||
@ -565,7 +565,7 @@ class WalletView(BaseView):
|
|||||||
self.receive_transaction_button.click()
|
self.receive_transaction_button.click()
|
||||||
send_transaction_view = self.send_transaction_request.click()
|
send_transaction_view = self.send_transaction_request.click()
|
||||||
send_transaction_view.select_asset_button.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)
|
asset_button = send_transaction_view.asset_by_name(asset_name)
|
||||||
send_transaction_view.select_asset_button.click_until_presence_of_element(asset_button)
|
send_transaction_view.select_asset_button.click_until_presence_of_element(asset_button)
|
||||||
asset_button.click()
|
asset_button.click()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user