2019-08-08 11:41:06 +00:00
|
|
|
import re
|
2018-06-29 17:27:30 +00:00
|
|
|
|
2021-01-27 16:13:47 +00:00
|
|
|
from tests import marks, bootnode_address, mailserver_address, test_dapp_url, test_dapp_name, mailserver_ams, \
|
|
|
|
mailserver_gc, mailserver_hk, used_fleet, common_password
|
2018-07-19 09:57:45 +00:00
|
|
|
from tests.base_test_case import SingleDeviceTestCase, MultipleDeviceTestCase
|
2020-07-15 15:48:23 +00:00
|
|
|
from tests.users import transaction_senders, basic_user, ens_user, ens_user_ropsten
|
2019-08-20 23:29:35 +00:00
|
|
|
from views.sign_in_view import SignInView
|
2020-09-15 13:40:39 +00:00
|
|
|
from time import time
|
2018-06-29 17:27:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
class TestProfileSingleDevice(SingleDeviceTestCase):
|
|
|
|
|
2020-08-11 16:10:53 +00:00
|
|
|
@marks.testrail_id(6318)
|
|
|
|
@marks.medium
|
|
|
|
def test_can_delete_several_multiaccounts(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
sign_in.create_user()
|
2021-01-27 16:13:47 +00:00
|
|
|
delete_alert_warning = sign_in.get_translation_by_key("delete-profile-warning")
|
2020-08-11 16:10:53 +00:00
|
|
|
profile = sign_in.profile_button.click()
|
|
|
|
profile.logout()
|
|
|
|
if sign_in.ok_button.is_element_displayed():
|
|
|
|
sign_in.ok_button.click()
|
2021-06-18 11:09:03 +00:00
|
|
|
sign_in.back_button.click()
|
2020-08-11 16:10:53 +00:00
|
|
|
sign_in.your_keys_more_icon.click()
|
|
|
|
sign_in.generate_new_key_button.click()
|
|
|
|
sign_in.next_button.click()
|
|
|
|
sign_in.next_button.click()
|
|
|
|
sign_in.create_password_input.set_value(common_password)
|
|
|
|
sign_in.next_button.click()
|
|
|
|
sign_in.confirm_your_password_input.set_value(common_password)
|
|
|
|
sign_in.next_button.click()
|
|
|
|
sign_in.maybe_later_button.click_until_presence_of_element(sign_in.lets_go_button)
|
|
|
|
sign_in.lets_go_button.click()
|
|
|
|
|
|
|
|
sign_in.just_fyi('Delete 2nd multiaccount')
|
|
|
|
public_key, username = sign_in.get_public_key_and_username(return_username=True)
|
|
|
|
profile.privacy_and_security_button.click()
|
2021-04-19 08:37:46 +00:00
|
|
|
profile.delete_my_profile_button.scroll_and_click()
|
2021-01-27 16:13:47 +00:00
|
|
|
for text in (username, delete_alert_warning):
|
|
|
|
if not profile.element_by_text(text).is_element_displayed():
|
|
|
|
self.errors.append('Required %s is not shown when deleting multiaccount' % text)
|
2020-08-11 16:10:53 +00:00
|
|
|
profile.delete_profile_button.click()
|
2021-01-27 16:13:47 +00:00
|
|
|
if profile.element_by_translation_id("profile-deleted-title").is_element_displayed():
|
2020-08-11 16:10:53 +00:00
|
|
|
self.driver.fail('Profile is deleted without confirmation with password')
|
|
|
|
profile.delete_my_profile_password_input.set_value(common_password)
|
2021-01-27 16:13:47 +00:00
|
|
|
profile.delete_profile_button.click_until_presence_of_element(profile.element_by_translation_id("profile-deleted-title"))
|
2020-08-11 16:10:53 +00:00
|
|
|
profile.ok_button.click()
|
|
|
|
|
|
|
|
sign_in.just_fyi('Delete last multiaccount')
|
|
|
|
sign_in.sign_in()
|
|
|
|
sign_in.profile_button.click()
|
|
|
|
profile.privacy_and_security_button.click()
|
2021-04-19 08:37:46 +00:00
|
|
|
profile.delete_my_profile_button.scroll_and_click()
|
2020-08-11 16:10:53 +00:00
|
|
|
profile.delete_my_profile_password_input.set_value(common_password)
|
|
|
|
profile.delete_profile_button.click()
|
|
|
|
profile.ok_button.click()
|
2020-11-10 17:07:39 +00:00
|
|
|
if not sign_in.get_started_button.is_element_displayed(20):
|
2020-08-11 16:10:53 +00:00
|
|
|
self.errors.append('No redirected to carousel view after deleting last multiaccount')
|
|
|
|
self.errors.verify_no_errors()
|
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5323)
|
|
|
|
@marks.critical
|
2021-01-27 16:13:47 +00:00
|
|
|
def test_share_copy_contact_code_and_wallet_address(self):
|
|
|
|
home = SignInView(self.driver).create_user()
|
|
|
|
profile = home.profile_button.click()
|
|
|
|
|
|
|
|
home.just_fyi("Copying contact code")
|
|
|
|
profile.share_my_profile_button.click()
|
|
|
|
public_key = profile.public_key_text.text
|
|
|
|
profile.public_key_text.long_press_element()
|
|
|
|
profile.copy_text()
|
|
|
|
|
|
|
|
home.just_fyi("Sharing contact code via messenger")
|
|
|
|
profile.share_button.click()
|
|
|
|
profile.share_via_messenger()
|
|
|
|
if not profile.element_by_text_part(public_key).is_element_present():
|
2018-07-03 12:40:44 +00:00
|
|
|
self.errors.append("Can't share public key")
|
2021-01-27 16:13:47 +00:00
|
|
|
[profile.click_system_back_button() for _ in range(2)]
|
|
|
|
profile.close_share_popup()
|
2018-06-29 17:27:30 +00:00
|
|
|
|
2021-01-27 16:13:47 +00:00
|
|
|
home.just_fyi("Check that can paste contact code in chat message input")
|
|
|
|
home = profile.home_button.click()
|
2018-09-17 08:50:01 +00:00
|
|
|
chat = home.add_contact(transaction_senders['M']['public_key'])
|
2018-06-29 17:27:30 +00:00
|
|
|
chat.chat_message_input.click()
|
2018-07-03 12:32:01 +00:00
|
|
|
chat.paste_text()
|
|
|
|
input_text = chat.chat_message_input.text
|
|
|
|
if input_text not in public_key or len(input_text) < 1:
|
2018-06-29 17:27:30 +00:00
|
|
|
self.errors.append('Public key was not copied')
|
|
|
|
chat.chat_message_input.clear()
|
|
|
|
chat.get_back_to_home_view()
|
|
|
|
|
2021-01-27 16:13:47 +00:00
|
|
|
home.just_fyi("Copying wallet address")
|
|
|
|
wallet = profile.wallet_button.click()
|
2019-07-12 07:16:02 +00:00
|
|
|
wallet.set_up_wallet()
|
2019-06-28 14:36:24 +00:00
|
|
|
wallet.accounts_status_account.click()
|
2021-01-27 16:13:47 +00:00
|
|
|
request = wallet.receive_transaction_button.click()
|
2018-06-29 17:27:30 +00:00
|
|
|
address = wallet.address_text.text
|
2021-01-27 16:13:47 +00:00
|
|
|
request.share_button.click()
|
|
|
|
request.element_by_translation_id("sharing-copy-to-clipboard").click()
|
|
|
|
|
|
|
|
home.just_fyi("Sharing wallet address via messenger")
|
|
|
|
request.share_button.click()
|
|
|
|
wallet.share_via_messenger()
|
|
|
|
if not wallet.element_by_text_part(address).is_element_present():
|
|
|
|
self.errors.append("Can't share address")
|
|
|
|
[wallet.click_system_back_button() for _ in range(2)]
|
|
|
|
wallet.close_share_popup()
|
|
|
|
|
|
|
|
home.just_fyi("Check that can paste wallet address in chat message input")
|
2018-06-29 17:27:30 +00:00
|
|
|
wallet.home_button.click()
|
2020-03-17 17:27:10 +00:00
|
|
|
home.get_chat(transaction_senders['M']['username']).click()
|
2018-06-29 17:27:30 +00:00
|
|
|
chat.chat_message_input.click()
|
2018-07-03 12:32:01 +00:00
|
|
|
chat.paste_text()
|
2018-06-29 17:27:30 +00:00
|
|
|
if chat.chat_message_input.text != address:
|
|
|
|
self.errors.append('Wallet address was not copied')
|
2019-10-29 08:25:57 +00:00
|
|
|
self.errors.verify_no_errors()
|
2018-06-29 17:27:30 +00:00
|
|
|
|
2019-08-02 09:28:59 +00:00
|
|
|
@marks.testrail_id(5502)
|
|
|
|
@marks.critical
|
|
|
|
def test_can_add_existing_ens(self):
|
2020-12-16 17:08:57 +00:00
|
|
|
home = SignInView(self.driver).recover_access(ens_user['passphrase'])
|
2019-08-02 09:28:59 +00:00
|
|
|
profile = home.profile_button.click()
|
|
|
|
profile.switch_network('Mainnet with upstream RPC')
|
|
|
|
home.profile_button.click()
|
2019-11-25 10:32:30 +00:00
|
|
|
dapp_view = profile.ens_usernames_button.click()
|
2019-08-02 09:28:59 +00:00
|
|
|
|
2019-09-02 08:40:13 +00:00
|
|
|
dapp_view.just_fyi('check if your name can be added via "ENS usernames" in Profile')
|
2019-08-02 09:28:59 +00:00
|
|
|
dapp_view.element_by_text('Get started').click()
|
2021-01-25 16:35:40 +00:00
|
|
|
dapp_view.ens_name_input.set_value(ens_user['ens'])
|
2021-01-28 12:55:23 +00:00
|
|
|
dapp_view.check_ens_name.click_until_absense_of_element(dapp_view.check_ens_name)
|
2021-01-25 16:35:40 +00:00
|
|
|
if not dapp_view.element_by_translation_id('ens-saved-title').is_element_displayed():
|
2019-08-02 09:28:59 +00:00
|
|
|
self.errors.append('No message "Username added" after resolving own username')
|
2021-01-25 16:35:40 +00:00
|
|
|
dapp_view.element_by_translation_id("ens-got-it").click()
|
2019-08-02 09:28:59 +00:00
|
|
|
|
2019-09-02 08:40:13 +00:00
|
|
|
dapp_view.just_fyi('check that after adding username is shown in "ENS usernames" and profile')
|
2019-08-02 09:28:59 +00:00
|
|
|
if not dapp_view.element_by_text(ens_user['ens']).is_element_displayed():
|
|
|
|
self.errors.append('No ENS name is shown in own "ENS usernames" after adding')
|
|
|
|
dapp_view.back_button.click()
|
|
|
|
if not dapp_view.element_by_text('@%s' % ens_user['ens']).is_element_displayed():
|
|
|
|
self.errors.append('No ENS name is shown in own profile after adding')
|
|
|
|
if not dapp_view.element_by_text('%s.stateofus.eth' % ens_user['ens']).is_element_displayed():
|
|
|
|
self.errors.append('No ENS name is shown in own profile after adding')
|
2020-04-23 15:42:20 +00:00
|
|
|
profile.share_my_profile_button.click()
|
|
|
|
if profile.ens_name_in_share_chat_key_text.text != '%s.stateofus.eth' % ens_user['ens']:
|
|
|
|
self.errors.append('No ENS name is shown on tapping on share icon in Profile')
|
|
|
|
profile.close_share_popup()
|
|
|
|
|
2019-10-29 08:25:57 +00:00
|
|
|
self.errors.verify_no_errors()
|
2019-08-02 09:28:59 +00:00
|
|
|
|
2020-05-27 12:40:07 +00:00
|
|
|
@marks.testrail_id(6296)
|
|
|
|
@marks.high
|
2019-10-31 17:07:14 +00:00
|
|
|
def test_recover_account_from_new_user_seedphrase(self):
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
sign_in_view.create_user()
|
|
|
|
profile_view = sign_in_view.profile_button.click()
|
|
|
|
profile_view.privacy_and_security_button.click()
|
|
|
|
profile_view.backup_recovery_phrase_button.click()
|
|
|
|
profile_view.ok_continue_button.click()
|
|
|
|
recovery_phrase = " ".join(profile_view.get_recovery_phrase().values())
|
2021-06-14 17:52:58 +00:00
|
|
|
profile_view.close_button.click()
|
2019-10-31 17:07:14 +00:00
|
|
|
profile_view.back_button.click()
|
2020-04-10 10:25:46 +00:00
|
|
|
public_key = profile_view.get_public_key_and_username()
|
2019-10-31 17:07:14 +00:00
|
|
|
wallet_view = profile_view.wallet_button.click()
|
|
|
|
wallet_view.set_up_wallet()
|
|
|
|
address = wallet_view.get_wallet_address()
|
2020-01-13 16:16:55 +00:00
|
|
|
sign_in_view.profile_button.click()
|
|
|
|
profile_view.logout()
|
2019-10-31 17:07:14 +00:00
|
|
|
self.driver.reset()
|
|
|
|
sign_in_view.recover_access(recovery_phrase)
|
|
|
|
wallet_view = sign_in_view.wallet_button.click()
|
|
|
|
wallet_view.set_up_wallet()
|
|
|
|
if wallet_view.get_wallet_address() != address:
|
|
|
|
self.driver.fail("Seed phrase displayed in new accounts for back up does not recover respective address")
|
|
|
|
profile_view = wallet_view.profile_button.click()
|
2020-04-10 10:25:46 +00:00
|
|
|
if profile_view.get_public_key_and_username() != public_key:
|
2019-10-31 17:07:14 +00:00
|
|
|
self.driver.fail("Seed phrase displayed in new accounts for back up does not recover respective public key")
|
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5433)
|
|
|
|
@marks.medium
|
2018-07-03 12:40:44 +00:00
|
|
|
def test_invite_friends(self):
|
2021-01-27 16:13:47 +00:00
|
|
|
home = SignInView(self.driver).create_user()
|
|
|
|
|
|
|
|
self.driver.info("Check it via 'Invite friends' on home view")
|
2019-04-05 13:05:23 +00:00
|
|
|
home.invite_friends_button.click()
|
|
|
|
home.share_via_messenger()
|
2021-01-27 16:13:47 +00:00
|
|
|
home.element_by_text_part("Hey join me on Status: https://join.status.im/u/0x")
|
2020-08-20 10:33:25 +00:00
|
|
|
home.click_system_back_button()
|
2021-01-27 16:13:47 +00:00
|
|
|
|
|
|
|
self.driver.info("Check it via bottom sheet menu")
|
2019-11-20 16:27:29 +00:00
|
|
|
home.plus_button.click()
|
|
|
|
home.chats_menu_invite_friends_button.click()
|
|
|
|
home.share_via_messenger()
|
2021-01-27 16:13:47 +00:00
|
|
|
home.element_by_text_part("Hey join me on Status: https://join.status.im/u/0x")
|
2019-11-20 16:27:29 +00:00
|
|
|
|
2020-07-15 15:48:23 +00:00
|
|
|
@marks.testrail_id(6312)
|
|
|
|
@marks.medium
|
|
|
|
def test_add_remove_contact_via_contacts_view(self):
|
2021-01-27 16:13:47 +00:00
|
|
|
home = SignInView(self.driver).create_user()
|
|
|
|
|
2020-07-15 15:48:23 +00:00
|
|
|
home.just_fyi('Check empty contacts view')
|
|
|
|
profile = home.profile_button.click()
|
|
|
|
profile.switch_network()
|
|
|
|
home.profile_button.click()
|
|
|
|
profile.contacts_button.click()
|
2020-10-28 08:46:17 +00:00
|
|
|
if not profile.add_new_contact_button.is_element_displayed():
|
|
|
|
self.driver.fail('No expected element on contacts view')
|
2020-07-15 15:48:23 +00:00
|
|
|
|
|
|
|
users = {
|
|
|
|
'scanning_ens_with_stateofus_domain_deep_link': {
|
|
|
|
'contact_code': 'https://join.status.im/u/%s.stateofus.eth' % ens_user_ropsten['ens'],
|
2020-10-30 14:40:14 +00:00
|
|
|
'username': ens_user_ropsten['username']
|
2020-07-15 15:48:23 +00:00
|
|
|
},
|
|
|
|
'scanning_public_key': {
|
|
|
|
'contact_code': transaction_senders['A']['public_key'],
|
|
|
|
'username': transaction_senders['A']['username'],
|
|
|
|
},
|
|
|
|
'pasting_public_key': {
|
|
|
|
'contact_code': basic_user['public_key'],
|
|
|
|
'username': basic_user['username'],
|
|
|
|
},
|
2020-10-30 14:40:14 +00:00
|
|
|
'pasting_ens_another_domain': {
|
2020-07-15 15:48:23 +00:00
|
|
|
'contact_code': ens_user['ens_another_domain'],
|
|
|
|
'username': '@%s' % ens_user['ens_another_domain'],
|
2020-10-30 14:40:14 +00:00
|
|
|
'nickname': 'my_dear_friend'
|
2020-07-15 15:48:23 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-10-28 08:46:17 +00:00
|
|
|
home.just_fyi('Add contact and check that they appear in Contacts view')
|
2021-01-27 16:13:47 +00:00
|
|
|
chat_view = home.get_chat_view()
|
2020-07-15 15:48:23 +00:00
|
|
|
for key in users:
|
2021-06-23 15:12:42 +00:00
|
|
|
profile.add_new_contact_button.click()
|
2021-01-27 16:13:47 +00:00
|
|
|
home.just_fyi('Checking %s case' % key)
|
2020-07-15 15:48:23 +00:00
|
|
|
if 'scanning' in key:
|
2021-01-25 16:35:40 +00:00
|
|
|
chat_view.scan_contact_code_button.click()
|
|
|
|
if chat_view.allow_button.is_element_displayed():
|
|
|
|
chat_view.allow_button.click()
|
|
|
|
chat_view.enter_qr_edit_box.scan_qr(users[key]['contact_code'])
|
2020-07-15 15:48:23 +00:00
|
|
|
else:
|
2021-01-25 16:35:40 +00:00
|
|
|
chat_view.public_key_edit_box.click()
|
|
|
|
chat_view.public_key_edit_box.send_keys(users[key]['contact_code'])
|
2020-10-30 14:40:14 +00:00
|
|
|
if 'nickname' in users[key]:
|
|
|
|
chat_view.nickname_input_field.set_value(users[key]['nickname'])
|
2021-01-25 16:35:40 +00:00
|
|
|
chat_view.confirm_until_presence_of_element(profile.contacts_button)
|
2020-07-15 15:48:23 +00:00
|
|
|
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)
|
2020-10-30 14:40:14 +00:00
|
|
|
if 'nickname' in users[key]:
|
|
|
|
if not profile.element_by_text(users[key]['nickname']).is_element_displayed():
|
|
|
|
self.errors.append('In %s case nickname %s not found in contact view after scanning' % (key, users[key]['nickname']))
|
2020-07-15 15:48:23 +00:00
|
|
|
|
|
|
|
home.just_fyi('Remove contact and check that it disappeared')
|
|
|
|
user_to_remove = '@%s' % ens_user['ens_another_domain']
|
|
|
|
profile.element_by_text(user_to_remove).click()
|
2020-10-30 14:40:14 +00:00
|
|
|
chat_view.remove_from_contacts.click()
|
2021-06-23 15:12:42 +00:00
|
|
|
chat_view.close_button.click()
|
2020-07-15 15:48:23 +00:00
|
|
|
if profile.element_by_text(user_to_remove).is_element_displayed():
|
|
|
|
self.errors.append('Removed user is still shown in contact view')
|
2021-05-25 16:42:58 +00:00
|
|
|
|
|
|
|
home.just_fyi('Relogin and open profile view of the contact removed from Contact list to ensure there is no crash')
|
|
|
|
profile.profile_button.click()
|
|
|
|
profile.relogin()
|
|
|
|
one_to_one_chat = home.add_contact(public_key=ens_user['ens_another_domain'], add_in_contacts=False)
|
|
|
|
one_to_one_chat.chat_options.click()
|
|
|
|
profile = one_to_one_chat.view_profile_button.click()
|
|
|
|
if profile.remove_from_contacts.is_element_displayed():
|
|
|
|
self.errors.append('User still added in contact after relogin')
|
|
|
|
|
2020-07-15 15:48:23 +00:00
|
|
|
self.errors.verify_no_errors()
|
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5431)
|
|
|
|
@marks.medium
|
2018-07-03 12:40:44 +00:00
|
|
|
def test_add_custom_network(self):
|
2021-01-27 16:13:47 +00:00
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
sign_in.create_user()
|
|
|
|
profile = sign_in.profile_button.click()
|
|
|
|
profile.add_custom_network()
|
|
|
|
sign_in.sign_in()
|
|
|
|
sign_in.profile_button.click()
|
|
|
|
profile.advanced_button.click()
|
|
|
|
profile.network_settings_button.scroll_to_element(10, 'up')
|
|
|
|
if not profile.element_by_text_part('custom_ropsten').is_element_displayed():
|
|
|
|
self.driver.fail("Network custom_ropsten was not added!")
|
|
|
|
|
2019-09-24 14:22:20 +00:00
|
|
|
@marks.critical
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5419)
|
2020-10-06 14:48:08 +00:00
|
|
|
@marks.flaky
|
2018-07-16 12:57:01 +00:00
|
|
|
def test_logcat_backup_recovery_phrase(self):
|
2021-01-27 16:13:47 +00:00
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
home = sign_in.create_user()
|
|
|
|
|
|
|
|
home.just_fyi("Check that badge on profile about back up seed phrase is presented")
|
|
|
|
if home.profile_button.counter.text != '1':
|
|
|
|
self.errors.append('Profile button counter is not shown')
|
|
|
|
|
|
|
|
home.just_fyi("Back up seed phrase and check logcat")
|
|
|
|
profile = home.profile_button.click()
|
|
|
|
profile.privacy_and_security_button.click()
|
|
|
|
profile.backup_recovery_phrase_button.click()
|
|
|
|
profile.ok_continue_button.click()
|
|
|
|
recovery_phrase = profile.get_recovery_phrase()
|
|
|
|
profile.next_button.click()
|
|
|
|
word_number = profile.recovery_phrase_word_number.number
|
|
|
|
profile.recovery_phrase_word_input.set_value(recovery_phrase[word_number])
|
|
|
|
profile.next_button.click()
|
|
|
|
word_number_1 = profile.recovery_phrase_word_number.number
|
|
|
|
profile.recovery_phrase_word_input.set_value(recovery_phrase[word_number_1])
|
|
|
|
profile.done_button.click()
|
|
|
|
profile.yes_button.click()
|
|
|
|
profile.ok_got_it_button.click()
|
|
|
|
if home.profile_button.counter.is_element_displayed():
|
|
|
|
self.errors.append('Profile button counter is shown after recovery phrase backup')
|
|
|
|
values_in_logcat = profile.find_values_in_logcat(passphrase1=recovery_phrase[word_number],
|
2018-07-17 16:27:00 +00:00
|
|
|
passphrase2=recovery_phrase[word_number_1])
|
2019-09-24 14:22:20 +00:00
|
|
|
if len(values_in_logcat) == 2:
|
|
|
|
self.driver.fail(values_in_logcat)
|
2021-01-27 16:13:47 +00:00
|
|
|
profile.profile_button.double_click()
|
|
|
|
|
|
|
|
home.just_fyi("Try to restore same account from seed phrase (should be possible only to unlock existing account)")
|
|
|
|
profile.logout()
|
2021-06-18 11:09:03 +00:00
|
|
|
sign_in.back_button.click()
|
2021-01-27 16:13:47 +00:00
|
|
|
sign_in.access_key_button.click()
|
|
|
|
sign_in.enter_seed_phrase_button.click()
|
|
|
|
sign_in.seedphrase_input.click()
|
|
|
|
sign_in.seedphrase_input.set_value(' '.join(recovery_phrase.values()))
|
|
|
|
sign_in.next_button.click()
|
|
|
|
sign_in.element_by_translation_id(id="unlock", uppercase=True).click()
|
|
|
|
sign_in.password_input.set_value(common_password)
|
|
|
|
chat = sign_in.sign_in_button.click()
|
|
|
|
chat.plus_button.click()
|
|
|
|
if not chat.start_new_chat_button.is_element_displayed():
|
|
|
|
self.errors.append("Can't proceed using account after it's re-recover twice.")
|
|
|
|
self.errors.verify_no_errors()
|
|
|
|
|
|
|
|
@marks.testrail_id(5453)
|
|
|
|
@marks.medium
|
2021-07-12 14:44:51 +00:00
|
|
|
# @marks.flaky
|
2021-07-05 19:28:55 +00:00
|
|
|
def test_privacy_policy_terms_of_use_node_version_need_help_in_profile(self):
|
2021-01-27 16:13:47 +00:00
|
|
|
signin = SignInView(self.driver)
|
|
|
|
no_link_found_error_msg = 'Could not find privacy policy link at'
|
|
|
|
no_link_open_error_msg = 'Could not open our privacy policy from'
|
2021-07-05 19:28:55 +00:00
|
|
|
no_link_tos_error_msg = 'Could not open Terms of Use from'
|
2021-01-27 16:13:47 +00:00
|
|
|
|
2021-07-12 14:44:51 +00:00
|
|
|
signin.just_fyi("Checking privacy policy and TOS links")
|
2021-07-05 19:28:55 +00:00
|
|
|
if not signin.privacy_policy_link.is_element_present():
|
2021-07-12 14:44:51 +00:00
|
|
|
self.errors.append('%s Sign in view!' % no_link_found_error_msg)
|
2021-07-05 19:28:55 +00:00
|
|
|
if not signin.terms_of_use_link.is_element_displayed():
|
|
|
|
self.driver.fail("No Terms of Use link on Sign in view!")
|
|
|
|
|
2021-01-27 16:13:47 +00:00
|
|
|
home = signin.create_user()
|
|
|
|
profile = home.profile_button.click()
|
|
|
|
profile.about_button.click()
|
|
|
|
profile.privacy_policy_button.click()
|
2021-07-12 14:44:51 +00:00
|
|
|
from views.web_views.base_web_view import BaseWebView
|
|
|
|
web_page = BaseWebView(self.driver)
|
2021-01-27 16:13:47 +00:00
|
|
|
if not web_page.policy_summary.is_element_displayed():
|
|
|
|
self.errors.append('%s Profile about view!' % no_link_open_error_msg)
|
|
|
|
web_page.click_system_back_button()
|
|
|
|
|
2021-07-05 19:28:55 +00:00
|
|
|
profile.terms_of_use_button.click()
|
|
|
|
web_page.wait_for_d_aap_to_load()
|
|
|
|
web_page.swipe_by_custom_coordinates(0.5,0.8,0.5,0.4)
|
|
|
|
if not web_page.terms_of_use_summary.is_element_displayed():
|
|
|
|
self.errors.append('%s Profile about view!' % no_link_tos_error_msg)
|
|
|
|
web_page.click_system_back_button()
|
|
|
|
|
2021-01-27 16:13:47 +00:00
|
|
|
signin.just_fyi("Checking that version match expected format and can be copied")
|
|
|
|
app_version = profile.app_version_text.text
|
|
|
|
node_version = profile.node_version_text.text
|
|
|
|
if not re.search(r'\d{1}[.]\d{1,2}[.]\d{1,2}\s[(]\d*[)]', app_version):
|
|
|
|
self.errors.append("App version %s didn't match expected format" % app_version)
|
|
|
|
if not re.search(r'StatusIM\/v.*\/android-\d{3}\/go\d{1}[.]\d{1,}', node_version):
|
|
|
|
self.errors.append("Node version %s didn't match expected format" % node_version)
|
|
|
|
profile.app_version_text.click()
|
|
|
|
profile.back_button.click()
|
|
|
|
profile.home_button.click()
|
|
|
|
chat = home.join_public_chat(home.get_random_chat_name())
|
|
|
|
message_input = chat.chat_message_input
|
|
|
|
message_input.paste_text_from_clipboard()
|
|
|
|
if message_input.text != app_version:
|
|
|
|
self.errors.append('Version number was not copied to clipboard')
|
|
|
|
|
|
|
|
signin.just_fyi("Checking Need help section")
|
|
|
|
home.profile_button.double_click()
|
|
|
|
profile.help_button.click()
|
|
|
|
web_page = profile.faq_button.click()
|
|
|
|
web_page.open_in_webview()
|
|
|
|
web_page.wait_for_d_aap_to_load()
|
|
|
|
if not profile.element_by_text_part("F.A.Q").is_element_displayed():
|
|
|
|
self.errors.append("FAQ is not shown")
|
|
|
|
profile.click_system_back_button()
|
|
|
|
profile.submit_bug_button.click()
|
|
|
|
if not profile.element_by_text_part("Welcome to Gmail").is_element_displayed():
|
|
|
|
self.errors.append("Mail client is not opened when submitting bug")
|
|
|
|
profile.click_system_back_button()
|
|
|
|
profile.request_a_feature_button.click()
|
2021-07-05 19:28:55 +00:00
|
|
|
if not profile.element_by_text("#support").is_element_displayed():
|
2021-03-17 09:28:23 +00:00
|
|
|
self.errors.append("Support channel is not suggested for requesting a feature")
|
2021-01-27 16:13:47 +00:00
|
|
|
self.errors.verify_no_errors()
|
2018-07-06 11:10:48 +00:00
|
|
|
|
2021-01-27 16:13:47 +00:00
|
|
|
@marks.testrail_id(5738)
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.high
|
2021-01-27 16:13:47 +00:00
|
|
|
def test_dapps_permissions(self):
|
|
|
|
home = SignInView(self.driver).create_user()
|
|
|
|
account_name = home.status_account_name
|
|
|
|
|
|
|
|
home.just_fyi('open Status Test Dapp, allow all and check permissions in Profile')
|
2021-06-18 11:09:03 +00:00
|
|
|
web_view = home.open_status_test_dapp()
|
|
|
|
dapp_view = home.dapp_tab_button.click()
|
2021-01-27 16:13:47 +00:00
|
|
|
profile = home.profile_button.click()
|
|
|
|
profile.privacy_and_security_button.click()
|
|
|
|
profile.dapp_permissions_button.click()
|
|
|
|
profile.element_by_text(test_dapp_name).click()
|
|
|
|
if not profile.element_by_text(account_name).is_element_displayed():
|
|
|
|
self.errors.append('Wallet permission was not granted')
|
|
|
|
if not profile.element_by_translation_id("chat-key").is_element_displayed():
|
|
|
|
self.errors.append('Contact code permission was not granted')
|
|
|
|
|
|
|
|
profile.just_fyi('revoke access and check that they are asked second time')
|
|
|
|
profile.revoke_access_button.click()
|
|
|
|
profile.back_button.click()
|
2021-06-18 11:09:03 +00:00
|
|
|
profile.dapp_tab_button.click()
|
|
|
|
|
|
|
|
web_view.open_tabs_button.click()
|
|
|
|
web_view.empty_tab_button.click()
|
|
|
|
|
2021-01-27 16:13:47 +00:00
|
|
|
dapp_view.open_url(test_dapp_url)
|
|
|
|
if not dapp_view.element_by_text_part(account_name).is_element_displayed():
|
|
|
|
self.errors.append('Wallet permission is not asked')
|
|
|
|
if dapp_view.allow_button.is_element_displayed():
|
|
|
|
dapp_view.allow_button.click(times_to_click=1)
|
|
|
|
if not dapp_view.element_by_translation_id("your-contact-code").is_element_displayed():
|
|
|
|
self.errors.append('Profile permission is not asked')
|
|
|
|
self.errors.verify_no_errors()
|
2018-07-06 11:10:48 +00:00
|
|
|
|
2019-10-15 08:58:11 +00:00
|
|
|
@marks.testrail_id(5368)
|
2020-11-03 16:15:14 +00:00
|
|
|
@marks.medium
|
|
|
|
def test_change_log_level_and_fleet(self):
|
|
|
|
home = SignInView(self.driver).create_user()
|
|
|
|
profile = home.profile_button.click()
|
|
|
|
profile.advanced_button.click()
|
|
|
|
default_log_level = 'INFO'
|
|
|
|
for text in default_log_level, used_fleet:
|
2021-01-27 16:13:47 +00:00
|
|
|
if not profile.element_by_text(text).is_element_displayed():
|
2020-03-27 14:35:59 +00:00
|
|
|
self.errors.append('%s is not selected by default' % text)
|
2020-11-03 16:15:14 +00:00
|
|
|
if home.find_values_in_geth('lvl=trce', 'lvl=dbug'):
|
2021-01-27 16:13:47 +00:00
|
|
|
self.errors.append('"%s" is set, but found another entries!' % default_log_level)
|
2020-11-03 16:15:14 +00:00
|
|
|
if not home.find_values_in_geth('lvl=info'):
|
2021-01-27 16:13:47 +00:00
|
|
|
self.errors.append('"%s" is set, but no entries are found!' % default_log_level)
|
2020-11-03 16:15:14 +00:00
|
|
|
|
|
|
|
home.just_fyi('Set another loglevel and check that changes are applied')
|
|
|
|
profile.log_level_setting_button.click()
|
|
|
|
changed_log_level = 'TRACE'
|
|
|
|
profile.element_by_text(changed_log_level).click_until_presence_of_element(profile.confirm_button)
|
|
|
|
profile.confirm_button.click()
|
|
|
|
SignInView(self.driver).sign_in()
|
|
|
|
home.profile_button.click()
|
|
|
|
profile.advanced_button.click()
|
|
|
|
if not profile.element_by_text(changed_log_level).is_element_displayed():
|
|
|
|
self.errors.append('"%s" is not selected after change' % changed_log_level)
|
|
|
|
if not home.find_values_in_geth('lvl=trc'):
|
|
|
|
self.errors.append('"%s" is set, but no entries are found!' % changed_log_level)
|
|
|
|
|
|
|
|
home.just_fyi('Set another fleet and check that changes are applied')
|
|
|
|
profile.fleet_setting_button.click()
|
|
|
|
changed_fleet = 'eth.prod'
|
|
|
|
profile.element_by_text(changed_fleet).click_until_presence_of_element(profile.confirm_button)
|
|
|
|
profile.confirm_button.click()
|
|
|
|
SignInView(self.driver).sign_in()
|
|
|
|
home.profile_button.click()
|
|
|
|
profile.advanced_button.click()
|
|
|
|
if not profile.element_by_text(changed_fleet).is_element_displayed():
|
|
|
|
self.errors.append('"%s" fleet is not selected after change' % changed_fleet)
|
|
|
|
if not home.find_values_in_geth(changed_fleet):
|
|
|
|
self.errors.append('"%s" is set, but no entry is found!' % changed_fleet)
|
|
|
|
|
2019-10-29 08:25:57 +00:00
|
|
|
self.errors.verify_no_errors()
|
2019-10-15 08:58:11 +00:00
|
|
|
|
2019-10-24 16:03:11 +00:00
|
|
|
@marks.testrail_id(5766)
|
|
|
|
@marks.medium
|
2020-05-20 08:47:53 +00:00
|
|
|
@marks.flaky
|
2019-10-24 16:03:11 +00:00
|
|
|
def test_use_pinned_mailserver(self):
|
2020-12-09 16:37:47 +00:00
|
|
|
home = SignInView(self.driver).create_user()
|
|
|
|
profile = home.profile_button.click()
|
2019-10-24 16:03:11 +00:00
|
|
|
|
2020-12-09 16:37:47 +00:00
|
|
|
profile.just_fyi('pin history node')
|
|
|
|
profile.sync_settings_button.click()
|
|
|
|
node_gc, node_ams, node_hk = [profile.return_mailserver_name(history_node_name, used_fleet) for history_node_name in (mailserver_gc, mailserver_ams, mailserver_hk)]
|
|
|
|
h_node = node_ams
|
|
|
|
profile.mail_server_button.click()
|
|
|
|
profile.mail_server_auto_selection_button.click()
|
|
|
|
profile.mail_server_by_name(h_node).click()
|
|
|
|
profile.confirm_button.click()
|
2021-01-25 16:35:40 +00:00
|
|
|
if profile.element_by_translation_id("mailserver-error-title").is_element_displayed(10):
|
2020-12-09 16:37:47 +00:00
|
|
|
h_node = node_hk
|
2021-01-25 16:35:40 +00:00
|
|
|
profile.element_by_translation_id("mailserver-pick-another", uppercase=True).click()
|
2020-12-09 16:37:47 +00:00
|
|
|
profile.mail_server_by_name(h_node).click()
|
|
|
|
profile.confirm_button.click()
|
2021-01-25 16:35:40 +00:00
|
|
|
if profile.element_by_translation_id("mailserver-error-title").is_element_displayed(10):
|
2020-12-09 16:37:47 +00:00
|
|
|
self.driver.fail("Couldn't connect to any history node")
|
|
|
|
|
|
|
|
profile.just_fyi('check that history node is pinned')
|
2021-06-23 15:12:42 +00:00
|
|
|
profile.close_button.click()
|
2020-12-09 16:37:47 +00:00
|
|
|
if not profile.element_by_text(h_node).is_element_displayed():
|
|
|
|
self.errors.append('"%s" history node is not pinned' % h_node)
|
2021-06-23 15:12:42 +00:00
|
|
|
profile.home_button.click()
|
2020-12-09 16:37:47 +00:00
|
|
|
|
|
|
|
profile.just_fyi('Relogin and check that settings are preserved')
|
|
|
|
home.relogin()
|
|
|
|
home.profile_button.click()
|
|
|
|
profile.sync_settings_button.click()
|
|
|
|
if not profile.element_by_text(h_node).is_element_displayed():
|
|
|
|
self.errors.append('"%s" history node is not pinned' % h_node)
|
2019-10-24 16:03:11 +00:00
|
|
|
|
2019-10-29 08:25:57 +00:00
|
|
|
self.errors.verify_no_errors()
|
2019-10-24 16:03:11 +00:00
|
|
|
|
2019-11-25 10:32:30 +00:00
|
|
|
@marks.testrail_id(6219)
|
|
|
|
@marks.medium
|
|
|
|
def test_set_primary_ens_custom_domain(self):
|
2021-01-27 16:13:47 +00:00
|
|
|
home = SignInView(self.driver).recover_access(ens_user['passphrase'])
|
2019-11-25 10:32:30 +00:00
|
|
|
ens_not_stateofus = ens_user['ens_another_domain']
|
|
|
|
ens_stateofus = ens_user['ens']
|
2021-01-27 16:13:47 +00:00
|
|
|
|
|
|
|
home.just_fyi('add 2 ENS names in Profile')
|
|
|
|
profile = home.profile_button.click()
|
|
|
|
dapp = profile.connect_existing_status_ens(ens_stateofus)
|
|
|
|
profile.element_by_text("Add username").click()
|
|
|
|
profile.element_by_text_part("another domain").click()
|
|
|
|
dapp.ens_name_input.set_value(ens_not_stateofus)
|
|
|
|
dapp.check_ens_name.click_until_presence_of_element(dapp.element_by_translation_id("ens-got-it"))
|
|
|
|
dapp.element_by_translation_id("ens-got-it").click()
|
|
|
|
|
|
|
|
home.just_fyi('check that by default %s ENS is set' % ens_stateofus)
|
|
|
|
dapp.element_by_text('Primary username').click()
|
2019-11-25 10:32:30 +00:00
|
|
|
message_to_check = 'Your messages are displayed to others with'
|
2021-01-27 16:13:47 +00:00
|
|
|
if not dapp.element_by_text('%s\n@%s.stateofus.eth' % (message_to_check, ens_stateofus)).is_element_displayed():
|
2019-11-25 10:32:30 +00:00
|
|
|
self.errors.append('%s ENS username is not set as primary by default' % ens_stateofus)
|
|
|
|
|
2021-01-27 16:13:47 +00:00
|
|
|
home.just_fyi('check view in chat settings ENS from other domain: %s after set new primary ENS' % ens_not_stateofus)
|
|
|
|
dapp.set_primary_ens_username(ens_user['ens_another_domain']).click()
|
|
|
|
if profile.username_in_ens_chat_settings_text.text != '@' + ens_not_stateofus:
|
2019-11-25 10:32:30 +00:00
|
|
|
self.errors.append('ENS username %s is not shown in ENS username Chat Settings after enabling' % ens_not_stateofus)
|
|
|
|
|
|
|
|
self.errors.verify_no_errors()
|
|
|
|
|
2021-01-27 16:13:47 +00:00
|
|
|
|
|
|
|
@marks.testrail_id(5468)
|
|
|
|
@marks.medium
|
|
|
|
@marks.skip
|
|
|
|
# TODO: skip until profile picture change feature is enabled
|
|
|
|
def test_deny_camera_access_changing_profile_photo(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
sign_in.create_user()
|
|
|
|
profile = sign_in.profile_button.click()
|
|
|
|
profile.profile_picture.click()
|
|
|
|
profile.capture_button.click()
|
|
|
|
for _ in range(2):
|
|
|
|
profile.deny_button.click()
|
|
|
|
profile.element_by_translation_id("camera-access-error").wait_for_visibility_of_element(3)
|
|
|
|
profile.ok_button.click()
|
|
|
|
profile.profile_picture.click()
|
|
|
|
profile.capture_button.click()
|
|
|
|
profile.deny_button.wait_for_visibility_of_element(2)
|
|
|
|
|
|
|
|
@marks.testrail_id(5469)
|
|
|
|
@marks.medium
|
|
|
|
@marks.skip
|
|
|
|
# TODO: skip until profile picture change feature is enabled
|
|
|
|
def test_deny_device_storage_access_changing_profile_photo(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
sign_in.create_user()
|
|
|
|
profile = sign_in.profile_button.click()
|
|
|
|
profile.profile_picture.click()
|
|
|
|
profile.select_from_gallery_button.click()
|
|
|
|
profile.deny_button.click()
|
|
|
|
profile.element_by_translation_id(id="external-storage-denied", element_type='text').wait_for_visibility_of_element(3)
|
|
|
|
profile.ok_button.click()
|
|
|
|
profile.profile_picture.click()
|
|
|
|
profile.select_from_gallery_button.click()
|
|
|
|
profile.deny_button.wait_for_visibility_of_element(2)
|
|
|
|
|
2019-08-18 23:31:42 +00:00
|
|
|
|
2018-07-19 09:57:45 +00:00
|
|
|
class TestProfileMultipleDevice(MultipleDeviceTestCase):
|
|
|
|
|
2021-02-23 12:19:55 +00:00
|
|
|
@marks.testrail_id(6646)
|
|
|
|
@marks.high
|
|
|
|
def test_set_profile_picture(self):
|
|
|
|
self.create_drivers(2)
|
|
|
|
home_1, home_2 = SignInView(self.drivers[0]).create_user(), SignInView(self.drivers[1]).create_user()
|
|
|
|
profile_1 = home_1.profile_button.click()
|
|
|
|
public_key_1 = profile_1.get_public_key_and_username()
|
|
|
|
|
|
|
|
profile_1.just_fyi("Set user Profile image from Gallery")
|
|
|
|
profile_1.edit_profile_picture(file_name='sauce_logo.png')
|
|
|
|
home_1.profile_button.click()
|
|
|
|
profile_1.swipe_down()
|
|
|
|
|
|
|
|
if not profile_1.profile_picture.is_element_image_similar_to_template('sauce_logo_profile.png'):
|
|
|
|
self.drivers[0].fail('Profile picture was not updated')
|
|
|
|
|
|
|
|
profile_1.just_fyi("Check user profile updated in chat")
|
|
|
|
home = profile_1.home_button.click()
|
|
|
|
message = "Text message"
|
|
|
|
public_chat_name = home.get_random_chat_name()
|
|
|
|
home_2.add_contact(public_key=public_key_1)
|
|
|
|
home_2.home_button.click()
|
|
|
|
public_chat_2 = home_2.join_public_chat(public_chat_name)
|
|
|
|
public_chat_1 = home.join_public_chat(public_chat_name)
|
|
|
|
public_chat_1.chat_message_input.send_keys(message)
|
|
|
|
public_chat_1.send_message_button.click()
|
|
|
|
if not public_chat_2.chat_element_by_text(message).member_photo.is_element_image_similar_to_template('sauce_logo.png'):
|
|
|
|
self.drivers[0].fail('Profile picture was not updated in chat')
|
|
|
|
|
|
|
|
profile_1.just_fyi("Set user Profile image by taking Photo")
|
|
|
|
home_1.profile_button.click()
|
|
|
|
profile_1.edit_profile_picture(file_name='sauce_logo.png', update_by='Make Photo')
|
|
|
|
home_1.home_button.click(desired_view='chat')
|
|
|
|
public_chat_1.chat_message_input.send_keys(message)
|
|
|
|
public_chat_1.send_message_button.click()
|
|
|
|
|
|
|
|
if public_chat_2.chat_element_by_text(message).member_photo.is_element_image_similar_to_template('sauce_logo.png'):
|
|
|
|
self.drivers[0].fail('Profile picture was not updated in chat after making photo')
|
|
|
|
|
2021-03-04 09:35:48 +00:00
|
|
|
@marks.testrail_id(6636)
|
|
|
|
@marks.medium
|
|
|
|
def test_show_profile_picture_of_setting(self):
|
|
|
|
self.create_drivers(2)
|
|
|
|
home_1, home_2 = SignInView(self.drivers[0]).create_user(), SignInView(self.drivers[1]).create_user()
|
|
|
|
profile_1 = home_1.profile_button.click()
|
|
|
|
public_key_1, default_username_1 = profile_1.get_public_key_and_username(return_username=True)
|
|
|
|
|
|
|
|
profile_1.just_fyi("Set user Profile image from Gallery")
|
|
|
|
profile_1.edit_profile_picture(file_name='sauce_logo.png')
|
|
|
|
home_1.profile_button.click()
|
|
|
|
profile_1.swipe_down()
|
|
|
|
|
|
|
|
profile_1.just_fyi('set status in profile')
|
|
|
|
device_1_status = 'My new update!'
|
|
|
|
timeline = profile_1.status_button.click()
|
|
|
|
timeline.set_new_status(device_1_status)
|
|
|
|
if not timeline.timeline_own_account_photo.is_element_image_similar_to_template('sauce_logo.png'):
|
|
|
|
self.errors.append('Profile picture was not updated in timeline')
|
|
|
|
|
|
|
|
profile_1.just_fyi('Check profile image it is not in mentions because user not in contacts yet')
|
|
|
|
one_to_one_chat_2 = home_2.add_contact(public_key_1, add_in_contacts=False)
|
|
|
|
one_to_one_chat_2.chat_message_input.set_value('@' + default_username_1)
|
|
|
|
one_to_one_chat_2.chat_message_input.click()
|
|
|
|
if one_to_one_chat_2.user_profile_image_in_mentions_list(default_username_1).is_element_image_similar_to_template('sauce_logo.png'):
|
|
|
|
self.errors.append('Profile picture is updated in 1-1 chat mentions list of contact not in Contacts list')
|
|
|
|
|
|
|
|
profile_1.just_fyi('Check profile image is in mentions because now user was added in contacts')
|
|
|
|
one_to_one_chat_2.add_to_contacts.click()
|
|
|
|
one_to_one_chat_2.chat_message_input.set_value('@' + default_username_1)
|
|
|
|
one_to_one_chat_2.chat_message_input.click()
|
|
|
|
if not one_to_one_chat_2.user_profile_image_in_mentions_list(default_username_1).is_element_image_similar_to_template('sauce_logo.png'):
|
|
|
|
self.errors.append('Profile picture was not updated in 1-1 chat mentions list')
|
|
|
|
|
|
|
|
profile_1.just_fyi('Check profile image updated in user profile view and on Chats view')
|
|
|
|
profile_2 = one_to_one_chat_2.profile_button.click()
|
|
|
|
profile_2.contacts_button.click()
|
|
|
|
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')
|
2021-06-23 15:12:42 +00:00
|
|
|
profile_2.close_button.click()
|
2021-03-04 09:35:48 +00:00
|
|
|
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')
|
|
|
|
|
|
|
|
profile_1.just_fyi('Check profile image updated in user profile view in Group chat views 4')
|
|
|
|
home_1.home_button.click(desired_view='home')
|
|
|
|
group_chat_message = 'Trololo'
|
|
|
|
group_chat_2 = home_2.create_group_chat(user_names_to_add=[default_username_1])
|
|
|
|
group_chat_2.send_message('Message')
|
|
|
|
group_chat_1 = home_1.get_chat('new_group_chat').click()
|
|
|
|
group_chat_1.join_chat_button.click()
|
|
|
|
group_chat_1.send_message(group_chat_message)
|
|
|
|
if not group_chat_2.chat_element_by_text(group_chat_message).member_photo.is_element_image_similar_to_template('sauce_logo.png'):
|
|
|
|
self.errors.append('User profile picture was not updated in message Group chat view')
|
|
|
|
|
|
|
|
profile_1.just_fyi('Check profile image updated in on login view')
|
|
|
|
home_1.profile_button.click()
|
|
|
|
profile_1.logout()
|
|
|
|
sign_in_1 = home_1.get_sign_in_view()
|
|
|
|
if not sign_in_1.get_multiaccount_by_position(1).account_logo.is_element_image_similar_to_template('sauce_logo.png'):
|
|
|
|
self.errors.append('User profile picture was not updated on Multiaccounts list select login view')
|
|
|
|
sign_in_1.element_by_text(default_username_1).click()
|
|
|
|
if not sign_in_1.get_multiaccount_by_position(1).account_logo.is_element_image_similar_to_template('sauce_logo.png'):
|
|
|
|
self.errors.append('User profile picture was not updated on account login view')
|
|
|
|
sign_in_1.password_input.set_value(common_password)
|
|
|
|
sign_in_1.sign_in_button.click()
|
|
|
|
|
|
|
|
profile_1.just_fyi('Remove user from contact and check there is no profile image displayed')
|
|
|
|
group_chat_2.profile_button.click()
|
|
|
|
profile_2.contacts_button.click()
|
|
|
|
profile_2.element_by_text(default_username_1).click()
|
|
|
|
one_to_one_chat_2.remove_from_contacts.click()
|
|
|
|
# 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)
|
2021-06-23 15:12:42 +00:00
|
|
|
one_to_one_chat_2.close_button.click()
|
2021-03-04 09:35:48 +00:00
|
|
|
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')
|
|
|
|
|
|
|
|
profile_2.just_fyi('Enable to see profile image from "Everyone" setting')
|
|
|
|
home_2.profile_button.click()
|
|
|
|
profile_2.appearance_button.click()
|
|
|
|
profile_2.show_profile_pictures_of.click()
|
|
|
|
profile_2.element_by_text('Everyone').click()
|
|
|
|
group_chat_1.send_message(group_chat_message)
|
|
|
|
profile_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 is not returned to default after user removed from Contacts')
|
2021-06-08 10:58:26 +00:00
|
|
|
self.errors.verify_no_errors()
|
2021-03-04 09:35:48 +00:00
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5432)
|
|
|
|
@marks.medium
|
2018-07-19 09:57:45 +00:00
|
|
|
def test_custom_bootnodes(self):
|
|
|
|
self.create_drivers(2)
|
2020-11-05 16:24:18 +00:00
|
|
|
home_1, home_2 = SignInView(self.drivers[0]).create_user(), SignInView(self.drivers[1]).create_user()
|
2020-04-10 10:25:46 +00:00
|
|
|
public_key = home_2.get_public_key_and_username()
|
2018-07-19 09:57:45 +00:00
|
|
|
|
2019-08-20 23:29:35 +00:00
|
|
|
profile_1, profile_2 = home_1.profile_button.click(), home_2.profile_button.click()
|
|
|
|
username_1, username_2 = profile_1.default_username_text.text, profile_2.default_username_text.text
|
2020-04-23 15:42:20 +00:00
|
|
|
|
|
|
|
profile_1.just_fyi('Add custom bootnode, enable bootnodes and check validation')
|
2018-07-19 09:57:45 +00:00
|
|
|
profile_1.advanced_button.click()
|
|
|
|
profile_1.bootnodes_button.click()
|
2020-04-23 15:42:20 +00:00
|
|
|
profile_1.add_bootnode_button.click()
|
2018-07-19 09:57:45 +00:00
|
|
|
profile_1.specify_name_input.set_value('test')
|
2020-04-23 15:42:20 +00:00
|
|
|
profile_1.bootnode_address_input.set_value('invalid_bootnode_address')
|
|
|
|
if not profile_1.element_by_text_part('Invalid format').is_element_displayed():
|
|
|
|
self.errors.append('Validation message about invalid format of bootnode is not shown')
|
|
|
|
profile_1.save_button.click()
|
|
|
|
if profile_1.add_bootnode_button.is_element_displayed():
|
|
|
|
self.errors.append('User was navigated to another screen when tapped on disabled "Save" button')
|
|
|
|
profile_1.bootnode_address_input.clear()
|
2018-07-19 09:57:45 +00:00
|
|
|
profile_1.bootnode_address_input.set_value(bootnode_address)
|
|
|
|
profile_1.save_button.click()
|
|
|
|
profile_1.enable_bootnodes.click()
|
2020-04-23 15:42:20 +00:00
|
|
|
profile_1.home_button.click()
|
2018-07-19 09:57:45 +00:00
|
|
|
|
2020-04-23 15:42:20 +00:00
|
|
|
profile_1.just_fyi('Add contact and send first message')
|
2018-07-19 09:57:45 +00:00
|
|
|
chat_1 = home_1.add_contact(public_key)
|
|
|
|
message = 'test message'
|
|
|
|
chat_1.chat_message_input.send_keys(message)
|
|
|
|
chat_1.send_message_button.click()
|
2019-08-20 23:29:35 +00:00
|
|
|
profile_2.home_button.click()
|
2020-03-17 17:27:10 +00:00
|
|
|
chat_2 = home_2.get_chat(username_1).click()
|
2018-07-19 09:57:45 +00:00
|
|
|
chat_2.chat_element_by_text(message).wait_for_visibility_of_element()
|
|
|
|
chat_2.add_to_contacts.click()
|
|
|
|
|
2020-04-23 15:42:20 +00:00
|
|
|
profile_1.just_fyi('Disable custom bootnodes')
|
|
|
|
chat_1.profile_button.click()
|
2020-11-05 16:24:18 +00:00
|
|
|
profile_1.advanced_button.click()
|
|
|
|
profile_1.bootnodes_button.click()
|
2018-07-19 09:57:45 +00:00
|
|
|
profile_1.enable_bootnodes.click()
|
2020-04-23 15:42:20 +00:00
|
|
|
profile_1.home_button.click()
|
2018-07-19 09:57:45 +00:00
|
|
|
|
2020-04-23 15:42:20 +00:00
|
|
|
profile_1.just_fyi('Send message and check that it is received after disabling bootnodes')
|
2020-03-17 17:27:10 +00:00
|
|
|
home_1.get_chat(username_2).click()
|
2018-07-19 09:57:45 +00:00
|
|
|
message_1 = 'new message'
|
|
|
|
chat_1.chat_message_input.send_keys(message_1)
|
|
|
|
chat_1.send_message_button.click()
|
2020-04-23 15:42:20 +00:00
|
|
|
for chat in chat_1, chat_2:
|
|
|
|
if not chat.chat_element_by_text(message_1).is_element_displayed():
|
|
|
|
self.errors.append('Message was not received after enabling bootnodes!')
|
|
|
|
self.errors.verify_no_errors()
|
2018-07-19 09:57:45 +00:00
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5436)
|
|
|
|
@marks.medium
|
2021-01-27 16:13:47 +00:00
|
|
|
@marks.flaky
|
2019-12-27 11:34:59 +00:00
|
|
|
def test_add_switch_delete_custom_mailserver(self):
|
2018-07-19 09:57:45 +00:00
|
|
|
self.create_drivers(2)
|
|
|
|
sign_in_1, sign_in_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
|
2019-08-20 23:29:35 +00:00
|
|
|
home_1, home_2 = sign_in_1.create_user(), sign_in_2.create_user()
|
2020-04-10 10:25:46 +00:00
|
|
|
public_key = home_2.get_public_key_and_username()
|
2021-06-23 15:12:42 +00:00
|
|
|
home_2.home_button.click()
|
2018-07-19 09:57:45 +00:00
|
|
|
|
|
|
|
profile_1 = home_1.profile_button.click()
|
2019-08-20 23:29:35 +00:00
|
|
|
username_1 = profile_1.default_username_text.text
|
2019-10-21 12:48:45 +00:00
|
|
|
|
2019-12-27 11:34:59 +00:00
|
|
|
profile_1.just_fyi('disable autoselection')
|
2019-10-21 12:48:45 +00:00
|
|
|
profile_1.sync_settings_button.click()
|
2018-07-19 09:57:45 +00:00
|
|
|
profile_1.mail_server_button.click()
|
2020-12-03 12:59:20 +00:00
|
|
|
mailserver = profile_1.return_mailserver_name(mailserver_hk, used_fleet)
|
2019-10-24 16:03:11 +00:00
|
|
|
profile_1.mail_server_auto_selection_button.click()
|
2020-10-22 09:41:29 +00:00
|
|
|
profile_1.mail_server_by_name(mailserver).click()
|
2019-10-24 16:03:11 +00:00
|
|
|
profile_1.confirm_button.click()
|
2021-06-23 15:12:42 +00:00
|
|
|
|
2019-12-27 11:34:59 +00:00
|
|
|
profile_1.just_fyi('add custom mailserver (check address/name validation) and connect to it')
|
2018-07-19 09:57:45 +00:00
|
|
|
profile_1.plus_button.click()
|
|
|
|
server_name = 'test'
|
2020-04-03 07:18:10 +00:00
|
|
|
profile_1.save_button.click()
|
2020-12-03 12:59:20 +00:00
|
|
|
if profile_1.element_by_text(mailserver).is_element_displayed():
|
2020-04-03 07:18:10 +00:00
|
|
|
self.errors.append('Could add custom mailserver with empty address and name')
|
2018-07-19 09:57:45 +00:00
|
|
|
profile_1.specify_name_input.set_value(server_name)
|
2019-12-27 11:34:59 +00:00
|
|
|
profile_1.mail_server_address_input.set_value(mailserver_address[:-3])
|
|
|
|
profile_1.save_button.click()
|
2020-12-03 12:59:20 +00:00
|
|
|
if not profile_1.element_by_text_part("Invalid format").is_element_displayed():
|
2019-12-27 11:34:59 +00:00
|
|
|
self.errors.append('could add custom mailserver with invalid address')
|
|
|
|
profile_1.mail_server_address_input.clear()
|
2018-07-19 09:57:45 +00:00
|
|
|
profile_1.mail_server_address_input.set_value(mailserver_address)
|
|
|
|
profile_1.save_button.click()
|
2020-12-03 12:59:20 +00:00
|
|
|
profile_1.mail_server_by_name(server_name).click()
|
|
|
|
profile_1.mail_server_connect_button.click()
|
|
|
|
profile_1.confirm_button.click()
|
|
|
|
if profile_1.element_by_text_part("Error connecting").is_element_displayed(40):
|
|
|
|
profile_1.retry_to_connect_to_mailserver()
|
|
|
|
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'
|
|
|
|
chat_1.chat_message_input.send_keys(message)
|
|
|
|
chat_1.send_message_button.click()
|
|
|
|
chat_2 = home_2.get_chat(username_1).click()
|
|
|
|
chat_2.chat_element_by_text(message).wait_for_visibility_of_element()
|
|
|
|
message_1 = 'new message'
|
|
|
|
chat_2.chat_message_input.send_keys(message_1)
|
|
|
|
chat_2.send_message_button.click()
|
|
|
|
chat_1.chat_element_by_text(message_1).wait_for_visibility_of_element()
|
|
|
|
|
|
|
|
profile_1.just_fyi('delete custom mailserver')
|
|
|
|
chat_1.profile_button.click()
|
|
|
|
profile_1.sync_settings_button.click()
|
|
|
|
profile_1.mail_server_button.click()
|
|
|
|
profile_1.element_by_text(mailserver).scroll_to_element()
|
|
|
|
profile_1.element_by_text(mailserver).click()
|
|
|
|
profile_1.confirm_button.click()
|
|
|
|
profile_1.element_by_text(server_name).scroll_to_element()
|
|
|
|
profile_1.element_by_text(server_name).click()
|
|
|
|
profile_1.mail_server_delete_button.scroll_to_element()
|
|
|
|
profile_1.mail_server_delete_button.click()
|
|
|
|
profile_1.mail_server_confirm_delete_button.click()
|
|
|
|
if profile_1.element_by_text(server_name).is_element_displayed():
|
|
|
|
self.errors.append('Deleted custom mailserver is shown')
|
|
|
|
profile_1.get_back_to_home_view()
|
|
|
|
profile_1.relogin()
|
|
|
|
chat_1.profile_button.click()
|
|
|
|
profile_1.sync_settings_button.click()
|
|
|
|
profile_1.mail_server_button.click()
|
|
|
|
if profile_1.element_by_text(server_name).is_element_displayed():
|
|
|
|
self.errors.append('Deleted custom mailserver is shown after relogin')
|
2019-12-27 11:34:59 +00:00
|
|
|
|
|
|
|
self.errors.verify_no_errors()
|
|
|
|
|
2019-10-24 16:03:11 +00:00
|
|
|
@marks.testrail_id(5767)
|
|
|
|
@marks.medium
|
2020-05-20 08:47:53 +00:00
|
|
|
@marks.flaky
|
2019-10-24 16:03:11 +00:00
|
|
|
def test_can_not_connect_to_mailserver(self):
|
|
|
|
self.create_drivers(2)
|
2020-12-03 12:59:20 +00:00
|
|
|
home_1, home_2= SignInView(self.drivers[0]).create_user(), SignInView(self.drivers[1]).create_user()
|
2019-10-24 16:03:11 +00:00
|
|
|
profile_1 = home_1.profile_button.click()
|
|
|
|
|
|
|
|
profile_1.just_fyi('add non-working mailserver and connect to it')
|
|
|
|
profile_1.sync_settings_button.click()
|
|
|
|
profile_1.mail_server_button.click()
|
2020-12-03 12:59:20 +00:00
|
|
|
profile_1.mail_server_auto_selection_button.click()
|
2019-10-24 16:03:11 +00:00
|
|
|
profile_1.plus_button.click()
|
|
|
|
server_name = 'test'
|
|
|
|
profile_1.specify_name_input.set_value(server_name)
|
|
|
|
profile_1.mail_server_address_input.set_value(mailserver_address.replace('4','5'))
|
|
|
|
profile_1.save_button.click()
|
|
|
|
profile_1.mail_server_by_name(server_name).click()
|
|
|
|
profile_1.mail_server_connect_button.click()
|
|
|
|
profile_1.confirm_button.click()
|
2020-12-03 12:59:20 +00:00
|
|
|
|
|
|
|
profile_1.just_fyi('check that popup "Error connecting" will not reappear if tap on "Cancel"')
|
2021-01-27 10:19:03 +00:00
|
|
|
profile_1.element_by_translation_id(id='mailserver-error-title').wait_for_element(60)
|
2020-12-03 12:59:20 +00:00
|
|
|
profile_1.cancel_button.click()
|
|
|
|
profile_1.home_button.click()
|
|
|
|
|
|
|
|
home_2.just_fyi('send several messages to public channel')
|
|
|
|
public_chat_name = home_2.get_random_chat_name()
|
|
|
|
message = 'test_message'
|
|
|
|
public_chat_2 = home_2.join_public_chat(public_chat_name)
|
|
|
|
public_chat_2.chat_message_input.send_keys(message)
|
|
|
|
public_chat_2.send_message_button.click()
|
|
|
|
public_chat_2.back_button.click()
|
|
|
|
|
|
|
|
profile_1.just_fyi('join same public chat and try to reconnect via "Tap to reconnect" and check "Connecting"')
|
|
|
|
profile_1.home_button.click()
|
|
|
|
public_chat_1 = home_1.join_public_chat(public_chat_name)
|
|
|
|
public_chat_1.relogin()
|
2021-02-16 14:57:20 +00:00
|
|
|
|
2021-07-12 14:44:51 +00:00
|
|
|
# TODO: blocked due to 11786
|
|
|
|
# profile_1.just_fyi('check that still connected to custom mailserver after relogin')
|
|
|
|
# home_1.profile_button.click()
|
|
|
|
# profile_1.sync_settings_button.click()
|
|
|
|
# if not profile_1.element_by_text(server_name).is_element_displayed():
|
|
|
|
# self.drivers[0].fail("Not connected to custom mailserver after re-login")
|
|
|
|
#
|
|
|
|
# profile_1.just_fyi('check that can RETRY to connect')
|
|
|
|
# profile_1.element_by_translation_id(id='mailserver-error-title').wait_for_element(60)
|
|
|
|
# public_chat_1.element_by_translation_id(id='mailserver-retry', uppercase=True).wait_and_click(60)
|
|
|
|
#
|
|
|
|
# profile_1.just_fyi('check that can pick another mailserver and receive messages')
|
|
|
|
# profile_1.element_by_translation_id(id='mailserver-error-title').wait_for_element(60)
|
|
|
|
# profile_1.element_by_translation_id(id='mailserver-pick-another', uppercase=True).wait_and_click(120)
|
|
|
|
# mailserver = profile_1.return_mailserver_name(mailserver_ams, used_fleet)
|
|
|
|
# profile_1.element_by_text(mailserver).click()
|
|
|
|
# profile_1.confirm_button.click()
|
|
|
|
# profile_1.home_button.click()
|
|
|
|
# home_1.get_chat('#%s' % public_chat_name).click()
|
|
|
|
# if not public_chat_1.chat_element_by_text(message).is_element_displayed(60):
|
|
|
|
# self.errors.append("Chat history wasn't fetched")
|
2019-10-24 16:03:11 +00:00
|
|
|
|
2019-10-29 08:25:57 +00:00
|
|
|
self.errors.verify_no_errors()
|
2019-10-24 16:03:11 +00:00
|
|
|
|
2020-12-16 17:08:57 +00:00
|
|
|
@marks.testrail_id(6332)
|
|
|
|
@marks.medium
|
|
|
|
def test_disable_use_history_node(self):
|
|
|
|
self.create_drivers(2)
|
|
|
|
home_1, home_2 = SignInView(self.drivers[0]).create_user(), SignInView(self.drivers[1]).create_user()
|
|
|
|
profile_1 = home_1.profile_button.click()
|
|
|
|
|
|
|
|
home_2.just_fyi('send several messages to public channel')
|
|
|
|
public_chat_name = home_2.get_random_chat_name()
|
|
|
|
message, message_no_history = 'test_message', 'history node is disabled'
|
|
|
|
public_chat_2 = home_2.join_public_chat(public_chat_name)
|
|
|
|
public_chat_2.send_message(message)
|
|
|
|
|
|
|
|
profile_1.just_fyi('disable use_history_node and check that no history is fetched but you can still send messages')
|
|
|
|
profile_1.sync_settings_button.click()
|
|
|
|
profile_1.mail_server_button.click()
|
|
|
|
profile_1.use_history_node_button.click()
|
|
|
|
profile_1.home_button.click()
|
|
|
|
public_chat_1 = home_1.join_public_chat(public_chat_name)
|
|
|
|
if public_chat_1.chat_element_by_text(message).is_element_displayed(30):
|
|
|
|
self.errors.append('Chat history was fetched when use_history_node is disabled')
|
|
|
|
public_chat_1.send_message(message_no_history)
|
|
|
|
if not public_chat_2.chat_element_by_text(message_no_history).is_element_displayed(30):
|
|
|
|
self.errors.append('Message sent when use_history_node is disabled was not received')
|
|
|
|
public_chat_1.profile_button.click()
|
|
|
|
profile_1.relogin()
|
|
|
|
home_1.get_chat('#%s'%public_chat_name).click()
|
|
|
|
if public_chat_1.chat_element_by_text(message).is_element_displayed(30):
|
|
|
|
self.drivers[0].fail('History was fetched after relogin when use_history_node is disabled')
|
|
|
|
|
|
|
|
profile_1.just_fyi('enable use_history_node and check that history is fetched')
|
|
|
|
home_1.profile_button.click()
|
|
|
|
profile_1.sync_settings_button.click()
|
|
|
|
profile_1.mail_server_button.click()
|
|
|
|
profile_1.use_history_node_button.click()
|
|
|
|
profile_1.home_button.click(desired_view='chat')
|
|
|
|
if not public_chat_1.chat_element_by_text(message).is_element_displayed(30):
|
|
|
|
self.errors.append('History was not fetched after enabling use_history_node')
|
|
|
|
self.errors.verify_no_errors()
|
|
|
|
|
2019-10-08 08:28:52 +00:00
|
|
|
@marks.testrail_id(5762)
|
2019-05-29 08:43:41 +00:00
|
|
|
@marks.high
|
2020-11-05 16:24:18 +00:00
|
|
|
def test_pair_devices_sync_one_to_one_contacts_nicknames_public_chat(self):
|
2019-05-29 08:43:41 +00:00
|
|
|
self.create_drivers(2)
|
|
|
|
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
|
|
|
|
device_1_home = device_1.create_user()
|
|
|
|
device_1_home.profile_button.click()
|
|
|
|
device_1_profile = device_1_home.get_profile_view()
|
2019-10-09 13:00:49 +00:00
|
|
|
device_1_profile.privacy_and_security_button.click()
|
2019-05-29 08:43:41 +00:00
|
|
|
device_1_profile.backup_recovery_phrase_button.click()
|
|
|
|
device_1_profile.ok_continue_button.click()
|
|
|
|
recovery_phrase = device_1_profile.get_recovery_phrase()
|
2021-06-14 17:52:58 +00:00
|
|
|
device_1_profile.close_button.click()
|
2021-06-23 15:12:42 +00:00
|
|
|
device_1_profile.home_button.click()
|
2019-05-29 08:43:41 +00:00
|
|
|
device_1_name = 'device_%s' % device_1.driver.number
|
|
|
|
device_2_name = 'device_%s' % device_2.driver.number
|
|
|
|
message_before_sync = 'sent before sync'
|
|
|
|
message_after_sync = 'sent after sync'
|
2020-03-17 17:27:10 +00:00
|
|
|
public_chat_before_sync = 'before-pairing'
|
|
|
|
public_chat_after_sync = 'after-pairing'
|
|
|
|
|
2019-10-09 13:00:49 +00:00
|
|
|
device_1.just_fyi('add contact, start 1-1 chat with basic user')
|
2019-05-29 08:43:41 +00:00
|
|
|
device_1_chat = device_1_home.add_contact(basic_user['public_key'])
|
|
|
|
device_1_chat.chat_message_input.send_keys(message_before_sync)
|
|
|
|
device_1_chat.send_message_button.click()
|
|
|
|
|
2020-03-17 17:27:10 +00:00
|
|
|
device_1.just_fyi('join public chat')
|
|
|
|
device_1_chat.get_back_to_home_view()
|
|
|
|
device_1_public_chat = device_1_home.join_public_chat(public_chat_before_sync)
|
2020-10-30 14:40:14 +00:00
|
|
|
device_2_home = device_2.recover_access(passphrase=' '.join(recovery_phrase.values()))
|
|
|
|
device_1_profile, device_2_profile = device_1_home.profile_button.click(), device_2_home.profile_button.click()
|
|
|
|
|
|
|
|
device_2.just_fyi('go to profile and set nickname for contact')
|
|
|
|
device_1_profile.open_contact_from_profile(basic_user['username'])
|
|
|
|
nickname = 'my_basic_user'
|
|
|
|
device_1_chat.set_nickname(nickname)
|
2021-06-18 11:09:03 +00:00
|
|
|
device_1_profile.close_button.click()
|
|
|
|
device_1.back_button.click()
|
2020-03-17 17:27:10 +00:00
|
|
|
|
2019-10-09 13:00:49 +00:00
|
|
|
device_2.just_fyi('go to profile > Devices, set device name, discover device 2 to device 1')
|
2019-05-30 13:09:52 +00:00
|
|
|
device_2_profile.discover_and_advertise_device(device_2_name)
|
|
|
|
device_1_profile.discover_and_advertise_device(device_1_name)
|
2020-09-23 11:48:20 +00:00
|
|
|
device_1_profile.get_toggle_device_by_name(device_2_name).wait_and_click()
|
2019-05-29 08:43:41 +00:00
|
|
|
device_1_profile.sync_all_button.click()
|
|
|
|
device_1_profile.sync_all_button.wait_for_visibility_of_element(15)
|
2020-11-05 16:24:18 +00:00
|
|
|
[device.profile_button.click() for device in (device_1_profile, device_2_profile)]
|
2019-05-29 08:43:41 +00:00
|
|
|
|
2020-10-30 14:40:14 +00:00
|
|
|
device_2.just_fyi('check that contact with nickname is appeared in Contact list')
|
2019-05-29 08:43:41 +00:00
|
|
|
device_2_profile.contacts_button.scroll_to_element(9, 'up')
|
|
|
|
device_2_profile.contacts_button.click()
|
2020-10-30 14:40:14 +00:00
|
|
|
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)
|
2019-05-29 08:43:41 +00:00
|
|
|
|
2019-10-09 13:00:49 +00:00
|
|
|
device_1.just_fyi('send message to 1-1 chat with basic user and add another contact')
|
2020-10-30 14:40:14 +00:00
|
|
|
device_1_profile.home_button.click(desired_view='chat')
|
2020-03-17 17:27:10 +00:00
|
|
|
device_1_public_chat.back_button.click()
|
2020-10-30 14:40:14 +00:00
|
|
|
device_1_home.get_chat(nickname).click()
|
2019-05-29 08:43:41 +00:00
|
|
|
device_1_chat.chat_message_input.send_keys(message_after_sync)
|
|
|
|
device_1_chat.send_message_button.click()
|
|
|
|
device_1_chat.back_button.click()
|
|
|
|
device_1_home.add_contact(transaction_senders['A']['public_key'])
|
|
|
|
|
2020-03-17 17:27:10 +00:00
|
|
|
device_2.just_fyi('check that messages appeared in 1-1 chat, public chats and new contacts are synced')
|
2020-09-17 13:14:55 +00:00
|
|
|
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'])
|
2020-03-17 17:27:10 +00:00
|
|
|
|
2020-10-30 14:40:14 +00:00
|
|
|
device_1.just_fyi('Set nickname for added contact and check that it will be synced')
|
|
|
|
device_1_home.profile_button.click()
|
2020-11-05 16:24:18 +00:00
|
|
|
device_1_profile.contacts_button.scroll_to_element(9, 'up')
|
2020-10-30 14:40:14 +00:00
|
|
|
device_1_profile.open_contact_from_profile(transaction_senders['A']['username'])
|
|
|
|
nickname_after_sync = 'my_transaction sender'
|
|
|
|
device_1_chat.set_nickname(nickname_after_sync)
|
2021-06-14 17:52:58 +00:00
|
|
|
device_1_profile.close_button.click()
|
2020-10-30 14:40:14 +00:00
|
|
|
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)
|
|
|
|
|
2020-03-17 17:27:10 +00:00
|
|
|
device_2_profile.home_button.click()
|
|
|
|
if not device_2_home.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)
|
2020-10-30 14:40:14 +00:00
|
|
|
chat = device_2_home.get_chat(nickname).click()
|
2019-05-29 08:43:41 +00:00
|
|
|
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)
|
2020-07-30 14:35:34 +00:00
|
|
|
if not chat.chat_element_by_text(message_after_sync).is_element_displayed(60):
|
2019-05-29 08:43:41 +00:00
|
|
|
self.errors.append('"%s" message in 1-1 is not synced' % message_after_sync)
|
|
|
|
|
2020-03-17 17:27:10 +00:00
|
|
|
device_1.just_fyi('add new public chat and check that it will be synced with device2')
|
|
|
|
device_1_chat.get_back_to_home_view()
|
|
|
|
device_1_home.join_public_chat(public_chat_after_sync)
|
|
|
|
device_2_home = chat.get_back_to_home_view()
|
|
|
|
if not device_2_home.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)
|
|
|
|
|
2019-10-29 08:25:57 +00:00
|
|
|
self.errors.verify_no_errors()
|
2019-05-30 13:09:52 +00:00
|
|
|
|
2019-09-05 02:32:33 +00:00
|
|
|
@marks.testrail_id(6226)
|
|
|
|
@marks.critical
|
2021-03-17 09:28:23 +00:00
|
|
|
def test_ens_mentions_pn_and_nickname_in_public_and_1_1_chats(self):
|
2019-09-05 02:32:33 +00:00
|
|
|
self.create_drivers(2)
|
|
|
|
device_1, device_2 = self.drivers[0], self.drivers[1]
|
|
|
|
sign_in_1, sign_in_2 = SignInView(device_1), SignInView(device_2)
|
|
|
|
user_1 = ens_user
|
2021-03-17 09:28:23 +00:00
|
|
|
home_1 = sign_in_1.recover_access(user_1['passphrase'], enable_notifications=True)
|
2019-09-05 02:32:33 +00:00
|
|
|
home_2 = sign_in_2.create_user()
|
2021-03-17 09:28:23 +00:00
|
|
|
publuc_key_2, username_2 = home_2.get_public_key_and_username(return_username=True)
|
|
|
|
home_2.home_button.double_click()
|
2019-09-05 02:32:33 +00:00
|
|
|
|
2019-09-02 08:40:13 +00:00
|
|
|
home_1.just_fyi('switching to mainnet and add ENS')
|
2019-09-05 02:32:33 +00:00
|
|
|
profile_1 = sign_in_1.profile_button.click()
|
|
|
|
profile_1.switch_network('Mainnet with upstream RPC')
|
|
|
|
home_1.profile_button.click()
|
2019-11-25 10:32:30 +00:00
|
|
|
dapp_view_1 = profile_1.ens_usernames_button.click()
|
2019-09-05 02:32:33 +00:00
|
|
|
dapp_view_1.element_by_text('Get started').click()
|
2021-01-25 16:35:40 +00:00
|
|
|
dapp_view_1.ens_name_input.set_value(ens_user['ens'])
|
2019-12-21 15:55:19 +00:00
|
|
|
expected_text = 'This user name is owned by you and connected with your chat key.'
|
2020-08-20 10:33:25 +00:00
|
|
|
if not dapp_view_1.element_by_text_part(expected_text).is_element_displayed():
|
|
|
|
dapp_view_1.click_system_back_button()
|
|
|
|
dapp_view_1.wait_for_element_starts_with_text(expected_text)
|
2019-11-13 17:38:41 +00:00
|
|
|
dapp_view_1.check_ens_name.click_until_presence_of_element(dapp_view_1.element_by_text('Ok, got it'))
|
2019-09-05 02:32:33 +00:00
|
|
|
dapp_view_1.element_by_text('Ok, got it').click()
|
2019-11-25 10:32:30 +00:00
|
|
|
|
|
|
|
home_1.just_fyi('check ENS name wallet address and public key')
|
|
|
|
profile_1.element_by_text(user_1['ens']).click()
|
|
|
|
for text in ('10 SNT, deposit unlocked', user_1['address'].lower(), user_1['public_key'] ):
|
2020-09-23 11:48:20 +00:00
|
|
|
if not profile_1.element_by_text_part(text).is_element_displayed(40):
|
2019-11-25 10:32:30 +00:00
|
|
|
self.errors.append('%s text is not shown' % text)
|
2019-09-05 02:32:33 +00:00
|
|
|
profile_1.home_button.click()
|
|
|
|
|
2019-12-19 09:55:40 +00:00
|
|
|
home_2.just_fyi('joining same public chat, set ENS name and check it in chat from device2')
|
2020-04-10 10:25:46 +00:00
|
|
|
chat_name = home_1.get_random_chat_name()
|
2019-09-05 02:32:33 +00:00
|
|
|
chat_2 = home_2.join_public_chat(chat_name)
|
|
|
|
chat_1 = home_1.join_public_chat(chat_name)
|
|
|
|
chat_1.get_back_to_home_view()
|
|
|
|
home_1.profile_button.click()
|
2020-09-15 13:40:39 +00:00
|
|
|
ens_name = '@' + user_1['ens']
|
2019-09-05 02:32:33 +00:00
|
|
|
profile_1.element_by_text('Your ENS name').click()
|
2020-09-15 13:40:39 +00:00
|
|
|
if profile_1.username_in_ens_chat_settings_text.text != ens_name:
|
2019-11-13 17:38:41 +00:00
|
|
|
self.errors.append('ENS username is not shown in ENS usernames Chat Settings after enabling')
|
2019-09-05 02:32:33 +00:00
|
|
|
profile_1.back_button.click()
|
|
|
|
profile_1.home_button.click()
|
2020-03-17 17:27:10 +00:00
|
|
|
home_1.get_chat('#' + chat_name).click()
|
2019-09-05 02:32:33 +00:00
|
|
|
message_text_2 = 'message test text 1'
|
|
|
|
chat_1.send_message(message_text_2)
|
2020-09-15 13:40:39 +00:00
|
|
|
if not chat_2.wait_for_element_starts_with_text(ens_name):
|
2019-09-05 02:32:33 +00:00
|
|
|
self.errors.append('ENS username is not shown in public chat')
|
2021-03-17 09:28:23 +00:00
|
|
|
home_1.put_app_to_background()
|
2019-09-05 02:32:33 +00:00
|
|
|
|
2020-10-20 15:34:52 +00:00
|
|
|
home_2.just_fyi('check that can mention user with ENS name')
|
|
|
|
chat_2.select_mention_from_suggestion_list(user_1['ens'])
|
|
|
|
if chat_2.chat_message_input.text != ens_name + ' ':
|
|
|
|
self.errors.append('ENS username is not resolved in chat input after selecting it in mention suggestions list!')
|
|
|
|
chat_2.send_message_button.click()
|
|
|
|
chat_2.element_starts_with_text(ens_name,'button').click()
|
2020-10-28 08:46:17 +00:00
|
|
|
for element in (chat_2.element_by_text(user_1['username']), chat_2.profile_add_to_contacts):
|
2020-10-20 15:34:52 +00:00
|
|
|
if not element.is_element_displayed():
|
2020-10-28 08:46:17 +00:00
|
|
|
self.errors.append('Was not redirected to user profile after tapping on mention!')
|
2021-03-17 09:28:23 +00:00
|
|
|
|
2021-05-28 15:39:33 +00:00
|
|
|
home_1.just_fyi('check that PN is received and after tap you are redirected to public chat, mention is highligted')
|
2021-03-17 09:28:23 +00:00
|
|
|
home_1.open_notification_bar()
|
Add community notifications on android & IOS
[Fixes: #11806]
[Fixes: #11877]
Features added
An admin should receive a notification on android if a community request is made
Clicking on the push notification will take you to the list of requests
Changes to push notifications
Push notification for messages are grouped by chat, similarly to discord. Only the first notification in a chat will alert, the next will be "silent" notification. Meaning you will see the message but it will not alert. This is consistent with discord/whatsapp.
Clicking on a transaction notification will take you to wallet (not sure it was doing that before, but it might have)
Changed the behavior of the notification toggle, before Notifications and wallet transactions were separate, meaning you could have wallet transaction and Notifications disabled and you'd still receive transactions notifications. Now you need to have Notifications enabled to receive wallet transactions. Eventually we will have an option to toggle message notifications.
Technical details
Removes headless tasks, they were not used
Message notifications are passed unchanged to java, we still check if the chat is in the foreground, but no modifications are made to the notification object. This should get us closer to avoid clojure completely.
Merged the two notifications implementation (NewMessageSignalHandler and PushNotificationHelper). We should split maybe off in more meaningful classes, but there's less code duplication now, and it can be re-used for non-chat (communities) notifications.
Parsing of text for message notifications is done in status-go
Signal is not passed to status-react if notifications are not enabled
Next step
To completely remove notification code from status-react the following are required:
Java needs to be alerted of which chat is in the foreground and whether the app is in the foreground
Transaction notification body message need to be created in status-go
Notification signal needs to be stopped in Java
Limitations
If the name of a contact changes, the notification will not change, once is displayed, it won't be modified
2021-03-04 09:27:55 +00:00
|
|
|
home_1.element_by_text_part(username_2).click()
|
2021-05-28 15:39:33 +00:00
|
|
|
if home_1.element_starts_with_text(user_1['ens'] +'.stateofus.eth').is_element_differs_from_template('mentioned.png', 2):
|
|
|
|
self.errors.append('Mention is not highlighted!')
|
2021-06-18 11:09:03 +00:00
|
|
|
|
|
|
|
# Close Device1 driver session since it's not needed anymore
|
|
|
|
self.drivers[0].quit()
|
2020-10-20 15:34:52 +00:00
|
|
|
|
2019-11-13 17:38:41 +00:00
|
|
|
home_2.just_fyi('check that ENS name is shown in 1-1 chat without adding user as contact in header, profile, options')
|
2020-10-20 15:34:52 +00:00
|
|
|
chat_2_one_to_one = chat_2.profile_send_message.click()
|
2020-09-15 13:40:39 +00:00
|
|
|
if chat_2_one_to_one.user_name_text.text != ens_name:
|
2019-11-13 17:38:41 +00:00
|
|
|
self.errors.append('ENS username is not shown in 1-1 chat header')
|
|
|
|
chat_2_one_to_one.chat_options.click()
|
2020-09-15 13:40:39 +00:00
|
|
|
if not chat_2_one_to_one.element_by_text(ens_name).is_element_displayed():
|
2019-11-13 17:38:41 +00:00
|
|
|
self.errors.append('ENS username is not shown in 1-1 chat options')
|
|
|
|
chat_2_one_to_one.view_profile_button.click()
|
2020-09-15 13:40:39 +00:00
|
|
|
if not chat_2_one_to_one.element_by_text(ens_name).is_element_displayed():
|
2019-11-13 17:38:41 +00:00
|
|
|
self.errors.append('ENS username is not shown in user profile')
|
|
|
|
|
|
|
|
home_2.just_fyi('add user to contacts and check that ENS name is shown in contact')
|
|
|
|
chat_2_one_to_one.profile_add_to_contacts.click()
|
2021-06-18 11:09:03 +00:00
|
|
|
chat_2.close_button.click()
|
2019-11-13 17:38:41 +00:00
|
|
|
profile_2 = chat_2_one_to_one.profile_button.click()
|
2020-09-15 13:40:39 +00:00
|
|
|
profile_2.open_contact_from_profile(ens_name)
|
|
|
|
|
|
|
|
home_2.just_fyi('set nickname and recheck username in 1-1 header, profile, options, contacts')
|
|
|
|
nickname = 'test user' + str(round(time()))
|
|
|
|
chat_2.set_nickname(nickname)
|
2021-06-18 11:09:03 +00:00
|
|
|
profile_2.close_button.click()
|
2020-09-15 13:40:39 +00:00
|
|
|
for name in (nickname, ens_name):
|
|
|
|
if not profile_2.element_by_text(name).is_element_displayed():
|
|
|
|
self.errors.append('%s is not shown in contact list' % name)
|
2020-11-02 17:12:24 +00:00
|
|
|
profile_2.home_button.click(desired_view='chat')
|
2020-09-15 13:40:39 +00:00
|
|
|
if chat_2_one_to_one.user_name_text.text != nickname:
|
|
|
|
self.errors.append('Nickname for user with ENS is not shown in 1-1 chat header')
|
|
|
|
chat_2_one_to_one.chat_options.click()
|
|
|
|
if not chat_2_one_to_one.element_by_text(nickname).is_element_displayed():
|
|
|
|
self.errors.append('Nickname for user with ENS is not shown in 1-1 chat options')
|
|
|
|
|
|
|
|
home_2.just_fyi('check nickname in public chat')
|
|
|
|
chat_2.get_back_to_home_view()
|
|
|
|
home_2.get_chat('#' + chat_name).click()
|
|
|
|
chat_element = chat_2.chat_element_by_text(message_text_2)
|
|
|
|
chat_element.find_element()
|
|
|
|
if chat_element.username.text != '%s %s' % (nickname, ens_name):
|
|
|
|
self.errors.append('Nickname for user with ENS is not shown in public chat')
|
2019-11-13 17:38:41 +00:00
|
|
|
|
2019-11-26 13:15:19 +00:00
|
|
|
self.errors.verify_no_errors()
|
2021-01-27 16:13:47 +00:00
|
|
|
|
2021-02-16 14:57:20 +00:00
|
|
|
@marks.testrail_id(6228)
|
|
|
|
@marks.high
|
|
|
|
def test_mobile_data_usage_complex_settings(self):
|
|
|
|
self.create_drivers(2)
|
|
|
|
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
|
|
|
|
device_1_home = device_1.create_user()
|
|
|
|
public_chat_name, public_chat_message = 'e2e-started-before', 'message to pub chat'
|
|
|
|
device_1_public = device_1_home.join_public_chat(public_chat_name)
|
|
|
|
device_1_public.send_message(public_chat_message)
|
|
|
|
|
|
|
|
device_1_home.just_fyi('set mobile data to "OFF" and check that peer-to-peer connection is still working')
|
|
|
|
device_2_home = device_2.create_user()
|
|
|
|
device_2_home.toggle_mobile_data()
|
|
|
|
device_2_home.mobile_connection_off_icon.wait_for_visibility_of_element(20)
|
|
|
|
for element in device_2_home.continue_syncing_button, device_2_home.stop_syncing_button, device_2_home.remember_my_choice_checkbox:
|
|
|
|
if not element.is_element_displayed(10):
|
|
|
|
self.drivers[0].fail('Element %s is not not shown in "Syncing mobile" bottom sheet' % element.locator)
|
|
|
|
device_2_home.stop_syncing_button.click()
|
|
|
|
if not device_2_home.mobile_connection_off_icon.is_element_displayed():
|
|
|
|
self.drivers[0].fail('No mobile connection OFF icon is shown')
|
|
|
|
device_2_home.mobile_connection_off_icon.click()
|
|
|
|
for element in device_2_home.connected_to_n_peers_text, device_2_home.waiting_for_wi_fi:
|
|
|
|
if not element.is_element_displayed():
|
|
|
|
self.errors.append("Element '%s' is not shown in Connection status bottom sheet" % element.locator)
|
|
|
|
device_2_home.click_system_back_button()
|
|
|
|
device_2_public = device_2_home.join_public_chat(public_chat_name)
|
|
|
|
if device_2_public.chat_element_by_text(public_chat_message).is_element_displayed(30):
|
|
|
|
self.errors.append("Chat history was fetched with mobile data fetching off")
|
|
|
|
public_chat_new_message = 'new message'
|
|
|
|
device_1_public.send_message(public_chat_new_message)
|
|
|
|
if not device_2_public.chat_element_by_text(public_chat_new_message).is_element_displayed(30):
|
|
|
|
self.errors.append("Peer-to-peer connection is not working when mobile data fetching is off")
|
|
|
|
|
|
|
|
device_2_home.just_fyi('set mobile data to "ON"')
|
|
|
|
device_2_home.home_button.click()
|
|
|
|
device_2_home.mobile_connection_off_icon.click()
|
|
|
|
device_2_home.use_mobile_data_switch.click()
|
|
|
|
if not device_2_home.connected_to_node_text.is_element_displayed(10):
|
|
|
|
self.errors.append("Not connected to history node after enabling fetching on mobile data")
|
|
|
|
device_2_home.click_system_back_button()
|
|
|
|
device_2_home.mobile_connection_on_icon.wait_for_visibility_of_element(10)
|
|
|
|
if not device_2_home.mobile_connection_on_icon.is_element_displayed():
|
|
|
|
self.errors.append('No mobile connection ON icon is shown')
|
|
|
|
device_2_home.get_chat('#%s'% public_chat_name).click()
|
2021-06-29 15:55:55 +00:00
|
|
|
if not device_2_public.chat_element_by_text(public_chat_message).is_element_displayed(90):
|
2021-02-16 14:57:20 +00:00
|
|
|
self.errors.append("Chat history was not fetched with mobile data fetching ON")
|
|
|
|
|
|
|
|
device_2_home.just_fyi('check redirect to sync settings by tappin "Sync" in connection status bottom sheet')
|
|
|
|
device_2_home.home_button.click()
|
|
|
|
device_2_home.mobile_connection_on_icon.click()
|
|
|
|
device_2_home.connection_settings_button.click()
|
|
|
|
if not device_2_home.element_by_translation_id("mobile-network-use-mobile").is_element_displayed():
|
|
|
|
self.errors.append("Was not redirected to sync settings after tapping on Settings in connection bottom sheet")
|
|
|
|
|
|
|
|
device_1_home.just_fyi("Check default preferences in Sync settings")
|
|
|
|
device_1_profile = device_1_home.profile_button.click()
|
|
|
|
device_1_profile.sync_settings_button.click()
|
|
|
|
if not device_1_profile.element_by_translation_id("mobile-network-use-wifi").is_element_displayed():
|
|
|
|
self.errors.append("Mobile data is enabled by default")
|
|
|
|
device_1_profile.element_by_translation_id("mobile-network-use-wifi").click()
|
|
|
|
if device_1_profile.ask_me_when_on_mobile_network.text != "ON":
|
|
|
|
self.errors.append("'Ask me when on mobile network' is not enabled by default")
|
|
|
|
|
|
|
|
device_1_profile.just_fyi("Disable 'ask me when on mobile network' and check that it is not shown")
|
|
|
|
device_1_profile.ask_me_when_on_mobile_network.click()
|
|
|
|
device_1_profile.toggle_mobile_data()
|
|
|
|
if device_1_profile.element_by_translation_id("mobile-network-start-syncing").is_element_displayed(20):
|
|
|
|
self.errors.append("Popup is shown, but 'ask me when on mobile network' is disabled")
|
|
|
|
|
|
|
|
device_1_profile.just_fyi("Check 'Restore default' setting")
|
|
|
|
device_1_profile.element_by_text('Restore Defaults').click()
|
|
|
|
if device_1_profile.use_mobile_data.attribute_value("checked"):
|
|
|
|
self.errors.append("Mobile data is enabled by default")
|
|
|
|
if not device_1_profile.ask_me_when_on_mobile_network.attribute_value("checked"):
|
|
|
|
self.errors.append("'Ask me when on mobile network' is not enabled by default")
|
|
|
|
|
|
|
|
self.errors.verify_no_errors()
|
|
|
|
|
|
|
|
|
2021-01-27 16:13:47 +00:00
|
|
|
@marks.testrail_id(5680)
|
|
|
|
@marks.high
|
|
|
|
@marks.skip
|
|
|
|
# TODO: skip until edit userpic is enabled back
|
|
|
|
def test_pair_devices_sync_name_photo_public_group_chats(self):
|
|
|
|
self.create_drivers(2)
|
|
|
|
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
|
|
|
|
device_1_home = device_1.create_user()
|
|
|
|
device_1_home.profile_button.click()
|
|
|
|
device_1_profile = device_1_home.get_profile_view()
|
|
|
|
device_1_profile.privacy_and_security_button.click()
|
|
|
|
device_1_profile.backup_recovery_phrase_button.click()
|
|
|
|
recovery_phrase = device_1_profile.backup_recovery_phrase()
|
|
|
|
device_1_profile.back_button.click()
|
|
|
|
device_1_profile.get_back_to_home_view()
|
|
|
|
device_1_name = 'device_%s' % device_1.driver.number
|
|
|
|
device_2_name = 'device_%s' % device_2.driver.number
|
|
|
|
public_chat_before_sync_name = 'b-public-%s' % device_1_home.get_random_chat_name()
|
|
|
|
public_chat_after_sync_name = 'a-public-%s' % device_1_home.get_random_chat_name()
|
|
|
|
group_chat_name = 'group-%s' % device_1_home.get_random_chat_name()
|
|
|
|
message_after_sync = 'sent after sync'
|
|
|
|
|
|
|
|
device_1.just_fyi('join public chat, create group chat, edit user picture')
|
|
|
|
device_1_public_chat = device_1_home.join_public_chat(public_chat_before_sync_name)
|
|
|
|
device_1_public_chat.back_button.click()
|
|
|
|
device_1_one_to_one = device_1_home.add_contact(basic_user['public_key'])
|
|
|
|
device_1_one_to_one.back_button.click()
|
|
|
|
device_1_group_chat = device_1_home.create_group_chat([basic_user['username']], group_chat_name)
|
|
|
|
device_1_group_chat.back_button.click()
|
|
|
|
device_1_home.profile_button.click()
|
|
|
|
device_1_profile = device_1_home.get_profile_view()
|
|
|
|
device_1_profile.edit_profile_picture('sauce_logo.png')
|
|
|
|
|
|
|
|
device_2.just_fyi('go to profile > Devices, set device name, discover device 2 to device 1')
|
|
|
|
device_2_home = device_2.recover_access(passphrase=' '.join(recovery_phrase.values()))
|
|
|
|
device_2_profile = device_2_home.get_profile_view()
|
|
|
|
device_2_profile.discover_and_advertise_device(device_2_name)
|
|
|
|
|
|
|
|
device_1.just_fyi('enable pairing of `device 2` and sync')
|
|
|
|
device_1_profile.discover_and_advertise_device(device_1_name)
|
|
|
|
device_1_profile.get_toggle_device_by_name(device_2_name).click()
|
|
|
|
device_1_profile.sync_all_button.click()
|
|
|
|
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')
|
2021-06-23 15:12:42 +00:00
|
|
|
device_2_home = device_2_profile.home_button.click()
|
2021-01-27 16:13:47 +00:00
|
|
|
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)
|
|
|
|
device_2_home.home_button.click()
|
|
|
|
device_2_home.profile_button.click()
|
|
|
|
if not device_2_profile.profile_picture.is_element_image_equals_template('sauce_logo_profile.png'):
|
|
|
|
self.errors.append('Profile picture was not updated after initial sync')
|
|
|
|
device_2_profile.home_button.click()
|
|
|
|
|
|
|
|
device_1.just_fyi('send message to group chat, and join to new public chat')
|
2021-06-23 15:12:42 +00:00
|
|
|
device_1_home = device_1_profile.home_button.click()
|
2021-01-27 16:13:47 +00:00
|
|
|
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()
|
|
|
|
device_1_group_chat.chat_message_input.send_keys(message_after_sync)
|
|
|
|
device_1_group_chat.send_message_button.click()
|
|
|
|
device_1_group_chat.back_button.click()
|
|
|
|
|
|
|
|
device_2.just_fyi('check that message in group chat is shown, public chats are synced')
|
|
|
|
if not device_2_home.element_by_text('#%s' % public_chat_after_sync_name).is_element_displayed():
|
|
|
|
self.errors.append('Public chat "%s" doesn\'t appear on other device when devices are paired'
|
|
|
|
% public_chat_before_sync_name)
|
|
|
|
|
|
|
|
device_2_home.element_by_text(group_chat_name).click()
|
|
|
|
device_2_group_chat = device_2_home.get_chat_view()
|
|
|
|
|
|
|
|
if not device_2_group_chat.chat_element_by_text(message_after_sync).is_element_displayed():
|
|
|
|
self.errors.append('"%s" message in group chat is not synced' % message_after_sync)
|
|
|
|
|
|
|
|
self.errors.verify_no_errors()
|