diff --git a/test/appium/support/api/network_api.py b/test/appium/support/api/network_api.py index f9bee8fda7..26d8ac479a 100644 --- a/test/appium/support/api/network_api.py +++ b/test/appium/support/api/network_api.py @@ -12,8 +12,9 @@ import support.api.web3_api as w3 class NetworkApi(object): + def __init__(self): - self.network_url = 'http://api-%s.etherscan.io/api?' % tests.pytest_config_global['network'] + self.network_url = 'http://api-ropsten.etherscan.io/api?' self.faucet_url = 'https://faucet-ropsten.status.im/donate' self.faucet_backup_address = w3.account_address self.headers = { @@ -179,13 +180,8 @@ class NetworkApi(object): return rounded_balance def get_custom_fee_tx_params(self, hash: str): - price_limit = int(w3.get_tx_param_by_hash(hash, 'maxFeePerGas'),16)/1000000000 - tip_limit = int(w3.get_tx_param_by_hash(hash, 'maxPriorityFeePerGas'),16)/1000000000 - gas_limit = w3.get_tx_param_by_hash(hash, 'gas') return { - 'fee_cap' : str(price_limit), - 'tip_cap': str(tip_limit), - 'gas_limit' : str(gas_limit) + 'fee_cap': str(w3.get_tx_param_by_hash(hash, 'maxFeePerGas')/1000000000), + 'tip_cap': str(w3.get_tx_param_by_hash(hash, 'maxPriorityFeePerGas')/1000000000), + 'gas_limit': str(w3.get_tx_param_by_hash(hash, 'gas')) } - - diff --git a/test/appium/tests/atomic/account_management/test_wallet_management.py b/test/appium/tests/atomic/account_management/test_wallet_management.py index 4ffd3f4c43..e2f1c758f9 100644 --- a/test/appium/tests/atomic/account_management/test_wallet_management.py +++ b/test/appium/tests/atomic/account_management/test_wallet_management.py @@ -91,6 +91,8 @@ class TestWalletManagement(SingleDeviceTestCase): @marks.testrail_id(5346) @marks.flaky @marks.high + @marks.skip + # TODO: skipped due to 13016 def test_collectible_from_wallet(self): passphrase = wallet_users['F']['passphrase'] home = SignInView(self.driver).recover_access(passphrase=passphrase) @@ -115,7 +117,7 @@ class TestWalletManagement(SingleDeviceTestCase): self.errors.append( 'Wrong number is shown on CK assets: %s' % wallet.get_collectibles_amount().text) wallet.get_collectibles_amount().click() - if not wallet.nft_asset_button.is_element_displayed(): + if not wallet.nft_asset_button.is_element_displayed(60): self.driver.fail("Kitty is not shown after opening it from collectibles!") wallet.nft_asset_button.click() wallet.set_collectible_as_profile_photo_button.scroll_and_click() diff --git a/test/appium/tests/atomic/chats/test_public.py b/test/appium/tests/atomic/chats/test_public.py index e661f3b4f5..f370f5a392 100644 --- a/test/appium/tests/atomic/chats/test_public.py +++ b/test/appium/tests/atomic/chats/test_public.py @@ -279,7 +279,7 @@ class TestPublicChatSingleDevice(SingleDeviceTestCase): quiet_time_yesterday, quiet_time_before_yesterday = '24 hours', '2 days' fetch_more = signin.get_translation_by_key("load-more-messages") for message in (yesterday, quiet_time_yesterday): - if not chat.element_by_text_part(message).is_element_displayed(): + if not chat.element_by_text_part(message).is_element_displayed(120): self.driver.fail('"%s" is not shown' % message) chat.element_by_text_part(fetch_more).wait_and_click(120) chat.element_by_text_part(fetch_more).wait_for_visibility_of_element(180) diff --git a/test/appium/tests/atomic/dapps_and_browsing/test_dapps.py b/test/appium/tests/atomic/dapps_and_browsing/test_dapps.py index 7d1b95f48c..764bfb9102 100644 --- a/test/appium/tests/atomic/dapps_and_browsing/test_dapps.py +++ b/test/appium/tests/atomic/dapps_and_browsing/test_dapps.py @@ -74,6 +74,8 @@ class TestDApps(SingleDeviceTestCase): @marks.testrail_id(6232) @marks.medium + @marks.flaky + # TODO: due to 13011 def test_switching_accounts_in_dapp(self): home = SignInView(self.driver).create_user() wallet = home.wallet_button.click() diff --git a/test/appium/tests/atomic/transactions/test_dapps_transactions.py b/test/appium/tests/atomic/transactions/test_dapps_transactions.py index 6c7a4aa65f..30343d71f9 100644 --- a/test/appium/tests/atomic/transactions/test_dapps_transactions.py +++ b/test/appium/tests/atomic/transactions/test_dapps_transactions.py @@ -18,6 +18,7 @@ class TestTransactionDApp(SingleDeviceTestCase): status_test_dapp = home.open_status_test_dapp() status_test_dapp.wait_for_d_aap_to_load() status_test_dapp.assets_button.click() + status_test_dapp.request_stt_button.wait_for_element(60) send_transaction = status_test_dapp.request_stt_button.click() if not send_transaction.onboarding_message.is_element_displayed(30): self.driver.fail('It seems onboarding screen is not shown.') diff --git a/test/appium/tests/atomic/transactions/test_wallet.py b/test/appium/tests/atomic/transactions/test_wallet.py index 8f53db56de..33fce82f7b 100644 --- a/test/appium/tests/atomic/transactions/test_wallet.py +++ b/test/appium/tests/atomic/transactions/test_wallet.py @@ -663,7 +663,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase): send_transaction.per_gas_price_limit_input: { 'default': default_price, - 'value': '24,000000001', + 'value': str(round(float(default_price)+3, 9)), '-2': 'invalid-number', } } @@ -681,20 +681,17 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase): send_transaction.save_fee_button.scroll_and_click() if wallet.element_by_translation_id("change-tip").is_element_displayed(): wallet.element_by_translation_id("continue-anyway").click() - if send_transaction.get_network_fee_from_bottom_sheet() != '0.000528': - self.driver.fail( - "Custom fee is not applied, in fact it is %s " % send_transaction.get_network_fee_from_bottom_sheet()) send_transaction.sign_transaction() self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, confirmations=3) transaction = wallet.find_transaction_in_history(amount=amount, return_hash=True) expected_params = { - 'fee_cap': '24.000000001', + 'fee_cap': values[send_transaction.per_gas_price_limit_input]['value'], 'tip_cap': '2.5', 'gas_limit': '22000' } actual_params = self.network_api.get_custom_fee_tx_params(transaction) if actual_params != expected_params: - self.errors.append('Real params %s for tx do not match expected ' % str(actual_params)) + self.errors.append('Real params %s for tx do not match expected %s' % (str(actual_params), str(expected_params))) wallet.just_fyi('Verify custom fee data on tx screen') wallet.swipe_up() diff --git a/test/appium/views/base_element.py b/test/appium/views/base_element.py index 0ebbfec192..d0dae09bf8 100644 --- a/test/appium/views/base_element.py +++ b/test/appium/views/base_element.py @@ -407,7 +407,10 @@ class CheckBox(Button): super(Button, self).__init__(driver, **kwargs) def __define_desired_element(self, elem_accessibility): - return ':%s' % elem_accessibility if ':' in self.accessibility_id else elem_accessibility + desired_element_accessibility_id = elem_accessibility + if self.accessibility_id is not None and ':' in self.accessibility_id: + desired_element_accessibility_id = ':%s' % elem_accessibility + return desired_element_accessibility_id def enable(self): self.click_until_presence_of_element(Button(self.driver,