e2e: collectibles + fixes

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
Churikova Tetiana 2021-09-15 17:21:05 +02:00 committed by Serhy
parent 8daf3df6b2
commit 995db1c332
No known key found for this signature in database
GPG Key ID: 5D7C4B9E2B6F500B
10 changed files with 310 additions and 305 deletions

View File

@ -511,7 +511,7 @@ class TestCreateAccount(SingleDeviceTestCase):
keycard.enter_another_pin() keycard.enter_another_pin()
keycard.element_by_text_part('one attempt').wait_for_element(30) keycard.element_by_text_part('one attempt').wait_for_element(30)
keycard.enter_another_pin() keycard.enter_another_pin()
if not home.element_by_translation_id("keycard-is-frozen-title").is_element_displayed(): if not home.element_by_translation_id("keycard-is-frozen-title").is_element_displayed(30):
self.driver.fail("No popup about frozen keycard is shown!") self.driver.fail("No popup about frozen keycard is shown!")
home.element_by_translation_id("keycard-is-frozen-reset").click() home.element_by_translation_id("keycard-is-frozen-reset").click()
keycard.enter_another_pin() keycard.enter_another_pin()

View File

@ -121,23 +121,23 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
profile = home.profile_button.click() profile = home.profile_button.click()
profile.switch_network('Mainnet with upstream RPC') profile.switch_network('Mainnet with upstream RPC')
home.profile_button.click() home.profile_button.click()
dapp_view = profile.ens_usernames_button.click() dapp = profile.ens_usernames_button.click()
dapp_view.just_fyi('check if your name can be added via "ENS usernames" in Profile') dapp.just_fyi('check if your name can be added via "ENS usernames" in Profile')
dapp_view.element_by_text('Get started').click() dapp.element_by_text('Get started').click()
dapp_view.ens_name_input.set_value(ens_user['ens']) dapp.ens_name_input.set_value(ens_user['ens'])
dapp_view.check_ens_name.click_until_absense_of_element(dapp_view.check_ens_name) dapp.check_ens_name.click_until_absense_of_element(dapp.check_ens_name)
if not dapp_view.element_by_translation_id('ens-saved-title').is_element_displayed(): if not dapp.element_by_translation_id('ens-saved-title').is_element_displayed():
self.errors.append('No message "Username added" after resolving own username') self.errors.append('No message "Username added" after resolving own username')
dapp_view.element_by_translation_id("ens-got-it").click() dapp.element_by_translation_id("ens-got-it").click()
dapp_view.just_fyi('check that after adding username is shown in "ENS usernames" and profile') dapp.just_fyi('check that after adding username is shown in "ENS usernames" and profile')
if not dapp_view.element_by_text(ens_user['ens']).is_element_displayed(): if not dapp.element_by_text(ens_user['ens']).is_element_displayed():
self.errors.append('No ENS name is shown in own "ENS usernames" after adding') self.errors.append('No ENS name is shown in own "ENS usernames" after adding')
dapp_view.back_button.click() dapp.back_button.click()
if not dapp_view.element_by_text('@%s' % ens_user['ens']).is_element_displayed(): if not dapp.element_by_text('@%s' % ens_user['ens']).is_element_displayed():
self.errors.append('No ENS name is shown in own profile after adding') 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(): if not dapp.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') self.errors.append('No ENS name is shown in own profile after adding')
profile.share_my_profile_button.click() profile.share_my_profile_button.click()
if profile.ens_name_in_share_chat_key_text.text != '%s.stateofus.eth' % ens_user['ens']: if profile.ens_name_in_share_chat_key_text.text != '%s.stateofus.eth' % ens_user['ens']:
@ -187,27 +187,26 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
@marks.testrail_id(6296) @marks.testrail_id(6296)
@marks.high @marks.high
def test_recover_account_from_new_user_seedphrase(self): def test_recover_account_from_new_user_seedphrase(self):
sign_in_view = SignInView(self.driver) home = SignInView(self.driver).create_user()
sign_in_view.create_user() profile = home.profile_button.click()
profile_view = sign_in_view.profile_button.click() profile.privacy_and_security_button.click()
profile_view.privacy_and_security_button.click() profile.backup_recovery_phrase_button.click()
profile_view.backup_recovery_phrase_button.click() profile.ok_continue_button.click()
profile_view.ok_continue_button.click() recovery_phrase = " ".join(profile.get_recovery_phrase().values())
recovery_phrase = " ".join(profile_view.get_recovery_phrase().values()) profile.close_button.click()
profile_view.close_button.click() profile.back_button.click()
profile_view.back_button.click() public_key = profile.get_public_key_and_username()
public_key = profile_view.get_public_key_and_username() wallet = profile.wallet_button.click()
wallet_view = profile_view.wallet_button.click() address = wallet.get_wallet_address()
address = wallet_view.get_wallet_address() home.profile_button.click()
sign_in_view.profile_button.click() profile.logout()
profile_view.logout()
self.driver.reset() self.driver.reset()
sign_in_view.recover_access(recovery_phrase) home.recover_access(recovery_phrase)
wallet_view = sign_in_view.wallet_button.click() wallet = home.wallet_button.click()
if wallet_view.get_wallet_address() != address: if wallet.get_wallet_address() != address:
self.driver.fail("Seed phrase displayed in new accounts for back up does not recover respective 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() profile = wallet.profile_button.click()
if profile_view.get_public_key_and_username() != public_key: if profile.get_public_key_and_username() != public_key:
self.driver.fail("Seed phrase displayed in new accounts for back up does not recover respective public key") self.driver.fail("Seed phrase displayed in new accounts for back up does not recover respective public key")
@marks.testrail_id(5433) @marks.testrail_id(5433)
@ -262,21 +261,21 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
} }
home.just_fyi('Add contact and check that they appear in Contacts view') home.just_fyi('Add contact and check that they appear in Contacts view')
chat_view = home.get_chat_view() chat = home.get_chat_view()
for key in users: for key in users:
profile.add_new_contact_button.click() profile.add_new_contact_button.click()
home.just_fyi('Checking %s case' % key) home.just_fyi('Checking %s case' % key)
if 'scanning' in key: if 'scanning' in key:
chat_view.scan_contact_code_button.click() chat.scan_contact_code_button.click()
if chat_view.allow_button.is_element_displayed(): if chat.allow_button.is_element_displayed():
chat_view.allow_button.click() chat.allow_button.click()
chat_view.enter_qr_edit_box.scan_qr(users[key]['contact_code']) chat.enter_qr_edit_box.scan_qr(users[key]['contact_code'])
else: else:
chat_view.public_key_edit_box.click() chat.public_key_edit_box.click()
chat_view.public_key_edit_box.send_keys(users[key]['contact_code']) chat.public_key_edit_box.send_keys(users[key]['contact_code'])
if 'nickname' in users[key]: if 'nickname' in users[key]:
chat_view.nickname_input_field.set_value(users[key]['nickname']) chat.nickname_input_field.set_value(users[key]['nickname'])
chat_view.confirm_until_presence_of_element(profile.contacts_button) chat.confirm_until_presence_of_element(profile.contacts_button)
if not profile.element_by_text(users[key]['username']).is_element_displayed(): if not profile.element_by_text(users[key]['username']).is_element_displayed():
self.errors.append('In %s case username not found in contact view after scanning' % key) self.errors.append('In %s case username not found in contact view after scanning' % key)
if 'nickname' in users[key]: if 'nickname' in users[key]:
@ -286,8 +285,8 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
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()
chat_view.remove_from_contacts.click() chat.remove_from_contacts.click()
chat_view.close_button.click() chat.close_button.click()
if profile.element_by_text(user_to_remove).is_element_displayed(): if profile.element_by_text(user_to_remove).is_element_displayed():
self.errors.append('Removed user is still shown in contact view') self.errors.append('Removed user is still shown in contact view')
@ -368,7 +367,6 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
@marks.testrail_id(5453) @marks.testrail_id(5453)
@marks.medium @marks.medium
# @marks.flaky
def test_privacy_policy_terms_of_use_node_version_need_help_in_profile(self): def test_privacy_policy_terms_of_use_node_version_need_help_in_profile(self):
signin = SignInView(self.driver) signin = SignInView(self.driver)
no_link_found_error_msg = 'Could not find privacy policy link at' no_link_found_error_msg = 'Could not find privacy policy link at'
@ -394,7 +392,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
profile.terms_of_use_button.click() profile.terms_of_use_button.click()
web_page.wait_for_d_aap_to_load() web_page.wait_for_d_aap_to_load()
web_page.swipe_by_custom_coordinates(0.5,0.8,0.5,0.4) web_page.swipe_by_custom_coordinates(0.5,0.8,0.5,0.4)
if not web_page.terms_of_use_summary.is_element_displayed(): if not web_page.terms_of_use_summary.is_element_displayed(30):
self.errors.append('%s Profile about view!' % no_link_tos_error_msg) self.errors.append('%s Profile about view!' % no_link_tos_error_msg)
web_page.click_system_back_button() web_page.click_system_back_button()
@ -420,15 +418,15 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
web_page = profile.faq_button.click() web_page = profile.faq_button.click()
web_page.open_in_webview() web_page.open_in_webview()
web_page.wait_for_d_aap_to_load() web_page.wait_for_d_aap_to_load()
if not profile.element_by_text_part("F.A.Q").is_element_displayed(): if not profile.element_by_text_part("F.A.Q").is_element_displayed(30):
self.errors.append("FAQ is not shown") self.errors.append("FAQ is not shown")
profile.click_system_back_button() profile.click_system_back_button()
profile.submit_bug_button.click() profile.submit_bug_button.click()
if not profile.element_by_text_part("Welcome to Gmail").is_element_displayed(): if not profile.element_by_text_part("Welcome to Gmail").is_element_displayed(30):
self.errors.append("Mail client is not opened when submitting bug") self.errors.append("Mail client is not opened when submitting bug")
profile.click_system_back_button() profile.click_system_back_button()
profile.request_a_feature_button.click() profile.request_a_feature_button.click()
if not profile.element_by_text("#support").is_element_displayed(): if not profile.element_by_text("#support").is_element_displayed(30):
self.errors.append("Support channel is not suggested for requesting a feature") self.errors.append("Support channel is not suggested for requesting a feature")
self.errors.verify_no_errors() self.errors.verify_no_errors()
@ -440,7 +438,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
home.just_fyi('open Status Test Dapp, allow all and check permissions in Profile') home.just_fyi('open Status Test Dapp, allow all and check permissions in Profile')
web_view = home.open_status_test_dapp() web_view = home.open_status_test_dapp()
dapp_view = home.dapp_tab_button.click() dapp = home.dapp_tab_button.click()
profile = home.profile_button.click() profile = home.profile_button.click()
profile.privacy_and_security_button.click() profile.privacy_and_security_button.click()
profile.dapp_permissions_button.click() profile.dapp_permissions_button.click()
@ -458,12 +456,12 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
web_view.open_tabs_button.click() web_view.open_tabs_button.click()
web_view.empty_tab_button.click() web_view.empty_tab_button.click()
dapp_view.open_url(test_dapp_url) dapp.open_url(test_dapp_url)
if not dapp_view.element_by_text_part(account_name).is_element_displayed(): if not dapp.element_by_text_part(account_name).is_element_displayed():
self.errors.append('Wallet permission is not asked') self.errors.append('Wallet permission is not asked')
if dapp_view.allow_button.is_element_displayed(): if dapp.allow_button.is_element_displayed():
dapp_view.allow_button.click(times_to_click=1) dapp.allow_button.click(times_to_click=1)
if not dapp_view.element_by_translation_id("your-contact-code").is_element_displayed(): if not dapp.element_by_translation_id("your-contact-code").is_element_displayed():
self.errors.append('Profile permission is not asked') self.errors.append('Profile permission is not asked')
self.errors.verify_no_errors() self.errors.verify_no_errors()
@ -654,7 +652,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
if not one_to_one_chat_2.user_profile_image_in_mentions_list(default_username_1).is_element_image_similar_to_template('sauce_logo.png'): if not one_to_one_chat_2.user_profile_image_in_mentions_list(default_username_1).is_element_image_similar_to_template('sauce_logo.png'):
self.errors.append('Profile picture was not updated in 1-1 chat mentions list') self.errors.append('Profile picture was not updated in 1-1 chat mentions list')
profile_1.just_fyi('Check profile image updated in user profile view and on Chats view') profile_1.just_fyi('Check profile image is updated in Group chat view')
profile_2 = one_to_one_chat_2.profile_button.click() profile_2 = one_to_one_chat_2.profile_button.click()
profile_2.contacts_button.click() profile_2.contacts_button.click()
profile_2.element_by_text(default_username_1).click() profile_2.element_by_text(default_username_1).click()
@ -953,47 +951,47 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
def test_pair_devices_sync_one_to_one_contacts_nicknames_public_chat(self): def test_pair_devices_sync_one_to_one_contacts_nicknames_public_chat(self):
self.create_drivers(2) self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
device_1_home = device_1.create_user() home_1 = device_1.create_user()
device_1_home.profile_button.click() home_1.profile_button.click()
device_1_profile = device_1_home.get_profile_view() profile_1 = home_1.get_profile_view()
device_1_profile.privacy_and_security_button.click() profile_1.privacy_and_security_button.click()
device_1_profile.backup_recovery_phrase_button.click() profile_1.backup_recovery_phrase_button.click()
device_1_profile.ok_continue_button.click() profile_1.ok_continue_button.click()
recovery_phrase = device_1_profile.get_recovery_phrase() recovery_phrase = profile_1.get_recovery_phrase()
device_1_profile.close_button.click() profile_1.close_button.click()
device_1_profile.home_button.click() profile_1.home_button.click()
device_1_name = 'device_%s' % device_1.driver.number name_1 = 'device_%s' % device_1.driver.number
device_2_name = 'device_%s' % device_2.driver.number name_2 = 'device_%s' % device_2.driver.number
message_before_sync = 'sent before sync' message_before_sync = 'sent before sync'
message_after_sync = 'sent after sync' message_after_sync = 'sent after sync'
public_chat_before_sync = 'before-pairing' public_chat_before_sync = 'before-pairing'
public_chat_after_sync = 'after-pairing' public_chat_after_sync = 'after-pairing'
device_1.just_fyi('add contact, start 1-1 chat with basic user') device_1.just_fyi('add contact, start 1-1 chat with basic user')
device_1_chat = device_1_home.add_contact(basic_user['public_key']) chat_1 = home_1.add_contact(basic_user['public_key'])
device_1_chat.chat_message_input.send_keys(message_before_sync) chat_1.chat_message_input.send_keys(message_before_sync)
device_1_chat.send_message_button.click() chat_1.send_message_button.click()
device_1.just_fyi('join public chat') device_1.just_fyi('join public chat')
device_1_chat.get_back_to_home_view() chat_1.get_back_to_home_view()
device_1_public_chat = device_1_home.join_public_chat(public_chat_before_sync) device_1_public_chat = home_1.join_public_chat(public_chat_before_sync)
device_2_home = device_2.recover_access(passphrase=' '.join(recovery_phrase.values())) home_2 = 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() profile_1, device_2_profile = home_1.profile_button.click(), home_2.profile_button.click()
device_2.just_fyi('go to profile and set nickname for contact') device_2.just_fyi('go to profile and set nickname for contact')
device_1_profile.open_contact_from_profile(basic_user['username']) profile_1.open_contact_from_profile(basic_user['username'])
nickname = 'my_basic_user' nickname = 'my_basic_user'
device_1_chat.set_nickname(nickname) chat_1.set_nickname(nickname)
device_1_profile.close_button.click() profile_1.close_button.click()
device_1.back_button.click() device_1.back_button.click()
device_2.just_fyi('go to profile > Devices, set device name, discover device 2 to device 1') device_2.just_fyi('go to profile > Devices, set device name, discover device 2 to device 1')
device_2_profile.discover_and_advertise_device(device_2_name) device_2_profile.discover_and_advertise_device(name_2)
device_1_profile.discover_and_advertise_device(device_1_name) profile_1.discover_and_advertise_device(name_1)
device_1_profile.get_toggle_device_by_name(device_2_name).wait_and_click() profile_1.get_toggle_device_by_name(name_2).wait_and_click()
device_1_profile.sync_all_button.click() profile_1.sync_all_button.click()
device_1_profile.sync_all_button.wait_for_visibility_of_element(15) profile_1.sync_all_button.wait_for_visibility_of_element(15)
[device.profile_button.click() for device in (device_1_profile, device_2_profile)] [device.profile_button.click() for device in (profile_1, device_2_profile)]
device_2.just_fyi('check that contact with nickname is appeared in Contact list') device_2.just_fyi('check that contact with nickname is appeared in Contact list')
device_2_profile.contacts_button.scroll_to_element(9, 'up') device_2_profile.contacts_button.scroll_to_element(9, 'up')
@ -1003,13 +1001,13 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
self.errors.append('"%s" is not found in Contacts after initial sync' % name) self.errors.append('"%s" is not found in Contacts after initial sync' % name)
device_1.just_fyi('send message to 1-1 chat with basic user and add another contact') device_1.just_fyi('send message to 1-1 chat with basic user and add another contact')
device_1_profile.home_button.click(desired_view='chat') profile_1.home_button.click(desired_view='chat')
device_1_public_chat.back_button.click() device_1_public_chat.back_button.click()
device_1_home.get_chat(nickname).click() home_1.get_chat(nickname).click()
device_1_chat.chat_message_input.send_keys(message_after_sync) chat_1.chat_message_input.send_keys(message_after_sync)
device_1_chat.send_message_button.click() chat_1.send_message_button.click()
device_1_chat.back_button.click() chat_1.back_button.click()
device_1_home.add_contact(transaction_senders['A']['public_key']) home_1.add_contact(transaction_senders['A']['public_key'])
device_2.just_fyi('check that messages appeared in 1-1 chat, public chats and new contacts are synced') device_2.just_fyi('check that messages appeared in 1-1 chat, public chats and new contacts are synced')
if not device_2_profile.element_by_text(transaction_senders['A']['username']).is_element_displayed(60): if not device_2_profile.element_by_text(transaction_senders['A']['username']).is_element_displayed(60):
@ -1018,32 +1016,32 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
'username']) 'username'])
device_1.just_fyi('Set nickname for added contact and check that it will be synced') device_1.just_fyi('Set nickname for added contact and check that it will be synced')
device_1_home.profile_button.click() home_1.profile_button.click()
device_1_profile.contacts_button.scroll_to_element(9, 'up') profile_1.contacts_button.scroll_to_element(9, 'up')
device_1_profile.open_contact_from_profile(transaction_senders['A']['username']) profile_1.open_contact_from_profile(transaction_senders['A']['username'])
nickname_after_sync = 'my_transaction sender' nickname_after_sync = 'my_transaction sender'
device_1_chat.set_nickname(nickname_after_sync) chat_1.set_nickname(nickname_after_sync)
device_1_profile.close_button.click() profile_1.close_button.click()
device_1.home_button.click(desired_view='chat') device_1.home_button.click(desired_view='chat')
if not device_2_profile.element_by_text(nickname_after_sync).is_element_displayed(60): if not device_2_profile.element_by_text(nickname_after_sync).is_element_displayed(60):
self.errors.append( self.errors.append(
'"%s" is not updated in Contacts after setting nickname when devices are paired' % nickname_after_sync) '"%s" is not updated in Contacts after setting nickname when devices are paired' % nickname_after_sync)
device_2_profile.home_button.click() device_2_profile.home_button.click()
if not device_2_home.element_by_text_part(public_chat_before_sync).is_element_displayed(): if not home_2.element_by_text_part(public_chat_before_sync).is_element_displayed():
self.errors.append( self.errors.append(
'"%s" is not found in Home after initial sync when devices are paired' % public_chat_before_sync) '"%s" is not found in Home after initial sync when devices are paired' % public_chat_before_sync)
chat = device_2_home.get_chat(nickname).click() chat = home_2.get_chat(nickname).click()
if chat.chat_element_by_text(message_before_sync).is_element_displayed(): 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) self.errors.append('"%s" message sent before pairing is synced' % message_before_sync)
if not chat.chat_element_by_text(message_after_sync).is_element_displayed(60): if not chat.chat_element_by_text(message_after_sync).is_element_displayed(60):
self.errors.append('"%s" message in 1-1 is not synced' % message_after_sync) self.errors.append('"%s" message in 1-1 is not synced' % message_after_sync)
device_1.just_fyi('add new public chat and check that it will be synced with device2') 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() chat_1.get_back_to_home_view()
device_1_home.join_public_chat(public_chat_after_sync) home_1.join_public_chat(public_chat_after_sync)
device_2_home = chat.get_back_to_home_view() home_2 = chat.get_back_to_home_view()
if not device_2_home.element_by_text_part(public_chat_after_sync).is_element_displayed(20): if not home_2.element_by_text_part(public_chat_after_sync).is_element_displayed(20):
self.errors.append( self.errors.append(
'"%s" public chat is not synced after adding when devices are paired' % public_chat_after_sync) '"%s" public chat is not synced after adding when devices are paired' % public_chat_after_sync)
@ -1065,15 +1063,15 @@ 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()
dapp_view_1 = profile_1.ens_usernames_button.click() dapp_1 = profile_1.ens_usernames_button.click()
dapp_view_1.element_by_text('Get started').click() dapp_1.element_by_text('Get started').click()
dapp_view_1.ens_name_input.set_value(ens_user['ens']) dapp_1.ens_name_input.set_value(ens_user['ens'])
expected_text = 'This user name is owned by you and connected with your chat key.' expected_text = 'This user name is owned by you and connected with your chat key.'
if not dapp_view_1.element_by_text_part(expected_text).is_element_displayed(): if not dapp_1.element_by_text_part(expected_text).is_element_displayed():
dapp_view_1.click_system_back_button() dapp_1.click_system_back_button()
dapp_view_1.wait_for_element_starts_with_text(expected_text) dapp_1.wait_for_element_starts_with_text(expected_text)
dapp_view_1.check_ens_name.click_until_presence_of_element(dapp_view_1.element_by_text('Ok, got it')) dapp_1.check_ens_name.click_until_presence_of_element(dapp_1.element_by_text('Ok, got it'))
dapp_view_1.element_by_text('Ok, got it').click() dapp_1.element_by_text('Ok, got it').click()
home_1.just_fyi('check ENS name wallet address and public key') home_1.just_fyi('check ENS name wallet address and public key')
profile_1.element_by_text(user_1['ens']).click() profile_1.element_by_text(user_1['ens']).click()
@ -1084,9 +1082,9 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
home_2.just_fyi('joining same public chat, set ENS name and check it in chat from device2') home_2.just_fyi('joining same public chat, set ENS name and check it in chat from device2')
chat_name = home_1.get_random_chat_name() chat_name = home_1.get_random_chat_name()
chat_2 = home_2.join_public_chat(chat_name) public_2 = home_2.join_public_chat(chat_name)
chat_1 = home_1.join_public_chat(chat_name) public_1 = home_1.join_public_chat(chat_name)
chat_1.get_back_to_home_view() public_1.get_back_to_home_view()
home_1.profile_button.click() home_1.profile_button.click()
ens_name = '@' + user_1['ens'] ens_name = '@' + user_1['ens']
profile_1.element_by_text('Your ENS name').click() profile_1.element_by_text('Your ENS name').click()
@ -1096,18 +1094,18 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
profile_1.home_button.click() profile_1.home_button.click()
home_1.get_chat('#' + chat_name).click() home_1.get_chat('#' + chat_name).click()
message_text_2 = 'message test text 1' message_text_2 = 'message test text 1'
chat_1.send_message(message_text_2) public_1.send_message(message_text_2)
if not chat_2.wait_for_element_starts_with_text(ens_name): if not public_2.wait_for_element_starts_with_text(ens_name):
self.errors.append('ENS username is not shown in public chat') self.errors.append('ENS username is not shown in public chat')
home_1.put_app_to_background() home_1.put_app_to_background()
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.select_mention_from_suggestion_list(user_1['ens']) public_2.select_mention_from_suggestion_list(user_1['ens'])
if chat_2.chat_message_input.text != ens_name + ' ': if public_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() public_2.send_message_button.click()
chat_2.element_starts_with_text(ens_name,'button').click() public_2.element_starts_with_text(ens_name,'button').click()
for element in (chat_2.element_by_text(user_1['username']), chat_2.profile_add_to_contacts): for element in (public_2.element_by_text(user_1['username']), public_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 tapping on mention!') self.errors.append('Was not redirected to user profile after tapping on mention!')
@ -1121,40 +1119,40 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
self.drivers[0].quit() self.drivers[0].quit()
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')
chat_2_one_to_one = chat_2.profile_send_message.click() one_to_one_2 = public_2.profile_send_message.click()
if chat_2_one_to_one.user_name_text.text != ens_name: if one_to_one_2.user_name_text.text != ens_name:
self.errors.append('ENS username is not shown in 1-1 chat header') self.errors.append('ENS username is not shown in 1-1 chat header')
chat_2_one_to_one.chat_options.click() one_to_one_2.chat_options.click()
if not chat_2_one_to_one.element_by_text(ens_name).is_element_displayed(): if not one_to_one_2.element_by_text(ens_name).is_element_displayed():
self.errors.append('ENS username is not shown in 1-1 chat options') self.errors.append('ENS username is not shown in 1-1 chat options')
chat_2_one_to_one.view_profile_button.click() one_to_one_2.view_profile_button.click()
if not chat_2_one_to_one.element_by_text(ens_name).is_element_displayed(): if not one_to_one_2.element_by_text(ens_name).is_element_displayed():
self.errors.append('ENS username is not shown in user profile') 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') 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() one_to_one_2.profile_add_to_contacts.click()
chat_2.close_button.click() public_2.close_button.click()
profile_2 = chat_2_one_to_one.profile_button.click() profile_2 = one_to_one_2.profile_button.click()
profile_2.open_contact_from_profile(ens_name) profile_2.open_contact_from_profile(ens_name)
home_2.just_fyi('set nickname and recheck username in 1-1 header, profile, options, contacts') home_2.just_fyi('set nickname and recheck username in 1-1 header, profile, options, contacts')
nickname = 'test user' + str(round(time())) nickname = 'test user' + str(round(time()))
chat_2.set_nickname(nickname) public_2.set_nickname(nickname)
profile_2.close_button.click() profile_2.close_button.click()
for name in (nickname, ens_name): for name in (nickname, ens_name):
if not profile_2.element_by_text(name).is_element_displayed(): if not profile_2.element_by_text(name).is_element_displayed():
self.errors.append('%s is not shown in contact list' % name) self.errors.append('%s is not shown in contact list' % name)
profile_2.home_button.click(desired_view='chat') profile_2.home_button.click(desired_view='chat')
if chat_2_one_to_one.user_name_text.text != nickname: if one_to_one_2.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() one_to_one_2.chat_options.click()
if not chat_2_one_to_one.element_by_text(nickname).is_element_displayed(): if not one_to_one_2.element_by_text(nickname).is_element_displayed():
self.errors.append('Nickname for user with ENS is not shown in 1-1 chat options') 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') home_2.just_fyi('check nickname in public chat')
chat_2.get_back_to_home_view() public_2.get_back_to_home_view()
home_2.get_chat('#' + chat_name).click() home_2.get_chat('#' + chat_name).click()
chat_element = chat_2.chat_element_by_text(message_text_2) chat_element = public_2.chat_element_by_text(message_text_2)
chat_element.find_element() chat_element.find_element()
if chat_element.username.text != '%s %s' % (nickname, ens_name): if chat_element.username.text != '%s %s' % (nickname, ens_name):
self.errors.append('Nickname for user with ENS is not shown in public chat') self.errors.append('Nickname for user with ENS is not shown in public chat')
@ -1166,75 +1164,75 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
def test_mobile_data_usage_complex_settings(self): def test_mobile_data_usage_complex_settings(self):
self.create_drivers(2) self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
device_1_home = device_1.create_user() home_1 = device_1.create_user()
public_chat_name, public_chat_message = 'e2e-started-before', 'message to pub chat' public_chat_name, public_chat_message = 'e2e-started-before', 'message to pub chat'
device_1_public = device_1_home.join_public_chat(public_chat_name) public_1 = home_1.join_public_chat(public_chat_name)
device_1_public.send_message(public_chat_message) public_1.send_message(public_chat_message)
device_1_home.just_fyi('set mobile data to "OFF" and check that peer-to-peer connection is still working') home_1.just_fyi('set mobile data to "OFF" and check that peer-to-peer connection is still working')
device_2_home = device_2.create_user() home_2 = device_2.create_user()
device_2_home.toggle_mobile_data() home_2.toggle_mobile_data()
device_2_home.mobile_connection_off_icon.wait_for_visibility_of_element(20) home_2.mobile_connection_off_icon.wait_for_visibility_of_element(20)
for element in device_2_home.continue_syncing_button, device_2_home.stop_syncing_button, device_2_home.remember_my_choice_checkbox: for element in home_2.continue_syncing_button, home_2.stop_syncing_button, home_2.remember_my_choice_checkbox:
if not element.is_element_displayed(10): if not element.is_element_displayed(10):
self.drivers[0].fail('Element %s is not not shown in "Syncing mobile" bottom sheet' % element.locator) self.drivers[0].fail('Element %s is not not shown in "Syncing mobile" bottom sheet' % element.locator)
device_2_home.stop_syncing_button.click() home_2.stop_syncing_button.click()
if not device_2_home.mobile_connection_off_icon.is_element_displayed(): if not home_2.mobile_connection_off_icon.is_element_displayed():
self.drivers[0].fail('No mobile connection OFF icon is shown') self.drivers[0].fail('No mobile connection OFF icon is shown')
device_2_home.mobile_connection_off_icon.click() home_2.mobile_connection_off_icon.click()
for element in device_2_home.connected_to_n_peers_text, device_2_home.waiting_for_wi_fi: for element in home_2.connected_to_n_peers_text, home_2.waiting_for_wi_fi:
if not element.is_element_displayed(): if not element.is_element_displayed():
self.errors.append("Element '%s' is not shown in Connection status bottom sheet" % element.locator) self.errors.append("Element '%s' is not shown in Connection status bottom sheet" % element.locator)
device_2_home.click_system_back_button() home_2.click_system_back_button()
device_2_public = device_2_home.join_public_chat(public_chat_name) public_2 = home_2.join_public_chat(public_chat_name)
if device_2_public.chat_element_by_text(public_chat_message).is_element_displayed(30): if public_2.chat_element_by_text(public_chat_message).is_element_displayed(30):
self.errors.append("Chat history was fetched with mobile data fetching off") self.errors.append("Chat history was fetched with mobile data fetching off")
public_chat_new_message = 'new message' public_chat_new_message = 'new message'
device_1_public.send_message(public_chat_new_message) public_1.send_message(public_chat_new_message)
if not device_2_public.chat_element_by_text(public_chat_new_message).is_element_displayed(30): if not public_2.chat_element_by_text(public_chat_new_message).is_element_displayed(30):
self.errors.append("Peer-to-peer connection is not working when mobile data fetching is off") self.errors.append("Peer-to-peer connection is not working when mobile data fetching is off")
device_2_home.just_fyi('set mobile data to "ON"') home_2.just_fyi('set mobile data to "ON"')
device_2_home.home_button.click() home_2.home_button.click()
device_2_home.mobile_connection_off_icon.click() home_2.mobile_connection_off_icon.click()
device_2_home.use_mobile_data_switch.click() home_2.use_mobile_data_switch.click()
if not device_2_home.connected_to_node_text.is_element_displayed(10): if not home_2.connected_to_node_text.is_element_displayed(10):
self.errors.append("Not connected to history node after enabling fetching on mobile data") self.errors.append("Not connected to history node after enabling fetching on mobile data")
device_2_home.click_system_back_button() home_2.click_system_back_button()
device_2_home.mobile_connection_on_icon.wait_for_visibility_of_element(10) home_2.mobile_connection_on_icon.wait_for_visibility_of_element(10)
if not device_2_home.mobile_connection_on_icon.is_element_displayed(): if not home_2.mobile_connection_on_icon.is_element_displayed():
self.errors.append('No mobile connection ON icon is shown') self.errors.append('No mobile connection ON icon is shown')
device_2_home.get_chat('#%s'% public_chat_name).click() home_2.get_chat('#%s'% public_chat_name).click()
if not device_2_public.chat_element_by_text(public_chat_message).is_element_displayed(90): if not public_2.chat_element_by_text(public_chat_message).is_element_displayed(90):
self.errors.append("Chat history was not fetched with mobile data fetching ON") self.errors.append("Chat history was not fetched with mobile data fetching ON")
device_2_home.just_fyi('check redirect to sync settings by tappin "Sync" in connection status bottom sheet') home_2.just_fyi('check redirect to sync settings by tappin "Sync" in connection status bottom sheet')
device_2_home.home_button.click() home_2.home_button.click()
device_2_home.mobile_connection_on_icon.click() home_2.mobile_connection_on_icon.click()
device_2_home.connection_settings_button.click() home_2.connection_settings_button.click()
if not device_2_home.element_by_translation_id("mobile-network-use-mobile").is_element_displayed(): if not home_2.element_by_translation_id("mobile-network-use-mobile").is_element_displayed():
self.errors.append("Was not redirected to sync settings after tapping on Settings in connection bottom sheet") self.errors.append("Was not redirected to sync settings after tapping on Settings in connection bottom sheet")
device_1_home.just_fyi("Check default preferences in Sync settings") home_1.just_fyi("Check default preferences in Sync settings")
device_1_profile = device_1_home.profile_button.click() profile_1 = home_1.profile_button.click()
device_1_profile.sync_settings_button.click() profile_1.sync_settings_button.click()
if not device_1_profile.element_by_translation_id("mobile-network-use-wifi").is_element_displayed(): if not profile_1.element_by_translation_id("mobile-network-use-wifi").is_element_displayed():
self.errors.append("Mobile data is enabled by default") self.errors.append("Mobile data is enabled by default")
device_1_profile.element_by_translation_id("mobile-network-use-wifi").click() profile_1.element_by_translation_id("mobile-network-use-wifi").click()
if device_1_profile.ask_me_when_on_mobile_network.text != "ON": if profile_1.ask_me_when_on_mobile_network.text != "ON":
self.errors.append("'Ask me when on mobile network' is not enabled by default") self.errors.append("'Ask me when on mobile network' is not enabled by default")
device_1_profile.just_fyi("Disable 'ask me when on mobile network' and check that it is not shown") profile_1.just_fyi("Disable 'ask me when on mobile network' and check that it is not shown")
device_1_profile.ask_me_when_on_mobile_network.click() profile_1.ask_me_when_on_mobile_network.click()
device_1_profile.toggle_mobile_data() profile_1.toggle_mobile_data()
if device_1_profile.element_by_translation_id("mobile-network-start-syncing").is_element_displayed(20): if profile_1.element_by_translation_id("mobile-network-start-syncing").is_element_displayed(20):
self.errors.append("Popup is shown, but 'ask me when on mobile network' is disabled") self.errors.append("Popup is shown, but 'ask me when on mobile network' is disabled")
device_1_profile.just_fyi("Check 'Restore default' setting") profile_1.just_fyi("Check 'Restore default' setting")
device_1_profile.element_by_text('Restore Defaults').click() profile_1.element_by_text('Restore Defaults').click()
if device_1_profile.use_mobile_data.attribute_value("checked"): if profile_1.use_mobile_data.attribute_value("checked"):
self.errors.append("Mobile data is enabled by default") self.errors.append("Mobile data is enabled by default")
if not device_1_profile.ask_me_when_on_mobile_network.attribute_value("checked"): if not profile_1.ask_me_when_on_mobile_network.attribute_value("checked"):
self.errors.append("'Ask me when on mobile network' is not enabled by default") self.errors.append("'Ask me when on mobile network' is not enabled by default")
self.errors.verify_no_errors() self.errors.verify_no_errors()
@ -1247,70 +1245,69 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
def test_pair_devices_sync_name_photo_public_group_chats(self): def test_pair_devices_sync_name_photo_public_group_chats(self):
self.create_drivers(2) self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
device_1_home = device_1.create_user() home_1 = device_1.create_user()
device_1_home.profile_button.click() home_1.profile_button.click()
device_1_profile = device_1_home.get_profile_view() profile_1 = home_1.get_profile_view()
device_1_profile.privacy_and_security_button.click() profile_1.privacy_and_security_button.click()
device_1_profile.backup_recovery_phrase_button.click() profile_1.backup_recovery_phrase_button.click()
recovery_phrase = device_1_profile.backup_recovery_phrase() recovery_phrase = profile_1.backup_recovery_phrase()
device_1_profile.back_button.click() profile_1.back_button.click()
device_1_profile.get_back_to_home_view() profile_1.get_back_to_home_view()
device_1_name = 'device_%s' % device_1.driver.number device_1_name = 'device_%s' % device_1.driver.number
device_2_name = 'device_%s' % device_2.driver.number device_2_name = 'device_%s' % device_2.driver.number
public_chat_before_sync_name = 'b-public-%s' % device_1_home.get_random_chat_name() public_chat_before_sync_name = 'b-public-%s' % home_1.get_random_chat_name()
public_chat_after_sync_name = 'a-public-%s' % device_1_home.get_random_chat_name() public_chat_after_sync_name = 'a-public-%s' % home_1.get_random_chat_name()
group_chat_name = 'group-%s' % device_1_home.get_random_chat_name() group_chat_name = 'group-%s' % home_1.get_random_chat_name()
message_after_sync = 'sent after sync' message_after_sync = 'sent after sync'
device_1.just_fyi('join public chat, create group chat, edit user picture') device_1.just_fyi('join public chat, create group chat, edit user picture')
device_1_public_chat = device_1_home.join_public_chat(public_chat_before_sync_name) public_1 = home_1.join_public_chat(public_chat_before_sync_name)
device_1_public_chat.back_button.click() public_1.back_button.click()
device_1_one_to_one = device_1_home.add_contact(basic_user['public_key']) one_to_one_1 = home_1.add_contact(basic_user['public_key'])
device_1_one_to_one.back_button.click() one_to_one_1.back_button.click()
device_1_group_chat = device_1_home.create_group_chat([basic_user['username']], group_chat_name) group_chat_1 = home_1.create_group_chat([basic_user['username']], group_chat_name)
device_1_group_chat.back_button.click() group_chat_1.back_button.click()
device_1_home.profile_button.click() home_1.profile_button.click()
device_1_profile = device_1_home.get_profile_view() profile_1 = home_1.get_profile_view()
device_1_profile.edit_profile_picture('sauce_logo.png') profile_1.edit_profile_picture('sauce_logo.png')
device_2.just_fyi('go to profile > Devices, set device name, discover device 2 to device 1') device_2.just_fyi('go to profile > Devices, set device name, discover device 2 to device 1')
device_2_home = device_2.recover_access(passphrase=' '.join(recovery_phrase.values())) home_2 = device_2.recover_access(passphrase=' '.join(recovery_phrase.values()))
device_2_profile = device_2_home.get_profile_view() profile_2 = home_2.get_profile_view()
device_2_profile.discover_and_advertise_device(device_2_name) profile_2.discover_and_advertise_device(device_2_name)
device_1.just_fyi('enable pairing of `device 2` and sync') device_1.just_fyi('enable pairing of `device 2` and sync')
device_1_profile.discover_and_advertise_device(device_1_name) profile_1.discover_and_advertise_device(device_1_name)
device_1_profile.get_toggle_device_by_name(device_2_name).click() profile_1.get_toggle_device_by_name(device_2_name).click()
device_1_profile.sync_all_button.click() profile_1.sync_all_button.click()
device_1_profile.sync_all_button.wait_for_visibility_of_element(15) profile_1.sync_all_button.wait_for_visibility_of_element(15)
device_2.just_fyi('check that public chat and profile details are updated') device_2.just_fyi('check that public chat and profile details are updated')
device_2_home = device_2_profile.home_button.click() home_2 = profile_2.home_button.click()
if not device_2_home.element_by_text('#%s' % public_chat_before_sync_name).is_element_displayed(): if not home_2.element_by_text('#%s' % public_chat_before_sync_name).is_element_displayed():
self.errors.append('Public chat "%s" doesn\'t appear after initial sync' self.errors.append('Public chat "%s" doesn\'t appear after initial sync'
% public_chat_before_sync_name) % public_chat_before_sync_name)
device_2_home.home_button.click() home_2.home_button.click()
device_2_home.profile_button.click() home_2.profile_button.click()
if not device_2_profile.profile_picture.is_element_image_equals_template('sauce_logo_profile.png'): if not profile_2.profile_picture.is_element_image_equals_template('sauce_logo_profile.png'):
self.errors.append('Profile picture was not updated after initial sync') self.errors.append('Profile picture was not updated after initial sync')
device_2_profile.home_button.click() profile_2.home_button.click()
device_1.just_fyi('send message to group chat, and join to new public chat') device_1.just_fyi('send message to group chat, and join to new public chat')
device_1_home = device_1_profile.home_button.click() home_1 = profile_1.home_button.click()
device_1_public_chat = device_1_home.join_public_chat(public_chat_after_sync_name) public_1 = home_1.join_public_chat(public_chat_after_sync_name)
device_1_public_chat.back_button.click() public_1.back_button.click()
device_1_home.element_by_text(group_chat_name).click() home_1.element_by_text(group_chat_name).click()
device_1_group_chat.chat_message_input.send_keys(message_after_sync) group_chat_1.send_message(message_after_sync)
device_1_group_chat.send_message_button.click() group_chat_1.back_button.click()
device_1_group_chat.back_button.click()
device_2.just_fyi('check that message in group chat is shown, public chats are synced') device_2.just_fyi('check that message in group chat is shown, public chats are synced')
if not device_2_home.element_by_text('#%s' % public_chat_after_sync_name).is_element_displayed(): if not home_2.element_by_text('#%s' % public_chat_after_sync_name).is_element_displayed():
self.errors.append('Public chat "%s" doesn\'t appear on other device when devices are paired' self.errors.append('Public chat "%s" doesn\'t appear on other device when devices are paired'
% public_chat_before_sync_name) % public_chat_before_sync_name)
device_2_home.element_by_text(group_chat_name).click() home_2.element_by_text(group_chat_name).click()
device_2_group_chat = device_2_home.get_chat_view() device_2_group_chat = home_2.get_chat_view()
if not device_2_group_chat.chat_element_by_text(message_after_sync).is_element_displayed(): if not device_2_group_chat.chat_element_by_text(message_after_sync).is_element_displayed():
self.errors.append('"%s" message in group chat is not synced' % message_after_sync) self.errors.append('"%s" message in group chat is not synced' % message_after_sync)

View File

@ -101,10 +101,12 @@ class TestWalletManagement(SingleDeviceTestCase):
wallet.collectibles_button.click() wallet.collectibles_button.click()
wallet.just_fyi('Check collectibles amount in wallet') wallet.just_fyi('Check collectibles amount in wallet')
wallet.element_by_translation_id("enable").scroll_and_click()
wallet.cryptokitties_in_collectibles_number.wait_for_visibility_of_element(30) wallet.cryptokitties_in_collectibles_number.wait_for_visibility_of_element(30)
if wallet.cryptokitties_in_collectibles_number.text != '1': if wallet.cryptokitties_in_collectibles_number.text != '1':
self.errors.append( self.errors.append(
'Wrong number is shown on CK assets: %s' % wallet.cryptokitties_in_collectibles_number.text) 'Wrong number is shown on CK assets: %s' % wallet.cryptokitties_in_collectibles_number.text)
# TODO: should be added check for that NFT image is shown after adding accessibility
wallet.just_fyi('Check that collectibles are not shown when sending assets from wallet') wallet.just_fyi('Check that collectibles are not shown when sending assets from wallet')
send_transaction = wallet.send_transaction_button.click() send_transaction = wallet.send_transaction_button.click()
@ -113,13 +115,12 @@ class TestWalletManagement(SingleDeviceTestCase):
self.errors.append('Collectibles can be sent from wallet') self.errors.append('Collectibles can be sent from wallet')
wallet.close_send_transaction_view_button.double_click() wallet.close_send_transaction_view_button.double_click()
wallet.just_fyi('Check "Open in OpenSea"') wallet.just_fyi('Check "Open in OpenSea" (that user is signed in)')
wallet.element_by_translation_id("check-on-opensea").click() wallet.element_by_translation_id("check-on-opensea").click()
web_view = wallet.get_webview_view() web_view = wallet.get_webview_view()
web_view.wait_for_d_aap_to_load(10) web_view.wait_for_d_aap_to_load(10)
wallet.swipe_by_custom_coordinates(0.5,0.8,0.5,0.7) #wallet.swipe_by_custom_coordinates(0.5,0.8,0.5,0.7)
wallet.element_by_text('Sign In').wait_for_element(60) wallet.element_by_text('e2ecryptokitty').wait_for_element(60)
wallet.element_by_text('Sign In').click_until_presence_of_element(wallet.allow_button)
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(5341) @marks.testrail_id(5341)
@ -170,6 +171,8 @@ class TestWalletManagement(SingleDeviceTestCase):
@marks.testrail_id(5381) @marks.testrail_id(5381)
@marks.high @marks.high
@marks.skip
# TODO: enabling after adding NFT support on Rinkeby
def test_user_can_see_all_own_assets_after_account_recovering(self): def test_user_can_see_all_own_assets_after_account_recovering(self):
home = SignInView(self.driver).recover_access(wallet_users['E']['passphrase']) home = SignInView(self.driver).recover_access(wallet_users['E']['passphrase'])
profile = home.profile_button.click() profile = home.profile_button.click()

View File

@ -277,6 +277,9 @@ class TestCommandsSingleDevices(SingleDeviceTestCase):
sign_in = SignInView(self.driver) sign_in = SignInView(self.driver)
sender = transaction_senders['E'] sender = transaction_senders['E']
home = sign_in.recover_access(sender['passphrase']) home = sign_in.recover_access(sender['passphrase'])
wallet = home.wallet_button.click()
wallet.wait_balance_is_changed()
wallet.home_button.click()
chat = home.add_contact(ens_user_ropsten['ens']) chat = home.add_contact(ens_user_ropsten['ens'])
chat.commands_button.click() chat.commands_button.click()
amount = chat.get_unique_amount() amount = chat.get_unique_amount()

View File

@ -12,38 +12,38 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
def test_create_new_group_chat_messaging_pn_delivered(self): def test_create_new_group_chat_messaging_pn_delivered(self):
self.create_drivers(2) self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
device_1_home, device_2_home = device_1.create_user(), device_2.create_user(enable_notifications=True) home_1, home_2 = device_1.create_user(), device_2.create_user(enable_notifications=True)
device_1_key, device_1_username = device_1.get_public_key_and_username(True) key_1, username_1 = device_1.get_public_key_and_username(True)
device_1.home_button.click() device_1.home_button.click()
chat_name = device_1_home.get_random_chat_name() chat_name = home_1.get_random_chat_name()
device_1_home.plus_button.click() home_1.plus_button.click()
device_1_home.just_fyi('Check default placeholder when trying to create group chat without contacts') home_1.just_fyi('Check default placeholder when trying to create group chat without contacts')
device_1_home.new_group_chat_button.click() home_1.new_group_chat_button.click()
if not device_1_home.element_by_translation_id("invite-friends").is_element_displayed(): if not home_1.element_by_translation_id("invite-friends").is_element_displayed():
self.errors.append("No placeholder is shown when there are no contacts") self.errors.append("No placeholder is shown when there are no contacts")
device_1_home.get_back_to_home_view() home_1.get_back_to_home_view()
device_2.just_fyi('Create group chat with new user, check system messages for sender') device_2.just_fyi('Create group chat with new user, check system messages for sender')
device_2_key, device_2_username = device_2.get_public_key_and_username(True) key_2, username_2 = device_2.get_public_key_and_username(True)
device_2.home_button.click() device_2.home_button.click()
device_1_home.add_contact(device_2_key) home_1.add_contact(key_2)
device_1_home.get_back_to_home_view() home_1.get_back_to_home_view()
device_1_chat = device_1_home.create_group_chat([device_2_username], chat_name) device_1_chat = home_1.create_group_chat([username_2], chat_name)
create_system_message = device_1_chat.create_system_message(device_1_username, chat_name) create_system_message = device_1_chat.create_system_message(username_1, chat_name)
invite_system_message = device_1_chat.invite_system_message(device_1_username, device_2_username) invite_system_message = device_1_chat.invite_system_message(username_1, username_2)
join_system_message = device_1_chat.join_system_message(device_2_username) join_system_message = device_1_chat.join_system_message(username_2)
invited_to_join = device_1_chat.invited_to_join_system_message(device_1_username, chat_name) invited_to_join = device_1_chat.invited_to_join_system_message(username_1, chat_name)
create_for_admin_system_message = device_1_chat.create_for_admin_system_message(chat_name) create_for_admin_system_message = device_1_chat.create_for_admin_system_message(chat_name)
for message in [create_for_admin_system_message, create_system_message, invite_system_message]: for message in [create_for_admin_system_message, create_system_message, invite_system_message]:
if not device_1_chat.chat_element_by_text(message): if not device_1_chat.chat_element_by_text(message):
self.errors.append('%s system message is not shown' % message) self.errors.append('%s system message is not shown' % message)
device_2.just_fyi('Navigate to group chat, check system messages for member') device_2.just_fyi('Navigate to group chat, check system messages for member')
if not device_2_home.get_chat(chat_name).is_element_displayed(): if not home_2.get_chat(chat_name).is_element_displayed():
self.drivers[0].fail('Group chat was not created!') self.drivers[0].fail('Group chat was not created!')
device_2_chat = device_2_home.get_chat(chat_name).click() device_2_chat = home_2.get_chat(chat_name).click()
for element in device_2_chat.join_chat_button, device_2_chat.decline_invitation_button: for element in device_2_chat.join_chat_button, device_2_chat.decline_invitation_button:
if not element.is_element_displayed(): if not element.is_element_displayed():
self.drivers[0].fail('"Join Chat" or "Decline" is not shown for member of group chat') self.drivers[0].fail('"Join Chat" or "Decline" is not shown for member of group chat')
@ -62,11 +62,11 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
if device_1_chat.chat_element_by_text(message_1).status != 'delivered': if device_1_chat.chat_element_by_text(message_1).status != 'delivered':
self.errors.append('Message status is not delivered, it is %s!' % device_1_chat.chat_element_by_text(message_1).status) self.errors.append('Message status is not delivered, it is %s!' % device_1_chat.chat_element_by_text(message_1).status)
device_2_home.put_app_to_background() home_2.put_app_to_background()
device_2_home.just_fyi('check that PN is received and after tap you are redirected to public chat') home_2.just_fyi('check that PN is received and after tap you are redirected to public chat')
device_2_home.open_notification_bar() home_2.open_notification_bar()
device_2_home.element_by_text_part("Message from device: %s" % device_1_chat.driver.number).click() home_2.element_by_text_part("Message from device: %s" % device_1_chat.driver.number).click()
device_2_chat.send_message("Message from device: %s" % device_2_chat.driver.number) device_2_chat.send_message("Message from device: %s" % device_2_chat.driver.number)
for chat in (device_1_chat, device_2_chat): for chat in (device_1_chat, device_2_chat):
for chat_driver in (device_1_chat, device_2_chat): for chat_driver in (device_1_chat, device_2_chat):

View File

@ -152,7 +152,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
home_1.just_fyi('Check that can find tx in history and balance is updated after offline') home_1.just_fyi('Check that can find tx in history and balance is updated after offline')
[home.wallet_button.click() for home in (home_1, home_2)] [home.wallet_button.click() for home in (home_1, home_2)]
wallet_2.wait_balance_is_changed('STT', initial_amount_STT) wallet_2.wait_balance_is_changed('STT', initial_amount_STT)
wallet_1.wait_balance_is_changed('STT') wallet_1.wait_balance_is_changed('STT', scan_tokens=True)
[wallet.find_transaction_in_history(amount=amount, asset='STT') for wallet in (wallet_1, wallet_2)] [wallet.find_transaction_in_history(amount=amount, asset='STT') for wallet in (wallet_1, wallet_2)]
self.errors.verify_no_errors() self.errors.verify_no_errors()

View File

@ -31,9 +31,7 @@ class TestDApps(SingleDeviceTestCase):
profile.privacy_and_security_button.click() profile.privacy_and_security_button.click()
camera_dapp.just_fyi("Enable camera requests in Dapps") camera_dapp.just_fyi("Enable camera requests in Dapps")
camera_permission_requests = home.get_translation_by_key("webview-camera-permission-requests") profile.element_by_translation_id("webview-camera-permission-requests").scroll_and_click()
if profile.element_by_text_part(camera_permission_requests).is_element_displayed():
profile.element_by_text_part('Webview camera permission requests').click()
home.dapp_tab_button.click(desired_element_text='webview') home.dapp_tab_button.click(desired_element_text='webview')
camera_dapp.just_fyi("Check DApp asks now to allow camera aceess but Deny in DApp") camera_dapp.just_fyi("Check DApp asks now to allow camera aceess but Deny in DApp")
@ -63,83 +61,84 @@ class TestDApps(SingleDeviceTestCase):
def test_resolve_ipns_name(self): def test_resolve_ipns_name(self):
user = basic_user user = basic_user
ipns_url = 'uniswap.eth' ipns_url = 'uniswap.eth'
sign_in_view = SignInView(self.driver) home = SignInView(self.driver).recover_access(passphrase=user['passphrase'])
home_view = sign_in_view.recover_access(passphrase=user['passphrase']) profile = home.profile_button.click()
profile_view = home_view.profile_button.click() profile.switch_network()
profile_view.switch_network()
self.driver.set_clipboard_text(ipns_url) self.driver.set_clipboard_text(ipns_url)
dapp_view = home_view.dapp_tab_button.click() dapp = home.dapp_tab_button.click()
dapp_view.enter_url_editbox.click() dapp.enter_url_editbox.click()
dapp_view.paste_text() dapp.paste_text()
dapp_view.confirm() dapp.confirm()
if not dapp_view.allow_button.is_element_displayed(30): if not dapp.allow_button.is_element_displayed(30):
self.driver.fail('No permission is asked for dapp, so IPNS name is not resolved') self.driver.fail('No permission is asked for dapp, so IPNS name is not resolved')
@marks.testrail_id(6232) @marks.testrail_id(6232)
@marks.medium @marks.medium
def test_switching_accounts_in_dapp(self): def test_switching_accounts_in_dapp(self):
sign_in_view = SignInView(self.driver) home = SignInView(self.driver).create_user()
home_view = sign_in_view.create_user() wallet = home.wallet_button.click()
wallet_view = sign_in_view.wallet_button.click()
wallet_view.just_fyi('create new account in multiaccount') wallet.just_fyi('create new account in multiaccount')
status_account = home_view.status_account_name status_account = home.status_account_name
account_name = 'Subaccount' account_name = 'Subaccount'
wallet_view.add_account(account_name) wallet.add_account(account_name)
address = wallet_view.get_wallet_address(account_name) address = wallet.get_wallet_address(account_name)
sign_in_view.just_fyi('can see two accounts in DApps') home.just_fyi('can see two accounts in DApps')
dapp_view = sign_in_view.dapp_tab_button.click() dapp = home.dapp_tab_button.click()
dapp_view.select_account_button.click() dapp.select_account_button.click()
for text in 'Select the account', status_account, account_name: for text in 'Select the account', status_account, account_name:
if not dapp_view.element_by_text_part(text).is_element_displayed(): if not dapp.element_by_text_part(text).is_element_displayed():
self.driver.fail("No expected element %s is shown in menu" % text) self.driver.fail("No expected element %s is shown in menu" % text)
sign_in_view.just_fyi('add permission to Status account') home.just_fyi('add permission to Status account')
dapp_view.enter_url_editbox.click() dapp.enter_url_editbox.click()
status_test_dapp = home_view.open_status_test_dapp() status_test_dapp = home.open_status_test_dapp()
sign_in_view.just_fyi('check that permissions from previous account was removed once you choose another')
dapp_view.select_account_button.click() home.just_fyi('check that permissions from previous account was removed once you choose another')
dapp_view.select_account_by_name(account_name).wait_for_element(30) dapp.select_account_button.click()
dapp_view.select_account_by_name(account_name).click() dapp.select_account_by_name(account_name).wait_for_element(30)
profile_view = dapp_view.profile_button.click() dapp.select_account_by_name(account_name).click()
profile_view.privacy_and_security_button.click() profile = dapp.profile_button.click()
profile_view.dapp_permissions_button.click() profile.privacy_and_security_button.click()
if profile_view.element_by_text(test_dapp_name).is_element_displayed(): profile.dapp_permissions_button.click()
if profile.element_by_text(test_dapp_name).is_element_displayed():
self.errors.append("Permissions for %s are not removed" % test_dapp_name) self.errors.append("Permissions for %s are not removed" % test_dapp_name)
sign_in_view.just_fyi('check that can change account') home.just_fyi('check that can change account')
profile_view.dapp_tab_button.click() profile.dapp_tab_button.click()
if profile.element_by_text("Can't find web3 library").is_element_displayed():
status_test_dapp.browser_refresh_page_button.wait_and_click()
if not status_test_dapp.element_by_text_part(account_name).is_element_displayed(): if not status_test_dapp.element_by_text_part(account_name).is_element_displayed():
self.errors.append("No expected account %s is shown in authorize web3 popup for wallet" % account_name) self.errors.append("No expected account %s is shown in authorize web3 popup for wallet" % account_name)
status_test_dapp.allow_button.click() status_test_dapp.allow_button.click()
dapp_view.profile_button.click(desired_element_text='DApp permissions') dapp.profile_button.click(desired_element_text='DApp permissions')
profile_view.element_by_text(test_dapp_name).click() profile.element_by_text(test_dapp_name).click()
for text in 'Chat key', account_name: for text in 'Chat key', account_name:
if not dapp_view.element_by_text_part(text).is_element_displayed(): if not dapp.element_by_text_part(text).is_element_displayed():
self.errors.append("Access is not granted to %s" % text) self.errors.append("Access is not granted to %s" % text)
sign_in_view.just_fyi('check correct account is shown for transaction if sending from DApp') home.just_fyi('check correct account is shown for transaction if sending from DApp')
profile_view.dapp_tab_button.click(desired_element_text='Accounts') profile.dapp_tab_button.click(desired_element_text='Accounts')
status_test_dapp.assets_button.click() status_test_dapp.assets_button.click()
send_transaction_view = status_test_dapp.request_stt_button.click() send_transaction = status_test_dapp.request_stt_button.click()
send_transaction_view.ok_got_it_button.wait_and_click() send_transaction.ok_got_it_button.wait_and_click()
address = send_transaction_view.get_formatted_recipient_address(address) address = send_transaction.get_formatted_recipient_address(address)
if not send_transaction_view.element_by_text(address).is_element_displayed(): if not send_transaction.element_by_text(address).is_element_displayed():
self.errors.append("Wallet address %s in not shown in 'From' on Send Transaction screen" % address) self.errors.append("Wallet address %s in not shown in 'From' on Send Transaction screen" % address)
sign_in_view.just_fyi('Relogin and check multiaccount loads fine') home.just_fyi('Relogin and check multiaccount loads fine')
send_transaction_view.cancel_button.click() send_transaction.cancel_button.click()
sign_in_view.profile_button.click() home.profile_button.click()
sign_in_view.relogin() home.relogin()
sign_in_view.wallet_button.click() home.wallet_button.click()
if not wallet_view.element_by_text(account_name).is_element_displayed(): if not wallet.element_by_text(account_name).is_element_displayed():
self.errors.append("Subaccount is gone after relogin in Wallet!") self.errors.append("Subaccount is gone after relogin in Wallet!")
sign_in_view.profile_button.click() home.profile_button.click()
profile_view.privacy_and_security_button.click() profile.privacy_and_security_button.click()
profile_view.dapp_permissions_button.click() profile.dapp_permissions_button.click()
profile_view.element_by_text(test_dapp_name).click() profile.element_by_text(test_dapp_name).click()
if not profile_view.element_by_text(account_name).is_element_displayed(): if not profile.element_by_text(account_name).is_element_displayed():
self.errors.append("Subaccount is not selected after relogin in Dapps!") self.errors.append("Subaccount is not selected after relogin in Dapps!")
self.errors.verify_no_errors() self.errors.verify_no_errors()

View File

@ -544,7 +544,7 @@ class BaseView(object):
profile_view = self.profile_button.click() profile_view = self.profile_button.click()
default_username = profile_view.default_username_text.text default_username = profile_view.default_username_text.text
profile_view.share_my_profile_button.click() profile_view.share_my_profile_button.click()
profile_view.public_key_text.wait_for_visibility_of_element() profile_view.public_key_text.wait_for_visibility_of_element(20)
public_key = profile_view.public_key_text.text public_key = profile_view.public_key_text.text
self.click_system_back_button() self.click_system_back_button()
user_data = (public_key, default_username) if return_username else public_key user_data = (public_key, default_username) if return_username else public_key

View File

@ -761,6 +761,7 @@ class ChatView(BaseView):
def send_message(self, message: str = 'test message'): def send_message(self, message: str = 'test message'):
self.driver.info("**Sending message '%s'**" % message) self.driver.info("**Sending message '%s'**" % message)
self.chat_message_input.wait_for_element(5)
self.chat_message_input.send_keys(message) self.chat_message_input.send_keys(message)
self.send_message_button.click() self.send_message_button.click()

View File

@ -177,6 +177,8 @@ class SignInView(BaseView):
self.accept_tos_checkbox.click() self.accept_tos_checkbox.click()
self.get_started_button.click() self.get_started_button.click()
self.generate_key_button.click_until_presence_of_element(self.next_button) self.generate_key_button.click_until_presence_of_element(self.next_button)
if self.generate_key_button.is_element_displayed():
[button.click() for button in [self.accept_tos_checkbox, self.get_started_button,self.generate_key_button]]
self.next_button.click_until_absense_of_element(self.element_by_translation_id("intro-wizard-title2")) self.next_button.click_until_absense_of_element(self.element_by_translation_id("intro-wizard-title2"))
if keycard: if keycard:
keycard_flow = self.keycard_storage_button.click() keycard_flow = self.keycard_storage_button.click()