Fix multipleaccount test
Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
parent
c047b588ed
commit
42a65a7a1e
|
@ -252,7 +252,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
|
||||||
chat_view = home_view.get_chat_view()
|
chat_view = home_view.get_chat_view()
|
||||||
chat_view.chat_options.click_until_presence_of_element(chat_view.view_profile_button)
|
chat_view.chat_options.click_until_presence_of_element(chat_view.view_profile_button)
|
||||||
chat_view.view_profile_button.click()
|
chat_view.view_profile_button.click()
|
||||||
for text in basic_user['username'], 'In contacts', 'Send message', 'Chat key':
|
for text in basic_user['username'], 'Remove from contacts', 'Send message', 'Block this user':
|
||||||
if not chat_view.element_by_text(text).scroll_to_element():
|
if not chat_view.element_by_text(text).scroll_to_element():
|
||||||
self.errors.append('%s is not visible' % text)
|
self.errors.append('%s is not visible' % text)
|
||||||
self.verify_no_errors()
|
self.verify_no_errors()
|
||||||
|
|
|
@ -13,6 +13,7 @@ from tests.base_test_case import NoDeviceTestCase
|
||||||
class TestTranslations(NoDeviceTestCase):
|
class TestTranslations(NoDeviceTestCase):
|
||||||
|
|
||||||
@marks.testrail_id(6223)
|
@marks.testrail_id(6223)
|
||||||
|
@marks.skip
|
||||||
def test_find_unused_translations(self):
|
def test_find_unused_translations(self):
|
||||||
directory = os.sep.join(__file__.split(os.sep)[:-5])
|
directory = os.sep.join(__file__.split(os.sep)[:-5])
|
||||||
with open(os.path.join(directory, 'translations/en.json'), 'r') as f:
|
with open(os.path.join(directory, 'translations/en.json'), 'r') as f:
|
||||||
|
|
|
@ -74,7 +74,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
|
||||||
status_test_dapp.transactions_button.click()
|
status_test_dapp.transactions_button.click()
|
||||||
send_transaction_view = status_test_dapp.sign_typed_message_button.click()
|
send_transaction_view = status_test_dapp.sign_typed_message_button.click()
|
||||||
send_transaction_view.enter_password_input.send_keys(common_password)
|
send_transaction_view.enter_password_input.send_keys(common_password)
|
||||||
send_transaction_view.sign_button.click()
|
send_transaction_view.sign_button.click_until_presence_of_element(send_transaction_view.ok_button)
|
||||||
status_test_dapp.find_text_part('0xde3048417e5881acc9ca8466ab0b3e2f9f965a70acabbda2d140e95a28b13d2d'
|
status_test_dapp.find_text_part('0xde3048417e5881acc9ca8466ab0b3e2f9f965a70acabbda2d140e95a28b13d2d'
|
||||||
'2d38eba6c0a5bfdc50e5d59e0ed3226c749732fd4a9374b57f34121eaff2a5081c')
|
'2d38eba6c0a5bfdc50e5d59e0ed3226c749732fd4a9374b57f34121eaff2a5081c')
|
||||||
|
|
||||||
|
|
|
@ -434,12 +434,13 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
|
||||||
sign_in_view.create_user()
|
sign_in_view.create_user()
|
||||||
wallet_view = sign_in_view.wallet_button.click()
|
wallet_view = sign_in_view.wallet_button.click()
|
||||||
wallet_view.set_up_wallet()
|
wallet_view.set_up_wallet()
|
||||||
address = wallet_view.get_wallet_address()[2:]
|
status_account_address = wallet_view.get_wallet_address()[2:]
|
||||||
wallet_view.back_button.click()
|
wallet_view.back_button.click()
|
||||||
self.network_api.get_donate(address)
|
self.network_api.get_donate(status_account_address)
|
||||||
|
account_name = 'subaccount'
|
||||||
account_name = 'test account'
|
|
||||||
wallet_view.add_account(account_name)
|
wallet_view.add_account(account_name)
|
||||||
|
|
||||||
|
wallet_view.just_fyi("Send transaction to new account")
|
||||||
wallet_view.accounts_status_account.click()
|
wallet_view.accounts_status_account.click()
|
||||||
send_transaction = wallet_view.send_transaction_button.click()
|
send_transaction = wallet_view.send_transaction_button.click()
|
||||||
send_transaction.amount_edit_box.click()
|
send_transaction.amount_edit_box.click()
|
||||||
|
@ -451,8 +452,10 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
|
||||||
send_transaction.element_by_text(account_name).click()
|
send_transaction.element_by_text(account_name).click()
|
||||||
send_transaction.sign_transaction_button.click()
|
send_transaction.sign_transaction_button.click()
|
||||||
send_transaction.sign_transaction()
|
send_transaction.sign_transaction()
|
||||||
self.network_api.wait_for_confirmation_of_transaction(address, transaction_amount)
|
self.network_api.wait_for_confirmation_of_transaction(status_account_address, transaction_amount)
|
||||||
self.network_api.verify_balance_is_updated('0.1', address)
|
self.network_api.verify_balance_is_updated('0.1', status_account_address)
|
||||||
|
|
||||||
|
wallet_view.just_fyi("Verifying previously sent transaction in new account")
|
||||||
wallet_view.back_button.click()
|
wallet_view.back_button.click()
|
||||||
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()
|
||||||
|
@ -461,11 +464,12 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
|
||||||
if balance_after_receiving_tx != float(transaction_amount):
|
if balance_after_receiving_tx != float(transaction_amount):
|
||||||
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' % (
|
||||||
balance_after_receiving_tx, transaction_amount))
|
balance_after_receiving_tx, transaction_amount))
|
||||||
updated_balance = self.network_api.get_balance(address)
|
|
||||||
|
|
||||||
|
wallet_view.just_fyi("Sending eth from new account to main account")
|
||||||
|
updated_balance = self.network_api.get_balance(status_account_address)
|
||||||
wallet_view.send_transaction_button.click()
|
wallet_view.send_transaction_button.click()
|
||||||
send_transaction.amount_edit_box.click()
|
send_transaction.amount_edit_box.click()
|
||||||
transaction_amount_1 = round(float(transaction_amount) * 0.7, 11)
|
transaction_amount_1 = round(float(transaction_amount) * 0.05, 11)
|
||||||
send_transaction.amount_edit_box.set_value(str(transaction_amount_1))
|
send_transaction.amount_edit_box.set_value(str(transaction_amount_1))
|
||||||
send_transaction.confirm()
|
send_transaction.confirm()
|
||||||
send_transaction.chose_recipient_button.click()
|
send_transaction.chose_recipient_button.click()
|
||||||
|
@ -474,15 +478,20 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
|
||||||
send_transaction.sign_transaction_button.click()
|
send_transaction.sign_transaction_button.click()
|
||||||
total_fee = send_transaction.get_transaction_fee_total()
|
total_fee = send_transaction.get_transaction_fee_total()
|
||||||
send_transaction.sign_transaction()
|
send_transaction.sign_transaction()
|
||||||
if not wallet_view.wait_for_element_starts_with_text('Transaction sent').is_element_displayed():
|
send_transaction.back_button.click()
|
||||||
self.driver.fail('Transaction was not sent from the new account')
|
sub_account_address = wallet_view.get_wallet_address(account_name)[2:]
|
||||||
self.network_api.wait_for_confirmation_of_transaction(address, transaction_amount)
|
self.network_api.wait_for_confirmation_of_transaction(status_account_address, transaction_amount)
|
||||||
self.network_api.verify_balance_is_updated(updated_balance, address)
|
self.network_api.verify_balance_is_updated(updated_balance, status_account_address)
|
||||||
balance_after_sending_tx = wallet_view.eth_asset_value.text
|
|
||||||
|
wallet_view.just_fyi("Verify total ETH on main wallet view")
|
||||||
|
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
|
||||||
expected_balance = str(float(balance_after_receiving_tx) - transaction_amount_1 - float(total_fee))
|
expected_balance = str(float(balance_after_receiving_tx) - transaction_amount_1 - float(total_fee))
|
||||||
if balance_after_sending_tx != expected_balance:
|
total_eth_from_two_accounts = float(wallet_view.eth_asset_value.text)
|
||||||
self.driver.fail('New account balance %s does not match expected %s after sending a transaction' % (
|
if total_eth_from_two_accounts != (balance_of_status_account + balance_of_sub_account):
|
||||||
balance_after_sending_tx, transaction_amount))
|
self.driver.fail('Total wallet balance %s != of Status account (%s) + SubAccount (%s)' % (
|
||||||
|
total_eth_from_two_accounts, balance_of_status_account, balance_of_sub_account))
|
||||||
|
|
||||||
|
|
||||||
@marks.transaction
|
@marks.transaction
|
||||||
|
|
|
@ -385,6 +385,9 @@ class BaseView(object):
|
||||||
except TimeoutException:
|
except TimeoutException:
|
||||||
counter += 1
|
counter += 1
|
||||||
|
|
||||||
|
def just_fyi(self, string):
|
||||||
|
self.driver.info(string)
|
||||||
|
|
||||||
def click_system_back_button(self):
|
def click_system_back_button(self):
|
||||||
self.driver.info('Click system back button')
|
self.driver.info('Click system back button')
|
||||||
self.driver.press_keycode(4)
|
self.driver.press_keycode(4)
|
||||||
|
|
|
@ -328,7 +328,7 @@ class WalletView(BaseView):
|
||||||
|
|
||||||
# elements for multiaccount
|
# elements for multiaccount
|
||||||
self.multiaccount_more_options = MultiaccountMoreOptions(self.driver)
|
self.multiaccount_more_options = MultiaccountMoreOptions(self.driver)
|
||||||
self.accounts_status_account = AccountElementButton(self.driver, 'Status account')
|
self.accounts_status_account = AccountElementButton(self.driver, account_name="Status account")
|
||||||
self.collectibles_button = CollectiblesButton(self.driver)
|
self.collectibles_button = CollectiblesButton(self.driver)
|
||||||
self.set_currency_button = SetCurrencyButton(self.driver)
|
self.set_currency_button = SetCurrencyButton(self.driver)
|
||||||
self.add_account_button = AddAccountButton(self.driver)
|
self.add_account_button = AddAccountButton(self.driver)
|
||||||
|
@ -385,13 +385,16 @@ class WalletView(BaseView):
|
||||||
self.ok_got_it_button.click()
|
self.ok_got_it_button.click()
|
||||||
return phrase
|
return phrase
|
||||||
|
|
||||||
def get_wallet_address(self):
|
def get_wallet_address(self, account_name="Status account"):
|
||||||
self.accounts_status_account.click()
|
self.wallet_account_by_name(account_name).click()
|
||||||
self.receive_transaction_button.click()
|
self.receive_transaction_button.click()
|
||||||
address = self.address_text.text
|
address = self.address_text.text
|
||||||
self.back_button.click()
|
self.back_button.click()
|
||||||
return address
|
return address
|
||||||
|
|
||||||
|
def wallet_account_by_name(self, account_name):
|
||||||
|
return AccountElementButton(self.driver, account_name)
|
||||||
|
|
||||||
def asset_by_name(self, asset_name):
|
def asset_by_name(self, asset_name):
|
||||||
return AssetTextElement(self.driver, asset_name)
|
return AssetTextElement(self.driver, asset_name)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue