Updated tests for deleting public chat and wallet recovery

Signed-off-by: yevh-berdnyk <ie.berdnyk@gmail.com>
This commit is contained in:
yevh-berdnyk 2018-05-29 16:06:32 +02:00
parent 6f8647e7d7
commit e2cc3123b2
No known key found for this signature in database
GPG Key ID: E9B425FDFC4DEA9C
4 changed files with 19 additions and 17 deletions

View File

@ -109,29 +109,21 @@ class TestChatManagementMultiple(MultipleDeviceTestCase):
chat_1.chat_message_input.send_keys(message_4)
chat_1.send_message_button.click()
public_chat_name = '#' + chat_name
chat_2.element_by_text(public_chat_name).click()
for message in message_1, message_2, message_3, message_4:
if not chat_2.element_starts_with_text(message).is_element_present():
self.errors.append("Message '%s' is not shown in public chat which has been deleted" % message)
chat_1.chat_options.click()
chat_1.leave_chat_button.click()
chat_1.leave_button.click()
chat_2.chat_message_input.send_keys(message_5)
chat_2.send_message_button.click()
if chat_1.element_starts_with_text(message_5).is_element_present(20):
self.errors.append("Message '%s' is shown, but the user left public chat" % message_5)
home_2 = chat_2.get_home_view()
if home_2.element_by_text(public_chat_name).is_element_present(sec=30):
self.errors.append("Public chat reappears after deleting")
chat_2.get_back_to_home_view()
home_2, home_1 = chat_2.get_home_view(), chat_1.get_home_view()
home_2.swipe_and_delete_chat('#' + chat_name)
chat_1.get_back_to_home_view()
home_1 = chat_1.get_home_view()
home_1.swipe_and_delete_chat(public_chat_name)
for home in home_2, home_1:
home.relogin()
if home_1.element_by_text(public_chat_name).is_element_present(20):
self.errors.append("Public chat '%s' is shown, but the user left public chat" % public_chat_name)
if home_2.element_by_text(public_chat_name).is_element_present(20):
self.errors.append("Public chat '%s' is shown, but the chat has been deleted via 'swipe to delete'"
% public_chat_name)
if home_2.element_by_text(public_chat_name).is_element_present(20):
self.errors.append("Public chat '%s' is shown, but the user deleted it" % public_chat_name)
self.verify_no_errors()

View File

@ -111,6 +111,7 @@ class TestTransaction(SingleDeviceTestCase):
sign_in_view.recover_access(user['passphrase'], user['password'])
home_view = sign_in_view.get_home_view()
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
transactions_view = wallet_view.transactions_button.click()
transaction_details = transactions_view.transactions_table.get_first_transaction().click()
transaction_hash = transaction_details.get_transaction_hash()
@ -132,6 +133,7 @@ class TestTransaction(SingleDeviceTestCase):
home_view.add_contact(recipient['public_key'])
home_view.get_back_to_home_view()
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
send_transaction = wallet_view.send_button.click()
send_transaction.select_asset_button.click_until_presence_of_element(send_transaction.stt_button)
send_transaction.stt_button.click()
@ -158,6 +160,7 @@ class TestTransaction(SingleDeviceTestCase):
home_view.add_contact(recipient['public_key'])
home_view.get_back_to_home_view()
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
send_transaction = wallet_view.send_button.click()
send_transaction.amount_edit_box.click()
transaction_amount = send_transaction.get_unique_amount()
@ -187,6 +190,7 @@ class TestTransaction(SingleDeviceTestCase):
home_view.add_contact(recipient['public_key'])
home_view.get_back_to_home_view()
wallet_view = home_view.wallet_button.click()
sign_in_phrase = wallet_view.set_up_wallet()
send_transaction = wallet_view.send_button.click()
send_transaction.amount_edit_box.click()
send_transaction.amount_edit_box.set_value(send_transaction.get_unique_amount())
@ -197,6 +201,7 @@ class TestTransaction(SingleDeviceTestCase):
send_transaction.recent_recipients_button.click_until_presence_of_element(recent_recipient)
recent_recipient.click()
send_transaction.sign_transaction_button.click()
assert send_transaction.sign_in_phrase_text.text == sign_in_phrase
send_transaction.enter_password_input.send_keys(sender['password'])
send_transaction.cancel_button.click()
send_transaction.sign_transaction_button.click()
@ -275,6 +280,7 @@ class TestTransactions(MultipleDeviceTestCase):
self.network_api.find_transaction_by_unique_amount(recipient['address'], amount)
device_2_chat.back_button.click()
device_2_wallet = device_2_home.wallet_button.click()
device_2_wallet.set_up_wallet()
transactions_view = device_2_wallet.transactions_button.click()
transactions_view.transactions_table.find_transaction(amount=amount)
@ -293,6 +299,7 @@ class TestTransactions(MultipleDeviceTestCase):
device_1_home.add_contact(sender['public_key'])
device_1_home.get_back_to_home_view()
wallet_view_device_1 = device_1_home.wallet_button.click()
wallet_view_device_1.set_up_wallet()
send_transaction_device_1 = wallet_view_device_1.request_button.click_until_presence_of_element(
wallet_view_device_1.send_transaction_request)
wallet_view_device_1.send_transaction_request.click()

View File

@ -16,6 +16,7 @@ class TestWallet(SingleDeviceTestCase):
sign_in_view.recover_access(sender['passphrase'], sender['password'])
home_view = sign_in_view.get_home_view()
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
send_transaction = wallet_view.send_button.click()
# Check valid amount
@ -71,6 +72,7 @@ class TestWallet(SingleDeviceTestCase):
sign_in_view.recover_access(passphrase=transaction_users_wallet['A_USER']['passphrase'],
password=transaction_users_wallet['A_USER']['password'])
wallet = sign_in_view.wallet_button.click()
wallet.set_up_wallet()
address = transaction_users_wallet['A_USER']['address']
balance = self.network_api.get_balance(address) / 1000000000000000000
eth_rate = self.network_api.get_ethereum_price_in_usd()

View File

@ -151,7 +151,8 @@ class WalletView(BaseView):
self.sign_in_phrase = SignInPhraseText(self.driver)
def get_usd_total_value(self):
return float(self.usd_total_value.text)
import re
return float(re.sub('[$,]', '', self.usd_total_value.text))
def get_eth_value(self):
return float(self.eth_asset.text)