Merge branch 'tests/e2e-fixes230921' into develop

This commit is contained in:
Churikova Tetiana 2021-09-24 13:09:26 +02:00
commit 76c5e7ce1e
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
10 changed files with 380 additions and 339 deletions

View File

@ -267,7 +267,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
chat.public_key_edit_box.send_keys(users[key]['contact_code']) chat.public_key_edit_box.send_keys(users[key]['contact_code'])
if 'nickname' in users[key]: if 'nickname' in users[key]:
chat.nickname_input_field.set_value(users[key]['nickname']) chat.nickname_input_field.set_value(users[key]['nickname'])
chat.confirm_until_presence_of_element(profile.contacts_button) chat.confirm_until_presence_of_element(profile.add_new_contact_button)
if not profile.element_by_text(users[key]['username']).is_element_displayed(): if not profile.element_by_text(users[key]['username']).is_element_displayed():
self.errors.append('In %s case username not found in contact view after scanning' % key) self.errors.append('In %s case username not found in contact view after scanning' % key)
if 'nickname' in users[key]: if 'nickname' in users[key]:
@ -936,107 +936,6 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
self.errors.append('History was not fetched after enabling use_history_node') self.errors.append('History was not fetched after enabling use_history_node')
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(5762)
@marks.high
def test_pair_devices_sync_one_to_one_contacts_nicknames_public_chat(self):
self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
home_1 = device_1.create_user()
home_1.profile_button.click()
profile_1 = home_1.get_profile_view()
profile_1.privacy_and_security_button.click()
profile_1.backup_recovery_phrase_button.click()
profile_1.ok_continue_button.click()
recovery_phrase = profile_1.get_recovery_phrase()
profile_1.close_button.click()
profile_1.home_button.click()
name_1 = 'device_%s' % device_1.driver.number
name_2 = 'device_%s' % device_2.driver.number
message_before_sync = 'sent before sync'
message_after_sync = 'sent after sync'
public_chat_before_sync = 'before-pairing'
public_chat_after_sync = 'after-pairing'
device_1.just_fyi('add contact, start 1-1 chat with basic user')
chat_1 = home_1.add_contact(basic_user['public_key'])
chat_1.chat_message_input.send_keys(message_before_sync)
chat_1.send_message_button.click()
device_1.just_fyi('join public chat')
chat_1.get_back_to_home_view()
device_1_public_chat = home_1.join_public_chat(public_chat_before_sync)
home_2 = device_2.recover_access(passphrase=' '.join(recovery_phrase.values()))
profile_1, device_2_profile = home_1.profile_button.click(), home_2.profile_button.click()
device_2.just_fyi('go to profile and set nickname for contact')
profile_1.open_contact_from_profile(basic_user['username'])
nickname = 'my_basic_user'
chat_1.set_nickname(nickname)
profile_1.close_button.click()
device_1.back_button.click()
device_2.just_fyi('go to profile > Devices, set device name, discover device 2 to device 1')
device_2_profile.discover_and_advertise_device(name_2)
profile_1.discover_and_advertise_device(name_1)
profile_1.get_toggle_device_by_name(name_2).wait_and_click()
profile_1.sync_all_button.click()
profile_1.sync_all_button.wait_for_visibility_of_element(15)
[device.profile_button.click() for device in (profile_1, device_2_profile)]
device_2.just_fyi('check that contact with nickname is appeared in Contact list')
device_2_profile.contacts_button.scroll_to_element(9, 'up')
device_2_profile.contacts_button.click()
for name in (basic_user['username'], nickname):
if not device_2_profile.element_by_text(name).is_element_displayed():
self.errors.append('"%s" is not found in Contacts after initial sync' % name)
device_1.just_fyi('send message to 1-1 chat with basic user and add another contact')
profile_1.home_button.click(desired_view='chat')
device_1_public_chat.back_button.click()
home_1.get_chat(nickname).click()
chat_1.chat_message_input.send_keys(message_after_sync)
chat_1.send_message_button.click()
chat_1.back_button.click()
home_1.add_contact(transaction_senders['A']['public_key'])
device_2.just_fyi('check that messages appeared in 1-1 chat, public chats and new contacts are synced')
if not device_2_profile.element_by_text(transaction_senders['A']['username']).is_element_displayed(60):
self.errors.append(
'"%s" is not found in Contacts after adding when devices are paired' % transaction_senders['A'][
'username'])
device_1.just_fyi('Set nickname for added contact and check that it will be synced')
home_1.profile_button.click()
profile_1.contacts_button.scroll_to_element(9, 'up')
profile_1.open_contact_from_profile(transaction_senders['A']['username'])
nickname_after_sync = 'my_transaction sender'
chat_1.set_nickname(nickname_after_sync)
profile_1.close_button.click()
device_1.home_button.click(desired_view='chat')
if not device_2_profile.element_by_text(nickname_after_sync).is_element_displayed(60):
self.errors.append(
'"%s" is not updated in Contacts after setting nickname when devices are paired' % nickname_after_sync)
device_2_profile.home_button.click()
if not home_2.element_by_text_part(public_chat_before_sync).is_element_displayed():
self.errors.append(
'"%s" is not found in Home after initial sync when devices are paired' % public_chat_before_sync)
chat = home_2.get_chat(nickname).click()
if chat.chat_element_by_text(message_before_sync).is_element_displayed():
self.errors.append('"%s" message sent before pairing is synced' % message_before_sync)
if not chat.chat_element_by_text(message_after_sync).is_element_displayed(60):
self.errors.append('"%s" message in 1-1 is not synced' % message_after_sync)
device_1.just_fyi('add new public chat and check that it will be synced with device2')
chat_1.get_back_to_home_view()
home_1.join_public_chat(public_chat_after_sync)
home_2 = chat.get_back_to_home_view()
if not home_2.element_by_text_part(public_chat_after_sync).is_element_displayed(20):
self.errors.append(
'"%s" public chat is not synced after adding when devices are paired' % public_chat_after_sync)
self.errors.verify_no_errors()
@marks.testrail_id(6226) @marks.testrail_id(6226)
@marks.critical @marks.critical
def test_ens_mentions_pn_and_nickname_in_public_and_1_1_chats(self): def test_ens_mentions_pn_and_nickname_in_public_and_1_1_chats(self):
@ -1115,7 +1014,6 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
home_2.just_fyi('set nickname and recheck username in 1-1 header, profile, options, contacts') home_2.just_fyi('set nickname and recheck username in 1-1 header, profile, options, contacts')
nickname = 'test user' + str(round(time())) nickname = 'test user' + str(round(time()))
public_2.set_nickname(nickname) public_2.set_nickname(nickname)
profile_2.close_button.click()
for name in (nickname, ens_name): for name in (nickname, ens_name):
if not profile_2.element_by_text(name).is_element_displayed(): if not profile_2.element_by_text(name).is_element_displayed():
self.errors.append('%s is not shown in contact list' % name) self.errors.append('%s is not shown in contact list' % name)

View File

@ -90,6 +90,8 @@ class TestWalletManagement(SingleDeviceTestCase):
@marks.testrail_id(5346) @marks.testrail_id(5346)
@marks.high @marks.high
@marks.skip
#TODO: skipped due to bug on status-go, should be enabled after 12615 merge
def test_collectible_from_wallet(self): def test_collectible_from_wallet(self):
passphrase = wallet_users['F']['passphrase'] passphrase = wallet_users['F']['passphrase']
home = SignInView(self.driver).recover_access(passphrase=passphrase) home = SignInView(self.driver).recover_access(passphrase=passphrase)

View File

@ -339,7 +339,6 @@ class TestChatManagement(SingleDeviceTestCase):
profile.open_contact_from_profile(dummy_user['username']) profile.open_contact_from_profile(dummy_user['username'])
nickname = 'dummy_user' nickname = 'dummy_user'
public_chat.set_nickname(nickname) public_chat.set_nickname(nickname)
public_chat.get_back_to_home_view()
public_chat.home_button.click() public_chat.home_button.click()
search_list = { search_list = {
@ -395,20 +394,20 @@ class TestChatManagement(SingleDeviceTestCase):
@marks.medium @marks.medium
def test_unblocked_user_is_not_added_in_contacts(self): def test_unblocked_user_is_not_added_in_contacts(self):
home = SignInView(self.driver).create_user() home = SignInView(self.driver).create_user()
chat_view = home.add_contact(basic_user["public_key"], add_in_contacts=False) chat = home.add_contact(basic_user["public_key"], add_in_contacts=False)
chat_view.just_fyi('Block user not added as contact from chat view') chat.just_fyi('Block user not added as contact from chat view')
chat_view.chat_options.click() chat.chat_options.click()
chat_view.view_profile_button.click() chat.view_profile_button.click()
chat_view.block_contact() chat.block_contact()
chat_view.get_back_to_home_view() chat.get_back_to_home_view()
chat_view.just_fyi('Unblock user not added as contact from chat view') chat.just_fyi('Unblock user not added as contact from chat view')
profile = home.profile_button.click() profile = home.profile_button.click()
profile.contacts_button.click() profile.contacts_button.click()
profile.blocked_users_button.click() profile.blocked_users_button.click()
profile.element_by_text(basic_user["username"]).click() profile.element_by_text(basic_user["username"]).click()
chat_view.unblock_contact_button.click() chat.unblock_contact_button.click()
profile.just_fyi('Navigating to contact list and check that user is not in list') profile.just_fyi('Navigating to contact list and check that user is not in list')
profile.close_button.click() profile.close_button.click()
@ -422,42 +421,42 @@ class TestChatManagement(SingleDeviceTestCase):
home = SignInView(self.driver).create_user() home = SignInView(self.driver).create_user()
home.just_fyi('Join to one-to-one chat and share link to other user profile via messenger') home.just_fyi('Join to one-to-one chat and share link to other user profile via messenger')
chat_view = home.add_contact(dummy_user["public_key"]) chat = home.add_contact(dummy_user["public_key"])
chat_view.chat_options.click() chat.chat_options.click()
chat_view.view_profile_button.click_until_presence_of_element(chat_view.remove_from_contacts) chat.view_profile_button.click_until_presence_of_element(chat.remove_from_contacts)
chat_view.profile_details.click() chat.profile_details.click()
chat_view.share_button.click() chat.share_button.click()
chat_view.share_via_messenger() chat.share_via_messenger()
if not chat_view.element_by_text_part( if not chat.element_by_text_part(
'https://join.status.im/u/%s' % dummy_user["public_key"]).is_element_present(): 'https://join.status.im/u/%s' % dummy_user["public_key"]).is_element_present():
self.errors.append("Can't share public key of contact") self.errors.append("Can't share public key of contact")
for _ in range(2): for _ in range(2):
chat_view.click_system_back_button() chat.click_system_back_button()
home.just_fyi('Join to public chat and share link to it via messenger') home.just_fyi('Join to public chat and share link to it via messenger')
chat_view.get_back_to_home_view() chat.get_back_to_home_view()
public_chat_name = 'pubchat' public_chat_name = 'pubchat'
public_chat = home.join_public_chat(public_chat_name) public_chat = home.join_public_chat(public_chat_name)
public_chat.chat_options.click() public_chat.chat_options.click()
public_chat.share_chat_button.click() public_chat.share_chat_button.click()
public_chat.share_via_messenger() public_chat.share_via_messenger()
if not chat_view.element_by_text_part('https://join.status.im/%s' % public_chat_name).is_element_present(): if not chat.element_by_text_part('https://join.status.im/%s' % public_chat_name).is_element_present():
self.errors.append("Can't share link to public chat") self.errors.append("Can't share link to public chat")
for _ in range(2): for _ in range(2):
chat_view.click_system_back_button() chat.click_system_back_button()
chat_view.get_back_to_home_view() chat.get_back_to_home_view()
home.just_fyi('Open URL and share link to it via messenger') home.just_fyi('Open URL and share link to it via messenger')
daap_view = home.dapp_tab_button.click() daap = home.dapp_tab_button.click()
browsing_view = daap_view.open_url('dap.ps') browser = daap.open_url('dap.ps')
browsing_view.options_button.click() browser.options_button.click()
browsing_view.share_url_button.click() browser.share_url_button.click()
browsing_view.share_via_messenger() browser.share_via_messenger()
expeceted_text_1 = 'https://join.status.im/b/https://dap.ps' expeceted_text_1 = 'https://join.status.im/b/https://dap.ps'
expeceted_text_2 = 'https://join.status.im/b/http://dap.ps' expeceted_text_2 = 'https://join.status.im/b/http://dap.ps'
if not (chat_view.element_by_text_part(expeceted_text_1).is_element_present() or if not (chat.element_by_text_part(expeceted_text_1).is_element_present() or
chat_view.element_by_text_part(expeceted_text_2).is_element_present()): chat.element_by_text_part(expeceted_text_2).is_element_present()):
self.errors.append("Can't share link to URL") self.errors.append("Can't share link to URL")
self.errors.verify_no_errors() self.errors.verify_no_errors()
@ -508,7 +507,6 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
device_1.just_fyi('Set nickname for user without adding him to contacts, check it in public chat') device_1.just_fyi('Set nickname for user without adding him to contacts, check it in public chat')
nickname = 'Name1' nickname = 'Name1'
chat_1.set_nickname(nickname) chat_1.set_nickname(nickname)
chat_1.close_button.click()
expected_username = '%s %s' % (nickname, username_2) expected_username = '%s %s' % (nickname, username_2)
if chat_element.username.text != expected_username: if chat_element.username.text != expected_username:
self.errors.append('Username %s in public chat does not match expected %s' % ( self.errors.append('Username %s in public chat does not match expected %s' % (
@ -617,7 +615,6 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
device_1.just_fyi('check that new messages from blocked user are not delivered') device_1.just_fyi('check that new messages from blocked user are not delivered')
self.drivers[0].launch_app() self.drivers[0].launch_app()
# device_1.accept_agreements()
device_1.sign_in() device_1.sign_in()
home_1.join_public_chat(chat_name) home_1.join_public_chat(chat_name)
for message in message_before_block_2, message_after_block_2: for message in message_before_block_2, message_after_block_2:
@ -984,7 +981,6 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
chat_1.view_profile_long_press(message) chat_1.view_profile_long_press(message)
nickname = 'nicknamefortestuser' nickname = 'nicknamefortestuser'
chat_1.set_nickname(nickname) chat_1.set_nickname(nickname)
chat_1.close_button.click()
ens_nickname_value = nickname + " @" + sender['ens'] ens_nickname_value = nickname + " @" + sender['ens']
chat_1.wait_ens_name_resolved_in_chat(message=message, username_value=ens_nickname_value) chat_1.wait_ens_name_resolved_in_chat(message=message, username_value=ens_nickname_value)

View File

@ -30,46 +30,46 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
home_1.add_contact(key_2) home_1.add_contact(key_2)
home_1.get_back_to_home_view() home_1.get_back_to_home_view()
device_1_chat = home_1.create_group_chat([username_2], chat_name) chat_1 = home_1.create_group_chat([username_2], chat_name)
create_system_message = device_1_chat.create_system_message(username_1, chat_name) create_system_message = chat_1.create_system_message(username_1, chat_name)
invite_system_message = device_1_chat.invite_system_message(username_1, username_2) invite_system_message = chat_1.invite_system_message(username_1, username_2)
join_system_message = device_1_chat.join_system_message(username_2) join_system_message = chat_1.join_system_message(username_2)
invited_to_join = device_1_chat.invited_to_join_system_message(username_1, chat_name) invited_to_join = chat_1.invited_to_join_system_message(username_1, chat_name)
create_for_admin_system_message = device_1_chat.create_for_admin_system_message(chat_name) create_for_admin_system_message = chat_1.create_for_admin_system_message(chat_name)
for message in [create_for_admin_system_message, create_system_message, invite_system_message]: for message in [create_for_admin_system_message, create_system_message, invite_system_message]:
if not device_1_chat.chat_element_by_text(message): if not chat_1.chat_element_by_text(message):
self.errors.append('%s system message is not shown' % message) self.errors.append('%s system message is not shown' % message)
device_2.just_fyi('Navigate to group chat, check system messages for member') device_2.just_fyi('Navigate to group chat, check system messages for member')
if not home_2.get_chat(chat_name).is_element_displayed(): if not home_2.get_chat(chat_name).is_element_displayed():
self.drivers[0].fail('Group chat was not created!') self.drivers[0].fail('Group chat was not created!')
device_2_chat = home_2.get_chat(chat_name).click() chat_2 = home_2.get_chat(chat_name).click()
for element in device_2_chat.join_chat_button, device_2_chat.decline_invitation_button: for element in chat_2.join_chat_button, chat_2.decline_invitation_button:
if not element.is_element_displayed(): if not element.is_element_displayed():
self.drivers[0].fail('"Join Chat" or "Decline" is not shown for member of group chat') self.drivers[0].fail('"Join Chat" or "Decline" is not shown for member of group chat')
for message in [invited_to_join, create_system_message, invite_system_message]: for message in [invited_to_join, create_system_message, invite_system_message]:
if not device_2_chat.chat_element_by_text(message): if not chat_2.chat_element_by_text(message):
self.errors.append('%s system message is not shown' % message) self.errors.append('%s system message is not shown' % message)
device_2.just_fyi('Join to group chat, check system messages and send messages to group chat, check message status is delivered') device_2.just_fyi('Join to group chat, check system messages and send messages to group chat, check message status is delivered')
device_2_chat.join_chat_button.click() chat_2.join_chat_button.click()
for chat in (device_1_chat, device_2_chat): for chat in (chat_1, chat_2):
if not chat.chat_element_by_text(join_system_message).is_element_displayed(30): if not chat.chat_element_by_text(join_system_message).is_element_displayed(30):
self.drivers[0].fail('System message after joining group chat is not shown') self.drivers[0].fail('System message after joining group chat is not shown')
device_2_chat.home_button.click(desired_view="home") chat_2.home_button.click(desired_view="home")
message_1 = "Message from device: %s" % device_1_chat.driver.number message_1 = "Message from device: %s" % chat_1.driver.number
device_1_chat.send_message(message_1) chat_1.send_message(message_1)
if device_1_chat.chat_element_by_text(message_1).status != 'delivered': if chat_1.chat_element_by_text(message_1).status != 'delivered':
self.errors.append('Message status is not delivered, it is %s!' % device_1_chat.chat_element_by_text(message_1).status) self.errors.append('Message status is not delivered, it is %s!' % chat_1.chat_element_by_text(message_1).status)
home_2.put_app_to_background() home_2.put_app_to_background()
home_2.just_fyi('check that PN is received and after tap you are redirected to public chat') home_2.just_fyi('check that PN is received and after tap you are redirected to public chat')
home_2.open_notification_bar() home_2.open_notification_bar()
home_2.element_by_text_part("Message from device: %s" % device_1_chat.driver.number).click() home_2.element_by_text_part("Message from device: %s" % chat_1.driver.number).click()
device_2_chat.send_message("Message from device: %s" % device_2_chat.driver.number) chat_2.send_message("Message from device: %s" % chat_2.driver.number)
for chat in (device_1_chat, device_2_chat): for chat in (chat_1, chat_2):
for chat_driver in (device_1_chat, device_2_chat): for chat_driver in (chat_1, chat_2):
if not chat.chat_element_by_text( if not chat.chat_element_by_text(
"Message from device: %s" % chat_driver.driver.number).is_element_displayed(): "Message from device: %s" % chat_driver.driver.number).is_element_displayed():
self.errors.append("Message from device '%s' was not received" % chat_driver.driver.number) self.errors.append("Message from device '%s' was not received" % chat_driver.driver.number)
@ -82,32 +82,32 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
self.create_drivers(2) self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
device_1_home, device_2_home = device_1.create_user(), device_2.create_user() home_1, home_2 = device_1.create_user(), device_2.create_user()
chat_name = device_1_home.get_random_chat_name() chat_name = home_1.get_random_chat_name()
device_2.just_fyi('Create and join group chat') device_2.just_fyi('Create and join group chat')
device_2_key, device_2_username = device_2.get_public_key_and_username(True) public_key_2, username_2 = device_2.get_public_key_and_username(True)
device_2.home_button.click() device_2.home_button.click()
device_1_home.add_contact(device_2_key) home_1.add_contact(public_key_2)
device_1_home.get_back_to_home_view() home_1.get_back_to_home_view()
device_1_chat = device_1_home.create_group_chat([device_2_username], chat_name) chat_1 = home_1.create_group_chat([username_2], chat_name)
left_system_message = device_1_chat.leave_system_message(device_2_username) left_system_message = chat_1.leave_system_message(username_2)
device_2_chat = device_2_home.get_chat(chat_name).click() chat_2 = home_2.get_chat(chat_name).click()
device_2_chat.join_chat_button.click() chat_2.join_chat_button.click()
device_2.just_fyi('Send several message and leave chat') device_2.just_fyi('Send several message and leave chat')
for chat in device_1_chat, device_2_chat: for chat in chat_1, chat_2:
chat.send_message('sent before leaving') chat.send_message('sent before leaving')
device_2_chat.leave_chat_via_group_info() chat_2.leave_chat_via_group_info()
if not device_1_chat.chat_element_by_text(left_system_message).is_element_displayed(): if not chat_1.chat_element_by_text(left_system_message).is_element_displayed():
self.errors.append('No system message after user left the group chat') self.errors.append('No system message after user left the group chat')
if device_2_home.element_by_text(chat_name).is_element_displayed(): if home_2.element_by_text(chat_name).is_element_displayed():
self.errors.append("Group chat '%s' is shown, but user has left" % chat_name) self.errors.append("Group chat '%s' is shown, but user has left" % chat_name)
device_2.just_fyi('Send message after user is left and check that it is not reappeared') device_2.just_fyi('Send message after user is left and check that it is not reappeared')
message = 'sent after leaving' message = 'sent after leaving'
device_1_chat.send_message(message) chat_1.send_message(message)
if device_2_home.element_by_text(chat_name).is_element_displayed(): if home_2.element_by_text(chat_name).is_element_displayed():
self.errors.append("Group chat '%s' reappeared when new message is sent" % chat_name) self.errors.append("Group chat '%s' reappeared when new message is sent" % chat_name)
self.errors.verify_no_errors() self.errors.verify_no_errors()
@ -116,28 +116,28 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
def test_decline_invitation_to_group_chat(self): def test_decline_invitation_to_group_chat(self):
self.create_drivers(2) self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
device_1_home, device_2_home = device_1.create_user(), device_2.create_user() home_1, home_2 = device_1.create_user(), device_2.create_user()
chat_name = device_1_home.get_random_chat_name() chat_name = home_1.get_random_chat_name()
device_1_home.plus_button.click() home_1.plus_button.click()
device_2.just_fyi('Create group chat with new user') device_2.just_fyi('Create group chat with new user')
device_2_key, device_2_username = device_2.get_public_key_and_username(True) public_key_2, username_2 = device_2.get_public_key_and_username(True)
device_2.home_button.click() device_2.home_button.click()
device_1_home.add_contact(device_2_key) home_1.add_contact(public_key_2)
device_1_home.get_back_to_home_view() home_1.get_back_to_home_view()
device_1_chat = device_1_home.create_group_chat([device_2_username], chat_name) chat_1 = home_1.create_group_chat([username_2], chat_name)
device_2_chat = device_2_home.get_chat(chat_name).click() chat_2 = home_2.get_chat(chat_name).click()
device_2_chat.decline_invitation_button.click() chat_2.decline_invitation_button.click()
left_system_message = device_2_chat.leave_system_message(device_2_username) left_system_message = chat_2.leave_system_message(username_2)
if device_1_chat.chat_element_by_text(left_system_message).is_element_displayed(): if chat_1.chat_element_by_text(left_system_message).is_element_displayed():
self.errors.append('System message after user left the group chat is shown if declined before accepting in Activity Centre') self.errors.append('System message after user left the group chat is shown if declined before accepting in Activity Centre')
if device_2_home.element_by_text(chat_name).is_element_displayed(): if home_2.element_by_text(chat_name).is_element_displayed():
self.errors.append("Group chat '%s' is shown, but user has left" % chat_name) self.errors.append("Group chat '%s' is shown, but user has left" % chat_name)
device_2.just_fyi('Send message after invite is declined and check that it is not reappeared') device_2.just_fyi('Send message after invite is declined and check that it is not reappeared')
message = 'sent after leaving' message = 'sent after leaving'
device_1_chat.send_message(message) chat_1.send_message(message)
if device_2_home.element_by_text(chat_name).is_element_displayed(): if home_2.element_by_text(chat_name).is_element_displayed():
self.errors.append("Group chat '%s' reappeared when new message is sent" % chat_name) self.errors.append("Group chat '%s' reappeared when new message is sent" % chat_name)
self.errors.verify_no_errors() self.errors.verify_no_errors()
@ -147,48 +147,48 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
def test_make_admin_member_of_group_chat(self): def test_make_admin_member_of_group_chat(self):
self.create_drivers(2) self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
device_1_home, device_2_home = device_1.create_user(), device_2.create_user() home_1, home_2 = device_1.create_user(), device_2.create_user()
device_1_key, device_1_username = device_1.get_public_key_and_username(True) public_key_1, username_1 = device_1.get_public_key_and_username(True)
device_1.home_button.click() device_1.home_button.click()
chat_name = device_1_home.get_random_chat_name() chat_name = home_1.get_random_chat_name()
device_2.just_fyi('Create and join to group chat') device_2.just_fyi('Create and join to group chat')
device_2_key, device_2_username = device_2.get_public_key_and_username(True) device_2_key, device_2_username = device_2.get_public_key_and_username(True)
device_2.home_button.click() device_2.home_button.click()
device_1_home.add_contact(device_2_key) home_1.add_contact(device_2_key)
device_1_home.get_back_to_home_view() home_1.get_back_to_home_view()
device_1_chat = device_1_home.create_group_chat([device_2_username], chat_name) chat_1 = home_1.create_group_chat([device_2_username], chat_name)
device_2_chat = device_2_home.get_chat(chat_name).click() chat_2 = home_2.get_chat(chat_name).click()
device_2_chat.join_chat_button.click() chat_2.join_chat_button.click()
device_1.just_fyi('Check group info view and options of users') device_1.just_fyi('Check group info view and options of users')
device_1_chat.chat_options.click() chat_1.chat_options.click()
group_info_view = device_1_chat.group_info.click() group_info_1 = chat_1.group_info.click()
if not group_info_view.user_admin(device_1_username).is_element_displayed(): if not group_info_1.user_admin(username_1).is_element_displayed():
self.errors.append("Admin user is not marked as admin") self.errors.append("Admin user is not marked as admin")
group_info_view.get_user_from_group_info(device_1_username).click() group_info_1.get_user_from_group_info(username_1).click()
if device_1_chat.profile_block_contact.is_element_displayed(): if chat_1.profile_block_contact.is_element_displayed():
self.errors.append("Admin is redirected to own profile on tapping own username from group info") self.errors.append("Admin is redirected to own profile on tapping own username from group info")
group_info_view.get_user_from_group_info(device_2_username).click() group_info_1.get_user_from_group_info(device_2_username).click()
if not device_1_chat.profile_block_contact.is_element_displayed(): if not chat_1.profile_block_contact.is_element_displayed():
self.errors.append("Admin is not redirected to user profile on tapping member username from group info") self.errors.append("Admin is not redirected to user profile on tapping member username from group info")
device_1_chat.close_button.click() chat_1.close_button.click()
device_1.just_fyi('Made admin another user and check system message') device_1.just_fyi('Made admin another user and check system message')
options = group_info_view.get_username_options(device_2_username).click() options = group_info_1.get_username_options(device_2_username).click()
options.make_admin_button.click() options.make_admin_button.click()
admin_system_message = device_1_chat.has_been_made_admin_system_message(device_1_username, device_2_username) admin_system_message = chat_1.has_been_made_admin_system_message(username_1, device_2_username)
for chat in (device_1_chat, device_2_chat): for chat in (chat_1, chat_2):
if not chat.chat_element_by_text(admin_system_message).is_element_displayed(): if not chat.chat_element_by_text(admin_system_message).is_element_displayed():
self.errors.append("Message with test '%s' was not received" % admin_system_message) self.errors.append("Message with test '%s' was not received" % admin_system_message)
device_2.just_fyi('Check Admin in group info and that "add members" is available') device_2.just_fyi('Check Admin in group info and that "add members" is available')
device_2_chat.chat_options.click() chat_2.chat_options.click()
group_info_view = device_2_chat.group_info.click() group_info_1 = chat_2.group_info.click()
for username in (device_1_username, device_2_username): for username in (username_1, device_2_username):
if not group_info_view.user_admin(username).is_element_displayed(): if not group_info_1.user_admin(username).is_element_displayed():
self.errors.append("Admin user is not marked as admin") self.errors.append("Admin user is not marked as admin")
if not group_info_view.add_members.is_element_displayed(): if not group_info_1.add_members.is_element_displayed():
self.errors.append("Add member button is not available for new admin") self.errors.append("Add member button is not available for new admin")
self.errors.verify_no_errors() self.errors.verify_no_errors()
@ -198,18 +198,18 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
def test_rename_group_chat(self): def test_rename_group_chat(self):
self.create_drivers(2) self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
device_1_home, device_2_home = device_1.create_user(), device_2.create_user() home_1, home_2 = device_1.create_user(), device_2.create_user()
device_1_key, device_1_username = device_1.get_public_key_and_username(True) device_1_key, device_1_username = device_1.get_public_key_and_username(True)
device_1.home_button.click() device_1.home_button.click()
initial_chat_name = device_1_home.get_random_chat_name() initial_chat_name = home_1.get_random_chat_name()
device_2.just_fyi('Create and join group chat') device_2.just_fyi('Create and join group chat')
device_2_key, device_2_username = device_2.get_public_key_and_username(True) public_key_2, username_2 = device_2.get_public_key_and_username(True)
device_2.home_button.click() device_2.home_button.click()
device_1_home.add_contact(device_2_key) home_1.add_contact(public_key_2)
device_1_home.get_back_to_home_view() home_1.get_back_to_home_view()
device_1_chat = device_1_home.create_group_chat([device_2_username], initial_chat_name) device_1_chat = home_1.create_group_chat([username_2], initial_chat_name)
device_2_chat = device_2_home.get_chat(initial_chat_name).click() device_2_chat = home_2.get_chat(initial_chat_name).click()
device_2_chat.join_chat_button.click() device_2_chat.join_chat_button.click()
device_2.just_fyi('Rename chat and check system messages') device_2.just_fyi('Rename chat and check system messages')
@ -223,7 +223,7 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
device_2.just_fyi('Check that you can navigate to renamed chat') device_2.just_fyi('Check that you can navigate to renamed chat')
device_2_chat.back_button.click() device_2_chat.back_button.click()
device_2_home.get_chat(new_chat_name).click() home_2.get_chat(new_chat_name).click()
self.errors.verify_no_errors() self.errors.verify_no_errors()
@ -288,7 +288,7 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
nickname = 'funny_bunny' nickname = 'funny_bunny'
device_2_options = chat_1.get_user_options(full_ens) device_2_options = chat_1.get_user_options(full_ens)
device_2_options.view_profile_button.click() device_2_options.view_profile_button.click()
chat_1.set_nickname(nickname) chat_1.set_nickname(nickname, close_profile=False)
if not chat_1.element_by_text(nickname).is_element_displayed(): if not chat_1.element_by_text(nickname).is_element_displayed():
self.errors.append('Nickname is not shown in profile view after setting from group info') self.errors.append('Nickname is not shown in profile view after setting from group info')
chat_1.close_button.click() chat_1.close_button.click()
@ -334,40 +334,40 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
def test_block_and_unblock_user_from_group_chat_via_group_info(self): def test_block_and_unblock_user_from_group_chat_via_group_info(self):
self.create_drivers(2) self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
device_1_home, device_2_home = device_1.create_user(), device_2.create_user() home_1, home_2 = device_1.create_user(), device_2.create_user()
initial_chat_name = device_1_home.get_random_chat_name() initial_chat_name = home_1.get_random_chat_name()
device_2.just_fyi('Create and join group chat') device_2.just_fyi('Create and join group chat')
device_2_key, device_2_username = device_2.get_public_key_and_username(True) public_key_2, username_2 = device_2.get_public_key_and_username(True)
device_2.home_button.click() device_2.home_button.click()
device_1_home.add_contact(device_2_key) home_1.add_contact(public_key_2)
device_1_home.get_back_to_home_view() home_1.get_back_to_home_view()
device_1_chat = device_1_home.create_group_chat([device_2_username], initial_chat_name) chat_1 = home_1.create_group_chat([username_2], initial_chat_name)
device_2_chat = device_2_home.get_chat(initial_chat_name).click() chat_2 = home_2.get_chat(initial_chat_name).click()
device_2_chat.join_chat_button.click() chat_2.join_chat_button.click()
device_2.just_fyi('Send message and block user via Group Info') device_2.just_fyi('Send message and block user via Group Info')
message_before_block = 'message from device2' message_before_block = 'message from device2'
device_2_chat.send_message(message_before_block) chat_2.send_message(message_before_block)
device_2_options = device_1_chat.get_user_options(device_2_username) options_2 = chat_1.get_user_options(username_2)
device_2_options.view_profile_button.click() options_2.view_profile_button.click()
device_2_options.block_contact() options_2.block_contact()
device_1_home.close_button.click() home_1.close_button.click()
if device_1_chat.chat_element_by_text(message_before_block).is_element_displayed(10): if chat_1.chat_element_by_text(message_before_block).is_element_displayed(10):
self.errors.append('User was blocked, but past message are shown') self.errors.append('User was blocked, but past message are shown')
message_after_block = 'message from device2 after block' message_after_block = 'message from device2 after block'
device_2_chat.send_message(message_after_block) chat_2.send_message(message_after_block)
if device_1_chat.chat_element_by_text(message_after_block).is_element_displayed(10): if chat_1.chat_element_by_text(message_after_block).is_element_displayed(10):
self.errors.append('User was blocked, but new messages still received') self.errors.append('User was blocked, but new messages still received')
device_1.just_fyi('Unblock user via group info and check that new messages will arrive') device_1.just_fyi('Unblock user via group info and check that new messages will arrive')
device_2_options = device_1_chat.get_user_options(device_2_username) options_2 = chat_1.get_user_options(username_2)
device_2_options.view_profile_button.click() options_2.view_profile_button.click()
device_2_options.unblock_contact_button.click() options_2.unblock_contact_button.click()
[device_2_options.close_button.click() for _ in range(2)] [options_2.close_button.click() for _ in range(2)]
message_after_unblock = 'message from device2 after unblock' message_after_unblock = 'message from device2 after unblock'
device_2_chat.send_message(message_after_unblock) chat_2.send_message(message_after_unblock)
if not device_1_chat.chat_element_by_text(message_after_unblock).is_element_displayed(20): if not chat_1.chat_element_by_text(message_after_unblock).is_element_displayed(20):
self.errors.append('User was unblocked, but new messages are not received') self.errors.append('User was unblocked, but new messages are not received')
self.errors.verify_no_errors() self.errors.verify_no_errors()

View File

@ -542,8 +542,8 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
home_1.just_fyi("Grant another user with admin rights and check he can unpin message now") home_1.just_fyi("Grant another user with admin rights and check he can unpin message now")
group_chat_1.chat_options.click() group_chat_1.chat_options.click()
group_info_view = group_chat_1.group_info.click() group_info = group_chat_1.group_info.click()
options = group_info_view.get_username_options(username_2).click() options = group_info.get_username_options(username_2).click()
options.make_admin_button.click() options.make_admin_button.click()
group_chat_2.click_system_back_button() group_chat_2.click_system_back_button()
group_chat_2.pin_message(message_1, action="unpin") group_chat_2.pin_message(message_1, action="unpin")
@ -887,12 +887,12 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
@marks.critical @marks.critical
def test_can_use_purchased_stickers_on_recovered_account(self): def test_can_use_purchased_stickers_on_recovered_account(self):
sign_in = SignInView(self.driver) sign_in = SignInView(self.driver)
home_view = sign_in.recover_access(ens_user['passphrase']) home = sign_in.recover_access(ens_user['passphrase'])
profile = home_view.profile_button.click() profile = home.profile_button.click()
profile.switch_network() profile.switch_network()
sign_in.just_fyi('join to public chat, buy and install stickers') sign_in.just_fyi('join to public chat, buy and install stickers')
chat = home_view.join_public_chat(home_view.get_random_chat_name()) chat = home.join_public_chat(home.get_random_chat_name())
chat.install_sticker_pack_by_name('Tozemoon') chat.install_sticker_pack_by_name('Tozemoon')
sign_in.just_fyi('check that can use installed pack') sign_in.just_fyi('check that can use installed pack')
@ -931,7 +931,6 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
home.just_fyi('Set nickname and mention user by nickname in 1-1 chat') home.just_fyi('Set nickname and mention user by nickname in 1-1 chat')
russian_nickname = 'МОЙ дорогой ДРУх' russian_nickname = 'МОЙ дорогой ДРУх'
chat.set_nickname(russian_nickname) chat.set_nickname(russian_nickname)
chat.close_button.click()
chat.select_mention_from_suggestion_list(russian_nickname + ' @' + ens) chat.select_mention_from_suggestion_list(russian_nickname + ' @' + ens)
chat.chat_element_by_text('%s hey!' % russian_nickname).click() chat.chat_element_by_text('%s hey!' % russian_nickname).click()
if not chat.profile_block_contact.is_element_displayed(): if not chat.profile_block_contact.is_element_displayed():

View File

@ -66,7 +66,9 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
self.driver.reset() self.driver.reset()
sign_in.just_fyi('Keycard: checking if balance will be restored after going back online') sign_in.just_fyi('Keycard: checking if balance will be restored after going back online')
self.driver.close_app()
sign_in.toggle_airplane_mode() sign_in.toggle_airplane_mode()
self.driver.launch_app()
sign_in.recover_access(sender['passphrase'], keycard=True) sign_in.recover_access(sender['passphrase'], keycard=True)
sign_in.toggle_airplane_mode() sign_in.toggle_airplane_mode()
wallet = home.wallet_button.click() wallet = home.wallet_button.click()
@ -78,12 +80,10 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
def test_send_eth_from_wallet_incorrect_address(self): def test_send_eth_from_wallet_incorrect_address(self):
recipient = basic_user recipient = basic_user
sender = wallet_users['B'] sender = wallet_users['B']
sign_in_view = SignInView(self.driver) home = SignInView(self.driver).recover_access(sender['passphrase'])
sign_in_view.recover_access(sender['passphrase']) wallet = home.wallet_button.click()
home_view = sign_in_view.get_home_view() wallet.accounts_status_account.click()
wallet_view = home_view.wallet_button.click() send_transaction = wallet.send_transaction_button.click()
wallet_view.accounts_status_account.click()
send_transaction = wallet_view.send_transaction_button.click()
send_transaction.amount_edit_box.click() send_transaction.amount_edit_box.click()
transaction_amount = send_transaction.get_unique_amount() transaction_amount = send_transaction.get_unique_amount()
send_transaction.amount_edit_box.set_value(transaction_amount) send_transaction.amount_edit_box.set_value(transaction_amount)
@ -99,19 +99,16 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
@marks.critical @marks.critical
@marks.transaction @marks.transaction
def test_send_token_with_7_decimals(self): def test_send_token_with_7_decimals(self):
sender = transaction_senders['S'] sender, recipient = transaction_senders['S'], basic_user
recipient = basic_user home = SignInView(self.driver).recover_access(sender['passphrase'])
sign_in_view = SignInView(self.driver) wallet = home.wallet_button.click()
sign_in_view.recover_access(sender['passphrase']) wallet.wait_balance_is_changed(asset='ADI', scan_tokens=True)
home_view = sign_in_view.get_home_view() wallet.accounts_status_account.click()
wallet_view = home_view.wallet_button.click()
wallet_view.wait_balance_is_changed(asset='ADI', scan_tokens=True)
wallet_view.accounts_status_account.click()
amount = '0.000%s' % str(random.randint(100, 999)) + '1' amount = '0.000%s' % str(random.randint(100, 999)) + '1'
wallet_view.send_transaction(amount=amount, wallet.send_transaction(amount=amount,
recipient='0x%s' % recipient['address'], recipient='0x%s' % recipient['address'],
asset_name='ADI') asset_name='ADI')
transaction = wallet_view.find_transaction_in_history(amount=amount, asset='ADI', return_hash=True) transaction = wallet.find_transaction_in_history(amount=amount, asset='ADI', return_hash=True)
self.network_api.find_transaction_by_hash(transaction) self.network_api.find_transaction_by_hash(transaction)
@ -120,16 +117,14 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
@marks.transaction @marks.transaction
def test_insufficient_funds_wallet_positive_balance(self): def test_insufficient_funds_wallet_positive_balance(self):
sender = wallet_users['E'] sender = wallet_users['E']
sign_in_view = SignInView(self.driver) home = SignInView(self.driver).recover_access(sender['passphrase'])
sign_in_view.recover_access(sender['passphrase']) wallet = home.wallet_button.click()
wallet_view = sign_in_view.wallet_button.click() [wallet.wait_balance_is_changed(asset) for asset in ['ETH', 'STT']]
[wallet_view.wait_balance_is_changed(asset) for asset in ['ETH', 'STT']] eth_value, stt_value = wallet.get_asset_amount_by_name('ETH'), wallet.get_asset_amount_by_name('STT')
eth_value = wallet_view.get_asset_amount_by_name('ETH')
stt_value = wallet_view.get_asset_amount_by_name('STT')
if eth_value == 0 or stt_value == 0: if eth_value == 0 or stt_value == 0:
self.driver.fail('No funds!') self.driver.fail('No funds!')
wallet_view.accounts_status_account.click() wallet.accounts_status_account.click()
send_transaction = wallet_view.send_transaction_button.click() send_transaction = wallet.send_transaction_button.click()
send_transaction.amount_edit_box.set_value(round(eth_value + 1)) send_transaction.amount_edit_box.set_value(round(eth_value + 1))
error_text = send_transaction.element_by_text('Insufficient funds') error_text = send_transaction.element_by_text('Insufficient funds')
if not error_text.is_element_displayed(): if not error_text.is_element_displayed():
@ -192,12 +187,11 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
@marks.medium @marks.medium
@marks.transaction @marks.transaction
def test_set_currency(self): def test_set_currency(self):
sign_in_view = SignInView(self.driver) home = SignInView(self.driver).create_user()
user_currency = 'Euro (EUR)' user_currency = 'Euro (EUR)'
sign_in_view.create_user() wallet = home.wallet_button.click()
wallet_view = sign_in_view.wallet_button.click() wallet.set_currency(user_currency)
wallet_view.set_currency(user_currency) if not wallet.element_by_text_part('EUR').is_element_displayed(20):
if not wallet_view.element_by_text_part('EUR').is_element_displayed(20):
self.driver.fail('EUR currency is not displayed') self.driver.fail('EUR currency is not displayed')
@marks.testrail_id(5407) @marks.testrail_id(5407)
@ -324,22 +318,22 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
@marks.medium @marks.medium
@marks.transaction @marks.transaction
def test_can_scan_eip_681_links(self): def test_can_scan_eip_681_links(self):
sign_in_view = SignInView(self.driver) sign_in = SignInView(self.driver)
sign_in_view.recover_access(transaction_senders['C']['passphrase']) sign_in.recover_access(transaction_senders['C']['passphrase'])
wallet_view = sign_in_view.wallet_button.click() wallet = sign_in.wallet_button.click()
wallet_view.wait_balance_is_changed() wallet.wait_balance_is_changed()
send_transaction_view = SendTransactionView(self.driver) send_transaction_view = SendTransactionView(self.driver)
sign_in_view.just_fyi("Setting up wallet") sign_in.just_fyi("Setting up wallet")
wallet_view.accounts_status_account.click_until_presence_of_element(wallet_view.send_transaction_button) wallet.accounts_status_account.click_until_presence_of_element(wallet.send_transaction_button)
send_transaction = wallet_view.send_transaction_button.click() send_transaction = wallet.send_transaction_button.click()
send_transaction.set_recipient_address('0x%s' % basic_user['address']) send_transaction.set_recipient_address('0x%s' % basic_user['address'])
send_transaction.amount_edit_box.set_value("0") send_transaction.amount_edit_box.set_value("0")
send_transaction.confirm() send_transaction.confirm()
send_transaction.sign_transaction_button.click() send_transaction.sign_transaction_button.click()
wallet_view.set_up_wallet_when_sending_tx() wallet.set_up_wallet_when_sending_tx()
wallet_view.cancel_button.click() wallet.cancel_button.click()
wallet_view.close_button.click() wallet.close_button.click()
url_data = { url_data = {
'ens_for_receiver': { 'ens_for_receiver': {
@ -404,15 +398,15 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
} }
for key in url_data: for key in url_data:
wallet_view.just_fyi('Checking %s case' % key) wallet.just_fyi('Checking %s case' % key)
wallet_view.scan_qr_button.click() wallet.scan_qr_button.click()
if wallet_view.allow_button.is_element_displayed(): if wallet.allow_button.is_element_displayed():
wallet_view.allow_button.click() wallet.allow_button.click()
wallet_view.enter_qr_edit_box.scan_qr(url_data[key]['url']) wallet.enter_qr_edit_box.scan_qr(url_data[key]['url'])
if url_data[key].get('error'): if url_data[key].get('error'):
if not wallet_view.element_by_text_part(url_data[key]['error']).is_element_displayed(): if not wallet.element_by_text_part(url_data[key]['error']).is_element_displayed():
self.errors.append('Expected error %s is not shown' % url_data[key]['error']) self.errors.append('Expected error %s is not shown' % url_data[key]['error'])
wallet_view.ok_button.click() wallet.ok_button.click()
if url_data[key].get('data'): if url_data[key].get('data'):
actual_data = send_transaction_view.get_values_from_send_transaction_bottom_sheet() actual_data = send_transaction_view.get_values_from_send_transaction_bottom_sheet()
difference_in_data = url_data[key]['data'].items() - actual_data.items() difference_in_data = url_data[key]['data'].items() - actual_data.items()
@ -421,13 +415,13 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
'In %s case returned value does not match expected in %s' % (key, repr(difference_in_data))) 'In %s case returned value does not match expected in %s' % (key, repr(difference_in_data)))
if url_data[key].get('send_transaction_validation_error'): if url_data[key].get('send_transaction_validation_error'):
error = url_data[key]['send_transaction_validation_error'] error = url_data[key]['send_transaction_validation_error']
if not wallet_view.element_by_text_part(error).is_element_displayed(): if not wallet.element_by_text_part(error).is_element_displayed():
self.errors.append( self.errors.append(
'Expected error %s is not shown' % error) 'Expected error %s is not shown' % error)
if wallet_view.close_send_transaction_view_button.is_element_displayed(): if wallet.close_send_transaction_view_button.is_element_displayed():
wallet_view.close_send_transaction_view_button.wait_and_click() wallet.close_send_transaction_view_button.wait_and_click()
else: else:
wallet_view.cancel_button.wait_and_click() wallet.cancel_button.wait_and_click()
self.errors.verify_no_errors() self.errors.verify_no_errors()
@ -435,16 +429,12 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
@marks.high @marks.high
@marks.transaction @marks.transaction
def test_send_transaction_with_custom_token(self): def test_send_transaction_with_custom_token(self):
contract_address = '0x101848D5C5bBca18E6b4431eEdF6B95E9ADF82FA' contract_address, name, symbol, decimals = '0x101848D5C5bBca18E6b4431eEdF6B95E9ADF82FA', 'Weenus 💪', 'WEENUS', '18'
name = 'Weenus 💪' home = SignInView(self.driver).recover_access(wallet_users['B']['passphrase'])
symbol = 'WEENUS' wallet = home.wallet_button.click()
decimals = '18' wallet.multiaccount_more_options.click()
sign_in_view = SignInView(self.driver) wallet.manage_assets_button.click()
sign_in_view.recover_access(wallet_users['B']['passphrase']) token_view = wallet.add_custom_token_button.click()
wallet_view = sign_in_view.wallet_button.click()
wallet_view.multiaccount_more_options.click()
wallet_view.manage_assets_button.click()
token_view = wallet_view.add_custom_token_button.click()
token_view.contract_address_input.send_keys(contract_address) token_view.contract_address_input.send_keys(contract_address)
if token_view.name_input.text != name: if token_view.name_input.text != name:
self.errors.append('Name for custom token was not set') self.errors.append('Name for custom token was not set')
@ -454,16 +444,16 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
self.errors.append('Decimals for custom token was not set') self.errors.append('Decimals for custom token was not set')
token_view.add_button.click() token_view.add_button.click()
token_view.close_button.click() token_view.close_button.click()
wallet_view.asset_by_name(symbol).scroll_to_element() wallet.asset_by_name(symbol).scroll_to_element()
if not wallet_view.asset_by_name(symbol).is_element_displayed(): if not wallet.asset_by_name(symbol).is_element_displayed():
self.errors.append('Custom token is not shown on Wallet view') self.errors.append('Custom token is not shown on Wallet view')
wallet_view.accounts_status_account.scroll_to_element(direction='up') wallet.accounts_status_account.scroll_to_element(direction='up')
wallet_view.accounts_status_account.click() wallet.accounts_status_account.click()
recipient = "0x" + basic_user['address'] recipient = "0x" + basic_user['address']
amount = '0.000%s' % str(random.randint(10000, 99999)) + '1' amount = '0.000%s' % str(random.randint(10000, 99999)) + '1'
wallet_view.send_transaction(asset_name=symbol, amount=amount, recipient=recipient) wallet.send_transaction(asset_name=symbol, amount=amount, recipient=recipient)
# TODO: disabled due to 10838 # TODO: disabled due to 10838
# transactions_view = wallet_view.transaction_history_button.click() # transactions_view = wallet.transaction_history_button.click()
# transactions_view.transactions_table.find_transaction(amount=amount, asset=symbol) # transactions_view.transactions_table.find_transaction(amount=amount, asset=symbol)
self.errors.verify_no_errors() self.errors.verify_no_errors()
@ -486,7 +476,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
chat.chat_options.click() chat.chat_options.click()
chat.view_profile_button.click_until_presence_of_element(chat.remove_from_contacts) chat.view_profile_button.click_until_presence_of_element(chat.remove_from_contacts)
chat.set_nickname(nickname) chat.set_nickname(nickname)
chat.close_button.click()
wallet = home.wallet_button.click() wallet = home.wallet_button.click()
wallet.add_account(account_name=account_name) wallet.add_account(account_name=account_name)
wallet.accounts_status_account.click() wallet.accounts_status_account.click()
@ -757,36 +746,36 @@ class TestTransactionWalletMultipleDevice(MultipleDeviceTestCase):
self.create_drivers(2) self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
device_1_home, device_2_home = device_1.recover_access(sender['passphrase']), \ home_1, home_2 = device_1.recover_access(sender['passphrase']), \
device_2.recover_access(receiver['passphrase']) device_2.recover_access(receiver['passphrase'])
wallet_view_serder = device_1_home.wallet_button.click() wallet_sender = home_1.wallet_button.click()
wallet_view_receiver = device_2_home.wallet_button.click() wallet_receiver = home_2.wallet_button.click()
if wallet_view_receiver.asset_by_name('STT').is_element_present(10): if wallet_receiver.asset_by_name('STT').is_element_present(10):
initial_balance = wallet_view_receiver.get_asset_amount_by_name("STT") initial_balance = wallet_receiver.get_asset_amount_by_name("STT")
else: else:
initial_balance = '0' initial_balance = '0'
device_1.just_fyi("Sending token amount to device who will use Set Max option for token") device_1.just_fyi("Sending token amount to device who will use Set Max option for token")
amount = '0.012345678912345678' amount = '0.012345678912345678'
wallet_view_serder.accounts_status_account.click() wallet_sender.accounts_status_account.click()
wallet_view_serder.send_transaction(asset_name='STT', amount=amount, recipient=receiver['address']) wallet_sender.send_transaction(asset_name='STT', amount=amount, recipient=receiver['address'])
wallet_view_receiver.wait_balance_is_changed(asset='STT', initial_balance=initial_balance, scan_tokens=True) wallet_receiver.wait_balance_is_changed(asset='STT', initial_balance=initial_balance, scan_tokens=True)
wallet_view_receiver.accounts_status_account.click() wallet_receiver.accounts_status_account.click()
device_1.just_fyi("Send all tokens via Set Max option") device_1.just_fyi("Send all tokens via Set Max option")
send_transaction_view = wallet_view_receiver.send_transaction_button.click() send_transaction = wallet_receiver.send_transaction_button.click()
send_transaction_view.select_asset_button.click() send_transaction.select_asset_button.click()
asset_name = 'STT' asset_name = 'STT'
asset_button = send_transaction_view.asset_by_name(asset_name) asset_button = send_transaction.asset_by_name(asset_name)
send_transaction_view.select_asset_button.click_until_presence_of_element( send_transaction.select_asset_button.click_until_presence_of_element(
send_transaction_view.eth_asset_in_select_asset_bottom_sheet_button) send_transaction.eth_asset_in_select_asset_bottom_sheet_button)
asset_button.click() asset_button.click()
send_transaction_view.set_max_button.click() send_transaction.set_max_button.click()
send_transaction_view.set_recipient_address(sender['address']) send_transaction.set_recipient_address(sender['address'])
send_transaction_view.sign_transaction_button.click() send_transaction.sign_transaction_button.click()
send_transaction_view.sign_transaction() send_transaction.sign_transaction()
wallet_view_receiver.close_button.click() wallet_receiver.close_button.click()
initial_balance = float(initial_balance) + float(amount) initial_balance = float(initial_balance) + float(amount)
wallet_view_receiver.wait_balance_is_changed(asset='STT', initial_balance=str(initial_balance), scan_tokens=True) wallet_receiver.wait_balance_is_changed(asset='STT', initial_balance=str(initial_balance), scan_tokens=True)

View File

@ -1,7 +1,6 @@
import time
from tests import marks from tests import marks
from tests.base_test_case import MultipleDeviceTestCase from tests.base_test_case import MultipleDeviceTestCase
from tests.users import transaction_senders, basic_user, ens_user, ens_user_ropsten
from views.sign_in_view import SignInView from views.sign_in_view import SignInView
from views.chat_view import ChatView from views.chat_view import ChatView
@ -64,6 +63,156 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(5762)
@marks.high
def test_pair_devices_sync_one_to_one_contacts_nicknames_public_chat(self):
self.create_drivers(3)
device_1, device_2, device_3 = SignInView(self.drivers[0]), SignInView(self.drivers[1]), SignInView(self.drivers[2])
no_contact_nickname = 'no_contact_nickname'
name_1, name_2 = 'device_%s' % device_1.driver.number, 'device_%s' % device_2.driver.number
message_before_sync, message_after_sync = 'sent before sync', 'sent after sync'
message_blocked_before, message_blocked_after = 'I am blocked user', 'Not blocked anymore'
public_chat_before_sync, public_chat_after_sync = device_1.get_random_chat_name(), 'after-pairing'
device_3.just_fyi("Block contact: create user for blocking from main device")
home_3 = device_3.create_user()
public_chat_3 = home_3.join_public_chat(public_chat_before_sync)
public_chat_3.send_message(message_blocked_before)
self.drivers[2].quit()
device_1.just_fyi("(main device): create main user")
home_1 = device_1.create_user()
profile_1 = home_1.profile_button.click()
profile_1.privacy_and_security_button.click()
profile_1.backup_recovery_phrase_button.click()
profile_1.ok_continue_button.click()
recovery_phrase = profile_1.get_recovery_phrase()
profile_1.close_button.click()
profile_1.home_button.click()
device_1.just_fyi('Add contact, 1-1 chat (main device): 3-random, contact with ENS, start 1-1')
chat_1 = home_1.add_contact(basic_user['public_key'])
chat_1.send_message(message_before_sync)
chat_1.home_button.click()
chat_1 = home_1.add_contact(ens_user['ens'])
chat_1.home_button.click()
device_1.just_fyi('Chats, contacts (main device): join public chat, block user, set nickname')
public_chat_1 = home_1.join_public_chat(public_chat_before_sync)
public_chat_1.open_user_profile_from_public_chat(message_blocked_before)
public_chat_1.set_nickname(no_contact_nickname, close_profile=False)
public_chat_1.block_contact()
device_2.just_fyi("(secondary device): restore same multiaccount on another device")
home_2 = device_2.recover_access(passphrase=' '.join(recovery_phrase.values()))
profile_1, profile_2 = home_1.profile_button.click(), home_2.profile_button.click()
device_2.just_fyi('Nicknames (main device): set nickname for contact')
profile_1.open_contact_from_profile(basic_user['username'])
nickname = 'my_basic_user'
chat_1.set_nickname(nickname)
device_1.back_button.click()
device_2.just_fyi('Pair main and secondary devices')
profile_2.discover_and_advertise_device(name_2)
profile_1.discover_and_advertise_device(name_1)
profile_1.get_toggle_device_by_name(name_2).wait_and_click()
profile_1.sync_all_button.click()
profile_1.sync_all_button.wait_for_visibility_of_element(15)
[device.profile_button.click() for device in (profile_1, profile_2)]
device_2.just_fyi('Contacts (secondary device): check contacts + blocked users after initial sync')
profile_2.contacts_button.scroll_to_element(9, 'up')
profile_2.contacts_button.click()
if not profile_2.blocked_users_button.is_element_displayed(30):
self.errors.append('Blocked users are not synced after initial sync')
for name in (basic_user['username'], nickname, '@%s' % ens_user['ens']):
if not profile_2.element_by_text(name).is_element_displayed():
self.errors.append('"%s" is not found in Contacts after initial sync' % name)
profile_2.blocked_users_button.click()
if not profile_2.element_by_text(no_contact_nickname).is_element_displayed():
self.errors.append("'%s' nickname without addeing to contacts is not synced after initial sync" % no_contact_nickname)
profile_2.profile_button.double_click()
device_1.just_fyi("Contacts(main device): unblock user, send message from unblocked user")
profile_1.profile_button.click()
profile_1.contacts_button.scroll_to_element(direction='up')
profile_1.contacts_button.click()
profile_1.blocked_users_button.click()
profile_1.element_by_text(no_contact_nickname).click()
public_chat_1.unblock_contact_button.click()
profile_1.close_button.click()
device_1.just_fyi('Chats, contacts, nickname (main device): send message to 1-1, add new contact')
profile_1.home_button.click(desired_view='chat')
public_chat_1.back_button.click()
home_1.get_chat(nickname).click()
chat_1.send_message(message_after_sync)
chat_1.back_button.click()
new_contact, new_contact_ens = transaction_senders['A'], ens_user_ropsten
home_1.add_contact(new_contact['public_key'])
home_1.home_button.click()
home_1.add_contact(new_contact_ens['ens'])
device_2.just_fyi('Contacts (secondary device): check unblocked user, new contact')
profile_2.contacts_button.click()
profile_2.blocked_users_button.wait_for_invisibility_of_element(60)
for name in (new_contact['username'], '@%s' % new_contact_ens['ens']):
if not profile_2.element_by_text(name).is_element_displayed(60):
self.errors.append('"%s" is not found in Contacts after adding when devices are paired' % name)
device_1.just_fyi('Contacts (main device): set nickname, (secondary device): check that synced')
home_1.profile_button.click()
profile_1.contacts_button.scroll_to_element(9, 'up')
profile_1.open_contact_from_profile(transaction_senders['A']['username'])
nickname_after_sync = 'my_transaction sender'
chat_1.set_nickname(nickname_after_sync)
device_1.home_button.double_click()
if not profile_2.element_by_text(nickname_after_sync).is_element_displayed(60):
self.errors.append(
'"%s" is not updated in Contacts after setting nickname when devices are paired' % nickname_after_sync)
device_2.just_fyi("Chats(secondary device): check public chats")
profile_2.home_button.click()
if not home_2.element_by_text_part(public_chat_before_sync).is_element_displayed():
self.errors.append(
'"%s" is not found in Home after initial sync when devices are paired' % public_chat_before_sync)
public_chat_2 = home_2.get_chat('#%s' % public_chat_before_sync).click()
if public_chat_2.chat_element_by_text(message_blocked_before).is_element_displayed(30):
self.errors.append('Message %s from previously blocked user is fetched' % message_blocked_before)
home_2.just_fyi("Chats (secondary device): check messages in 1-1")
public_chat_2.home_button.click()
chat = home_2.get_chat(nickname).click()
if chat.chat_element_by_text(message_before_sync).is_element_displayed():
self.errors.append('"%s" message sent before pairing is synced' % message_before_sync)
if not chat.chat_element_by_text(message_after_sync).is_element_displayed(60):
self.errors.append('"%s" message in 1-1 is not synced' % message_after_sync)
device_1.just_fyi('Chats (main device):add new public chat, (secondary device): check that synced ')
home_1.join_public_chat(public_chat_after_sync)
home_2 = chat.get_back_to_home_view()
if not home_2.element_by_text_part(public_chat_after_sync).is_element_displayed(20):
self.errors.append(
'"%s" public chat is not synced after adding when devices are paired' % public_chat_after_sync)
home_1.just_fyi('Contacts (main device): remove and block contact')
home_1.profile_button.click()
profile_1.contacts_button.scroll_to_element(9, 'up')
profile_1.open_contact_from_profile(nickname)
chat_1.block_contact()
profile_1.element_by_text(nickname_after_sync).click()
chat_1.remove_from_contacts.click()
home_2.just_fyi('Contacts (secondary device): check removed and blocked contact')
home_2.element_by_text_part(nickname).wait_for_invisibility_of_element(60)
home_2.profile_button.click()
profile_2.contacts_button.click()
profile_2.element_by_text(nickname_after_sync).wait_for_invisibility_of_element(60)
self.errors.verify_no_errors()
@marks.testrail_id(6324) @marks.testrail_id(6324)
@marks.medium @marks.medium

View File

@ -9,7 +9,7 @@ from PIL import Image
from appium.webdriver.common.touch_action import TouchAction from appium.webdriver.common.touch_action import TouchAction
from datetime import datetime from datetime import datetime
from io import BytesIO from io import BytesIO
from selenium.common.exceptions import NoSuchElementException, TimeoutException, StaleElementReferenceException from selenium.common.exceptions import NoSuchElementException, TimeoutException
from support.device_apps import start_web_browser from support.device_apps import start_web_browser
from tests import common_password, pytest_config_global, geth_log_emulator_path, transl from tests import common_password, pytest_config_global, geth_log_emulator_path, transl

View File

@ -885,11 +885,19 @@ class ChatView(BaseView):
self.profile_block_contact.click() self.profile_block_contact.click()
self.confirm_block_contact_button.click() self.confirm_block_contact_button.click()
def set_nickname(self, nickname): def open_user_profile_from_public_chat(self, message):
chat_element = self.chat_element_by_text(message)
chat_element.find_element()
chat_element.member_photo.click()
def set_nickname(self, nickname, close_profile=True):
self.driver.info("**Setting nickname:%s**" % nickname) self.driver.info("**Setting nickname:%s**" % nickname)
self.profile_nickname_button.click() self.profile_nickname_button.click()
self.nickname_input_field.send_keys(nickname) self.nickname_input_field.send_keys(nickname)
self.element_by_text('Done').click() self.element_by_text('Done').click()
if close_profile:
self.close_button.click()
def convert_device_time_to_chat_timestamp(self) -> list: def convert_device_time_to_chat_timestamp(self) -> list:
sent_time_object = dateutil.parser.parse(self.driver.device_time) sent_time_object = dateutil.parser.parse(self.driver.device_time)

View File

@ -332,7 +332,7 @@ class ProfileView(BaseView):
def open_contact_from_profile(self, username): def open_contact_from_profile(self, username):
self.driver.info("**Open profile of '%s' via Contacts**" % username) self.driver.info("**Open profile of '%s' via Contacts**" % username)
self.contacts_button.click() self.contacts_button.wait_and_click(30)
self.element_by_text(username).click() self.element_by_text(username).click()
from views.chat_view import ChatView from views.chat_view import ChatView
return ChatView(self.driver) return ChatView(self.driver)