e2e: align tests with RNN upgrade

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2021-06-23 17:12:42 +02:00
parent 706d6a44a4
commit 8bab25075b
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
19 changed files with 144 additions and 113 deletions

View File

@ -255,8 +255,12 @@ class TestCreateAccount(SingleDeviceTestCase):
address = wallet_view.get_wallet_address()
if address != account:
self.errors.append('Restored wallet address "%s" does not match expected "%s"' % (address, account))
profile_view = home_view.profile_button.click()
profile_view.logout()
profile = home_view.profile_button.click()
profile.privacy_and_security_button.click()
profile.delete_my_profile_button.scroll_and_click()
profile.delete_my_profile_password_input.set_value(unique_password)
profile.delete_profile_button.click()
profile.ok_button.click()
self.errors.verify_no_errors()

View File

@ -362,10 +362,9 @@ class TestCreateAccount(SingleDeviceTestCase):
profile_view.logout()
sign_in.just_fyi('Create new multiaccount')
sign_in.back_button.click()
sign_in.close_button.click()
sign_in.your_keys_more_icon.click()
sign_in.generate_new_key_button.click()
sign_in.generate_key_button.click()
sign_in.next_button.click()
sign_in.next_button.click()
sign_in.create_password_input.set_value(common_password)
@ -390,14 +389,13 @@ class TestCreateAccount(SingleDeviceTestCase):
sign_in.just_fyi('Send transaction from added account and log out')
transaction_amount_added = wallet_view.get_unique_amount()
wallet_view.send_transaction(amount=transaction_amount_added, recipient=recipient, sign_transaction=True)
wallet_view.accounts_status_account.click()
wallet_view.profile_button.click()
profile_view.logout()
sign_in.just_fyi('Login to keycard account and send another transaction')
sign_in.back_button.click()
sign_in.sign_in(position=2, keycard=True)
sign_in.wallet_button.click()
wallet_view.set_up_wallet()
wallet_view.wait_balance_is_changed('ETH')
wallet_view.accounts_status_account.click()
transaction_amount_keycard = wallet_view.get_unique_amount()

View File

@ -23,7 +23,6 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
sign_in.back_button.click()
sign_in.your_keys_more_icon.click()
sign_in.generate_new_key_button.click()
sign_in.generate_key_button.click()
sign_in.next_button.click()
sign_in.next_button.click()
sign_in.create_password_input.set_value(common_password)
@ -230,7 +229,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
home.just_fyi('Add contact and check that they appear in Contacts view')
chat_view = home.get_chat_view()
for key in users:
profile.plus_button.click()
profile.add_new_contact_button.click()
home.just_fyi('Checking %s case' % key)
if 'scanning' in key:
chat_view.scan_contact_code_button.click()
@ -253,7 +252,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
user_to_remove = '@%s' % ens_user['ens_another_domain']
profile.element_by_text(user_to_remove).click()
chat_view.remove_from_contacts.click()
chat_view.back_button.click()
chat_view.close_button.click()
if profile.element_by_text(user_to_remove).is_element_displayed():
self.errors.append('Removed user is still shown in contact view')
@ -491,10 +490,10 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
self.driver.fail("Couldn't connect to any history node")
profile.just_fyi('check that history node is pinned')
profile.back_button.click()
profile.close_button.click()
if not profile.element_by_text(h_node).is_element_displayed():
self.errors.append('"%s" history node is not pinned' % h_node)
profile.get_back_to_home_view()
profile.home_button.click()
profile.just_fyi('Relogin and check that settings are preserved')
home.relogin()
@ -652,7 +651,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
profile_2.element_by_text(default_username_1).click()
if not profile_2.profile_picture.is_element_image_similar_to_template('sauce_logo.png'):
self.errors.append('Profile picture was not updated on user Profile view')
profile_2.back_button.click()
profile_2.close_button.click()
one_to_one_chat_2.home_button.click(desired_view='home')
if not home_2.get_chat(default_username_1).chat_image.is_element_image_similar_to_template('sauce_logo.png'):
self.errors.append('User profile picture was not updated on Chats view')
@ -688,7 +687,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
# Send message to User 2 so update of profile image picked up
group_chat_1 = home_1.get_chat('new_group_chat').click()
group_chat_1.send_message(group_chat_message)
one_to_one_chat_2.back_button.click()
one_to_one_chat_2.close_button.click()
one_to_one_chat_2.home_button.click(desired_view='home')
if home_2.get_chat(default_username_1).chat_image.is_element_image_similar_to_template('sauce_logo.png'):
self.errors.append('User profile picture is not default to default after user removed from Contacts')
@ -766,7 +765,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
sign_in_1, sign_in_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
home_1, home_2 = sign_in_1.create_user(), sign_in_2.create_user()
public_key = home_2.get_public_key_and_username()
home_2.get_back_to_home_view()
home_2.home_button.click()
profile_1 = home_1.profile_button.click()
username_1 = profile_1.default_username_text.text
@ -778,6 +777,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
profile_1.mail_server_auto_selection_button.click()
profile_1.mail_server_by_name(mailserver).click()
profile_1.confirm_button.click()
profile_1.just_fyi('add custom mailserver (check address/name validation) and connect to it')
profile_1.plus_button.click()
server_name = 'test'
@ -800,7 +800,6 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
profile_1.get_back_to_home_view()
profile_1.home_button.click()
profile_1.just_fyi('start chat with user2 and check that all messages are delivered')
chat_1 = home_1.add_contact(public_key)
message = 'test message'
@ -952,7 +951,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
device_1_profile.ok_continue_button.click()
recovery_phrase = device_1_profile.get_recovery_phrase()
device_1_profile.close_button.click()
device_1_profile.get_back_to_home_view()
device_1_profile.home_button.click()
device_1_name = 'device_%s' % device_1.driver.number
device_2_name = 'device_%s' % device_2.driver.number
message_before_sync = 'sent before sync'
@ -1071,7 +1070,6 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
for text in ('10 SNT, deposit unlocked', user_1['address'].lower(), user_1['public_key'] ):
if not profile_1.element_by_text_part(text).is_element_displayed(40):
self.errors.append('%s text is not shown' % text)
dapp_view_1.get_back_to_home_view()
profile_1.home_button.click()
home_2.just_fyi('joining same public chat, set ENS name and check it in chat from device2')
@ -1277,7 +1275,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
device_1_profile.sync_all_button.wait_for_visibility_of_element(15)
device_2.just_fyi('check that public chat and profile details are updated')
device_2_home = device_2_profile.get_back_to_home_view()
device_2_home = device_2_profile.home_button.click()
if not device_2_home.element_by_text('#%s' % public_chat_before_sync_name).is_element_displayed():
self.errors.append('Public chat "%s" doesn\'t appear after initial sync'
% public_chat_before_sync_name)
@ -1288,7 +1286,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
device_2_profile.home_button.click()
device_1.just_fyi('send message to group chat, and join to new public chat')
device_1_home = device_1_profile.get_back_to_home_view()
device_1_home = device_1_profile.home_button.click()
device_1_public_chat = device_1_home.join_public_chat(public_chat_after_sync_name)
device_1_public_chat.back_button.click()
device_1_home.element_by_text(group_chat_name).click()

View File

@ -165,7 +165,7 @@ class TestWalletManagement(SingleDeviceTestCase):
self.driver.fail("'Back up your seed phrase' warning is shown on Wallet while no funds are present")
address = wallet.get_wallet_address()
self.network_api.get_donate(address[2:], external_faucet=True, wait_time=200)
wallet.back_button.click()
wallet.close_button.click()
wallet.wait_balance_is_changed(scan_tokens=True)
if not wallet.backup_recovery_phrase_warning_text.is_element_present(30):
self.driver.fail("'Back up your seed phrase' warning is not shown on Wallet with funds")
@ -366,7 +366,7 @@ class TestWalletManagement(SingleDeviceTestCase):
self.errors.append("'%s' is shown on the home screen after searching by '%s' keyword" %
(', '.join(search_results), keyword))
home.cancel_button.click()
wallet.back_button.click()
wallet.close_button.click()
home.just_fyi('Searching for currency')
search_list_currencies = {

View File

@ -341,7 +341,8 @@ class TestChatManagement(SingleDeviceTestCase):
send_transaction.deny_button.click()
general_camera_error.wait_for_visibility_of_element(3)
send_transaction.ok_button.click()
wallet.back_button.click_until_absense_of_element(wallet.back_button)
wallet.close_button.click()
wallet.close_send_transaction_view_button.click()
home.just_fyi("Allow access to camera in universal qr code scanner and check it in other views")
wallet.home_button.click()
@ -383,8 +384,8 @@ class TestChatManagement(SingleDeviceTestCase):
profile.open_contact_from_profile(dummy_user['username'])
nickname = 'dummy_user'
public_chat.set_nickname(nickname)
profile.home_button.click()
public_chat.get_back_to_home_view()
public_chat.home_button.click()
search_list = {
basic_user['username']: basic_user['username'],
@ -445,6 +446,7 @@ class TestChatManagement(SingleDeviceTestCase):
chat_view.chat_options.click()
chat_view.view_profile_button.click()
chat_view.block_contact()
chat_view.get_back_to_home_view()
chat_view.just_fyi('Unblock user not added as contact from chat view')
profile = home.profile_button.click()
@ -454,7 +456,8 @@ class TestChatManagement(SingleDeviceTestCase):
chat_view.unblock_contact_button.click()
profile.just_fyi('Navigating to contact list and check that user is not in list')
profile.back_button.click(2)
profile.close_button.click()
profile.back_button.click()
if profile.element_by_text(basic_user["username"]).is_element_displayed():
self.driver.fail("Unblocked user not added previously in contact list added in contacts!")
@ -514,7 +517,7 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
home_1, home_2 = device_1.create_user(), device_2.create_user()
public_key_2, username_2 = home_2.get_public_key_and_username(return_username=True)
home_2.get_back_to_home_view()
home_2.home_button.click()
chat_name = 'testaddcontact'
device_1.just_fyi('join same public chat')
@ -677,9 +680,9 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
home_1, home_2 = device_1.create_user(enable_notifications=True), device_2.create_user()
profile_1 = home_1.profile_button.click()
device_2_public_key = home_2.get_public_key_and_username()
home_2.get_back_to_home_view()
home_2.home_button.click()
default_username_1 = profile_1.default_username_text.text
profile_1.get_back_to_home_view()
profile_1.home_button.click()
device_1.just_fyi('both devices joining the same public chat and send messages')
chat_name = device_1.get_random_chat_name()
@ -708,6 +711,8 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
chat_1.chat_options.click()
chat_1.view_profile_button.click()
chat_1.block_contact()
chat_1.get_back_to_home_view()
chat_1.home_button.click()
device_1.just_fyi('no 1-1, messages from blocked user are hidden in public chat')
from views.home_view import ChatElement
@ -1024,20 +1029,18 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
device_2.back_button.click()
device_2.your_keys_more_icon.click()
device_2.generate_new_key_button.click()
device_2.generate_key_button.click()
device_2.create_user(second_user=True)
home_2.join_public_chat(chat_name)
newusermessage = 'Newusermessage2'
chat_2.send_message(newusermessage)
random_username = chat_1.chat_element_by_text(newusermessage).username.text
chat_1.wait_ens_name_resolved_in_chat(message=message, username_value=username_value)
device_1.just_fyi('Set nickname for ENS user')
device_1.just_fyi('Set nickname for ENS user')
chat_1.view_profile_long_press(message)
nickname = 'nicknamefortestuser'
chat_1.set_nickname(nickname)
chat_1.back_button.click()
chat_1.close_button.click()
ens_nickname_value = nickname + " @" + sender['ens']
chat_1.wait_ens_name_resolved_in_chat(message=message, username_value=ens_nickname_value)
@ -1051,16 +1054,16 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
self.errors.append('ENS-owner user is not available in mention suggestion list')
device_1.just_fyi('Check there is no random user in different public chat')
chat_1.get_back_to_home_view(2)
chat_1.get_back_to_home_view()
chat_1 = home_1.join_public_chat(chat_name + "2")
chat_1.chat_message_input.send_keys('@')
if chat_1.search_user_in_mention_suggestion_list(random_username).is_element_displayed():
self.errors.append('Random user from public chat is in mention suggestion list another public chat')
device_1.just_fyi('Check there is ENS+Nickname user in Group chat and no random user')
chat_1.get_back_to_home_view(2)
chat_1.get_back_to_home_view()
home_1.add_contact(sender['public_key'])
chat_1.get_back_to_home_view(2)
chat_1.get_back_to_home_view()
home_1.create_group_chat(user_names_to_add=[nickname])
chat_1.chat_message_input.send_keys('@')
if chat_1.search_user_in_mention_suggestion_list(random_username).is_element_displayed():
@ -1079,7 +1082,6 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
chat_1.search_user_in_mention_suggestion_list(sender['username']).is_element_displayed()):
self.errors.append('Blcoked user is available in mention suggestion list')
self.errors.verify_no_errors()
@marks.testrail_id(695771)

View File

@ -173,7 +173,7 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
group_info_view.get_user_from_group_info(device_2_username).click()
if not device_1_chat.profile_block_contact.is_element_displayed():
self.errors.append("Admin is not redirected to user profile on tapping member username from group info")
device_1_chat.back_button.click()
device_1_chat.close_button.click()
device_1.just_fyi('Made admin another user and check system message')
options = group_info_view.get_username_options(device_2_username).click()
@ -264,7 +264,7 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
chat_1.profile_nickname_button.click()
chat_1.nickname_input_field.clear()
chat_1.element_by_text('Done').click()
chat_1.back_button.click()
chat_1.close_button.click()
if chat_1.user_name_text.text != full_ens:
self.errors.append('Nickname was not removed! real chat name is %s instead of %s' % (chat_1.user_name_text.text, full_ens))
@ -300,10 +300,10 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
chat_1.set_nickname(nickname)
if not chat_1.element_by_text(nickname).is_element_displayed():
self.errors.append('Nickname is not shown in profile view after setting from froup info')
chat_1.back_button.click()
chat_1.close_button.click()
if not chat_1.element_by_text(nickname).is_element_displayed():
self.errors.append('Nickname is not shown in group info view after setting from froup info')
chat_1.back_button.click()
chat_1.close_button.click()
message_text = '%s %s' % (nickname, additional_text)
if not chat_1.chat_element_by_text(message_text).is_element_displayed():
self.errors.append("ENS name was not replaced with nickname on sent message")
@ -328,8 +328,8 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
chat_1.profile_nickname_button.click()
chat_1.nickname_input_field.clear()
chat_1.element_by_text('Done').click()
chat_1.back_button.click()
chat_1.back_button.click()
chat_1.close_button.click()
chat_1.close_button.click()
message_text = '%s %s' % (full_ens, additional_text)
if not chat_1.chat_element_by_text(message_text).is_element_displayed():
self.errors.append("ENS name is not resolved on sent message after removing nickname")
@ -362,7 +362,7 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
device_2_options = device_1_chat.get_user_options(device_2_username)
device_2_options.view_profile_button.click()
device_2_options.block_contact()
device_2_options.back_button.click()
device_1_home.close_button.click()
if device_1_chat.chat_element_by_text(message_before_block).is_element_displayed(10):
self.errors.append('User was blocked, but past message are shown')
message_after_block = 'message from device2 after block'
@ -374,7 +374,7 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
device_2_options = device_1_chat.get_user_options(device_2_username)
device_2_options.view_profile_button.click()
device_2_options.unblock_contact_button.click()
device_2_options.back_button.click(2)
[device_2_options.close_button.click() for _ in range(2)]
message_after_unblock = 'message from device2 after unblock'
device_2_chat.send_message(message_after_unblock)
if not device_1_chat.chat_element_by_text(message_after_unblock).is_element_displayed(20):
@ -407,6 +407,8 @@ class TestCommandsSingleDevices(SingleDeviceTestCase):
chat = home.create_group_chat(usernames, 'some_group_chat')
home.just_fyi('Verify that can not add more users via group info')
chat.get_back_to_home_view()
home.get_chat('some_group_chat').click()
chat.chat_options.click()
group_info_view = chat.group_info.click()
if group_info_view.add_members.is_element_displayed():

View File

@ -26,7 +26,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
default_username_1 = profile_1.default_username_text.text
profile_1.profile_notifications_button.click()
profile_1.profile_notifications_toggle_button.click()
device_1_home = profile_1.get_back_to_home_view()
device_1_home = profile_1.home_button.click()
device_2_public_key = device_2_home.get_public_key_and_username()
message_no_pn, message = 'No PN', 'Text push notification'
@ -99,7 +99,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
profile_2 = home_2.profile_button.click()
username_2 = profile_2.default_username_text.text
profile_2.get_back_to_home_view()
profile_2.home_button.click()
chat_2 = home_2.add_contact(public_key_1)
message_1 = 'test message'
@ -354,7 +354,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
home_1, home_2 = device_1.create_user(), device_2.create_user(enable_notifications=True)
profile_1 = home_1.profile_button.click()
default_username_1 = profile_1.default_username_text.text
home_1 = profile_1.get_back_to_home_view()
home_1 = profile_1.home_button.click()
public_key_2 = home_2.get_public_key_and_username()
chat_1 = home_1.add_contact(public_key_2)
chat_1.send_message('hey')
@ -396,7 +396,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
home_1, home_2 = device_1.create_user(), device_2.create_user()
profile_1 = home_1.profile_button.click()
default_username_1 = profile_1.default_username_text.text
home_1 = profile_1.get_back_to_home_view()
home_1 = profile_1.home_button.click()
public_key_2 = home_2.get_public_key_and_username()
home_2.home_button.click()
chat_1 = home_1.add_contact(public_key_2)
@ -478,7 +478,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
device_1_home, device_2_home = device_1.create_user(), device_2.create_user()
profile_2 = device_2_home.profile_button.click()
default_username_2 = profile_2.default_username_text.text
device_2_home = profile_2.get_back_to_home_view()
device_2_home = profile_2.home_button.click()
device_1_public_key = device_1_home.get_public_key_and_username()
device_1_home.home_button.click()
@ -515,7 +515,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
device_1_home, device_2_home = sign_in_1.create_user(), sign_in_2.create_user()
profile_2 = device_2_home.profile_button.click()
default_username_2 = profile_2.default_username_text.text
device_2_home = profile_2.get_back_to_home_view()
device_2_home = profile_2.home_button.click()
device_1_public_key = device_1_home.get_public_key_and_username()
device_1_home.home_button.click()
@ -780,7 +780,7 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
'In "%s" case chat input is not found after scanning, so no redirect to 1-1' % key)
if not chat_view.element_by_text(url_data[key]['username']).is_element_displayed():
self.errors.append('In "%s" case "%s" not found after scanning' % (key, url_data[key]['username']))
chat_view.back_button.click()
chat_view.get_back_to_home_view()
self.errors.verify_no_errors()
@marks.testrail_id(6322)
@ -809,17 +809,16 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
},
'own_profile_key': {
'url': user['public_key'],
'username': user['username']
},
'other_user_profile_key': {
'url': ens_user['public_key'],
'username': ens_user['username']
},
'validation_wrong_address_transaction': {
'wallet_validation_wrong_address_transaction': {
'url': 'ethereum:0x744d70fdbe2ba4cf95131626614a1763df805b9e@3/transfer?address=blablabla&uint256=1e10',
'error': 'Invalid address',
},
'eip_ens_for_receiver': {
'wallet_eip_ens_for_receiver': {
'url': 'ethereum:0xc55cf4b03948d7ebc8b9e8bad92643703811d162@3/transfer?address=nastya.stateofus.eth&uint256=1e-1',
'data': {
'asset': 'STT',
@ -827,7 +826,7 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
'address': '0x58d8…F2ff',
},
},
'eip_payment_link': {
'wallet_eip_payment_link': {
'url': 'ethereum:pay-0xc55cf4b03948d7ebc8b9e8bad92643703811d162@3/transfer?address=0x3d597789ea16054a084ac84ce87f50df9198f415&uint256=1e1',
'data': {
'amount': '10',
@ -870,18 +869,21 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
self.errors.append('In %s case block user button is not shown' % key)
if not chat_view.element_by_text(url_data[key]['username']).is_element_displayed():
self.errors.append('In %s case username not shown' % key)
if url_data[key].get('data'):
actual_data = send_transaction_view.get_values_from_send_transaction_bottom_sheet()
difference_in_data = url_data[key]['data'].items() - actual_data.items()
if difference_in_data:
self.errors.append(
'In %s case returned value does not match expected in %s' % (key, repr(difference_in_data)))
send_transaction_view.back_button.click()
if 'wallet' in key:
if url_data[key].get('data'):
actual_data = send_transaction_view.get_values_from_send_transaction_bottom_sheet()
difference_in_data = url_data[key]['data'].items() - actual_data.items()
if difference_in_data:
self.errors.append(
'In %s case returned value does not match expected in %s' % (key, repr(difference_in_data)))
wallet_view.close_send_transaction_view_button.click()
wallet_view.home_button.click()
if 'dapp' in key:
home_view.open_in_status_button.click()
if not chat_view.allow_button.is_element_displayed():
self.errors.append('No allow button is shown in case of navigating to Status dapp!')
chat_view.dapp_tab_button.click()
chat_view.home_button.click()
if 'public' in key:
if not chat_view.chat_message_input.is_element_displayed():
self.errors.append('No message input is shown in case of navigating to public chat via deep link!')

View File

@ -99,7 +99,6 @@ class TestDApps(SingleDeviceTestCase):
sign_in_view.just_fyi('add permission to Status account')
dapp_view.enter_url_editbox.click()
status_test_dapp = home_view.open_status_test_dapp()
sign_in_view.just_fyi('check that permissions from previous account was removed once you choose another')
dapp_view.select_account_button.click()
dapp_view.select_account_by_name(account_name).wait_for_element(30)
@ -125,6 +124,7 @@ class TestDApps(SingleDeviceTestCase):
profile_view.dapp_tab_button.click(desired_element_text='Accounts')
status_test_dapp.assets_button.click()
send_transaction_view = status_test_dapp.request_stt_button.click()
send_transaction_view.ok_got_it_button.click()
address = send_transaction_view.get_formatted_recipient_address(address)
if not send_transaction_view.element_by_text(address).is_element_displayed():
self.errors.append("Wallet address %s in not shown in 'From' on Send Transaction screen" % address)

View File

@ -55,29 +55,27 @@ class TestDeepLinks(SingleDeviceTestCase):
except NoSuchElementException:
self.driver.fail("DApp '%s' is not opened!" % dapp_name)
@marks.testrail_id(5780)
@marks.medium
def test_open_own_user_profile_using_deep_link(self):
sign_in_view = SignInView(self.driver)
sign_in_view.recover_access(passphrase=basic_user['passphrase'])
self.driver.close_app()
deep_link = 'status-im://u/%s' % basic_user['public_key']
sign_in_view.open_weblink_and_login(deep_link)
profile_view = sign_in_view.get_profile_view()
if profile_view.default_username_text.text != basic_user['username'] \
or not profile_view.contacts_button.is_element_displayed() \
or not profile_view.share_my_profile_button.is_element_displayed():
self.driver.fail("Own profile screen is not opened!")
@marks.testrail_id(5781)
@marks.medium
def test_deep_link_with_invalid_user_public_key(self):
def test_deep_link_with_invalid_user_public_key_own_profile_key(self):
sign_in_view = SignInView(self.driver)
sign_in_view.create_user()
sign_in_view.recover_access(passphrase=basic_user['passphrase'])
self.driver.close_app()
sign_in_view.just_fyi('Check that no error when opening invalid deep link')
deep_link = 'status-im://u/%s' % basic_user['public_key'][:-10]
sign_in_view.open_weblink_and_login(deep_link)
home_view = sign_in_view.get_home_view()
home_view.plus_button.click_until_presence_of_element(home_view.start_new_chat_button)
if not home_view.start_new_chat_button.is_element_present():
self.driver.fail("Can't navigate to start new chat after app opened from deep link with invalid public key")
self.errors.append("Can't navigate to start new chat after app opened from deep link with invalid public key")
self.driver.close_app()
sign_in_view.just_fyi('Check that no error when opening invalid deep link')
deep_link = 'status-im://u/%s' % basic_user['public_key']
sign_in_view.open_weblink_and_login(deep_link)
home_view.plus_button.click_until_presence_of_element(home_view.start_new_chat_button)
if not home_view.start_new_chat_button.is_element_present():
self.errors.append("Can't navigate to start new chat after app opened from deep link with own public key")
self.errors.verify_no_errors()

View File

@ -103,7 +103,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
status_test_dapp.allow_button.click()
if not status_test_dapp.element_by_text(user['public_key']).is_element_displayed():
self.errors.append('Public key is not returned')
status_test_dapp.dapp_tab_button.double_click()
status_test_dapp.get_empty_dapp_tab()
wallet = home.wallet_button.click()
wallet.set_up_wallet()

View File

@ -111,20 +111,20 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet_view.add_account(account_name, keycard=True)
wallet_view.just_fyi("Send transaction to new account")
wallet_view.accounts_status_account.click()
wallet_view.accounts_status_account.wait_and_click()
transaction_amount = '0.004'
initial_balance = self.network_api.get_balance(status_account_address)
send_transaction = wallet_view.send_transaction(account_name=account_name,
wallet_view.send_transaction(account_name=account_name,
amount=transaction_amount,
keycard=True)
self.network_api.wait_for_confirmation_of_transaction(status_account_address, transaction_amount)
self.network_api.verify_balance_is_updated(str(initial_balance), status_account_address)
wallet_view.just_fyi("Verifying previously sent transaction in new account")
send_transaction.back_button.click()
wallet_view.close_button.click()
wallet_view.get_account_by_name(account_name).click()
wallet_view.send_transaction_button.click()
wallet_view.back_button.click()
wallet_view.close_send_transaction_view_button.click()
balance_after_receiving_tx = float(wallet_view.get_asset_amount_by_name('ETH'))
expected_balance = self.network_api.get_rounded_balance(balance_after_receiving_tx, transaction_amount)
if balance_after_receiving_tx != expected_balance:
@ -140,7 +140,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
amount=transaction_amount_1,
keycard=True,
default_gas_price=True)
send_transaction.back_button.click()
wallet_view.close_button.click()
sub_account_address = wallet_view.get_wallet_address(account_name)[2:]
self.network_api.wait_for_confirmation_of_transaction(sub_account_address, transaction_amount_1)
wallet_view.find_transaction_in_history(amount=transaction_amount)
@ -152,7 +152,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
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.verify_balance_is_updated((updated_balance + transaction_amount_1), status_account_address)
send_transaction.back_button.click()
wallet_view.close_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
wallet_view.scan_tokens()

View File

@ -258,10 +258,10 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
self.network_api.verify_balance_is_updated(str(initial_balance), status_account_address)
wallet_view.just_fyi("Verifying previously sent transaction in new account")
wallet_view.back_button.click()
wallet_view.close_button.click()
wallet_view.get_account_by_name(account_name).click()
wallet_view.send_transaction_button.click()
wallet_view.back_button.click()
wallet_view.close_send_transaction_view_button.click()
balance_after_receiving_tx = float(wallet_view.get_asset_amount_by_name('ETH'))
expected_balance = self.network_api.get_rounded_balance(balance_after_receiving_tx, transaction_amount)
if balance_after_receiving_tx != expected_balance:
@ -271,10 +271,10 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet_view.just_fyi("Sending eth from new account to main account")
updated_balance = self.network_api.get_balance(status_account_address)
transaction_amount_1 = round(float(transaction_amount) * 0.2, 12)
send_transaction = wallet_view.send_transaction(account_name=wallet_view.status_account_name,
wallet_view.send_transaction(account_name=wallet_view.status_account_name,
amount=transaction_amount_1,
default_gas_price=True)
send_transaction.back_button.click()
wallet_view.close_button.click()
sub_account_address = wallet_view.get_wallet_address(account_name)[2:]
self.network_api.wait_for_confirmation_of_transaction(status_account_address, transaction_amount)
self.network_api.verify_balance_is_updated(updated_balance, status_account_address)
@ -287,7 +287,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
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.verify_balance_is_updated((updated_balance + transaction_amount_1), status_account_address)
send_transaction.back_button.click()
wallet_view.close_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
wallet_view.scan_tokens()
@ -322,8 +322,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet_view.account_color_button.select_color_by_position(1)
wallet_view.apply_settings_button.click()
wallet_view.element_by_text('This device').scroll_to_element()
wallet_view.back_button.click()
wallet_view.back_button.click()
wallet_view.close_button.click()
wallet_view.close_button.click()
account_button = wallet_view.get_account_by_name(account_name)
if not account_button.is_element_displayed():
self.driver.fail('Account name was not changed')
@ -338,8 +338,19 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
sign_in_view = SignInView(self.driver)
sign_in_view.recover_access(transaction_senders['C']['passphrase'])
wallet_view = sign_in_view.wallet_button.click()
wallet_view.set_up_wallet()
send_transaction_view = SendTransactionView(self.driver)
sign_in_view.just_fyi("Setting up wallet")
wallet_view.accounts_status_account.click_until_presence_of_element(wallet_view.send_transaction_button)
send_transaction = wallet_view.send_transaction_button.click()
send_transaction.set_recipient_address('0x%s' % basic_user['address'])
send_transaction.amount_edit_box.set_value("0")
send_transaction.confirm()
send_transaction.sign_transaction_button.click()
wallet_view.set_up_wallet_when_sending_tx()
wallet_view.cancel_button.click()
wallet_view.close_button.click()
url_data = {
'ens_for_receiver': {
'url': 'ethereum:0xc55cf4b03948d7ebc8b9e8bad92643703811d162@3/transfer?address=nastya.stateofus.eth&uint256=1e-1',
@ -426,8 +437,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
if not wallet_view.element_by_text_part(error).is_element_displayed():
self.errors.append(
'Expected error %s is not shown' % error)
if send_transaction_view.back_button.is_element_displayed():
send_transaction_view.back_button.wait_and_click()
if wallet_view.close_send_transaction_view_button.is_element_displayed():
wallet_view.close_send_transaction_view_button.wait_and_click()
else:
wallet_view.cancel_button.wait_and_click()
@ -617,7 +628,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
send_transaction.amount_edit_box.set_value(str(initial_amount_ADI) + '1')
if not send_transaction.element_by_text(errors['send_transaction_screen']['insufficient_funds']).is_element_displayed():
self.errors.append(warning % (errors['send_transaction_screen']['insufficient_funds'], screen))
send_transaction.back_button.click(2)
wallet_view.close_send_transaction_view_button.click()
wallet_view.close_button.click()
screen = 'sending screen from wallet'
sign_in_view.just_fyi('Checking %s on %s' % (errors['sending_screen']['Network fee'], screen))
@ -718,6 +730,6 @@ class TestTransactionWalletMultipleDevice(MultipleDeviceTestCase):
send_transaction_view.set_recipient_address(sender['address'])
send_transaction_view.sign_transaction_button.click()
send_transaction_view.sign_transaction()
wallet_view_receiver.back_button.click()
wallet_view_receiver.close_button.click()
initial_balance = float(initial_balance) + float(amount)
wallet_view_receiver.wait_balance_is_changed(asset='STT', initial_balance=str(initial_balance), scan_tokens=True)

View File

@ -182,8 +182,8 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
device_1_profile.backup_recovery_phrase_button.click()
device_1_profile.ok_continue_button.click()
recovery_phrase = device_1_profile.get_recovery_phrase()
device_1_profile.back_button.click()
device_1_profile.get_back_to_home_view()
device_1_profile.close_button.click()
device_1_profile.home_button.click()
device_3_home = device_3.create_user()
device_3_chat_key, device_3_username = device_3_home.get_public_key_and_username(return_username=True)
device_3.home_button.click()
@ -191,7 +191,7 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
device_1.just_fyi('Add contact, start group chat')
nickname = 'my_tester'
device_1_home.add_contact(device_3_chat_key,nickname=nickname)
device_1_home.back_button.click()
device_1_home.get_back_to_home_view()
device_1_chat = device_1_home.create_group_chat([device_3_username], group_chat_name)
device_3_chat = device_3_home.get_chat(group_chat_name).click()
device_3_chat.join_chat_button.click()

View File

@ -331,7 +331,7 @@ class Button(BaseElement):
def click_until_presence_of_element(self, desired_element, attempts=4):
counter = 0
self.driver.info('*Click until %s by %s:*`%s` *is presented*' % (self.name, self.by, self.locator))
self.driver.info('*Click until %s by %s:*`%s` *will be presented*' % (desired_element.name, desired_element.by, desired_element.locator))
while not desired_element.is_element_present(1) and counter <= attempts:
try:
self.find_element().click()

View File

@ -65,16 +65,19 @@ class HomeButton(TabButton):
return HomeView(self.driver)
def click(self, desired_view='home'):
element = None
from views.home_view import HomeView
from views.chat_view import ChatView
from views.home_view import HomeView
if desired_view == 'home':
ChatView(self.driver).get_back_to_home_view()
element = HomeView(self.driver).plus_button
if not element.is_element_displayed():
self.click_until_presence_of_element(element)
elif desired_view == 'chat':
element = ChatView(self.driver).chat_message_input
self.click_until_presence_of_element(element)
elif desired_view == 'other_user_profile':
element = ChatView(self.driver).profile_nickname
self.click_until_presence_of_element(element)
self.click_until_presence_of_element(element)
return self.navigate()
@ -87,10 +90,8 @@ class DappTabButton(TabButton):
return DappsView(self.driver)
def click(self, desired_element_text=None):
from views.dapps_view import DappsView
if desired_element_text is None:
self.click_until_presence_of_element(DappsView(self.driver).enter_url_editbox)
super().click()
elif desired_element_text == 'webview':
self.find_element().click()
else:
@ -508,15 +509,19 @@ class BaseView(object):
def get_back_to_home_view(self, times_to_click_on_back_btn=3):
counter = 0
while BackButton(self.driver).is_element_displayed(2):
while BackButton(self.driver).is_element_displayed(2) or self.close_button.is_element_displayed(2):
try:
if counter >= times_to_click_on_back_btn:
break
self.back_button.click()
if BackButton(self.driver).is_element_displayed(2):
self.back_button.click()
else:
self.close_button.click()
counter += 1
except (NoSuchElementException, TimeoutException):
continue
return self.home_button.click()
return self.get_home_view()
def relogin(self, password=common_password):
try:
@ -625,6 +630,14 @@ class BaseView(object):
self.ok_got_it_button.click()
return phrase
def get_empty_dapp_tab(self):
from views.web_views.base_web_view import BaseWebView
web_view = BaseWebView(self.driver)
web_view.options_button.click()
if web_view.new_tab_button.is_element_displayed():
web_view.new_tab_button.click()
return web_view
# Method-helper
def write_page_source_to_file(self, full_path_to_file):
string_source = self.driver.page_source

View File

@ -162,7 +162,7 @@ class HomeView(BaseView):
one_to_one_chat.chat_options.click()
one_to_one_chat.view_profile_button.click()
one_to_one_chat.set_nickname(nickname)
one_to_one_chat.back_button.click()
one_to_one_chat.close_button.click()
self.driver.info("**1-1 chat is created successfully!**")
return one_to_one_chat

View File

@ -312,6 +312,7 @@ class ProfileView(BaseView):
self.ropsten_chain_button.click()
self.ropsten_chain_button.click()
self.save_button.click()
self.element_by_text_part('custom_ropsten').scroll_to_element()
self.element_by_text_part('custom_ropsten').click_until_presence_of_element(self.connect_button)
self.connect_button.click()
self.confirm_button.click()

View File

@ -67,7 +67,7 @@ class SignWithKeycardButton(Button):
def click(self):
from views.keycard_view import KeycardView
self.click_until_presence_of_element(KeycardView(self.driver).one_button)
self.click_until_presence_of_element(KeycardView(self.driver).two_button)
return self.navigate()

View File

@ -213,8 +213,9 @@ class SignInView(BaseView):
from views.keycard_view import KeycardView
keycard_view = KeycardView(self.driver)
keycard_view.one_button.wait_for_visibility_of_element(10)
keycard_view.connect_selected_card_button.click()
keycard_view.enter_default_pin()
if keycard_view.connect_selected_card_button.is_element_displayed():
keycard_view.connect_selected_card_button.click()
else:
self.password_input.set_value(password)
self.sign_in_button.click()