2019-08-08 11:41:06 +00:00
|
|
|
import re
|
2018-06-29 17:27:30 +00:00
|
|
|
|
2018-09-17 08:50:01 +00:00
|
|
|
from tests import marks, bootnode_address, mailserver_address, camera_access_error_text, \
|
2020-01-21 13:59:01 +00:00
|
|
|
photos_access_error_text, test_dapp_url, test_dapp_name, mailserver_ams, mailserver_gc, \
|
2020-08-11 16:10:53 +00:00
|
|
|
mailserver_hk, used_fleet, common_password, delete_alert_text
|
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):
|
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5302)
|
2019-03-05 16:43:30 +00:00
|
|
|
@marks.high
|
2020-01-28 13:55:28 +00:00
|
|
|
@marks.skip
|
2018-06-29 17:27:30 +00:00
|
|
|
def test_set_profile_picture(self):
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
sign_in_view.create_user()
|
|
|
|
profile_view = sign_in_view.profile_button.click()
|
|
|
|
profile_view.edit_profile_picture(file_name='sauce_logo.png')
|
|
|
|
profile_view.home_button.click()
|
|
|
|
sign_in_view.profile_button.click()
|
|
|
|
profile_view.swipe_down()
|
2019-08-23 10:24:52 +00:00
|
|
|
if not profile_view.profile_picture.is_element_image_equals_template('sauce_logo_profile.png'):
|
2019-08-20 23:29:35 +00:00
|
|
|
self.driver.fail('Profile picture was not updated')
|
2018-06-29 17:27:30 +00:00
|
|
|
|
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()
|
|
|
|
profile = sign_in.profile_button.click()
|
|
|
|
profile.logout()
|
|
|
|
if sign_in.ok_button.is_element_displayed():
|
|
|
|
sign_in.ok_button.click()
|
|
|
|
sign_in.your_keys_more_icon.click()
|
|
|
|
sign_in.generate_new_key_button.click()
|
|
|
|
sign_in.generate_key_button.click()
|
|
|
|
sign_in.next_button.click()
|
|
|
|
sign_in.next_button.click()
|
|
|
|
sign_in.create_password_input.set_value(common_password)
|
|
|
|
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()
|
|
|
|
profile.delete_my_profile_button.click()
|
|
|
|
for element in (username, delete_alert_text):
|
|
|
|
if not profile.element_by_text(delete_alert_text).is_element_displayed():
|
|
|
|
self.errors.append('Required %s is not shown when deleting multiaccount' % element)
|
|
|
|
profile.delete_profile_button.click()
|
|
|
|
if profile.element_by_text('Profile deleted').is_element_displayed():
|
|
|
|
self.driver.fail('Profile is deleted without confirmation with password')
|
|
|
|
profile.delete_my_profile_password_input.set_value(common_password)
|
|
|
|
profile.delete_profile_button.click_until_presence_of_element(profile.element_by_text('Profile deleted'))
|
|
|
|
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()
|
|
|
|
profile.delete_my_profile_button.click()
|
|
|
|
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()
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-09-25 12:04:40 +00:00
|
|
|
@marks.testrail_id(5741)
|
|
|
|
@marks.high
|
2019-10-03 16:08:06 +00:00
|
|
|
def test_mobile_data_usage_popup_continue_syncing(self):
|
2019-09-25 12:04:40 +00:00
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
sign_in_view.create_user()
|
2019-10-03 16:08:06 +00:00
|
|
|
sign_in_view.just_fyi("Enable mobile network to see popup and enable syncing")
|
2019-09-25 12:04:40 +00:00
|
|
|
sign_in_view.toggle_mobile_data()
|
2020-01-07 12:33:47 +00:00
|
|
|
if not sign_in_view.element_by_text_part("Sync using mobile data?").is_element_displayed():
|
2019-09-25 12:04:40 +00:00
|
|
|
self.driver.fail('No popup about Mobile data is shown')
|
2019-10-03 16:08:06 +00:00
|
|
|
sign_in_view.wait_for_element_starts_with_text('Continue syncing').click()
|
2019-09-25 12:04:40 +00:00
|
|
|
|
2019-10-03 16:08:06 +00:00
|
|
|
sign_in_view.just_fyi("Check that selected option is stored in Profile")
|
|
|
|
profile_view = sign_in_view.profile_button.click()
|
|
|
|
profile_view.sync_settings_button.click()
|
|
|
|
profile_view.element_by_text('Mobile data').click()
|
2019-12-03 11:08:37 +00:00
|
|
|
if not profile_view.use_mobile_data.attribute_value('checked'):
|
|
|
|
self.errors.append("Use mobile data option is enabled after 'Continue syncing' selected")
|
|
|
|
if profile_view.ask_me_when_on_mobile_network.attribute_value('checked'):
|
|
|
|
self.errors.append("'Ask me when on mobile network' option not enabled even it was checked when 'Continue"
|
|
|
|
"syncing' selected!")
|
2019-10-03 16:08:06 +00:00
|
|
|
|
|
|
|
sign_in_view.just_fyi("Check that can join public chat and send message")
|
2020-04-10 10:25:46 +00:00
|
|
|
chat_name = sign_in_view.get_random_chat_name()
|
2019-10-03 16:08:06 +00:00
|
|
|
home = profile_view.get_back_to_home_view()
|
|
|
|
chat = home.join_public_chat(chat_name)
|
|
|
|
message = 'test message'
|
|
|
|
chat.chat_message_input.send_keys(message)
|
|
|
|
chat.send_message_button.click()
|
|
|
|
if not chat.chat_element_by_text(message).is_element_displayed():
|
|
|
|
self.errors.append("Message was not sent!")
|
2019-10-29 08:25:57 +00:00
|
|
|
self.errors.verify_no_errors()
|
2019-10-03 16:08:06 +00:00
|
|
|
|
2019-10-15 08:58:11 +00:00
|
|
|
@marks.testrail_id(6228)
|
2019-10-03 16:08:06 +00:00
|
|
|
@marks.high
|
|
|
|
def test_mobile_data_usage_popup_stop_syncing(self):
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
sign_in_view.create_user()
|
2020-06-16 14:24:51 +00:00
|
|
|
offline_banner_text = "No Wi-fi, message syncing disabled."
|
2019-10-03 16:08:06 +00:00
|
|
|
|
|
|
|
sign_in_view.just_fyi("Enable mobile network to see popup and stop syncing")
|
|
|
|
sign_in_view.toggle_mobile_data()
|
|
|
|
sign_in_view.wait_for_element_starts_with_text('Stop syncing').click()
|
2020-09-15 13:40:39 +00:00
|
|
|
if not sign_in_view.wait_for_element_starts_with_text(offline_banner_text, 120):
|
2019-10-03 16:08:06 +00:00
|
|
|
self.driver.fail('No popup about offline history is shown')
|
|
|
|
sign_in_view.element_by_text_part(offline_banner_text).click()
|
2020-06-16 14:24:51 +00:00
|
|
|
for item in offline_banner_text, "Start syncing", "Go to settings":
|
2019-10-03 16:08:06 +00:00
|
|
|
if not sign_in_view.element_by_text(item).is_element_displayed():
|
|
|
|
self.driver.fail("%s is not shown" % item)
|
|
|
|
|
|
|
|
sign_in_view.just_fyi("Start syncing in offline popup")
|
|
|
|
sign_in_view.element_by_text("Start syncing").click()
|
2020-03-02 16:07:46 +00:00
|
|
|
sign_in_view.element_by_text_part(offline_banner_text).wait_for_invisibility_of_element(10)
|
2019-10-03 16:08:06 +00:00
|
|
|
if sign_in_view.element_by_text_part(offline_banner_text).is_element_displayed():
|
|
|
|
self.driver.fail("Popup about offline history is shown")
|
|
|
|
|
2019-10-15 08:58:11 +00:00
|
|
|
@marks.testrail_id(6229)
|
2019-10-03 16:08:06 +00:00
|
|
|
@marks.high
|
|
|
|
def test_mobile_data_usage_settings(self):
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
sign_in_view.create_user()
|
|
|
|
profile_view = sign_in_view.profile_button.click()
|
|
|
|
|
|
|
|
sign_in_view.just_fyi("Check default preferences")
|
|
|
|
profile_view.sync_settings_button.click()
|
|
|
|
profile_view.element_by_text('Mobile data').click()
|
|
|
|
|
2020-03-24 15:39:52 +00:00
|
|
|
if profile_view.use_mobile_data.text != 'OFF':
|
2019-10-03 16:08:06 +00:00
|
|
|
self.errors.append("Mobile data is enabled by default")
|
2020-03-24 15:39:52 +00:00
|
|
|
if profile_view.ask_me_when_on_mobile_network.text != "ON":
|
2019-10-03 16:08:06 +00:00
|
|
|
self.errors.append("'Ask me when on mobile network' is not enabled by default")
|
|
|
|
|
|
|
|
sign_in_view.just_fyi("Disable 'ask me when on mobile network' and check that it is not shown")
|
|
|
|
profile_view.ask_me_when_on_mobile_network.click()
|
|
|
|
sign_in_view.toggle_mobile_data()
|
|
|
|
if sign_in_view.element_by_text("Start syncing").is_element_displayed(20):
|
|
|
|
self.errors.append("Popup is shown, but 'ask me when on mobile network' is disabled")
|
|
|
|
|
|
|
|
sign_in_view.just_fyi("Check 'Restore default' setting")
|
|
|
|
profile_view.element_by_text('Restore Defaults').click()
|
|
|
|
if profile_view.use_mobile_data.attribute_value("checked"):
|
|
|
|
self.errors.append("Mobile data is enabled by default")
|
|
|
|
if not profile_view.ask_me_when_on_mobile_network.attribute_value("checked"):
|
|
|
|
self.errors.append("'Ask me when on mobile network' is not enabled by default")
|
2019-10-29 08:25:57 +00:00
|
|
|
self.errors.verify_no_errors()
|
2019-10-03 16:08:06 +00:00
|
|
|
|
|
|
|
|
2019-10-08 08:28:52 +00:00
|
|
|
@marks.testrail_id(5454)
|
2018-10-24 08:50:58 +00:00
|
|
|
@marks.critical
|
2020-01-28 13:55:28 +00:00
|
|
|
@marks.skip
|
2020-03-17 17:27:10 +00:00
|
|
|
# TODO: waiting for better times - no profile picture for now
|
2018-10-24 08:50:58 +00:00
|
|
|
def test_user_can_remove_profile_picture(self):
|
|
|
|
signin_view = SignInView(self.driver)
|
|
|
|
home_view = signin_view.create_user()
|
|
|
|
profile_view = home_view.profile_button.click()
|
|
|
|
profile_view.edit_profile_picture('sauce_logo.png')
|
|
|
|
profile_view.swipe_down()
|
2019-08-14 16:05:04 +00:00
|
|
|
if not profile_view.profile_picture.is_element_image_equals_template('sauce_logo_profile.png'):
|
2018-10-24 08:50:58 +00:00
|
|
|
self.driver.fail('Profile picture was not updated')
|
|
|
|
profile_view.remove_profile_picture()
|
|
|
|
profile_view.swipe_down()
|
2019-08-14 16:05:04 +00:00
|
|
|
if profile_view.profile_picture.is_element_image_equals_template('default_icon_profile.png'):
|
2018-10-24 08:50:58 +00:00
|
|
|
self.driver.fail('Profile picture was not deleted')
|
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5323)
|
|
|
|
@marks.critical
|
2018-06-29 17:27:30 +00:00
|
|
|
def test_share_contact_code_and_wallet_address(self):
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
sign_in_view.create_user()
|
|
|
|
profile_view = sign_in_view.profile_button.click()
|
2018-10-02 11:33:51 +00:00
|
|
|
profile_view.share_my_profile_button.click()
|
2018-07-03 12:40:44 +00:00
|
|
|
public_key = profile_view.public_key_text.text
|
2018-06-29 17:27:30 +00:00
|
|
|
profile_view.share_button.click()
|
2018-07-03 12:40:44 +00:00
|
|
|
profile_view.share_via_messenger()
|
|
|
|
if not profile_view.element_by_text_part(public_key).is_element_present():
|
|
|
|
self.errors.append("Can't share public key")
|
2019-01-28 09:00:55 +00:00
|
|
|
for _ in range(2):
|
|
|
|
profile_view.click_system_back_button()
|
2019-12-20 17:35:36 +00:00
|
|
|
profile_view.close_share_popup()
|
2018-06-29 17:27:30 +00:00
|
|
|
wallet = profile_view.wallet_button.click()
|
2019-07-12 07:16:02 +00:00
|
|
|
wallet.set_up_wallet()
|
2019-06-24 15:53:02 +00:00
|
|
|
wallet.accounts_status_account.click()
|
2018-06-29 17:27:30 +00:00
|
|
|
request = wallet.receive_transaction_button.click()
|
2018-07-03 12:40:44 +00:00
|
|
|
address = wallet.address_text.text
|
2018-06-29 17:27:30 +00:00
|
|
|
request.share_button.click()
|
2018-07-03 12:40:44 +00:00
|
|
|
wallet.share_via_messenger()
|
|
|
|
if not wallet.element_by_text_part(address).is_element_present():
|
|
|
|
self.errors.append("Can't share address")
|
2019-10-29 08:25:57 +00:00
|
|
|
self.errors.verify_no_errors()
|
2018-06-29 17:27:30 +00:00
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5375)
|
|
|
|
@marks.high
|
2018-06-29 17:27:30 +00:00
|
|
|
def test_copy_contact_code_and_wallet_address(self):
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
sign_in_view.create_user()
|
|
|
|
profile_view = sign_in_view.profile_button.click()
|
2018-10-02 11:33:51 +00:00
|
|
|
profile_view.share_my_profile_button.click()
|
2018-06-29 17:27:30 +00:00
|
|
|
public_key = profile_view.public_key_text.text
|
|
|
|
profile_view.public_key_text.long_press_element()
|
2018-07-03 12:32:01 +00:00
|
|
|
profile_view.copy_text()
|
2019-12-20 17:35:36 +00:00
|
|
|
profile_view.close_share_popup()
|
2018-06-29 17:27:30 +00:00
|
|
|
home = profile_view.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()
|
|
|
|
|
|
|
|
wallet = home.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()
|
2019-08-06 14:36:20 +00:00
|
|
|
wallet.receive_transaction_button.click()
|
2018-06-29 17:27:30 +00:00
|
|
|
address = wallet.address_text.text
|
2019-07-23 23:10:55 +00:00
|
|
|
share_view = home.get_send_transaction_view()
|
|
|
|
share_view.share_button.click()
|
2020-03-17 17:27:10 +00:00
|
|
|
share_view.element_by_text('Copy').click()
|
2018-06-29 17:27:30 +00:00
|
|
|
wallet.get_back_to_home_view()
|
|
|
|
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):
|
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
home = sign_in.recover_access(ens_user['passphrase'])
|
2019-09-02 08:40:13 +00:00
|
|
|
|
|
|
|
home.just_fyi('switching to Mainnet')
|
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()
|
|
|
|
dapp_view.ens_name.set_value(ens_user['ens'])
|
|
|
|
if not dapp_view.element_by_text_part('is owned by you').is_element_displayed():
|
|
|
|
self.errors.append('Owned username is not shown in ENS Dapp.')
|
|
|
|
dapp_view.check_ens_name.click()
|
|
|
|
if not dapp_view.element_by_text_part('Username added').is_element_displayed():
|
|
|
|
self.errors.append('No message "Username added" after resolving own username')
|
|
|
|
dapp_view.element_by_text('Ok, got it').click()
|
|
|
|
|
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
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5475)
|
|
|
|
@marks.low
|
2020-02-05 18:20:24 +00:00
|
|
|
@marks.skip
|
|
|
|
# TODO: skip until profile picture change feature is enabled
|
2018-06-29 17:27:30 +00:00
|
|
|
def test_change_profile_picture_several_times(self):
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
sign_in_view.create_user()
|
|
|
|
profile_view = sign_in_view.profile_button.click()
|
|
|
|
for file_name in ['sauce_logo.png', 'sauce_logo_red.png', 'saucelabs_sauce.png']:
|
|
|
|
profile_view.edit_profile_picture(file_name=file_name)
|
|
|
|
profile_view.swipe_down()
|
2019-08-20 23:29:35 +00:00
|
|
|
if not profile_view.profile_picture.is_element_image_equals_template(
|
|
|
|
file_name.replace('.png', '_profile.png')):
|
2019-10-21 12:48:45 +00:00
|
|
|
self.driver.fail('Profile picture was not updated')
|
2018-06-29 17:27:30 +00:00
|
|
|
|
2019-10-31 17:07:14 +00:00
|
|
|
@marks.testrail_id(6239)
|
|
|
|
@marks.medium
|
2018-07-04 13:40:52 +00:00
|
|
|
def test_backup_recovery_phrase(self):
|
2018-06-29 17:27:30 +00:00
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
sign_in_view.create_user()
|
|
|
|
if sign_in_view.profile_button.counter.text != '1':
|
|
|
|
self.errors.append('Profile button counter is not shown')
|
|
|
|
profile_view = sign_in_view.profile_button.click()
|
|
|
|
profile_view.logout()
|
|
|
|
sign_in_view.sign_in()
|
|
|
|
if sign_in_view.profile_button.counter.text != '1':
|
2018-08-20 10:02:37 +00:00
|
|
|
self.errors.append('Profile button counter is not shown after re-login')
|
2018-06-29 17:27:30 +00:00
|
|
|
sign_in_view.profile_button.click()
|
2019-08-29 15:53:17 +00:00
|
|
|
profile_view.privacy_and_security_button.click()
|
|
|
|
profile_view.backup_recovery_phrase_button.click()
|
2020-02-12 10:10:19 +00:00
|
|
|
recovery_phrase = profile_view.backup_recovery_phrase()
|
2019-10-10 07:29:04 +00:00
|
|
|
if sign_in_view.profile_button.counter.is_element_displayed():
|
2019-07-24 11:36:46 +00:00
|
|
|
self.errors.append('Profile button counter is shown after recovery phrase backup')
|
2019-10-10 07:29:04 +00:00
|
|
|
profile_view.backup_recovery_phrase_button.click()
|
|
|
|
if not profile_view.backup_recovery_phrase_button.is_element_displayed():
|
2020-02-12 10:10:19 +00:00
|
|
|
self.driver.fail('Back up seed phrase option is available after seed phrase backed up!')
|
|
|
|
profile_view.back_button.click()
|
|
|
|
profile_view.logout()
|
|
|
|
recover_view = sign_in_view.access_key_button.click()
|
|
|
|
recover_view.enter_seed_phrase_button.click()
|
|
|
|
recover_view.seedphrase_input.click()
|
|
|
|
recover_view.seedphrase_input.set_value(' '.join(recovery_phrase.values()))
|
|
|
|
recover_view.next_button.click()
|
|
|
|
recover_view.element_by_text('UNLOCK').click()
|
|
|
|
sign_in_view.password_input.set_value(common_password)
|
|
|
|
chats_view = sign_in_view.sign_in_button.click()
|
|
|
|
chats_view.plus_button.click()
|
|
|
|
if not chats_view.start_new_chat_button.is_element_displayed():
|
|
|
|
self.errors.append("Can't proceed using account after it's re-recover twice.")
|
2019-10-29 08:25:57 +00:00
|
|
|
self.errors.verify_no_errors()
|
2018-07-03 12:40:44 +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())
|
|
|
|
profile_view.back_button.click()
|
|
|
|
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()
|
2020-09-09 15:06:07 +00:00
|
|
|
# sign_in_view.accept_agreements()
|
2019-10-31 17:07:14 +00:00
|
|
|
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):
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
home = sign_in_view.create_user()
|
2019-04-05 13:05:23 +00:00
|
|
|
home.invite_friends_button.click()
|
|
|
|
home.share_via_messenger()
|
2020-08-06 10:43:42 +00:00
|
|
|
home.find_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()
|
2019-11-20 16:27:29 +00:00
|
|
|
home.plus_button.click()
|
|
|
|
home.chats_menu_invite_friends_button.click()
|
|
|
|
home.share_via_messenger()
|
2020-08-06 10:43:42 +00:00
|
|
|
home.find_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):
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
home = sign_in_view.create_user()
|
|
|
|
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')
|
|
|
|
from views.chat_view import ChatView
|
2020-10-30 14:40:14 +00:00
|
|
|
chat_view = ChatView(self.driver)
|
2020-07-15 15:48:23 +00:00
|
|
|
for key in users:
|
2020-10-28 08:46:17 +00:00
|
|
|
profile.plus_button.click()
|
2020-07-15 15:48:23 +00:00
|
|
|
sign_in_view.just_fyi('Checking %s case' % key)
|
|
|
|
if 'scanning' in key:
|
2020-10-28 08:46:17 +00:00
|
|
|
from views.contacts_view import ContactsView
|
|
|
|
contact_view = ContactsView(self.driver)
|
2020-07-15 15:48:23 +00:00
|
|
|
contact_view.scan_contact_code_button.click()
|
|
|
|
if contact_view.allow_button.is_element_displayed():
|
|
|
|
contact_view.allow_button.click()
|
2020-10-30 14:40:14 +00:00
|
|
|
contact_view.enter_qr_edit_box.scan_qr(users[key]['contact_code'])
|
2020-07-15 15:48:23 +00:00
|
|
|
else:
|
|
|
|
contact_view.public_key_edit_box.click()
|
|
|
|
contact_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'])
|
2020-11-05 16:24:18 +00:00
|
|
|
contact_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()
|
|
|
|
chat_view.back_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')
|
|
|
|
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):
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
sign_in_view.create_user()
|
|
|
|
profile_view = sign_in_view.profile_button.click()
|
|
|
|
profile_view.add_custom_network()
|
|
|
|
sign_in_view.sign_in()
|
|
|
|
profile_view = sign_in_view.profile_button.click()
|
|
|
|
profile_view.advanced_button.click()
|
2019-06-04 11:37:19 +00:00
|
|
|
profile_view.network_settings_button.scroll_to_element(10, 'up')
|
2019-03-22 10:03:31 +00:00
|
|
|
profile_view.find_text_part('custom_ropsten')
|
2018-07-09 19:47:50 +00:00
|
|
|
|
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):
|
2018-07-09 19:47:50 +00:00
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
sign_in_view.create_user()
|
|
|
|
profile_view = sign_in_view.profile_button.click()
|
2019-08-29 15:53:17 +00:00
|
|
|
profile_view.privacy_and_security_button.click()
|
2018-07-16 12:57:01 +00:00
|
|
|
profile_view.backup_recovery_phrase_button.click()
|
2018-07-11 14:14:39 +00:00
|
|
|
profile_view.ok_continue_button.click()
|
2018-07-16 12:57:01 +00:00
|
|
|
recovery_phrase = profile_view.get_recovery_phrase()
|
2018-07-11 14:14:39 +00:00
|
|
|
profile_view.next_button.click()
|
2018-07-16 12:57:01 +00:00
|
|
|
word_number = profile_view.recovery_phrase_word_number.number
|
|
|
|
profile_view.recovery_phrase_word_input.set_value(recovery_phrase[word_number])
|
2018-07-11 14:14:39 +00:00
|
|
|
profile_view.next_button.click()
|
2018-07-16 12:57:01 +00:00
|
|
|
word_number_1 = profile_view.recovery_phrase_word_number.number
|
|
|
|
profile_view.recovery_phrase_word_input.set_value(recovery_phrase[word_number_1])
|
2018-07-11 14:14:39 +00:00
|
|
|
profile_view.done_button.click()
|
|
|
|
profile_view.yes_button.click()
|
2019-09-24 14:22:20 +00:00
|
|
|
values_in_logcat = profile_view.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)
|
2018-07-06 11:10:48 +00:00
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5391)
|
|
|
|
@marks.high
|
2018-07-06 11:10:48 +00:00
|
|
|
def test_need_help_section(self):
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
sign_in_view.create_user()
|
|
|
|
profile_view = sign_in_view.profile_button.click()
|
|
|
|
profile_view.help_button.click()
|
|
|
|
base_web_view = profile_view.faq_button.click()
|
|
|
|
base_web_view.open_in_webview()
|
2018-11-19 16:50:41 +00:00
|
|
|
base_web_view.find_full_text('Frequently Asked Questions')
|
2018-10-17 11:02:34 +00:00
|
|
|
base_web_view.click_system_back_button()
|
2020-04-06 16:21:23 +00:00
|
|
|
profile_view.submit_bug_button.click()
|
|
|
|
base_web_view.find_full_text('Welcome to Gmail')
|
|
|
|
base_web_view.click_system_back_button()
|
2019-08-29 15:53:17 +00:00
|
|
|
profile_view.request_a_feature_button.click()
|
2018-10-17 11:02:34 +00:00
|
|
|
profile_view.find_full_text('#status')
|
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:
|
|
|
|
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'):
|
|
|
|
self.errors.append('"%s" is set, but found another entries!' % default_log_level)
|
|
|
|
if not home.find_values_in_geth('lvl=info'):
|
|
|
|
self.errors.append('"%s" is set, but no entries are found!' % default_log_level)
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5468)
|
|
|
|
@marks.medium
|
2020-02-05 18:20:24 +00:00
|
|
|
@marks.skip
|
|
|
|
# TODO: skip until profile picture change feature is enabled
|
2018-07-20 08:27:33 +00:00
|
|
|
def test_deny_camera_access_changing_profile_photo(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
sign_in.create_user()
|
|
|
|
profile = sign_in.profile_button.click()
|
2019-08-26 17:09:30 +00:00
|
|
|
profile.profile_picture.click()
|
2018-07-20 08:27:33 +00:00
|
|
|
profile.capture_button.click()
|
|
|
|
for _ in range(2):
|
|
|
|
profile.deny_button.click()
|
|
|
|
profile.element_by_text(camera_access_error_text).wait_for_visibility_of_element(3)
|
|
|
|
profile.ok_button.click()
|
2019-08-26 17:09:30 +00:00
|
|
|
profile.profile_picture.click()
|
2018-07-20 08:27:33 +00:00
|
|
|
profile.capture_button.click()
|
|
|
|
profile.deny_button.wait_for_visibility_of_element(2)
|
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5469)
|
|
|
|
@marks.medium
|
2020-02-05 18:20:24 +00:00
|
|
|
@marks.skip
|
|
|
|
# TODO: skip until profile picture change feature is enabled
|
2018-07-20 08:27:33 +00:00
|
|
|
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()
|
2019-08-26 17:09:30 +00:00
|
|
|
profile.profile_picture.click()
|
2018-07-20 08:27:33 +00:00
|
|
|
profile.select_from_gallery_button.click()
|
2018-07-25 11:09:45 +00:00
|
|
|
profile.deny_button.click()
|
2018-08-27 18:24:51 +00:00
|
|
|
profile.element_by_text(photos_access_error_text, element_type='text').wait_for_visibility_of_element(3)
|
2018-07-20 08:27:33 +00:00
|
|
|
profile.ok_button.click()
|
2019-08-26 17:09:30 +00:00
|
|
|
profile.profile_picture.click()
|
2018-07-20 08:27:33 +00:00
|
|
|
profile.select_from_gallery_button.click()
|
|
|
|
profile.deny_button.wait_for_visibility_of_element(2)
|
|
|
|
|
2018-09-05 19:50:48 +00:00
|
|
|
@marks.testrail_id(5299)
|
2019-03-05 16:43:30 +00:00
|
|
|
@marks.high
|
2018-09-05 19:50:48 +00:00
|
|
|
def test_user_can_switch_network(self):
|
|
|
|
signin_view = SignInView(self.driver)
|
|
|
|
home_view = signin_view.create_user()
|
|
|
|
network_name = 'Mainnet with upstream RPC'
|
|
|
|
profile = home_view.profile_button.click()
|
2018-11-09 12:36:21 +00:00
|
|
|
profile.switch_network(network_name)
|
2018-09-05 19:50:48 +00:00
|
|
|
profile = home_view.profile_button.click()
|
2019-03-22 10:03:31 +00:00
|
|
|
if not profile.current_active_network == network_name:
|
2019-07-29 23:32:29 +00:00
|
|
|
self.driver.fail('Oops! Wrong network selected!')
|
2018-09-05 19:50:48 +00:00
|
|
|
|
2019-01-28 09:00:55 +00:00
|
|
|
@marks.testrail_id(5453)
|
|
|
|
@marks.medium
|
|
|
|
def test_privacy_policy_is_accessible(self):
|
|
|
|
signin_view = 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'
|
|
|
|
|
|
|
|
if not signin_view.privacy_policy_link.is_element_displayed():
|
|
|
|
self.driver.fail('{} Sign in view!'.format(no_link_found_error_msg))
|
|
|
|
|
|
|
|
base_web_view = signin_view.privacy_policy_link.click()
|
|
|
|
base_web_view.open_in_webview()
|
|
|
|
if not base_web_view.policy_summary.is_element_displayed():
|
|
|
|
self.errors.append('{} Sign in view!'.format(no_link_open_error_msg))
|
|
|
|
|
|
|
|
base_web_view.click_system_back_button()
|
|
|
|
home_view = signin_view.create_user()
|
|
|
|
profile = home_view.profile_button.click()
|
|
|
|
about_view = profile.about_button.click()
|
2019-07-23 23:10:55 +00:00
|
|
|
about_view.privacy_policy_button.click()
|
2019-01-28 09:00:55 +00:00
|
|
|
|
|
|
|
if not base_web_view.policy_summary.is_element_displayed():
|
|
|
|
self.errors.append('{} Profile about view!'.format(no_link_open_error_msg))
|
|
|
|
|
2019-10-29 08:25:57 +00:00
|
|
|
self.errors.verify_no_errors()
|
2019-01-28 09:00:55 +00:00
|
|
|
|
2019-08-02 21:22:23 +00:00
|
|
|
@marks.testrail_id(5738)
|
2019-10-18 13:23:36 +00:00
|
|
|
@marks.high
|
2019-08-02 21:22:23 +00:00
|
|
|
def test_dapps_permissions(self):
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
home_view = sign_in_view.create_user()
|
2020-11-11 15:37:27 +00:00
|
|
|
account_name = home_view.status_account_name
|
2019-10-18 13:23:36 +00:00
|
|
|
|
|
|
|
home_view.just_fyi('open Status Test Dapp, allow all and check permissions in Profile')
|
2019-08-02 21:22:23 +00:00
|
|
|
home_view.open_status_test_dapp()
|
2019-09-06 18:17:44 +00:00
|
|
|
home_view.cross_icon.click()
|
2019-08-02 21:22:23 +00:00
|
|
|
profile_view = home_view.profile_button.click()
|
2019-09-06 18:17:44 +00:00
|
|
|
profile_view.privacy_and_security_button.click()
|
2019-08-02 21:22:23 +00:00
|
|
|
profile_view.dapp_permissions_button.click()
|
2019-10-18 13:23:36 +00:00
|
|
|
profile_view.element_by_text(test_dapp_name).click()
|
|
|
|
if not profile_view.element_by_text(account_name).is_element_displayed():
|
2019-08-02 21:22:23 +00:00
|
|
|
self.errors.append('Wallet permission was not granted')
|
2019-09-06 18:17:44 +00:00
|
|
|
if not profile_view.element_by_text('Chat key').is_element_displayed():
|
2019-08-02 21:22:23 +00:00
|
|
|
self.errors.append('Contact code permission was not granted')
|
2019-10-18 13:23:36 +00:00
|
|
|
|
|
|
|
profile_view.just_fyi('revoke access and check that they are asked second time')
|
2019-08-02 21:22:23 +00:00
|
|
|
profile_view.revoke_access_button.click()
|
|
|
|
profile_view.back_button.click()
|
|
|
|
dapp_view = profile_view.dapp_tab_button.click()
|
2019-10-18 13:23:36 +00:00
|
|
|
dapp_view.open_url(test_dapp_url)
|
|
|
|
if not dapp_view.element_by_text_part(account_name).is_element_displayed():
|
2019-08-02 21:22:23 +00:00
|
|
|
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_text_part('to your profile').is_element_displayed():
|
|
|
|
self.errors.append('Profile permission is not asked')
|
2019-10-29 08:25:57 +00:00
|
|
|
self.errors.verify_no_errors()
|
2019-08-02 21:22:23 +00:00
|
|
|
|
2019-08-08 11:41:06 +00:00
|
|
|
@marks.testrail_id(5428)
|
|
|
|
@marks.low
|
|
|
|
def test_version_format(self):
|
|
|
|
sign_in_view = SignInView(self.driver)
|
2019-09-06 18:17:44 +00:00
|
|
|
home_view = sign_in_view.create_user()
|
|
|
|
profile_view = home_view.profile_button.click()
|
2019-08-08 11:41:06 +00:00
|
|
|
profile_view.about_button.click()
|
2019-09-20 15:12:03 +00:00
|
|
|
app_version = profile_view.app_version_text.text
|
|
|
|
node_version = profile_view.node_version_text.text
|
2019-11-29 11:48:07 +00:00
|
|
|
if not re.search(r'\d{1}[.]\d{1,2}[.]\d{1,2}\s[(]\d*[)]', app_version):
|
2019-09-20 15:12:03 +00:00
|
|
|
self.errors.append("App version %s didn't match expected format" % app_version)
|
2020-04-29 14:42:54 +00:00
|
|
|
if not re.search(r'StatusIM\/v.*\/android-\d{3}\/go\d{1}[.]\d{1,}', node_version):
|
2019-09-20 15:12:03 +00:00
|
|
|
self.errors.append("Node version %s didn't match expected format" % node_version)
|
|
|
|
profile_view.app_version_text.click()
|
2019-09-06 18:17:44 +00:00
|
|
|
profile_view.back_button.click()
|
|
|
|
profile_view.home_button.click()
|
2020-04-10 10:25:46 +00:00
|
|
|
chat = home_view.join_public_chat(home_view.get_random_chat_name())
|
2019-09-06 18:17:44 +00:00
|
|
|
message_input = chat.chat_message_input
|
|
|
|
message_input.paste_text_from_clipboard()
|
2019-09-20 15:12:03 +00:00
|
|
|
if message_input.text != app_version:
|
2019-09-06 18:17:44 +00:00
|
|
|
self.errors.append('Version number was not copied to clipboard')
|
2019-10-29 08:25:57 +00:00
|
|
|
self.errors.verify_no_errors()
|
2018-07-19 09:57:45 +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):
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
home_view = sign_in_view.create_user()
|
|
|
|
profile_view = home_view.profile_button.click()
|
|
|
|
|
|
|
|
profile_view.just_fyi('pin mailserver')
|
|
|
|
profile_view.sync_settings_button.click()
|
2020-06-29 10:42:14 +00:00
|
|
|
mailserver_1 = profile_view.return_mailserver_name(mailserver_gc, used_fleet)
|
|
|
|
mailserver_2 = profile_view.return_mailserver_name(mailserver_ams, used_fleet)
|
2019-10-24 16:03:11 +00:00
|
|
|
# TODO: temporary to avoid issue 9269 - should be disabled after fix
|
2020-01-21 13:59:01 +00:00
|
|
|
mailserver = mailserver_1 if profile_view.element_by_text(mailserver_2).is_element_present() else mailserver_2
|
2019-10-24 16:03:11 +00:00
|
|
|
profile_view.mail_server_button.click()
|
|
|
|
profile_view.mail_server_auto_selection_button.click()
|
2020-10-22 09:41:29 +00:00
|
|
|
profile_view.mail_server_by_name(mailserver).click()
|
2019-10-24 16:03:11 +00:00
|
|
|
profile_view.confirm_button.click()
|
|
|
|
|
|
|
|
profile_view.just_fyi('check that mailserver is pinned')
|
|
|
|
profile_view.back_button.click()
|
|
|
|
if not profile_view.element_by_text(mailserver).is_element_displayed():
|
|
|
|
self.errors.append('"%s" mailserver is not pinned' % mailserver)
|
|
|
|
profile_view.get_back_to_home_view()
|
|
|
|
|
2020-10-22 09:41:29 +00:00
|
|
|
profile_view.just_fyi('Relogin and check that settings are preserved')
|
2019-10-24 16:03:11 +00:00
|
|
|
home_view.relogin()
|
|
|
|
home_view.profile_button.click()
|
|
|
|
profile_view.sync_settings_button.click()
|
|
|
|
if not profile_view.element_by_text(mailserver).is_element_displayed():
|
|
|
|
self.errors.append('"%s" mailserver is not pinned' % mailserver)
|
|
|
|
|
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):
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
ens_not_stateofus = ens_user['ens_another_domain']
|
|
|
|
ens_stateofus = ens_user['ens']
|
|
|
|
home_view = sign_in_view.recover_access(ens_user['passphrase'])
|
|
|
|
|
|
|
|
home_view.just_fyi('add 2 ENS names in Profile')
|
|
|
|
profile_view = home_view.profile_button.click()
|
|
|
|
dapp_view = profile_view.connect_existing_status_ens(ens_stateofus)
|
|
|
|
profile_view.element_by_text("Add username").click()
|
|
|
|
profile_view.element_by_text_part("another domain").click()
|
|
|
|
dapp_view.ens_name.set_value(ens_not_stateofus)
|
|
|
|
dapp_view.check_ens_name.click_until_presence_of_element(dapp_view.element_by_text('Ok, got it'))
|
|
|
|
dapp_view.element_by_text('Ok, got it').click()
|
|
|
|
|
|
|
|
home_view.just_fyi('check that by default %s ENS is set' % ens_stateofus)
|
|
|
|
dapp_view.element_by_text('Primary username').click()
|
|
|
|
message_to_check = 'Your messages are displayed to others with'
|
|
|
|
if not dapp_view.element_by_text('%s\n@%s.stateofus.eth' % (message_to_check, ens_stateofus)).is_element_displayed():
|
|
|
|
self.errors.append('%s ENS username is not set as primary by default' % ens_stateofus)
|
|
|
|
|
|
|
|
home_view.just_fyi('check view in chat settings ENS from other domain: %s after set new primary ENS' % ens_not_stateofus)
|
|
|
|
dapp_view.set_primary_ens_username(ens_user['ens_another_domain']).click()
|
|
|
|
if profile_view.username_in_ens_chat_settings_text.text != '@' + ens_not_stateofus:
|
|
|
|
self.errors.append('ENS username %s is not shown in ENS username Chat Settings after enabling' % ens_not_stateofus)
|
|
|
|
|
|
|
|
self.errors.verify_no_errors()
|
|
|
|
|
2019-08-18 23:31:42 +00:00
|
|
|
|
2018-07-19 09:57:45 +00:00
|
|
|
class TestProfileMultipleDevice(MultipleDeviceTestCase):
|
|
|
|
|
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
|
2020-05-20 08:47:53 +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()
|
2019-10-21 12:48:45 +00:00
|
|
|
home_2.get_back_to_home_view()
|
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-06-29 10:42:14 +00:00
|
|
|
mailserver_1 = profile_1.return_mailserver_name(mailserver_hk, used_fleet)
|
|
|
|
mailserver_2 = profile_1.return_mailserver_name(mailserver_ams, used_fleet)
|
2019-10-24 16:03:11 +00:00
|
|
|
# TODO: temporary pin mailserver to avoid issue 9269 - should be disabled after fix
|
2020-01-21 13:59:01 +00:00
|
|
|
mailserver = mailserver_1 if profile_1.element_by_text(mailserver_2).is_element_present() else mailserver_2
|
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()
|
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()
|
|
|
|
if profile_1.element_by_text(mailserver_ams).is_element_displayed():
|
|
|
|
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-01-21 13:59:01 +00:00
|
|
|
if profile_1.element_by_text(mailserver_2).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-09-23 11:48:20 +00:00
|
|
|
# TODO: disabled due to 10065
|
2020-10-06 14:48:08 +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()
|
|
|
|
|
|
|
|
|
2020-09-23 11:48:20 +00:00
|
|
|
# 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)
|
|
|
|
sign_in_1, sign_in_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
|
|
|
|
home_1, home_2 = sign_in_1.create_user(), sign_in_2.create_user()
|
|
|
|
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()
|
|
|
|
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_auto_selection_button.click()
|
|
|
|
profile_1.mail_server_by_name(server_name).click()
|
|
|
|
profile_1.mail_server_connect_button.click()
|
|
|
|
profile_1.confirm_button.click()
|
|
|
|
if not profile_1.element_by_text_part('Error connecting').is_element_displayed(30):
|
|
|
|
sign_in_1.driver.fail("No popup with 'Error connecting' is shown")
|
|
|
|
profile_1.element_by_text('CANCEL').click()
|
|
|
|
|
2020-02-24 11:30:45 +00:00
|
|
|
# TODO: blocked by 10065
|
|
|
|
# profile_1.home_button.click()
|
|
|
|
# home_2.just_fyi('send several messages to public channel')
|
2020-04-10 10:25:46 +00:00
|
|
|
# public_chat_name = home_2.get_random_chat_name()
|
2020-02-24 11:30:45 +00:00
|
|
|
# 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()
|
|
|
|
# home_1.join_public_chat(public_chat_name)
|
|
|
|
# public_chat_1 = home_1.get_chat_view()
|
|
|
|
# chat_state = 'Could not connect to mailserver. Tap to reconnect'
|
|
|
|
# public_chat_1.element_by_text(chat_state).click()
|
|
|
|
# if not public_chat_1.element_by_text_part('Connecting').is_element_displayed():
|
|
|
|
# self.errors.append("Indicator doesn't show 'Connecting'")
|
|
|
|
|
|
|
|
# profile_1.just_fyi('check that can RETRY to connect')
|
|
|
|
# for _ in range(2):
|
|
|
|
# public_chat_1.element_by_text('RETRY').wait_for_element(30)
|
|
|
|
# public_chat_1.element_by_text('RETRY').click()
|
|
|
|
#
|
|
|
|
# profile_1.just_fyi('check that can pick another mailserver and receive messages')
|
|
|
|
# public_chat_1.element_by_text('PICK ANOTHER').is_element_displayed(30)
|
|
|
|
# public_chat_1.element_by_text_part('PICK ANOTHER').click()
|
2020-06-29 10:42:14 +00:00
|
|
|
# mailserver = profile_1.return_mailserver_name(mailserver_ams, used_fleet)
|
2020-02-24 11:30:45 +00:00
|
|
|
# profile_1.element_by_text(mailserver).click()
|
|
|
|
# profile_1.confirm_button.click()
|
|
|
|
# profile_1.home_button.click()
|
|
|
|
# if not public_chat_1.chat_element_by_text(message).is_element_displayed(30):
|
|
|
|
# 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
|
|
|
|
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()
|
|
|
|
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
|
|
|
|
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)
|
2020-11-05 16:24:18 +00:00
|
|
|
device_1_profile.back_button.click(2)
|
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)
|
|
|
|
device_1_profile.back_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)
|
|
|
|
|
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
|
|
|
|
|
|
|
@marks.testrail_id(5680)
|
|
|
|
@marks.high
|
2020-01-28 13:55:28 +00:00
|
|
|
@marks.skip
|
2020-02-24 11:30:45 +00:00
|
|
|
# TODO: skip until edit userpic is enabled back
|
2019-05-30 13:09:52 +00:00
|
|
|
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])
|
2019-08-18 23:31:42 +00:00
|
|
|
device_1_home = device_1.create_user()
|
2019-05-30 13:09:52 +00:00
|
|
|
device_1_home.profile_button.click()
|
|
|
|
device_1_profile = device_1_home.get_profile_view()
|
2019-08-29 15:53:17 +00:00
|
|
|
device_1_profile.privacy_and_security_button.click()
|
2019-05-30 13:09:52 +00:00
|
|
|
device_1_profile.backup_recovery_phrase_button.click()
|
2019-08-29 15:53:17 +00:00
|
|
|
recovery_phrase = device_1_profile.backup_recovery_phrase()
|
2019-05-30 13:09:52 +00:00
|
|
|
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
|
2020-04-10 10:25:46 +00:00
|
|
|
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()
|
2019-05-30 13:09:52 +00:00
|
|
|
message_after_sync = 'sent after sync'
|
|
|
|
|
2019-10-21 12:48:45 +00:00
|
|
|
device_1.just_fyi('join public chat, create group chat, edit user picture')
|
2019-05-30 13:09:52 +00:00
|
|
|
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()
|
2019-08-20 23:29:35 +00:00
|
|
|
device_1_profile.edit_profile_picture('sauce_logo.png')
|
2019-05-30 13:09:52 +00:00
|
|
|
|
2019-10-21 12:48:45 +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_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)
|
|
|
|
|
2019-10-21 12:48:45 +00:00
|
|
|
device_1.just_fyi('enable pairing of `device 2` and sync')
|
2019-05-30 13:09:52 +00:00
|
|
|
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)
|
|
|
|
|
2019-10-21 12:48:45 +00:00
|
|
|
device_2.just_fyi('check that public chat and profile details are updated')
|
2019-05-30 13:09:52 +00:00
|
|
|
device_2_home = device_2_profile.get_back_to_home_view()
|
|
|
|
if not device_2_home.element_by_text('#%s' % public_chat_before_sync_name).is_element_displayed():
|
2019-08-18 23:31:42 +00:00
|
|
|
self.errors.append('Public chat "%s" doesn\'t appear after initial sync'
|
2019-08-20 23:29:35 +00:00
|
|
|
% public_chat_before_sync_name)
|
|
|
|
device_2_home.home_button.click()
|
2019-05-30 13:09:52 +00:00
|
|
|
device_2_home.profile_button.click()
|
2019-08-20 23:29:35 +00:00
|
|
|
if not device_2_profile.profile_picture.is_element_image_equals_template('sauce_logo_profile.png'):
|
2019-08-18 23:31:42 +00:00
|
|
|
self.errors.append('Profile picture was not updated after initial sync')
|
2020-01-15 15:44:25 +00:00
|
|
|
device_2_profile.home_button.click()
|
2019-05-30 13:09:52 +00:00
|
|
|
|
2020-01-15 15:44:25 +00:00
|
|
|
device_1.just_fyi('send message to group chat, and join to new public chat')
|
2019-05-30 13:09:52 +00:00
|
|
|
device_1_home = device_1_profile.get_back_to_home_view()
|
|
|
|
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()
|
|
|
|
|
2020-01-15 15:44:25 +00:00
|
|
|
device_2.just_fyi('check that message in group chat is shown, public chats are synced')
|
2019-05-30 13:09:52 +00:00
|
|
|
if not device_2_home.element_by_text('#%s' % public_chat_after_sync_name).is_element_displayed():
|
2019-08-18 23:31:42 +00:00
|
|
|
self.errors.append('Public chat "%s" doesn\'t appear on other device when devices are paired'
|
2019-08-20 23:29:35 +00:00
|
|
|
% public_chat_before_sync_name)
|
2019-05-30 13:09:52 +00:00
|
|
|
|
2019-12-09 14:55:42 +00:00
|
|
|
device_2_home.element_by_text(group_chat_name).click()
|
|
|
|
device_2_group_chat = device_2_home.get_chat_view()
|
2019-05-30 13:09:52 +00:00
|
|
|
|
2019-12-09 14:55:42 +00:00
|
|
|
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)
|
2019-05-30 13:09:52 +00:00
|
|
|
|
2019-10-29 08:25:57 +00:00
|
|
|
self.errors.verify_no_errors()
|
2019-09-05 02:32:33 +00:00
|
|
|
|
|
|
|
@marks.testrail_id(6226)
|
|
|
|
@marks.critical
|
2020-10-20 15:34:52 +00:00
|
|
|
def test_ens_mentions_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
|
|
|
|
home_1 = sign_in_1.recover_access(user_1['passphrase'])
|
|
|
|
home_2 = sign_in_2.create_user()
|
|
|
|
|
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()
|
|
|
|
dapp_view_1.ens_name.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)
|
|
|
|
dapp_view_1.get_back_to_home_view()
|
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')
|
|
|
|
|
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!')
|
2020-10-20 15:34:52 +00:00
|
|
|
chat_1.element_starts_with_text(user_1['ens'] +'.stateofus.eth','button').click()
|
2020-11-05 16:24:18 +00:00
|
|
|
if not profile_1.contacts_button.is_element_displayed():
|
2020-10-20 15:34:52 +00:00
|
|
|
self.errors.append('Was not redirected to own profile after tapping on mention of myself from another user!')
|
|
|
|
|
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()
|
2020-10-28 08:46:17 +00:00
|
|
|
chat_2.back_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)
|
|
|
|
profile_2.back_button.click()
|
|
|
|
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()
|