e2e: ens ropsten

This commit is contained in:
Churikova Tetiana 2021-09-17 18:20:12 +02:00
parent c001688db9
commit 18606f548b
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
19 changed files with 318 additions and 368 deletions

View File

@ -116,31 +116,25 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
@marks.testrail_id(5502)
@marks.critical
def test_can_add_existing_ens(self):
def test_can_add_existing_ens_on_mainnet(self):
home = SignInView(self.driver).recover_access(ens_user['passphrase'])
profile = home.profile_button.click()
profile.switch_network('Mainnet with upstream RPC')
profile.just_fyi('check if your name can be added via "ENS usernames" in Profile')
profile.switch_network()
home.profile_button.click()
dapp = profile.ens_usernames_button.click()
profile.connect_existing_ens(ens_user['ens'])
dapp.just_fyi('check if your name can be added via "ENS usernames" in Profile')
dapp.element_by_text('Get started').click()
dapp.ens_name_input.set_value(ens_user['ens'])
dapp.check_ens_name.click_until_absense_of_element(dapp.check_ens_name)
if not dapp.element_by_translation_id('ens-saved-title').is_element_displayed():
self.errors.append('No message "Username added" after resolving own username')
dapp.element_by_translation_id("ens-got-it").click()
dapp.just_fyi('check that after adding username is shown in "ENS usernames" and profile')
if not dapp.element_by_text(ens_user['ens']).is_element_displayed():
profile.just_fyi('check that after adding username is shown in "ENS usernames" and profile')
if not profile.element_by_text(ens_user['ens']).is_element_displayed():
self.errors.append('No ENS name is shown in own "ENS usernames" after adding')
dapp.back_button.click()
if not dapp.element_by_text('@%s' % ens_user['ens']).is_element_displayed():
profile.back_button.click()
if not profile.element_by_text('@%s' % ens_user['ens']).is_element_displayed():
self.errors.append('No ENS name is shown in own profile after adding')
if not dapp.element_by_text('%s.stateofus.eth' % ens_user['ens']).is_element_displayed():
if not profile.element_by_text('%s' % ens_user['ens']).is_element_displayed():
self.errors.append('No ENS name is shown in own profile after adding')
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' % ens_user['ens']:
self.errors.append('No ENS name is shown on tapping on share icon in Profile')
profile.close_share_popup()
@ -201,7 +195,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
home.profile_button.click()
profile.logout()
self.driver.reset()
home.recover_access(recovery_phrase)
SignInView(self.driver).recover_access(recovery_phrase)
wallet = home.wallet_button.click()
if wallet.get_wallet_address() != address:
self.driver.fail("Seed phrase displayed in new accounts for back up does not recover respective address")
@ -233,8 +227,6 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
home.just_fyi('Check empty contacts view')
profile = home.profile_button.click()
profile.switch_network()
home.profile_button.click()
profile.contacts_button.click()
if not profile.add_new_contact_button.is_element_displayed():
self.driver.fail('No expected element on contacts view')
@ -253,8 +245,8 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
'username': basic_user['username'],
},
'pasting_ens_another_domain': {
'contact_code': ens_user['ens_another_domain'],
'username': '@%s' % ens_user['ens_another_domain'],
'contact_code': ens_user['ens_another'],
'username': '@%s' % ens_user['ens_another'],
'nickname': 'my_dear_friend'
},
@ -283,7 +275,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
self.errors.append('In %s case nickname %s not found in contact view after scanning' % (key, users[key]['nickname']))
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']
profile.element_by_text(user_to_remove).click()
chat.remove_from_contacts.click()
chat.close_button.click()
@ -293,7 +285,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
home.just_fyi('Relogin and open profile view of the contact removed from Contact list to ensure there is no crash')
profile.profile_button.click()
profile.relogin()
one_to_one_chat = home.add_contact(public_key=ens_user['ens_another_domain'], add_in_contacts=False)
one_to_one_chat = home.add_contact(public_key=ens_user['ens_another'], add_in_contacts=False)
one_to_one_chat.chat_options.click()
profile = one_to_one_chat.view_profile_button.click()
if profile.remove_from_contacts.is_element_displayed():
@ -550,29 +542,27 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
@marks.medium
def test_set_primary_ens_custom_domain(self):
home = SignInView(self.driver).recover_access(ens_user['passphrase'])
ens_not_stateofus = ens_user['ens_another_domain']
ens_stateofus = ens_user['ens']
ens_second, ens_main = ens_user['ens_another'], ens_user['ens']
home.just_fyi('add 2 ENS names in Profile')
profile = home.profile_button.click()
dapp = profile.connect_existing_status_ens(ens_stateofus)
profile.element_by_text("Add username").click()
profile.element_by_text_part("another domain").click()
dapp.ens_name_input.set_value(ens_not_stateofus)
dapp = profile.connect_existing_ens(ens_main)
profile.element_by_translation_id("ens-add-username").wait_and_click()
profile.element_by_translation_id("ens-want-custom-domain").wait_and_click()
dapp.ens_name_input.set_value(ens_second)
dapp.check_ens_name.click_until_presence_of_element(dapp.element_by_translation_id("ens-got-it"))
dapp.element_by_translation_id("ens-got-it").click()
dapp.element_by_translation_id("ens-got-it").wait_and_click()
home.just_fyi('check that by default %s ENS is set' % ens_stateofus)
dapp.element_by_text('Primary username').click()
home.just_fyi('check that by default %s ENS is set' % ens_main)
dapp.element_by_translation_id("ens-primary-username").click()
message_to_check = 'Your messages are displayed to others with'
if not dapp.element_by_text('%s\n@%s.stateofus.eth' % (message_to_check, ens_stateofus)).is_element_displayed():
self.errors.append('%s ENS username is not set as primary by default' % ens_stateofus)
home.just_fyi('check view in chat settings ENS from other domain: %s after set new primary ENS' % ens_not_stateofus)
dapp.set_primary_ens_username(ens_user['ens_another_domain']).click()
if profile.username_in_ens_chat_settings_text.text != '@' + ens_not_stateofus:
self.errors.append('ENS username %s is not shown in ENS username Chat Settings after enabling' % ens_not_stateofus)
if not dapp.element_by_text('%s\n@%s' % (message_to_check, ens_main)).is_element_displayed():
self.errors.append('%s ENS username is not set as primary by default' % ens_main)
home.just_fyi('check view in chat settings ENS from other domain: %s after set new primary ENS' % ens_second)
dapp.set_primary_ens_username(ens_second).click()
if profile.username_in_ens_chat_settings_text.text != '@' + ens_second:
self.errors.append('ENS username %s is not shown in ENS username Chat Settings after enabling' % ens_second)
self.errors.verify_no_errors()
@ -651,6 +641,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
one_to_one_chat_2.chat_message_input.click()
if not one_to_one_chat_2.user_profile_image_in_mentions_list(default_username_1).is_element_image_similar_to_template('sauce_logo.png'):
self.errors.append('Profile picture was not updated in 1-1 chat mentions list')
one_to_one_chat_2.get_back_to_home_view()
profile_1.just_fyi('Check profile image is updated in Group chat view')
profile_2 = one_to_one_chat_2.profile_button.click()
@ -659,12 +650,11 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
if not profile_2.profile_picture.is_element_image_similar_to_template('sauce_logo.png'):
self.errors.append('Profile picture was not updated on user Profile view')
profile_2.close_button.click()
one_to_one_chat_2.home_button.click(desired_view='home')
[home.home_button.click() for home in (profile_2, home_1)]
if not home_2.get_chat(default_username_1).chat_image.is_element_image_similar_to_template('sauce_logo.png'):
self.errors.append('User profile picture was not updated on Chats view')
profile_1.just_fyi('Check profile image updated in user profile view in Group chat views 4')
home_1.home_button.click(desired_view='home')
group_chat_message = 'Trololo'
group_chat_2 = home_2.create_group_chat(user_names_to_add=[default_username_1])
group_chat_2.send_message('Message')
@ -865,7 +855,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
profile_1.confirm_button.click()
profile_1.just_fyi('check that popup "Error connecting" will not reappear if tap on "Cancel"')
profile_1.element_by_translation_id(id='mailserver-error-title').wait_for_element(60)
profile_1.element_by_translation_id(id='mailserver-error-title').wait_for_element(120)
profile_1.cancel_button.click()
profile_1.home_button.click()
@ -1056,47 +1046,34 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
user_1 = ens_user
home_1 = sign_in_1.recover_access(user_1['passphrase'], enable_notifications=True)
home_2 = sign_in_2.create_user()
publuc_key_2, username_2 = home_2.get_public_key_and_username(return_username=True)
public_key_2, username_2 = home_2.get_public_key_and_username(return_username=True)
home_2.home_button.double_click()
home_1.just_fyi('switching to mainnet and add ENS')
profile_1 = sign_in_1.profile_button.click()
profile_1.switch_network('Mainnet with upstream RPC')
home_1.profile_button.click()
dapp_1 = profile_1.ens_usernames_button.click()
dapp_1.element_by_text('Get started').click()
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.'
if not dapp_1.element_by_text_part(expected_text).is_element_displayed():
dapp_1.click_system_back_button()
dapp_1.wait_for_element_starts_with_text(expected_text)
dapp_1.check_ens_name.click_until_presence_of_element(dapp_1.element_by_text('Ok, got it'))
dapp_1.element_by_text('Ok, got it').click()
profile_1.connect_existing_ens(user_1['ens'])
home_1.just_fyi('check ENS name wallet address and public key')
profile_1.element_by_text(user_1['ens']).click()
for text in ('10 SNT, deposit unlocked', user_1['address'].lower(), user_1['public_key'] ):
for text in (user_1['address'].lower(), user_1['public_key'] ):
if not profile_1.element_by_text_part(text).is_element_displayed(40):
self.errors.append('%s text is not shown' % text)
profile_1.home_button.click()
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()
public_2 = home_2.join_public_chat(chat_name)
public_1 = home_1.join_public_chat(chat_name)
public_1.get_back_to_home_view()
home_1.profile_button.click()
[public_1, public_2] = [home.join_public_chat(chat_name) for home in (home_1, home_2)]
public_1.home_button.double_click()
home_1.profile_button.double_click()
ens_name = '@' + user_1['ens']
profile_1.element_by_text('Your ENS name').click()
profile_1.element_by_translation_id("ens-your-your-name").click()
if profile_1.username_in_ens_chat_settings_text.text != ens_name:
self.errors.append('ENS username is not shown in ENS usernames Chat Settings after enabling')
self.errors.append('ENS username is not shown in ENS usernames Chat Settings after enabling')
profile_1.back_button.click()
profile_1.home_button.click()
home_1.get_chat('#' + chat_name).click()
message_text_2 = 'message test text 1'
public_1.send_message(message_text_2)
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_2.just_fyi('check that can mention user with ENS name')
@ -1112,7 +1089,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
home_1.just_fyi('check that PN is received and after tap you are redirected to public chat, mention is highligted')
home_1.open_notification_bar()
home_1.element_by_text_part(username_2).click()
if home_1.element_starts_with_text(user_1['ens'] +'.stateofus.eth').is_element_differs_from_template('mentioned.png', 2):
if home_1.element_starts_with_text(user_1['ens']).is_element_differs_from_template('mentioned.png', 2):
self.errors.append('Mention is not highlighted!')
# Close Device1 driver session since it's not needed anymore
@ -1203,7 +1180,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
if not home_2.mobile_connection_on_icon.is_element_displayed():
self.errors.append('No mobile connection ON icon is shown')
home_2.get_chat('#%s'% public_chat_name).click()
if not public_2.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(180):
self.errors.append("Chat history was not fetched with mobile data fetching ON")
home_2.just_fyi('check redirect to sync settings by tappin "Sync" in connection status bottom sheet')

View File

@ -377,7 +377,7 @@ class TestWalletManagement(SingleDeviceTestCase):
sign_in = SignInView(self.driver)
home = sign_in.create_user()
profile = home.profile_button.click()
profile.switch_network('Mainnet with upstream RPC')
profile.switch_network()
search_list_assets = {
'ad': ['AdEx', 'Open Trading Network', 'TrueCAD'],
'zs': ['ZSC']

View File

@ -164,11 +164,9 @@ class TestChatManagement(SingleDeviceTestCase):
def test_can_start_chat_from_suggestions_using_search_chat(self):
sign_in = SignInView(self.driver)
home = sign_in.create_user()
profile = home.profile_button.click()
profile.switch_network()
chat_view = ChatView(self.driver)
chat = ChatView(self.driver)
ens_name_status, ens_name_another_domain, public_chat_name = ens_user_ropsten['ens'], \
ens_user['ens_another_domain'], 'some-pub-chat'
ens_user['ens_another'], 'some-pub-chat'
search_list = {
ens_name_status: {
'home': {
@ -178,10 +176,10 @@ class TestChatManagement(SingleDeviceTestCase):
'#%s' % ens_name_status
},
'navigate_to': '%s.stateofus.eth' % ens_name_status,
'chat_view': {
chat_view.add_to_contacts,
chat_view.element_by_text('@%s' % ens_name_status),
chat_view.chat_message_input
'chat': {
chat.add_to_contacts,
chat.element_by_text('@%s' % ens_name_status),
chat.chat_message_input
}
},
ens_name_another_domain: {
@ -190,10 +188,10 @@ class TestChatManagement(SingleDeviceTestCase):
},
'home_not_shown': 'Join a public chat',
'navigate_to': 'Start a new private chat',
'chat_view': {
chat_view.add_to_contacts,
chat_view.element_by_text('@%s' % ens_name_another_domain),
chat_view.chat_message_input
'chat': {
chat.add_to_contacts,
chat.element_by_text('@%s' % ens_name_another_domain),
chat.chat_message_input
},
},
public_chat_name: {
@ -202,9 +200,9 @@ class TestChatManagement(SingleDeviceTestCase):
},
'home_not_shown': 'Start a new private chat',
'navigate_to': '#%s' % public_chat_name,
'chat_view': {
chat_view.element_by_text('#%s' % public_chat_name),
chat_view.chat_message_input
'chat': {
chat.element_by_text('#%s' % public_chat_name),
chat.chat_message_input
},
},
@ -229,7 +227,7 @@ class TestChatManagement(SingleDeviceTestCase):
if not home.element_by_text(text).is_element_displayed():
self.errors.append('%s is not shown on home view while searching for %s' % (text, keyword))
home.element_by_text(search_list[keyword]['navigate_to']).click()
for element in search_list[keyword]['chat_view']:
for element in search_list[keyword]['chat']:
if not element.is_element_displayed():
self.errors.append(
'Requested %s element is not shown on chat view after navigating from suggestion '
@ -534,6 +532,7 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
chat_1.send_message_button.click()
if not chat_1.chat_element_by_text('%s %s' % (nickname, additional_text)).is_element_displayed():
self.errors.append("Nickname is not resolved on send message")
chat_1.get_back_to_home_view()
device_1.just_fyi('check contact list in Profile after setting nickname')
profile_1 = chat_1.profile_button.click()
@ -956,28 +955,15 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
def test_mention_users_not_in_chats_if_not_in_contacts(self):
self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
sender = ens_user_message_sender
sender = ens_user
home_1, home_2 = device_1.create_user(), device_2.recover_access(passphrase=sender['passphrase'])
profile_2 = home_2.profile_button.click()
profile_2.switch_network()
home_2.profile_button.click()
home_2.just_fyi('Set ENS name so its visible in chats')
dapp_view = profile_2.ens_usernames_button.click()
dapp_view.element_by_text('Get started').click()
dapp_view.ens_name_input.set_value(sender['ens'])
dapp_view.check_ens_name.click_until_presence_of_element(dapp_view.element_by_translation_id("ens-got-it"))
dapp_view.element_by_translation_id("ens-got-it").click()
profile_2.connect_existing_ens(sender['ens'])
profile_2.home_button.double_click()
device_1.just_fyi('Both devices joining the same public chat and send messages')
chat_name = device_1.get_random_chat_name()
own_default_username = home_1.get_public_key_and_username(return_username=True)
home_1.home_button.click()
chat_1 = home_1.join_public_chat(chat_name)
profile_2.home_button.click()
chat_2 = home_2.join_public_chat(chat_name)
[chat_1, chat_2] = [home.join_public_chat(chat_name) for home in (home_1, home_2)]
message = 'From ' + sender['ens'] + ' message'
chat_2.send_message(message)
username_value = '@' + sender['ens']

View File

@ -1,8 +1,8 @@
import time
from tests import marks
from tests.users import transaction_senders, transaction_recipients, ens_user_ropsten
from tests.base_test_case import MultipleDeviceTestCase, SingleDeviceTestCase
from tests.users import transaction_senders, ens_user
from tests.base_test_case import MultipleDeviceTestCase
from views.sign_in_view import SignInView
@ -224,14 +224,14 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
def test_network_mismatch_for_send_request_in_1_1_chat(self):
sender = transaction_senders['D']
self.create_drivers(2)
device_1_sign_in, device_2_sign_in = SignInView(self.drivers[0]), SignInView(self.drivers[1])
device_1_sign_in.recover_access(passphrase=sender['passphrase'])
device_2_sign_in.create_user()
home_1, home_2 = device_1_sign_in.get_home_view(), device_2_sign_in.get_home_view()
sign_in_1, sign_in_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
sign_in_1.recover_access(passphrase=sender['passphrase'])
sign_in_2.create_user()
home_1, home_2 = sign_in_1.get_home_view(), sign_in_2.get_home_view()
wallet_1 = home_1.wallet_button.click()
wallet_1.home_button.click()
profile_2 = home_2.profile_button.click()
device_2_username = profile_2.default_username_text.text
username_2 = profile_2.default_username_text.text
profile_2.switch_network()
chat_2 = home_2.add_contact(sender['public_key'])
@ -249,7 +249,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
if chat_2.reply_message_button.is_element_displayed():
self.errors.append('Reply is available on long-tap on Incoming transaction message!')
chat_1 = home_1.get_chat(device_2_username).click()
chat_1 = home_1.get_chat(username_2).click()
chat_1_sender_message = chat_1.get_outgoing_transaction()
chat_1_sender_message.long_press_element()
if chat_1.reply_message_button.is_element_displayed():
@ -267,32 +267,44 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
self.errors.append("Transaction is shown as confirmed on mainnet, but was sent on ropsten!")
self.errors.verify_no_errors()
class TestCommandsSingleDevices(SingleDeviceTestCase):
@marks.testrail_id(6279)
@marks.high
@marks.transaction
def test_send_eth_to_ens_in_chat(self):
sign_in = SignInView(self.driver)
sender = transaction_senders['E']
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.commands_button.click()
amount = chat.get_unique_amount()
self.create_drivers(2)
sign_in_1, sign_in_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
sender, reciever = transaction_senders['E'], ens_user
home_1, home_2 = sign_in_1.recover_access(sender['passphrase']), sign_in_2.recover_access(reciever['passphrase'])
send_message = chat.send_command.click()
home_2.just_fyi("Start chat with sender")
profile_2 = home_2.profile_button.click()
profile_2.connect_existing_ens(reciever['ens'])
profile_2.home_button.click()
chat_2 = home_2.add_contact(sender['public_key'])
message_1, message_2 = 'hello', 'hey'
chat_2.send_message(message_1)
wallet_1 = home_1.wallet_button.click()
wallet_1.wait_balance_is_changed()
wallet_1.home_button.click()
chat_1 = home_1.add_contact(reciever['ens'])
chat_1.send_message(message_2)
chat_1.commands_button.click()
amount = chat_1.get_unique_amount()
chat_1.just_fyi("Check sending assets to ENS name from sender side")
send_message = chat_1.send_command.click()
send_message.amount_edit_box.set_value(amount)
send_message.confirm()
send_message.next_button.click()
from views.send_transaction_view import SendTransactionView
send_transaction = SendTransactionView(self.driver)
send_transaction = SendTransactionView(self.drivers[0])
send_transaction.ok_got_it_button.click()
send_transaction.sign_transaction()
chat_sender_message = chat.get_outgoing_transaction()
chat_1_sender_message = chat_1.get_outgoing_transaction(transaction_value=amount)
self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount)
chat_sender_message.transaction_status.wait_for_element_text(chat_sender_message.confirmed)
chat_1_sender_message.transaction_status.wait_for_element_text(chat_1_sender_message.confirmed)
chat_2.just_fyi("Check that message is fetched for receiver")
chat_2_reciever_message = chat_2.get_incoming_transaction(transaction_value=amount)
chat_2_reciever_message.transaction_status.wait_for_element_text(chat_2_reciever_message.confirmed)

View File

@ -236,16 +236,8 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
profile_1, profile_2 = [home.profile_button.click() for home in (home_1, home_2)]
key_1, username_1 = profile_1.get_public_key_and_username(return_username=True)
ens, full_ens, username_2 = ens_user['ens'], '@%s' % ens_user['ens'], ens_user['username']
[profile.switch_network() for profile in (profile_1, profile_2)]
home_2.just_fyi('Set ENS')
profile_2 = home_2.profile_button.click()
dapp_view = profile_2.ens_usernames_button.click()
dapp_view.element_by_text('Get started').click()
dapp_view.ens_name_input.set_value(ens)
dapp_view.check_ens_name.click_until_presence_of_element(dapp_view.element_by_translation_id("ens-got-it"))
dapp_view.element_by_translation_id("ens-got-it").click()
home_2.home_button.click()
profile_2.connect_existing_ens(ens)
[profile.home_button.click() for profile in (profile_1, profile_2)]
home_1.just_fyi('Set nickname, using emojis, special chars and cyrrilic chars without adding to contact')
emoji_message = random.choice(list(emoji.EMOJI_UNICODE))

View File

@ -270,30 +270,23 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
home_1, home_2 = device_1.create_user(), device_2.create_user()
home_1.just_fyi('join public chat and check that stickers are not available on Ropsten')
home_1.just_fyi('Join public chat and check that stickers are not available on Ropsten')
chat_name = home_1.get_random_chat_name()
home_1.join_public_chat(chat_name)
public_chat_1 = home_1.get_chat_view()
if public_chat_1.show_stickers_button.is_element_displayed():
self.errors.append('Sticker button is shown while on Ropsten')
home_1.just_fyi('switch to mainnet')
home_1.just_fyi('Switch to mainnet on both devices')
public_chat_1.get_back_to_home_view()
device_1_profile, device_2_profile = home_1.profile_button.click(), home_2.profile_button.click()
device_2_public_key = device_2_profile.get_public_key_and_username()
device_1_public_key, device_1_username = device_1_profile.get_public_key_and_username(return_username=True)
for device in device_2_profile, device_1_profile:
device.switch_network('Mainnet with upstream RPC')
profile_1, profile_2 = home_1.profile_button.click(), home_2.profile_button.click()
public_key_2 = profile_2.get_public_key_and_username()
public_key_1, username_1 = profile_1.get_public_key_and_username(return_username=True)
[profile.switch_network() for profile in (profile_2, profile_1)]
home_1.get_chat('#' + chat_name).click()
home_1.just_fyi('install free sticker pack and use it in public chat')
public_chat_1.show_stickers_button.click()
public_chat_1.get_stickers.click()
public_chat_1.install_sticker_pack_by_name('Status Cat')
public_chat_1.back_button.click()
time.sleep(2)
public_chat_1.swipe_left()
home_1.just_fyi('Install free sticker pack and use it in public chat')
public_chat_1.install_sticker_pack_by_name()
public_chat_1.sticker_icon.click()
if not public_chat_1.sticker_message.is_element_displayed():
self.errors.append('Sticker was not sent')
@ -302,15 +295,15 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
self.errors.append('Sticker is not shown in recently used list')
public_chat_1.get_back_to_home_view()
home_1.just_fyi('send stickers in 1-1 chat from Recent')
private_chat_1 = home_1.add_contact(device_2_public_key)
home_1.just_fyi('Send stickers in 1-1 chat from Recent')
private_chat_1 = home_1.add_contact(public_key_2)
private_chat_1.show_stickers_button.click()
private_chat_1.sticker_icon.click()
if not private_chat_1.chat_item.is_element_displayed():
self.errors.append('Sticker was not sent from Recent')
home_2.just_fyi('check that can install stickers by tapping on sticker message')
private_chat_2 = home_2.get_chat(device_1_username).click()
home_2.just_fyi('Check that can install stickers by tapping on sticker message')
private_chat_2 = home_2.get_chat(username_1).click()
private_chat_2.chat_item.click()
if not private_chat_2.element_by_text_part('Status Cat').is_element_displayed():
self.errors.append('Stickerpack is not available for installation after tapping on sticker message')
@ -318,7 +311,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
if private_chat_2.element_by_text_part('Free').is_element_displayed():
self.errors.append('Stickerpack was not installed')
home_2.just_fyi('check that can navigate to another user profile via long tap on sticker message')
home_2.just_fyi('Check that can navigate to another user profile via long tap on sticker message')
private_chat_2.close_sticker_view_icon.click()
private_chat_2.chat_item.long_press_element()
private_chat_2.element_by_text('View Details').click()
@ -690,12 +683,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
chat_2 = home_2.add_contact(public_key_1)
home_2.just_fyi('Install free sticker pack and use it in 1-1 chat')
chat_2.show_stickers_button.click()
chat_2.get_stickers.click()
chat_2.install_sticker_pack_by_name('Status Cat')
chat_2.back_button.click()
time.sleep(2)
chat_2.swipe_left()
chat_2.install_sticker_pack_by_name()
chat_1 = home_1.add_contact(public_key_2)
# methods with steps to use later in loop
@ -900,21 +888,14 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
def test_can_use_purchased_stickers_on_recovered_account(self):
sign_in = SignInView(self.driver)
home_view = sign_in.recover_access(ens_user['passphrase'])
sign_in.just_fyi('switch to Mainnet')
profile = home_view.profile_button.click()
profile.switch_network('Mainnet with upstream RPC')
profile.switch_network()
sign_in.just_fyi('join to public chat, buy and install stickers')
chat = home_view.join_public_chat(home_view.get_random_chat_name())
chat.show_stickers_button.click()
chat.get_stickers.click()
chat.install_sticker_pack_by_name('Tozemoon')
chat.back_button.click()
sign_in.just_fyi('check that can use installed pack')
time.sleep(2)
chat.swipe_left()
chat.sticker_icon.click()
if not chat.chat_item.is_element_displayed():
self.driver.fail('Sticker was not sent')
@ -975,20 +956,18 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
def test_can_scan_qr_with_chat_key_from_home_start_chat(self):
sign_in = SignInView(self.driver)
home = sign_in.recover_access(basic_user['passphrase'])
profile = home.profile_button.click()
profile.switch_network()
url_data = {
'ens_with_stateofus_domain_deep_link': {
'url': 'https://join.status.im/u/%s.stateofus.eth' % ens_user['ens'],
'username': ens_user['username']
'url': 'https://join.status.im/u/%s.stateofus.eth' % ens_user_ropsten['ens'],
'username': ens_user_ropsten['username']
},
'ens_without_stateofus_domain_deep_link': {
'url': 'https://join.status.im/u/%s' % ens_user['ens'],
'username': ens_user['username']
},
'ens_another_domain_deep_link': {
'url': 'status-im://u/%s' % ens_user['ens_another_domain'],
'url': 'status-im://u/%s' % ens_user['ens_another'],
'username': ens_user['username']
},
'own_profile_key_deep_link': {
@ -1005,7 +984,7 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
},
# TODO: comment until clarification case with scanning QR with ENS names only
# 'ens_another_domain':{
# 'url': ens_user['ens_another_domain'],
# 'url': ens_user['ens_another'],
# 'username': ens_user['username']
# },
'own_profile_key': {
@ -1035,18 +1014,18 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
contacts.allow_button.click()
contacts.enter_qr_edit_box.scan_qr(url_data[key]['url'])
from views.chat_view import ChatView
chat_view = ChatView(self.driver)
chat = ChatView(self.driver)
if url_data[key].get('error'):
if not chat_view.element_by_text_part(url_data[key]['error']).is_element_displayed():
if not chat.element_by_text_part(url_data[key]['error']).is_element_displayed():
self.errors.append('Expected error %s is not shown' % url_data[key]['error'])
chat_view.ok_button.click()
chat.ok_button.click()
if url_data[key].get('username'):
if not chat_view.chat_message_input.is_element_displayed():
if not chat.chat_message_input.is_element_displayed():
self.errors.append(
'In "%s" case chat input is not found after scanning, so no redirect to 1-1' % key)
if not chat_view.element_by_text(url_data[key]['username']).is_element_displayed():
if not chat.element_by_text(url_data[key]['username']).is_element_displayed():
self.errors.append('In "%s" case "%s" not found after scanning' % (key, url_data[key]['username']))
chat_view.get_back_to_home_view()
chat.get_back_to_home_view()
self.errors.verify_no_errors()
@marks.testrail_id(6322)

View File

@ -340,6 +340,7 @@ class TestPublicChatSingleDevice(SingleDeviceTestCase):
self.errors.append("'Quiet here for %s' is not shown after fetching more history" % times[period])
else:
variants = times[period]
chat.element_by_text_part(fetch_more).wait_for_invisibility_of_element(120)
res = any(profile.element_by_text_part(variant).is_element_displayed(30) for variant in variants)
if not res:
self.errors.append("History is not fetched for one month!" )

View File

@ -26,17 +26,15 @@ class TestDeepLinks(SingleDeviceTestCase):
@marks.testrail_id(5441)
@marks.medium
def test_open_user_profile_using_deep_link(self):
sign_in_view = SignInView(self.driver)
sign_in_view.create_user()
profile = sign_in_view.profile_button.click()
profile.switch_network('Mainnet with upstream RPC')
for user_ident in ens_user['ens'], ens_user['ens_another_domain'], ens_user['public_key'],:
sign_in = SignInView(self.driver)
sign_in.create_user()
for user_ident in ens_user['ens'], ens_user['ens_another'], ens_user['public_key'],:
self.driver.close_app()
deep_link = 'status-im://u/%s' % user_ident
sign_in_view.open_weblink_and_login(deep_link)
chat_view = sign_in_view.get_chat_view()
for text in ens_user['username'], 'Add to contacts':
if not chat_view.element_by_text(text).scroll_to_element(10):
sign_in.open_weblink_and_login(deep_link)
chat = sign_in.get_chat_view()
for text in ens_user['username'], sign_in.get_translation_by_key("add-to-contacts"):
if not chat.element_by_text(text).scroll_to_element(10):
self.driver.fail("User profile screen is not opened")
@marks.testrail_id(5442)

View File

@ -508,7 +508,7 @@ class TestUpgradeMultipleApplication(MultipleDeviceTestCase):
device_1.just_fyi("Check profile settings")
profile_1 = device_1.profile_button.click()
profile_1.element_by_translation_id("ens-your-your-name").click()
for ens in user['ens'], user['ens_another_domain']:
for ens in user['ens'], user['ens_another']:
if not profile_1.element_by_text(ens).is_element_displayed():
self.errors.append("ENS name %s is not shown after upgrade" % ens)
profile_1.profile_button.click()

View File

@ -119,7 +119,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
home.just_fyi("Checking deploy simple contract")
send_transaction = status_test_dapp.deploy_contract_button.click()
send_transaction.sign_transaction(default_gas_price=True)
send_transaction.sign_transaction()
if not status_test_dapp.element_by_text('Contract deployed at: ').is_element_displayed(180):
self.errors.append('Contract was not created')
for text in ['Call contract get function',

View File

@ -115,8 +115,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet.get_account_by_name(account_name).click()
send_transaction = wallet.send_transaction(account_name=wallet.status_account_name,
amount=transaction_amount_1,
keycard=True,
default_gas_price=True)
keycard=True)
wallet.close_button.click()
sub_account_address = wallet.get_wallet_address(account_name)[2:]
self.network_api.wait_for_confirmation_of_transaction(sub_account_address, transaction_amount_1)
@ -153,6 +152,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
send_transaction.accounts_button.click()
send_transaction.element_by_text(wallet.status_account_name).click()
send_transaction.sign_transaction_button.click()
send_transaction.sign_transaction(keycard=True, default_gas_price=True)
send_transaction.sign_transaction(keycard=True)
wallet.element_by_text('Assets').click()
wallet.wait_balance_is_equal_expected_amount(asset='ETH', expected_balance=0)

View File

@ -261,8 +261,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
updated_balance = self.network_api.get_balance(status_account_address)
transaction_amount_1 = round(float(transaction_amount) * 0.2, 12)
wallet.send_transaction(account_name=wallet.status_account_name,
amount=transaction_amount_1,
default_gas_price=True)
amount=transaction_amount_1)
wallet.close_button.click()
sub_account_address = wallet.get_wallet_address(account_name)[2:]
self.network_api.wait_for_confirmation_of_transaction(status_account_address, transaction_amount)
@ -541,7 +540,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
self.errors.append('ENS from contact is not resolved as recipient')
send_tr.just_fyi('Set different ENS options')
send_tr.set_recipient_address(ens_other['ens_another_domain'])
send_tr.set_recipient_address(ens_other['ens_another'])
if send_tr.enter_recipient_address_text.text != send_tr.get_formatted_recipient_address(ens_other['address']):
self.errors.append('ENS address on another domain is not resolved as recipient')
send_tr.set_recipient_address('%s.stateofus.eth' % ens_status['ens'])

View File

@ -14,56 +14,52 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
message_before_adding = 'message before adding new user'
message_after_adding = 'message from new member'
message_from_old_member_after_adding = 'message from old member'
self.create_drivers(3)
devices_home, devices_key, devices_username, devices_chat = {}, {}, {}, {}
homes, public_keys, usernames, chats = {}, {}, {}, {}
for key in self.drivers:
sign_in_view = SignInView(self.drivers[key])
devices_home[key] = sign_in_view.create_user()
devices_key[key], devices_username[key] = sign_in_view.get_public_key_and_username(True)
homes[key] = sign_in_view.create_user()
public_keys[key], usernames[key] = sign_in_view.get_public_key_and_username(True)
sign_in_view.home_button.click()
chat_name = devices_home[0].get_random_chat_name()
chat_name = homes[0].get_random_chat_name()
for i in range(1, 3):
devices_home[0].add_contact(devices_key[i])
devices_home[0].get_back_to_home_view()
devices_chat[0] = devices_home[0].create_group_chat([devices_username[1]], chat_name)
devices_chat[0].send_message(message_before_adding)
homes[0].add_contact(public_keys[i])
homes[0].get_back_to_home_view()
chats[0] = homes[0].create_group_chat([usernames[1]], chat_name)
chats[0].send_message(message_before_adding)
devices_home[1].just_fyi('Join to chat as chat member')
devices_chat[1] = devices_home[1].get_chat(chat_name).click()
devices_chat[1].join_chat_button.click()
homes[1].just_fyi('Join to chat as chat member')
chats[1] = homes[1].get_chat(chat_name).click()
chats[1].join_chat_button.click()
devices_home[2].just_fyi('Put not added member device to offline and check that invite will be fetched')
invite_system_message = devices_chat[0].invite_system_message(devices_username[0], devices_username[1])
devices_home[2].toggle_airplane_mode()
devices_chat[0].add_members_to_group_chat([devices_username[2]])
devices_home[2].toggle_airplane_mode()
devices_home[2].connection_offline_icon.wait_for_invisibility_of_element(60)
homes[2].just_fyi('Put not added member device to offline and check that invite will be fetched')
invite_system_message = chats[0].invite_system_message(usernames[0], usernames[1])
homes[2].toggle_airplane_mode()
chats[0].add_members_to_group_chat([usernames[2]])
homes[2].toggle_airplane_mode()
homes[2].connection_offline_icon.wait_for_invisibility_of_element(60)
if not devices_home[2].get_chat(chat_name).is_element_displayed():
if not homes[2].get_chat(chat_name).is_element_displayed():
self.drivers[0].fail('Invite to group chat was not fetched from offline')
devices_chat[2] = devices_home[2].get_chat(chat_name).click()
if not devices_chat[2].element_by_text(invite_system_message).is_element_displayed():
chats[2] = homes[2].get_chat(chat_name).click()
if not chats[2].element_by_text(invite_system_message).is_element_displayed():
self.errors.append('Message about adding first chat member is not shown for new added member')
if devices_chat[2].element_by_text(message_before_adding).is_element_displayed():
if chats[2].element_by_text(message_before_adding).is_element_displayed():
self.errors.append('Message sent before adding user is shown')
devices_chat[0].just_fyi('Put admin device to offline and check that message from new member will be fetched')
devices_chat[0].toggle_airplane_mode()
devices_chat[2].join_chat_button.click()
devices_chat[2].send_message(message_after_adding)
devices_chat[0].toggle_airplane_mode()
for key in devices_chat:
if not devices_chat[key].chat_element_by_text(message_after_adding).is_element_displayed(
40):
chats[0].just_fyi('Put admin device to offline and check that message from new member will be fetched')
chats[0].toggle_airplane_mode()
chats[2].join_chat_button.click()
chats[2].send_message(message_after_adding)
chats[0].toggle_airplane_mode()
for key in chats:
if not chats[key].chat_element_by_text(message_after_adding).is_element_displayed(40):
self.errors.append("Message with text '%s' was not received" % message_after_adding)
devices_chat[0].just_fyi('Send message from old member and check that it is fetched')
devices_chat[1].send_message(message_from_old_member_after_adding)
for key in devices_chat:
if not devices_chat[key].chat_element_by_text(message_from_old_member_after_adding).is_element_displayed(
20):
chats[0].just_fyi('Send message from old member and check that it is fetched')
chats[1].send_message(message_from_old_member_after_adding)
for key in chats:
if not chats[key].chat_element_by_text(message_from_old_member_after_adding).is_element_displayed(20):
self.errors.append("Message with text '%s' was not received" % message_from_old_member_after_adding)
self.errors.verify_no_errors()
@ -73,58 +69,64 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
@marks.medium
def test_invite_to_group_chat_handling(self):
self.create_drivers(3)
devices_sign_in, devices_home, devices_key, devices_username, devices_chat = {}, {}, {}, {}, {}
sign_ins, homes, public_keys, usernames, chats = {}, {}, {}, {}, {}
for key in self.drivers:
devices_sign_in[key] = SignInView(self.drivers[key])
devices_home[key] = devices_sign_in[key].create_user()
devices_key[key], devices_username[key] = devices_sign_in[key].get_public_key_and_username(True)
devices_sign_in[key].home_button.click()
sign_ins[key] = SignInView(self.drivers[key])
homes[key] = sign_ins[key].create_user()
public_keys[key], usernames[key] = sign_ins[key].get_public_key_and_username(True)
sign_ins[key].home_button.click()
[driver.close_app() for driver in (self.drivers[1], self.drivers[2])]
chat_name = devices_home[0].get_random_chat_name()
devices_home[0].just_fyi('Create group chats without members')
devices_chat[0] = devices_home[0].create_group_chat([], chat_name)
link = devices_chat[0].get_group_invite_via_group_info()
devices_chat[0].get_back_to_home_view()
devices_chat[0].just_fyi('Member_1, member_2: both users send requests to join group chat')
[sign_in.open_weblink_and_login(link) for sign_in in (devices_sign_in[1], devices_sign_in[2])]
chat_name = homes[0].get_random_chat_name()
homes[0].just_fyi('Create group chats without members')
chats[0] = homes[0].create_group_chat([], chat_name)
link = chats[0].get_group_invite_via_group_info()
chats[0].get_back_to_home_view()
chats[0].just_fyi('Member_1, member_2: both users send requests to join group chat')
[sign_in.open_weblink_and_login(link) for sign_in in (sign_ins[1], sign_ins[2])]
introduction_messages = ['message for retrying']
for i in range(1,3):
devices_home[i].element_by_text_part(chat_name).click()
devices_chat[i] = ChatView(self.drivers[i])
homes[i].element_by_text_part(chat_name).click()
chats[i] = ChatView(self.drivers[i])
introduction_messages.append('Please add me, member_%s to your gorgeous group chat' % str(i))
devices_chat[i].request_membership_for_group_chat(introduction_messages[i])
devices_chat[0].just_fyi('Admin: accept request for Member_1 and decline for Member_2')
devices_home[0].get_chat(chat_name).click()
devices_chat[0].group_membership_request_button.wait_and_click()
devices_chat[0].element_by_text(devices_username[1]).click()
if not devices_chat[0].element_by_text_part(introduction_messages[1]).is_element_displayed():
chats[i].request_membership_for_group_chat(introduction_messages[i])
chats[0].just_fyi('Admin: accept request for Member_1 and decline for Member_2')
homes[0].get_chat(chat_name).click()
chats[0].group_membership_request_button.wait_and_click()
chats[0].element_by_text(usernames[1]).click()
if not chats[0].element_by_text_part(introduction_messages[1]).is_element_displayed():
self.errors.append('Introduction message is not shown!')
devices_chat[0].accept_group_invitation_button.wait_and_click()
devices_chat[0].accept_membership_for_group_chat_via_chat_view(devices_username[2], accept=False)
devices_chat[0].click_system_back_button()
devices_chat[2].just_fyi('Member_2: retry request')
devices_chat[2].retry_group_invite_button.wait_and_click()
devices_chat[2].request_membership_for_group_chat(introduction_messages[0])
devices_chat[2].just_fyi('Admin: decline request for Member_2')
devices_chat[0].group_membership_request_button.wait_and_click()
devices_chat[0].element_by_text(devices_username[2]).click()
if not devices_chat[0].element_by_text_part(introduction_messages[0]).is_element_displayed():
chats[0].accept_group_invitation_button.wait_and_click()
chats[0].accept_membership_for_group_chat_via_chat_view(usernames[2], accept=False)
chats[0].click_system_back_button()
chats[2].just_fyi('Member_2: retry request')
chats[2].retry_group_invite_button.wait_and_click()
chats[2].request_membership_for_group_chat(introduction_messages[0])
chats[2].just_fyi('Admin: decline request for Member_2')
chats[0].group_membership_request_button.wait_and_click()
chats[0].element_by_text(usernames[2]).click()
if not chats[0].element_by_text_part(introduction_messages[0]).is_element_displayed():
self.errors.append('Introduction message that was set after retrying attempt is not shown for admin!')
devices_chat[0].decline_group_invitation_button.wait_and_click()
devices_chat[0].click_system_back_button()
devices_chat[2].just_fyi('Member_2: remove chat')
devices_chat[2].remove_group_invite_button.wait_and_click()
devices_chat[2].just_fyi('Double check after relogin')
if devices_chat[0].group_membership_request_button.is_element_displayed():
chats[0].decline_group_invitation_button.wait_and_click()
chats[0].click_system_back_button()
chats[2].just_fyi('Member_2: remove chat')
chats[2].remove_group_invite_button.wait_and_click()
chats[2].just_fyi('Double check after relogin')
if chats[0].group_membership_request_button.is_element_displayed():
self.errors.append('Group membership request is still shown when there are no pending requests anymore')
[devices_home[i].relogin() for i in range(0,3)]
if devices_home[2].element_by_text_part(chat_name).is_element_displayed():
[homes[i].relogin() for i in range(0,3)]
if homes[2].element_by_text_part(chat_name).is_element_displayed():
self.errors.append('Group chat was not removed when removing after declining group invite')
[home.get_chat(chat_name).click() for home in (devices_home[0], devices_home[1])]
if devices_chat[0].group_membership_request_button.is_element_displayed():
[home.get_chat(chat_name).click() for home in (homes[0], homes[1])]
if chats[0].group_membership_request_button.is_element_displayed():
self.errors.append('Group membership request is shown after relogin when there are no pending requests anymore')
join_system_message = devices_chat[0].join_system_message(devices_username[1])
for chat in (devices_chat[1], devices_chat[0]):
join_system_message = chats[0].join_system_message(usernames[1])
for chat in (chats[1], chats[0]):
if not chat.chat_element_by_text(join_system_message).is_element_displayed():
self.errors.append('%s is not shown after joining to group chat via invite' % join_system_message)
self.errors.verify_no_errors()
@ -133,39 +135,40 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
@marks.medium
def test_remove_member_from_group_chat(self):
self.create_drivers(3)
devices_home, devices_key, devices_username, devices_chat = {}, {}, {}, {}
homes, public_keys, usernames, chats = {}, {}, {}, {}
for key in self.drivers:
sign_in_view = SignInView(self.drivers[key])
devices_home[key] = sign_in_view.create_user()
devices_key[key], devices_username[key] = sign_in_view.get_public_key_and_username(True)
homes[key] = sign_in_view.create_user()
public_keys[key], usernames[key] = sign_in_view.get_public_key_and_username(True)
sign_in_view.home_button.click()
chat_name = devices_home[0].get_random_chat_name()
chat_name = homes[0].get_random_chat_name()
for i in range(1,3):
devices_home[0].add_contact(devices_key[i])
devices_home[0].get_back_to_home_view()
devices_chat[0] = devices_home[0].create_group_chat([devices_username[1],
devices_username[2]], chat_name)
devices_chat[0].just_fyi('Member_1, member_2: both users join to group chat')
homes[0].add_contact(public_keys[i])
homes[0].get_back_to_home_view()
chats[0] = homes[0].create_group_chat([usernames[1],
usernames[2]], chat_name)
chats[0].just_fyi('Member_1, member_2: both users join to group chat')
for i in range(1,3):
devices_chat[i] = devices_home[i].get_chat(chat_name).click()
devices_chat[i].join_chat_button.click()
devices_chat[0].just_fyi("Admin: get options for device 2 in group chat and remove him")
options = devices_chat[0].get_user_options(devices_username[1])
chats[i] = homes[i].get_chat(chat_name).click()
chats[i].join_chat_button.click()
chats[0].just_fyi("Admin: get options for device 2 in group chat and remove him")
options = chats[0].get_user_options(usernames[1])
options.remove_user_button.click()
left_message = devices_chat[0].leave_system_message(devices_username[1])
for key in devices_chat:
if not devices_chat[key].chat_element_by_text(left_message).is_element_displayed():
left_message = chats[0].leave_system_message(usernames[1])
for key in chats:
if not chats[key].chat_element_by_text(left_message).is_element_displayed():
self.errors.append("Message with text '%s' was not received" % left_message)
devices_chat[0].just_fyi("Check that input field is not available after removing")
if devices_chat[1].chat_message_input.is_element_displayed():
chats[0].just_fyi("Check that input field is not available after removing")
if chats[1].chat_message_input.is_element_displayed():
self.errors.append("Message input is still available for removed user")
devices_chat[0].just_fyi("Send message and check that it is available only for remaining users")
chats[0].just_fyi("Send message and check that it is available only for remaining users")
message = 'after removing member'
devices_chat[0].send_message(message)
for chat in (devices_chat[0], devices_chat[2]):
chats[0].send_message(message)
for chat in (chats[0], chats[2]):
if not chat.chat_element_by_text(message).is_element_displayed():
self.errors.append("Message '%s' was not received after removing member" % message)
if devices_chat[1].chat_element_by_text(message).is_element_displayed():
if chats[1].chat_element_by_text(message).is_element_displayed():
self.errors.append("Message '%s' was received by removed member" % message)
self.errors.verify_no_errors()
@ -174,79 +177,80 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
def test_pair_devices_group_chat_different_messages_nicknames(self):
self.create_drivers(3)
device_1, device_2, device_3 = SignInView(self.drivers[0]), SignInView(self.drivers[1]), SignInView(self.drivers[2])
device_1_home = device_1.create_user()
device_1_profile = device_1_home.profile_button.click()
device_1_profile.privacy_and_security_button.click()
device_1_profile.backup_recovery_phrase_button.click()
device_1_profile.ok_continue_button.click()
recovery_phrase = device_1_profile.get_recovery_phrase()
device_1_profile.close_button.click()
device_1_profile.home_button.click()
device_3_home = device_3.create_user()
device_3_chat_key, device_3_username = device_3_home.get_public_key_and_username(return_username=True)
home_1 = device_1.create_user()
profile_1 = home_1.profile_button.click()
profile_1.privacy_and_security_button.click()
profile_1.backup_recovery_phrase_button.click()
profile_1.ok_continue_button.click()
recovery_phrase = profile_1.get_recovery_phrase()
profile_1.close_button.click()
profile_1.home_button.click()
home_3 = device_3.create_user()
public_key_3, username_3 = home_3.get_public_key_and_username(return_username=True)
device_3.home_button.click()
device_1_name, device_2_name, group_chat_name = 'creator', 'paired', 'some group chat'
device_1.just_fyi('Add contact, start group chat')
nickname = 'my_tester'
device_1_home.add_contact(device_3_chat_key,nickname=nickname)
device_1_home.get_back_to_home_view()
device_1_chat = device_1_home.create_group_chat([device_3_username], group_chat_name)
device_3_chat = device_3_home.get_chat(group_chat_name).click()
device_3_chat.join_chat_button.click()
home_1.add_contact(public_key_3,nickname=nickname)
home_1.get_back_to_home_view()
chat_1 = home_1.create_group_chat([username_3], group_chat_name)
chat_3 = home_3.get_chat(group_chat_name).click()
chat_3.join_chat_button.click()
device_2.just_fyi('Go to profile > Devices, set device name, discover device 2 to device 1')
device_2_home = device_2.recover_access(passphrase=' '.join(recovery_phrase.values()))
device_2_profile = device_2_home.profile_button.click()
device_2_profile.discover_and_advertise_device(device_2_name)
home_2 = device_2.recover_access(passphrase=' '.join(recovery_phrase.values()))
profile_2 = home_2.profile_button.click()
profile_2.discover_and_advertise_device(device_2_name)
device_1.profile_button.click()
device_1_profile.discover_and_advertise_device(device_1_name)
device_1_profile.get_toggle_device_by_name(device_2_name).click()
device_1_profile.sync_all_button.click()
device_1_profile.sync_all_button.wait_for_visibility_of_element(15)
device_1_profile.click_system_back_button(2)
profile_1.discover_and_advertise_device(device_1_name)
profile_1.get_toggle_device_by_name(device_2_name).click()
profile_1.sync_all_button.click()
profile_1.sync_all_button.wait_for_visibility_of_element(15)
profile_1.click_system_back_button(2)
device_1.just_fyi('Send message to group chat and verify it on all devices')
text_message = 'some text'
device_1_profile.home_button.click(desired_view='chat')
device_2_profile.home_button.click()
device_1_chat.send_message(text_message)
device_2_chat = device_2_home.get_chat(group_chat_name).click()
for chat in device_1_chat, device_2_chat, device_3_chat:
profile_1.home_button.click(desired_view='chat')
profile_2.home_button.click()
chat_1.send_message(text_message)
chat_2 = home_2.get_chat(group_chat_name).click()
for chat in chat_1, chat_2, chat_3:
if not chat.chat_element_by_text(text_message).is_element_displayed():
self.errors.append('Message was sent, but it is not shown')
device_3.just_fyi('Send message to group chat as member and verify nickname on it')
message_from_member = 'member1'
device_3_chat.send_message(message_from_member)
device_1_chat.chat_element_by_text(message_from_member).wait_for_visibility_of_element(20)
for chat in device_1_chat, device_2_chat:
if not chat.chat_element_by_text(message_from_member).username != '%s %s' % (nickname, device_3_username):
chat_3.send_message(message_from_member)
chat_1.chat_element_by_text(message_from_member).wait_for_visibility_of_element(20)
for chat in chat_1, chat_2:
if not chat.chat_element_by_text(message_from_member).username != '%s %s' % (nickname, username_3):
self.errors.append('Nickname is not shown in group chat')
device_1.just_fyi('Send image to group chat and verify it on all devices')
device_1_chat.show_images_button.click()
device_1_chat.allow_button.click()
device_1_chat.first_image_from_gallery.click()
device_1_chat.send_message_button.click()
device_1_chat.chat_message_input.click()
for chat in device_1_chat, device_2_chat, device_3_chat:
chat_1.show_images_button.click()
chat_1.allow_button.click()
chat_1.first_image_from_gallery.click()
chat_1.send_message_button.click()
chat_1.chat_message_input.click()
for chat in chat_1, chat_2, chat_3:
if not chat.image_message_in_chat.is_element_displayed(60):
self.errors.append('Image is not shown in chat after sending for %s' % chat.driver.number)
device_1.just_fyi('Send audio message to group chat and verify it on all devices')
device_1_chat.record_audio_message(message_length_in_seconds=3)
chat_1.record_audio_message(message_length_in_seconds=3)
device_1.send_message_button.click()
device_1_chat.chat_message_input.click()
for chat in device_1_chat, device_2_chat, device_3_chat:
chat_1.chat_message_input.click()
for chat in chat_1, chat_2, chat_3:
if not chat.play_pause_audio_message_button.is_element_displayed(30):
self.errors.append('Audio message is not shown in chat after sending!')
device_1.just_fyi('Send sticker to group chat and verify it on all devices')
device_1_chat.profile_button.click()
device_1_profile.switch_network()
device_1_home.get_chat(group_chat_name).click()
device_1_chat.show_stickers_button.click()
device_1_chat.get_stickers.click()
device_1_chat.install_sticker_pack_by_name('Status Cat')
device_1_chat.back_button.click()
time.sleep(2)
device_1_chat.swipe_left()
device_1_chat.sticker_icon.click()
if not device_1_chat.sticker_message.is_element_displayed(30):
chat_1.profile_button.click()
profile_1.switch_network()
home_1.get_chat(group_chat_name).click()
chat_1.install_sticker_pack_by_name()
chat_1.sticker_icon.click()
if not chat_1.sticker_message.is_element_displayed(30):
self.errors.append('Sticker was not sent')
self.errors.verify_no_errors()

View File

@ -11,8 +11,8 @@ ens_user['passphrase'] = "fashion quality know robust copy neck stand embody ent
ens_user['username'] = "Legal Vibrant Indianabat"
ens_user['public_key'] = "0x04359bb3e73cba0b815d71e562670ad00bb5d2db0d16cd1c4c92c668b61fde2274d6e487fcdffe66f913b3fea2a" \
"3058f53ce7946c2b501aa61a9ca8a883df72dc9"
ens_user['ens'] = 'statuse2e'
ens_user['ens_another_domain'] = 'statuse2e.eth'
ens_user['ens'] = 'statuse2e.eth'
ens_user['ens_another'] = 'status-another-ens-e2e.eth'
ens_user['address'] = '0x1eE3058Bd300246B4B20E687Efc9Eba81FF7814b'
ens_user_ropsten = dict()

View File

@ -553,8 +553,8 @@ class BaseView(object):
def share_via_messenger(self):
self.driver.info("**Sharing via messenger**")
self.element_by_text_part("Direct share").wait_for_element()
self.element_by_text('Messages').click()
self.element_by_text('New message').click()
self.element_by_text('Messages').wait_and_click()
self.element_by_text('New message').wait_and_click()
self.send_as_keyevent('+0100100101')
self.confirm()

View File

@ -816,7 +816,6 @@ class ChatView(BaseView):
def wait_ens_name_resolved_in_chat(self, message = str, username_value = str):
self.driver.info("**Waiting ENS name '%s' is resolved in chat**" % username_value)
# self.view_profile_by_avatar_button.click()
counter = 0
while True:
if counter >= 120:
@ -826,19 +825,23 @@ class ChatView(BaseView):
time.sleep(5)
else:
return
# self.profile_block_contact.wait_for_visibility_of_element(5)
def move_to_messages_by_time_marker(self, marker='Today'):
self.driver.info("**Moving to messages by time marker: '%s'**" % marker)
Button(self.driver, xpath="//*[@text='%s'']" % marker).scroll_to_element(depth=50, direction='up')
def install_sticker_pack_by_name(self, pack_name: str):
def install_sticker_pack_by_name(self, pack_name='Status Cat'):
self.driver.info("**Installing '%s' stickerpack**" % pack_name)
self.show_stickers_button.click()
self.get_stickers.click()
element = Button(self.driver,
xpath="//*[@content-desc='sticker-pack-name'][@text='%s']/..//*[@content-desc='sticker-pack-price']" % pack_name)
element.scroll_to_element()
element.click()
element.wait_for_invisibility_of_element()
self.back_button.click()
time.sleep(2)
self.swipe_left()
def scroll_to_start_of_history(self, depth=20):
self.driver.info('*Scrolling th the start of chat history*')

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -452,15 +452,18 @@ class ProfileView(BaseView):
if i == 5:
self.driver.fail("Failed to connect after %s attempts" % i)
def connect_existing_status_ens(self, name):
def connect_existing_ens(self, name, is_stateofus=False):
self.driver.info("**Connect existing ENS: %s**" % name)
profile = self.profile_button.click()
profile.switch_network('Mainnet with upstream RPC')
self.profile_button.click()
dapp_view = self.ens_usernames_button.click()
dapp_view.element_by_translation_id("get-started").click()
if not is_stateofus:
dapp_view.element_by_translation_id("ens-want-custom-domain").click()
dapp_view.ens_name_input.set_value(name)
dapp_view.check_ens_name.click_until_presence_of_element(self.element_by_translation_id("ens-got-it"))
expected_text = dapp_view.get_translation_by_key("ens-username-connected")
if not dapp_view.element_by_text_part(expected_text).is_element_displayed():
dapp_view.click_system_back_button()
dapp_view.element_by_text_part(expected_text).wait_for_element(30)
dapp_view.check_ens_name.click_until_presence_of_element(dapp_view.element_by_translation_id("ens-got-it"))
dapp_view.element_by_translation_id("ens-got-it").click()
return dapp_view

View File

@ -124,13 +124,10 @@ class SendTransactionView(BaseView):
self.enter_recipient_address_input.click()
self.done_button.click_until_absense_of_element(self.done_button)
def sign_transaction(self, sender_password: str = common_password, keycard=False, default_gas_price=True):
self.driver.info("**Signing transaction (keycard:%s, default gas price:%s)**" % (str(keycard), str(default_gas_price)))
def sign_transaction(self, sender_password: str = common_password, keycard=False):
self.driver.info("**Signing transaction (keycard:%s)**" % str(keycard))
if self.sign_in_phrase.is_element_displayed(30):
self.set_up_wallet_when_sending_tx()
if not default_gas_price:
self.network_fee_button.click()
# to be updated with new fast/slow/normal fee
if keycard:
keycard_view = self.sign_with_keycard_button.click()
keycard_view.enter_default_pin()