e2e: more fixes

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2022-01-17 20:23:38 +01:00
parent 69221695b3
commit cfab672f63
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
7 changed files with 19 additions and 18 deletions

View File

@ -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'))
}

View File

@ -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()

View File

@ -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)

View File

@ -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()

View File

@ -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.')

View File

@ -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()

View File

@ -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,