Seedphrase validation in e2e and fixes

Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
Serhy 2020-01-03 17:27:50 +02:00
parent bf16116acd
commit 1956671e7d
No known key found for this signature in database
GPG Key ID: 5D7C4B9E2B6F500B
4 changed files with 16 additions and 23 deletions

View File

@ -78,11 +78,11 @@ class NetworkApi(object):
(amount, address)) (amount, address))
return transaction return transaction
def wait_for_confirmation_of_transaction(self, address, amount, token=False): def wait_for_confirmation_of_transaction(self, address, amount, confirmations=12, token=False):
start_time = time.time() start_time = time.time()
while round(time.time() - start_time, ndigits=2) < 900: # should be < idleTimeout capability while round(time.time() - start_time, ndigits=2) < 900: # should be < idleTimeout capability
transaction = self.find_transaction_by_unique_amount(address, amount, token) transaction = self.find_transaction_by_unique_amount(address, amount, token)
if int(transaction['confirmations']) >= 12: if int(transaction['confirmations']) >= confirmations:
return return
time.sleep(10) time.sleep(10)
pytest.fail('Transaction with amount %s was not confirmed, address is %s' % (amount, address)) pytest.fail('Transaction with amount %s was not confirmed, address is %s' % (amount, address))

View File

@ -81,9 +81,9 @@ class TestRecoverAccessFromSignInScreen(SingleDeviceTestCase):
'words count': 1, 'words count': 1,
'popup' : False 'popup' : False
}, },
# outside mnemonic # mnemonic but checksum validation fails
{ {
'phrase': '; two three four five six seven eight nine ten eleven twelve', 'phrase': 'one two three four five six seven eight nine ten eleven twelve',
'element to check': recover_access_view.warnings.invalid_recovery_phrase, 'element to check': recover_access_view.warnings.invalid_recovery_phrase,
'validation message': '', 'validation message': '',
'words count': 12, 'words count': 12,
@ -136,16 +136,8 @@ class TestRecoverAccessFromSignInScreen(SingleDeviceTestCase):
if not recover_access_view.find_full_text(text): if not recover_access_view.find_full_text(text):
self.errors.append('"%s" text is not shown' % text) self.errors.append('"%s" text is not shown' % text)
recover_access_view.cancel_custom_seed_phrase_button.click() recover_access_view.cancel_custom_seed_phrase_button.click()
recover_access_view.next_button.click()
recover_access_view.continue_custom_seed_phrase_button.click() recover_access_view.click_system_back_button()
recover_access_view.reencrypt_your_key_button.click()
recover_access_view.next_button.click()
recover_access_view.create_password_input.set_value(common_password)
recover_access_view.next_button.click()
recover_access_view.confirm_your_password_input.set_value(common_password)
recover_access_view.next_button.click_until_presence_of_element(recover_access_view.home_button)
else:
recover_access_view.click_system_back_button()
self.errors.verify_no_errors() self.errors.verify_no_errors()

View File

@ -147,7 +147,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet_view.send_transaction(asset_name=asset, amount=sending_amount, recipient=recipient, wallet_view.send_transaction(asset_name=asset, amount=sending_amount, recipient=recipient,
sign_transaction=True) sign_transaction=True)
sign_in_view.toggle_airplane_mode() sign_in_view.toggle_airplane_mode()
self.network_api.wait_for_confirmation_of_transaction(basic_user['address'], sending_amount, token=True) self.network_api.wait_for_confirmation_of_transaction(basic_user['address'], sending_amount, confirmations=6, token=True)
sign_in_view.just_fyi('Change that balance is updated') sign_in_view.just_fyi('Change that balance is updated')
initial_amount_STT = wallet_view.get_asset_amount_by_name('STT') initial_amount_STT = wallet_view.get_asset_amount_by_name('STT')
@ -392,7 +392,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
send_transaction.enter_recipient_address_input.set_value(recipient_address) send_transaction.enter_recipient_address_input.set_value(recipient_address)
send_transaction.done_button.click() send_transaction.done_button.click()
send_transaction.sign_transaction_button.click() send_transaction.sign_transaction_button.click()
send_transaction.network_fee_button.click() send_transaction.network_fee_button.click_until_presence_of_element(send_transaction.gas_limit_input)
send_transaction.gas_limit_input.clear() send_transaction.gas_limit_input.clear()
send_transaction.gas_limit_input.set_value('1') send_transaction.gas_limit_input.set_value('1')
send_transaction.gas_price_input.clear() send_transaction.gas_price_input.clear()
@ -470,7 +470,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
self.driver.fail("Sign transaction button is active in offline mode") self.driver.fail("Sign transaction button is active in offline mode")
@marks.testrail_id(6225) @marks.testrail_id(6225)
@marks.high @marks.medium
def test_send_funds_between_accounts_in_multiaccount_instance(self): def test_send_funds_between_accounts_in_multiaccount_instance(self):
sign_in_view = SignInView(self.driver) sign_in_view = SignInView(self.driver)
sign_in_view.create_user() sign_in_view.create_user()
@ -527,7 +527,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
self.network_api.verify_balance_is_updated(updated_balance, status_account_address) self.network_api.verify_balance_is_updated(updated_balance, status_account_address)
wallet_view.just_fyi("Verify total ETH on main wallet view") wallet_view.just_fyi("Verify total ETH on main wallet view")
self.network_api.wait_for_confirmation_of_transaction(status_account_address, transaction_amount_1) self.network_api.wait_for_confirmation_of_transaction(status_account_address, transaction_amount_1, 3)
self.network_api.verify_balance_is_updated((updated_balance + transaction_amount_1), status_account_address) self.network_api.verify_balance_is_updated((updated_balance + transaction_amount_1), status_account_address)
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

View File

@ -34,11 +34,12 @@ wallet_users['A']['public_key'] = "0x04fa759cc29261fd7779cf8b3566de61e3fb22aca46
"9a957fdab86e277e4bb7ec90f7998d21fc16690397d3783b8d8711e1" "9a957fdab86e277e4bb7ec90f7998d21fc16690397d3783b8d8711e1"
wallet_users['B'] = dict() wallet_users['B'] = dict()
wallet_users['B']['passphrase'] = "subway size dial screen stomach route skin kitchen radar true coffee six" wallet_users['B']['passphrase'] = "unknown endless ill average shell foil kitchen runway left race neither exhaust"
wallet_users['B']['username'] = "Idealistic Assured Spidermonkey" wallet_users['B']['username'] = "Bulky Able Firecrest"
wallet_users['B']['address'] = "85b159bad0d500483b307ec6892c7fa3be591cbc" wallet_users['B']['address'] = "0F3EFF5CacEe63045be97281316457fb78dd659E"
wallet_users['B']['public_key'] = "0x04c068a1467abf8d18ea4a020e52880d855c5a418e52c1ef29cc9b30999ed986cf5c9fe55" \ wallet_users['B']['public_key'] = "0x04f3c372522a087bd6895a67b669601e6b6825b2ee7add5942d10efd1c3c836a1d9a677d94d33" \
"d6ffd10659be32c8c1ce15dbf7dc0659e238a0169eb7e18be9757baa8" "895833b6ebe523f0fe5965f73558da58520a3f9c7a00e73f75d61"
wallet_users['C'] = dict() wallet_users['C'] = dict()
wallet_users['C']['passphrase'] = "purchase ensure mistake crystal person similar shaft family shield clog risk market" wallet_users['C']['passphrase'] = "purchase ensure mistake crystal person similar shaft family shield clog risk market"