profile e2e

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2020-10-28 09:46:17 +01:00
parent eae66c967e
commit ce20eddb99
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
11 changed files with 81 additions and 41 deletions

View File

@ -48,6 +48,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
sign_in.just_fyi('Delete 2nd multiaccount') sign_in.just_fyi('Delete 2nd multiaccount')
public_key, username = sign_in.get_public_key_and_username(return_username=True) public_key, username = sign_in.get_public_key_and_username(return_username=True)
profile.settings_button.click()
profile.privacy_and_security_button.click() profile.privacy_and_security_button.click()
profile.delete_my_profile_button.click() profile.delete_my_profile_button.click()
for element in (username, delete_alert_text): for element in (username, delete_alert_text):
@ -63,6 +64,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
sign_in.just_fyi('Delete last multiaccount') sign_in.just_fyi('Delete last multiaccount')
sign_in.sign_in() sign_in.sign_in()
sign_in.profile_button.click() sign_in.profile_button.click()
profile.settings_button.click()
profile.privacy_and_security_button.click() profile.privacy_and_security_button.click()
profile.delete_my_profile_button.click() profile.delete_my_profile_button.click()
profile.delete_my_profile_password_input.set_value(common_password) profile.delete_my_profile_password_input.set_value(common_password)
@ -87,6 +89,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
sign_in_view.just_fyi("Check that selected option is stored in Profile") sign_in_view.just_fyi("Check that selected option is stored in Profile")
profile_view = sign_in_view.profile_button.click() profile_view = sign_in_view.profile_button.click()
profile_view.settings_button.click()
profile_view.sync_settings_button.click() profile_view.sync_settings_button.click()
profile_view.element_by_text('Mobile data').click() profile_view.element_by_text('Mobile data').click()
if not profile_view.use_mobile_data.attribute_value('checked'): if not profile_view.use_mobile_data.attribute_value('checked'):
@ -137,6 +140,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
profile_view = sign_in_view.profile_button.click() profile_view = sign_in_view.profile_button.click()
sign_in_view.just_fyi("Check default preferences") sign_in_view.just_fyi("Check default preferences")
profile_view.settings_button.click()
profile_view.sync_settings_button.click() profile_view.sync_settings_button.click()
profile_view.element_by_text('Mobile data').click() profile_view.element_by_text('Mobile data').click()
@ -335,6 +339,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
sign_in_view = SignInView(self.driver) sign_in_view = SignInView(self.driver)
sign_in_view.create_user() sign_in_view.create_user()
profile_view = sign_in_view.profile_button.click() profile_view = sign_in_view.profile_button.click()
profile_view.settings_button.click()
profile_view.privacy_and_security_button.click() profile_view.privacy_and_security_button.click()
profile_view.backup_recovery_phrase_button.click() profile_view.backup_recovery_phrase_button.click()
profile_view.ok_continue_button.click() profile_view.ok_continue_button.click()
@ -382,9 +387,8 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
profile.switch_network() profile.switch_network()
home.profile_button.click() home.profile_button.click()
profile.contacts_button.click() profile.contacts_button.click()
for element in [profile.invite_friends_in_contact_button, profile.add_new_contact_button]: if not profile.add_new_contact_button.is_element_displayed():
if not element.is_element_displayed(): self.driver.fail('No expected element on contacts view')
self.driver.fail('No expected element on contacts view')
users = { users = {
'scanning_ens_with_stateofus_domain_deep_link': { 'scanning_ens_with_stateofus_domain_deep_link': {
@ -406,11 +410,14 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
} }
home.just_fyi('Add contactx and check that they appear in Contacts view') home.just_fyi('Add contact and check that they appear in Contacts view')
from views.chat_view import ChatView
for key in users: for key in users:
contact_view = profile.add_new_contact_button.click() profile.plus_button.click()
sign_in_view.just_fyi('Checking %s case' % key) sign_in_view.just_fyi('Checking %s case' % key)
if 'scanning' in key: if 'scanning' in key:
from views.contacts_view import ContactsView
contact_view = ContactsView(self.driver)
contact_view.scan_contact_code_button.click() contact_view.scan_contact_code_button.click()
if contact_view.allow_button.is_element_displayed(): if contact_view.allow_button.is_element_displayed():
contact_view.allow_button.click() contact_view.allow_button.click()
@ -419,14 +426,13 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
else: else:
contact_view.public_key_edit_box.click() contact_view.public_key_edit_box.click()
contact_view.public_key_edit_box.send_keys(users[key]['contact_code']) contact_view.public_key_edit_box.send_keys(users[key]['contact_code'])
contact_view.confirm_until_presence_of_element(profile.add_new_contact_button) contact_view.confirm_until_presence_of_element(profile.settings_button)
if not profile.element_by_text(users[key]['username']).is_element_displayed(): if not profile.element_by_text(users[key]['username']).is_element_displayed():
self.errors.append('In %s case username not found in contact view after scanning' % key) self.errors.append('In %s case username not found in contact view after scanning' % key)
home.just_fyi('Remove contact and check that it disappeared') home.just_fyi('Remove contact and check that it disappeared')
user_to_remove = '@%s' % ens_user['ens_another_domain'] user_to_remove = '@%s' % ens_user['ens_another_domain']
profile.element_by_text(user_to_remove).click() profile.element_by_text(user_to_remove).click()
from views.chat_view import ChatView
profile_user_to_remove = ChatView(self.driver) profile_user_to_remove = ChatView(self.driver)
profile_user_to_remove.remove_from_contacts.click() profile_user_to_remove.remove_from_contacts.click()
profile_user_to_remove.back_button.click() profile_user_to_remove.back_button.click()
@ -441,6 +447,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
sign_in_view = SignInView(self.driver) sign_in_view = SignInView(self.driver)
sign_in_view.create_user() sign_in_view.create_user()
profile_view = sign_in_view.profile_button.click() profile_view = sign_in_view.profile_button.click()
profile_view.settings_button.click()
profile_view.add_custom_network() profile_view.add_custom_network()
sign_in_view.sign_in() sign_in_view.sign_in()
profile_view = sign_in_view.profile_button.click() profile_view = sign_in_view.profile_button.click()
@ -455,6 +462,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
sign_in_view = SignInView(self.driver) sign_in_view = SignInView(self.driver)
sign_in_view.create_user() sign_in_view.create_user()
profile_view = sign_in_view.profile_button.click() profile_view = sign_in_view.profile_button.click()
profile_view.settings_button.click()
profile_view.privacy_and_security_button.click() profile_view.privacy_and_security_button.click()
profile_view.backup_recovery_phrase_button.click() profile_view.backup_recovery_phrase_button.click()
profile_view.ok_continue_button.click() profile_view.ok_continue_button.click()
@ -478,6 +486,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
sign_in_view = SignInView(self.driver) sign_in_view = SignInView(self.driver)
sign_in_view.create_user() sign_in_view.create_user()
profile_view = sign_in_view.profile_button.click() profile_view = sign_in_view.profile_button.click()
profile_view.settings_button.click()
profile_view.help_button.click() profile_view.help_button.click()
base_web_view = profile_view.faq_button.click() base_web_view = profile_view.faq_button.click()
base_web_view.open_in_webview() base_web_view.open_in_webview()
@ -499,9 +508,9 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
chat_view = home_view.get_chat_view() chat_view = home_view.get_chat_view()
chat_view.chat_options.click_until_presence_of_element(chat_view.view_profile_button) chat_view.chat_options.click_until_presence_of_element(chat_view.view_profile_button)
chat_view.view_profile_button.click() chat_view.view_profile_button.click()
for text in basic_user['username'], 'Remove from contacts', 'Send message', 'Block this user': for element in (chat_view.profile_block_contact, chat_view.remove_from_contacts, chat_view.profile_send_message):
if not chat_view.element_by_text(text).scroll_to_element(): if not element.is_element_displayed():
self.errors.append('%s is not visible' % text) self.errors.append('Expected %s is not visible' % element.locator)
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(5368) @marks.testrail_id(5368)
@ -510,6 +519,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
sign_in_view = SignInView(self.driver) sign_in_view = SignInView(self.driver)
sign_in_view.create_user() sign_in_view.create_user()
profile_view = sign_in_view.profile_button.click() profile_view = sign_in_view.profile_button.click()
profile_view.settings_button.click()
profile_view.advanced_button.click() profile_view.advanced_button.click()
for text in 'INFO', used_fleet: for text in 'INFO', used_fleet:
if not profile_view.element_by_text(text).is_element_displayed(): if not profile_view.element_by_text(text).is_element_displayed():
@ -582,6 +592,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
base_web_view.click_system_back_button() base_web_view.click_system_back_button()
home_view = signin_view.create_user() home_view = signin_view.create_user()
profile = home_view.profile_button.click() profile = home_view.profile_button.click()
profile.settings_button.click()
about_view = profile.about_button.click() about_view = profile.about_button.click()
about_view.privacy_policy_button.click() about_view.privacy_policy_button.click()
@ -601,6 +612,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
home_view.open_status_test_dapp() home_view.open_status_test_dapp()
home_view.cross_icon.click() home_view.cross_icon.click()
profile_view = home_view.profile_button.click() profile_view = home_view.profile_button.click()
profile_view.settings_button.click()
profile_view.privacy_and_security_button.click() profile_view.privacy_and_security_button.click()
profile_view.dapp_permissions_button.click() profile_view.dapp_permissions_button.click()
profile_view.element_by_text(test_dapp_name).click() profile_view.element_by_text(test_dapp_name).click()
@ -628,6 +640,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
sign_in_view = SignInView(self.driver) sign_in_view = SignInView(self.driver)
home_view = sign_in_view.create_user() home_view = sign_in_view.create_user()
profile_view = home_view.profile_button.click() profile_view = home_view.profile_button.click()
profile_view.settings_button.click()
profile_view.about_button.click() profile_view.about_button.click()
app_version = profile_view.app_version_text.text app_version = profile_view.app_version_text.text
node_version = profile_view.node_version_text.text node_version = profile_view.node_version_text.text
@ -654,6 +667,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
profile_view = home_view.profile_button.click() profile_view = home_view.profile_button.click()
profile_view.just_fyi('pin mailserver') profile_view.just_fyi('pin mailserver')
profile_view.settings_button.click()
profile_view.sync_settings_button.click() profile_view.sync_settings_button.click()
mailserver_1 = profile_view.return_mailserver_name(mailserver_gc, used_fleet) mailserver_1 = profile_view.return_mailserver_name(mailserver_gc, used_fleet)
mailserver_2 = profile_view.return_mailserver_name(mailserver_ams, used_fleet) mailserver_2 = profile_view.return_mailserver_name(mailserver_ams, used_fleet)
@ -724,6 +738,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
username_1, username_2 = profile_1.default_username_text.text, profile_2.default_username_text.text username_1, username_2 = profile_1.default_username_text.text, profile_2.default_username_text.text
profile_1.just_fyi('Add custom bootnode, enable bootnodes and check validation') profile_1.just_fyi('Add custom bootnode, enable bootnodes and check validation')
profile_1.settings_button.click()
profile_1.advanced_button.click() profile_1.advanced_button.click()
profile_1.bootnodes_button.click() profile_1.bootnodes_button.click()
profile_1.add_bootnode_button.click() profile_1.add_bootnode_button.click()
@ -779,6 +794,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
username_1 = profile_1.default_username_text.text username_1 = profile_1.default_username_text.text
profile_1.just_fyi('disable autoselection') profile_1.just_fyi('disable autoselection')
profile_1.settings_button.click()
profile_1.sync_settings_button.click() profile_1.sync_settings_button.click()
profile_1.mail_server_button.click() profile_1.mail_server_button.click()
mailserver_1 = profile_1.return_mailserver_name(mailserver_hk, used_fleet) mailserver_1 = profile_1.return_mailserver_name(mailserver_hk, used_fleet)
@ -858,6 +874,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
profile_1 = home_1.profile_button.click() profile_1 = home_1.profile_button.click()
profile_1.just_fyi('add non-working mailserver and connect to it') profile_1.just_fyi('add non-working mailserver and connect to it')
profile_1.settings_button.click()
profile_1.sync_settings_button.click() profile_1.sync_settings_button.click()
profile_1.mail_server_button.click() profile_1.mail_server_button.click()
profile_1.plus_button.click() profile_1.plus_button.click()
@ -917,6 +934,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
device_1_home = device_1.create_user() device_1_home = device_1.create_user()
device_1_home.profile_button.click() device_1_home.profile_button.click()
device_1_profile = device_1_home.get_profile_view() device_1_profile = device_1_home.get_profile_view()
device_1_profile.settings_button.click()
device_1_profile.privacy_and_security_button.click() device_1_profile.privacy_and_security_button.click()
device_1_profile.backup_recovery_phrase_button.click() device_1_profile.backup_recovery_phrase_button.click()
device_1_profile.ok_continue_button.click() device_1_profile.ok_continue_button.click()
@ -1001,6 +1019,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
device_1_home = device_1.create_user() device_1_home = device_1.create_user()
device_1_home.profile_button.click() device_1_home.profile_button.click()
device_1_profile = device_1_home.get_profile_view() device_1_profile = device_1_home.get_profile_view()
device_1_profile.settings_button.click()
device_1_profile.privacy_and_security_button.click() device_1_profile.privacy_and_security_button.click()
device_1_profile.backup_recovery_phrase_button.click() device_1_profile.backup_recovery_phrase_button.click()
recovery_phrase = device_1_profile.backup_recovery_phrase() recovery_phrase = device_1_profile.backup_recovery_phrase()
@ -1082,6 +1101,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
profile_1 = sign_in_1.profile_button.click() profile_1 = sign_in_1.profile_button.click()
profile_1.switch_network('Mainnet with upstream RPC') profile_1.switch_network('Mainnet with upstream RPC')
home_1.profile_button.click() home_1.profile_button.click()
profile_1.settings_button.click()
dapp_view_1 = profile_1.ens_usernames_button.click() dapp_view_1 = profile_1.ens_usernames_button.click()
dapp_view_1.element_by_text('Get started').click() dapp_view_1.element_by_text('Get started').click()
dapp_view_1.ens_name.set_value(ens_user['ens']) dapp_view_1.ens_name.set_value(ens_user['ens'])
@ -1119,18 +1139,16 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
self.errors.append('ENS username is not shown in public chat') self.errors.append('ENS username is not shown in public chat')
home_2.just_fyi('check that can mention user with ENS name') home_2.just_fyi('check that can mention user with ENS name')
# chat_2.chat_message_input.send_keys('@' + user_1['username'][0:4])
# chat_2.search_user_in_mention_suggestion_list(user_1['ens']).click()
chat_2.select_mention_from_suggestion_list(user_1['ens']) chat_2.select_mention_from_suggestion_list(user_1['ens'])
if chat_2.chat_message_input.text != ens_name + ' ': 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!') 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.send_message_button.click()
chat_2.element_starts_with_text(ens_name,'button').click() chat_2.element_starts_with_text(ens_name,'button').click()
for element in (chat_2.element_by_text(user_1['username']), chat_2.add_to_contacts): for element in (chat_2.element_by_text(user_1['username']), chat_2.profile_add_to_contacts):
if not element.is_element_displayed(): if not element.is_element_displayed():
self.errors.append('Was not redirected to user profile after tappin on mention!') self.errors.append('Was not redirected to user profile after tapping on mention!')
chat_1.element_starts_with_text(user_1['ens'] +'.stateofus.eth','button').click() chat_1.element_starts_with_text(user_1['ens'] +'.stateofus.eth','button').click()
if not profile_1.privacy_and_security_button.is_element_displayed(): if not profile_1.settings_button.is_element_displayed():
self.errors.append('Was not redirected to own profile after tapping on mention of myself from another user!') self.errors.append('Was not redirected to own profile after tapping on mention of myself from another user!')
home_2.just_fyi('check that ENS name is shown in 1-1 chat without adding user as contact in header, profile, options') home_2.just_fyi('check that ENS name is shown in 1-1 chat without adding user as contact in header, profile, options')
@ -1146,6 +1164,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
home_2.just_fyi('add user to contacts and check that ENS name is shown in contact') 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() chat_2_one_to_one.profile_add_to_contacts.click()
chat_2.back_button.click()
profile_2 = chat_2_one_to_one.profile_button.click() profile_2 = chat_2_one_to_one.profile_button.click()
profile_2.open_contact_from_profile(ens_name) profile_2.open_contact_from_profile(ens_name)
@ -1157,9 +1176,6 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
if not profile_2.element_by_text(name).is_element_displayed(): if not profile_2.element_by_text(name).is_element_displayed():
self.errors.append('%s is not shown in contact list' % name) self.errors.append('%s is not shown in contact list' % name)
profile_2.home_button.click() profile_2.home_button.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 user profile')
chat_2.back_button.click()
if chat_2_one_to_one.user_name_text.text != nickname: 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') self.errors.append('Nickname for user with ENS is not shown in 1-1 chat header')
chat_2_one_to_one.chat_options.click() chat_2_one_to_one.chat_options.click()

View File

@ -16,6 +16,7 @@ class TestRecoverAccountSingleDevice(SingleDeviceTestCase):
sign_in = SignInView(self.driver) sign_in = SignInView(self.driver)
sign_in.recover_access(passphrase=basic_user['passphrase'], password=unique_password) sign_in.recover_access(passphrase=basic_user['passphrase'], password=unique_password)
profile_view = sign_in.profile_button.click() profile_view = sign_in.profile_button.click()
profile_view.settings_button.click()
profile_view.privacy_and_security_button.click() profile_view.privacy_and_security_button.click()
profile_view.backup_recovery_phrase_button.click() profile_view.backup_recovery_phrase_button.click()
if profile_view.profile_button.counter.is_element_displayed(): if profile_view.profile_button.counter.is_element_displayed():

View File

@ -326,7 +326,7 @@ class TestChatManagement(SingleDeviceTestCase):
home.just_fyi("Denying access to camera in send transaction > scan address view") home.just_fyi("Denying access to camera in send transaction > scan address view")
wallet.accounts_status_account.click() wallet.accounts_status_account.click()
send_transaction = wallet.send_transaction_button.click() send_transaction = wallet.send_transaction_button.click()
send_transaction.chose_recipient_button.click() send_transaction.chose_recipient_button.scroll_and_click()
send_transaction.scan_qr_code_button.click() send_transaction.scan_qr_code_button.click()
send_transaction.deny_button.click() send_transaction.deny_button.click()
send_transaction.element_by_text(camera_access_error_text).wait_for_visibility_of_element(3) send_transaction.element_by_text(camera_access_error_text).wait_for_visibility_of_element(3)
@ -551,7 +551,7 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
self.errors.append('3-random username is not resolved in chat input after selecting it in mention suggestions list!') self.errors.append('3-random username is not resolved in chat input after selecting it in mention suggestions list!')
chat_1.send_message_button.click() chat_1.send_message_button.click()
chat_1.chat_element_by_text(username_2).click() chat_1.chat_element_by_text(username_2).click()
chat_1.profile_add_to_contacts.wait_for_visibility_of_element(20) chat_1.profile_send_message.wait_for_visibility_of_element(20)
chat_1.back_button.click() chat_1.back_button.click()
chat_2.driver.quit() chat_2.driver.quit()
@ -561,9 +561,8 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
chat_element.member_photo.click() chat_element.member_photo.click()
for element in [chat_1.contact_profile_picture, for element in [chat_1.contact_profile_picture,
chat_1.element_by_text(username_2, 'text'), chat_1.element_by_text(username_2, 'text'),
chat_1.add_to_contacts, chat_1.profile_add_to_contacts,
chat_1.profile_send_message, chat_1.profile_send_message,
chat_1.profile_address_text,
chat_1.profile_nickname]: chat_1.profile_nickname]:
if not element.scroll_to_element(): if not element.scroll_to_element():
self.errors.append('%s is not visible' % element.name) self.errors.append('%s is not visible' % element.name)
@ -580,7 +579,7 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
device_1.just_fyi('Add user to contacts, mention it by nickname check contact list in Profile') device_1.just_fyi('Add user to contacts, mention it by nickname check contact list in Profile')
chat_element.member_photo.click() chat_element.member_photo.click()
chat_1.add_to_contacts.click() chat_1.profile_add_to_contacts.click()
if not chat_1.remove_from_contacts.is_element_displayed(): if not chat_1.remove_from_contacts.is_element_displayed():
self.errors.append("'Add to contacts' is not changed to 'Remove from contacts'") self.errors.append("'Add to contacts' is not changed to 'Remove from contacts'")
chat_1.back_button.click() chat_1.back_button.click()

View File

@ -342,7 +342,7 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
if device_1_chat.profile_block_contact.is_element_displayed(): if device_1_chat.profile_block_contact.is_element_displayed():
self.errors.append("Admin is redirected to own profile on tapping own username from group info") self.errors.append("Admin is redirected to own profile on tapping own username from group info")
group_info_view.get_user_from_group_info(device_2_username).click() group_info_view.get_user_from_group_info(device_2_username).click()
if not device_1_chat.profile_details.is_element_displayed(): if not device_1_chat.profile_block_contact.is_element_displayed():
self.errors.append("Admin is not redirected to user profile on tapping member username from group info") self.errors.append("Admin is not redirected to user profile on tapping member username from group info")
device_1_chat.back_button.click() device_1_chat.back_button.click()
@ -451,6 +451,7 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
device_1_home = device_1.create_user() device_1_home = device_1.create_user()
device_1_home.profile_button.click() device_1_home.profile_button.click()
device_1_profile = device_1_home.get_profile_view() device_1_profile = device_1_home.get_profile_view()
device_1_profile.settings_button.click()
device_1_profile.privacy_and_security_button.click() device_1_profile.privacy_and_security_button.click()
device_1_profile.backup_recovery_phrase_button.click() device_1_profile.backup_recovery_phrase_button.click()
device_1_profile.ok_continue_button.click() device_1_profile.ok_continue_button.click()

View File

@ -45,6 +45,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
profile_1 = device_1_home.profile_button.click() profile_1 = device_1_home.profile_button.click()
default_username_1 = profile_1.default_username_text.text default_username_1 = profile_1.default_username_text.text
profile_1.settings_button.click()
profile_1.profile_notifications_button.click() profile_1.profile_notifications_button.click()
device_1_home = profile_1.get_back_to_home_view() device_1_home = profile_1.get_back_to_home_view()
device_2_public_key = device_2_home.get_public_key_and_username() device_2_public_key = device_2_home.get_public_key_and_username()
@ -267,7 +268,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
device2_one_to_one_chat.cross_icon.click() device2_one_to_one_chat.cross_icon.click()
device2_one_to_one_chat.chat_item.long_press_element() device2_one_to_one_chat.chat_item.long_press_element()
device2_one_to_one_chat.element_by_text('View Details').click() device2_one_to_one_chat.element_by_text('View Details').click()
if not device2_one_to_one_chat.profile_details.is_element_displayed(): if not device2_one_to_one_chat.profile_add_to_contacts.is_element_displayed():
self.errors.append('No navigate to user profile after tapping View Details on sticker message') self.errors.append('No navigate to user profile after tapping View Details on sticker message')
@ -915,7 +916,8 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
for key in url_data: for key in url_data:
home_view.plus_button.click_until_presence_of_element(home_view.start_new_chat_button) home_view.plus_button.click_until_presence_of_element(home_view.start_new_chat_button)
sign_in_view.just_fyi('Checking %s case' % key) sign_in_view.just_fyi('Checking %s case' % key)
home_view.universal_qr_scanner_button.click() if home_view.universal_qr_scanner_button.is_element_displayed():
home_view.universal_qr_scanner_button.click()
if home_view.allow_button.is_element_displayed(): if home_view.allow_button.is_element_displayed():
home_view.allow_button.click() home_view.allow_button.click()
home_view.enter_qr_edit_box.set_value(url_data[key]['url']) home_view.enter_qr_edit_box.set_value(url_data[key]['url'])

View File

@ -84,6 +84,7 @@ class TestDApps(SingleDeviceTestCase):
dapp_view.select_account_by_name(account_name).wait_for_element(30) dapp_view.select_account_by_name(account_name).wait_for_element(30)
dapp_view.select_account_by_name(account_name).click() dapp_view.select_account_by_name(account_name).click()
profile_view = dapp_view.profile_button.click() profile_view = dapp_view.profile_button.click()
profile_view.settings_button.click()
profile_view.privacy_and_security_button.click() profile_view.privacy_and_security_button.click()
profile_view.dapp_permissions_button.click() profile_view.dapp_permissions_button.click()
if profile_view.element_by_text(test_dapp_name).is_element_displayed(): if profile_view.element_by_text(test_dapp_name).is_element_displayed():

View File

@ -64,7 +64,7 @@ class TestDeepLinks(SingleDeviceTestCase):
deep_link = 'status-im://u/%s' % basic_user['public_key'] deep_link = 'status-im://u/%s' % basic_user['public_key']
sign_in_view.open_weblink_and_login(deep_link) sign_in_view.open_weblink_and_login(deep_link)
profile_view = sign_in_view.get_profile_view() profile_view = sign_in_view.get_profile_view()
profile_view.privacy_and_security_button.wait_for_element() profile_view.settings_button.wait_for_element()
if profile_view.default_username_text.text != basic_user['username'] \ if profile_view.default_username_text.text != basic_user['username'] \
or not profile_view.contacts_button.is_element_displayed() \ or not profile_view.contacts_button.is_element_displayed() \
or not profile_view.share_my_profile_button.is_element_displayed(): or not profile_view.share_my_profile_button.is_element_displayed():

View File

@ -498,6 +498,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
chat.chat_options.click() chat.chat_options.click()
chat.view_profile_button.click_until_presence_of_element(chat.remove_from_contacts) chat.view_profile_button.click_until_presence_of_element(chat.remove_from_contacts)
chat.set_nickname(nickname) chat.set_nickname(nickname)
chat.back_button.click()
wallet_view = home_view.wallet_button.click() wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet() wallet_view.set_up_wallet()
wallet_view.add_account(account_name=account_name) wallet_view.add_account(account_name=account_name)

View File

@ -173,8 +173,8 @@ class ProfileButton(TabButton):
return ProfileView(self.driver) return ProfileView(self.driver)
def click(self): def click(self):
from views.profile_view import PrivacyAndSecurityButton from views.profile_view import ContactsButton
self.click_until_presence_of_element(PrivacyAndSecurityButton(self.driver)) self.click_until_presence_of_element(ContactsButton(self.driver))
return self.navigate() return self.navigate()
@ -628,7 +628,7 @@ class BaseView(object):
raw_public_key = bytearray.fromhex(public_key.replace('0x04', '')) raw_public_key = bytearray.fromhex(public_key.replace('0x04', ''))
return datatypes.PublicKey(raw_public_key).to_address()[2:] return datatypes.PublicKey(raw_public_key).to_address()[2:]
def get_back_to_home_view(self, times_to_click_on_back_btn=5): def get_back_to_home_view(self, times_to_click_on_back_btn=3):
counter = 0 counter = 0
while BackButton(self.driver).is_element_displayed(2): while BackButton(self.driver).is_element_displayed(2):
try: try:
@ -723,6 +723,7 @@ class BaseView(object):
def open_universal_web_link(self, deep_link): def open_universal_web_link(self, deep_link):
start_web_browser(self.driver) start_web_browser(self.driver)
self.driver.info('Open %s web link via web browser' % deep_link)
self.driver.get(deep_link) self.driver.get(deep_link)
def upgrade_app(self): def upgrade_app(self):

View File

@ -49,7 +49,7 @@ class AddToContacts(BaseButton):
class RemoveFromContactsButton(BaseButton): class RemoveFromContactsButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(RemoveFromContactsButton, self).__init__(driver) super(RemoveFromContactsButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('in-contacts-button') self.locator = self.Locator.accessibility_id('Remove from contacts-item-button')
class AddGroupChatMembersButton(BaseButton): class AddGroupChatMembersButton(BaseButton):
@ -141,15 +141,21 @@ class ImageInRecentInGalleryElement(BaseElement):
class ProfileDetailsOtherUser(BaseButton): class ProfileDetailsOtherUser(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(ProfileDetailsOtherUser, self).__init__(driver) super(ProfileDetailsOtherUser, self).__init__(driver)
self.locator = self.Locator.accessibility_id('profile-public-key') self.locator = self.Locator.accessibility_id('share-button')
class ProfileNicknameOtherUser(BaseButton): class ProfileNicknameOtherUser(BaseElement):
def __init__(self, driver): def __init__(self, driver):
super(ProfileNicknameOtherUser, self).__init__(driver) super(ProfileNicknameOtherUser, self).__init__(driver)
self.locator = self.Locator.xpath_selector('//*[@content-desc="profile-nickname-item"]/android.widget.TextView[2]') self.locator = self.Locator.xpath_selector('//*[@content-desc="profile-nickname-item"]/android.widget.TextView[2]')
class ProfileNicknameOtherUserButton(BaseElement):
def __init__(self, driver):
super(ProfileNicknameOtherUserButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('profile-nickname-item')
class NicknameInputOtherUser(BaseEditBox): class NicknameInputOtherUser(BaseEditBox):
def __init__(self, driver): def __init__(self, driver):
super(NicknameInputOtherUser, self).__init__(driver) super(NicknameInputOtherUser, self).__init__(driver)
@ -247,7 +253,7 @@ class BlockContactButton(BaseButton):
class UnblockContactButton(BaseButton): class UnblockContactButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(UnblockContactButton, self).__init__(driver) super(UnblockContactButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('unblock-contact') self.locator = self.Locator.accessibility_id('Unblock-item-button')
def click(self): def click(self):
self.scroll_to_element() self.scroll_to_element()
@ -352,7 +358,7 @@ class NoMessagesInChatText(BaseText):
class ProfileSendMessageButton(BaseButton): class ProfileSendMessageButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(ProfileSendMessageButton, self).__init__(driver) super(ProfileSendMessageButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('start-conversation-button') self.locator = self.Locator.accessibility_id('Chat-item-button')
def navigate(self): def navigate(self):
return ChatView(self.driver) return ChatView(self.driver)
@ -361,7 +367,7 @@ class ProfileSendMessageButton(BaseButton):
class ProfileBlockContactButton(BaseButton): class ProfileBlockContactButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(ProfileBlockContactButton, self).__init__(driver) super(ProfileBlockContactButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('block-contact') self.locator = self.Locator.accessibility_id('Block-item-button')
def click(self): def click(self):
self.scroll_to_element() self.scroll_to_element()
@ -371,7 +377,7 @@ class ProfileBlockContactButton(BaseButton):
class ProfileAddToContactsButton(BaseButton): class ProfileAddToContactsButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(ProfileAddToContactsButton, self).__init__(driver) super(ProfileAddToContactsButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('add-to-contacts-button') self.locator = self.Locator.accessibility_id('Add to contacts-item-button')
class JoinChatButton(BaseButton): class JoinChatButton(BaseButton):
@ -804,6 +810,8 @@ class ChatView(BaseView):
self.profile_add_to_contacts = ProfileAddToContactsButton(self.driver) self.profile_add_to_contacts = ProfileAddToContactsButton(self.driver)
self.profile_details = ProfileDetailsOtherUser(self.driver) self.profile_details = ProfileDetailsOtherUser(self.driver)
self.profile_nickname = ProfileNicknameOtherUser(self.driver) self.profile_nickname = ProfileNicknameOtherUser(self.driver)
self.profile_nickname_button = ProfileNicknameOtherUserButton(self.driver)
self.nickname_input_field = NicknameInputOtherUser(self.driver) self.nickname_input_field = NicknameInputOtherUser(self.driver)
def delete_chat(self): def delete_chat(self):
@ -923,7 +931,7 @@ class ChatView(BaseView):
def view_profile_long_press(self, message = str): def view_profile_long_press(self, message = str):
self.chat_element_by_text(message).long_press_element() self.chat_element_by_text(message).long_press_element()
self.view_profile_by_avatar_button.click() self.view_profile_by_avatar_button.click()
self.profile_details.wait_for_visibility_of_element(5) self.profile_block_contact.wait_for_visibility_of_element(5)
def move_to_messages_by_time_marker(self, marker='Today'): def move_to_messages_by_time_marker(self, marker='Today'):
self.driver.info("Moving to messages by time marker: '%s'" % marker) self.driver.info("Moving to messages by time marker: '%s'" % marker)
@ -965,7 +973,7 @@ class ChatView(BaseView):
self.block_contact_button.click() self.block_contact_button.click()
def set_nickname(self, nickname): def set_nickname(self, nickname):
self.profile_nickname.click() self.profile_nickname_button.click()
self.nickname_input_field.send_keys(nickname) self.nickname_input_field.send_keys(nickname)
self.element_by_text('Done').click() self.element_by_text('Done').click()

View File

@ -52,7 +52,7 @@ class AddNewContactButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(AddNewContactButton, self).__init__(driver) super(AddNewContactButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('add-new-contact-button') self.locator = self.Locator.text_selector('Add contact')
def navigate(self): def navigate(self):
from views.contacts_view import ContactsView from views.contacts_view import ContactsView
@ -530,9 +530,14 @@ class SyncAllButton(BaseButton):
class ContactsButton(BaseButton): class ContactsButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(ContactsButton, self).__init__(driver) super(ContactsButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('contacts-button') self.locator = self.Locator.accessibility_id('Contacts-item-button')
class SettingsButton(BaseButton):
def __init__(self, driver):
super(SettingsButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('Settings-item-button')
class BlockedUsersButton(BaseButton): class BlockedUsersButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(BlockedUsersButton, self).__init__(driver) super(BlockedUsersButton, self).__init__(driver)
@ -670,6 +675,7 @@ class ProfileView(BaseView):
self.faq_button = FaqButton(self.driver) self.faq_button = FaqButton(self.driver)
self.about_button = AboutButton(self.driver) self.about_button = AboutButton(self.driver)
self.sync_settings_button = SyncSettingsButton(self.driver) self.sync_settings_button = SyncSettingsButton(self.driver)
self.settings_button = SettingsButton(self.driver)
# Bootnodes # Bootnodes
self.bootnodes_button = BootnodesButton(self.driver) self.bootnodes_button = BootnodesButton(self.driver)
@ -706,6 +712,7 @@ class ProfileView(BaseView):
self.push_notification_toggle = PushNotificationToggle(self.driver) self.push_notification_toggle = PushNotificationToggle(self.driver)
def switch_network(self, network='Mainnet with upstream RPC'): def switch_network(self, network='Mainnet with upstream RPC'):
self.settings_button.click()
self.advanced_button.click() self.advanced_button.click()
self.network_settings_button.click() self.network_settings_button.click()
network_button = NetworkSettingsButton.NetworkButton(self.driver, network) network_button = NetworkSettingsButton.NetworkButton(self.driver, network)
@ -782,6 +789,7 @@ class ProfileView(BaseView):
self.remove_picture_button.click() self.remove_picture_button.click()
def logout(self): def logout(self):
self.settings_button.click()
self.logout_button.click() self.logout_button.click()
self.logout_dialog.logout_button.click() self.logout_dialog.logout_button.click()
self.logout_button.wait_for_invisibility_of_element(30) self.logout_button.wait_for_invisibility_of_element(30)
@ -794,6 +802,7 @@ class ProfileView(BaseView):
def discover_and_advertise_device(self, device_name): def discover_and_advertise_device(self, device_name):
self.profile_button.click() self.profile_button.click()
self.settings_button.click()
self.sync_settings_button.click() self.sync_settings_button.click()
self.devices_button.scroll_to_element() self.devices_button.scroll_to_element()
self.devices_button.click() self.devices_button.click()
@ -817,6 +826,7 @@ class ProfileView(BaseView):
profile = self.profile_button.click() profile = self.profile_button.click()
profile.switch_network('Mainnet with upstream RPC') profile.switch_network('Mainnet with upstream RPC')
self.profile_button.click() self.profile_button.click()
self.settings_button.click()
dapp_view = self.ens_usernames_button.click() dapp_view = self.ens_usernames_button.click()
dapp_view.element_by_text('Get started').click() dapp_view.element_by_text('Get started').click()
dapp_view.ens_name.set_value(name) dapp_view.ens_name.set_value(name)