Update e2e with more checks

Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
Serhy 2021-05-25 19:42:58 +03:00
parent 69a50ff9ab
commit 399e7d399b
No known key found for this signature in database
GPG Key ID: 5D7C4B9E2B6F500B
5 changed files with 74 additions and 47 deletions

View File

@ -255,6 +255,16 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
chat_view.back_button.click()
if profile.element_by_text(user_to_remove).is_element_displayed():
self.errors.append('Removed user is still shown in contact view')
home.just_fyi('Relogin and open profile view of the contact removed from Contact list to ensure there is no crash')
profile.profile_button.click()
profile.relogin()
one_to_one_chat = home.add_contact(public_key=ens_user['ens_another_domain'], add_in_contacts=False)
one_to_one_chat.chat_options.click()
profile = one_to_one_chat.view_profile_button.click()
if profile.remove_from_contacts.is_element_displayed():
self.errors.append('User still added in contact after relogin')
self.errors.verify_no_errors()
@marks.testrail_id(5431)

View File

@ -93,7 +93,8 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
home_1.connection_offline_icon.wait_and_click(20)
for element in home_1.not_connected_to_node_text, home_1.not_connected_to_peers_text:
if not element.is_element_displayed():
self.errors.append('Element "%s" is not shown in Connection status screen if device is offline' % element.locator)
self.errors.append(
'Element "%s" is not shown in Connection status screen if device is offline' % element.locator)
home_1.click_system_back_button()
profile_2 = home_2.profile_button.click()
@ -118,7 +119,8 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
home_1.just_fyi('checking offline fetching for another message, check delivered stutus for first message')
chat_2.toggle_airplane_mode()
if chat_2.chat_element_by_text(message_1).status != 'delivered':
self.errors.append('Message status is not delivered, it is %s!' % chat_2.chat_element_by_text(message_1).status)
self.errors.append(
'Message status is not delivered, it is %s!' % chat_2.chat_element_by_text(message_1).status)
home_1.toggle_airplane_mode()
message_2 = 'one more message'
chat_2.send_message(message_2)
@ -131,7 +133,8 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
@marks.high
def test_send_non_english_message_to_newly_added_contact_on_different_networks(self):
self.create_drivers(2)
device_1_home, device_2_home = SignInView(self.drivers[0]).create_user(), SignInView(self.drivers[1]).create_user()
device_1_home, device_2_home = SignInView(self.drivers[0]).create_user(), SignInView(
self.drivers[1]).create_user()
profile_1 = device_1_home.profile_button.click()
profile_1.switch_network()
@ -167,7 +170,8 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
chat.verify_message_is_under_today_text(timestamp_message, self.errors)
timestamp = chat.chat_element_by_text(timestamp_message).timestamp_message.text
if timestamp not in sent_time_variants:
self.errors.append("Timestamp is not shown, expected '%s', in fact '%s'" % (sent_time_variants.join(","), timestamp))
self.errors.append(
"Timestamp is not shown, expected '%s', in fact '%s'" % (sent_time_variants.join(","), timestamp))
device_2_home.just_fyi("Add user to contact and verify his default username")
device_2_chat.add_to_contacts.click()
@ -254,7 +258,6 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
if not device2_one_to_one_chat.profile_add_to_contacts.is_element_displayed():
self.errors.append('No navigate to user profile after tapping View Details on sticker message')
self.errors.verify_no_errors()
@marks.testrail_id(6305)
@ -433,11 +436,12 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
self.errors.append('Device 1: URL was not opened from 1-1 chat')
home_1.home_button.click(desired_view='chat')
preview_urls = {'github_pr':{'url':'https://github.com/status-im/status-react/pull/11707',
'txt':'Update translations by jinhojang6 · Pull Request #11707 · status-im/status-react',
'subtitle' : 'GitHub'},
'yotube':{'url':'https://www.youtube.com/watch?v=XN-SVmuJH2g&list=PLbrz7IuP1hrgNtYe9g6YHwHO6F3OqNMao',
'txt':'Status & Keycard Hardware-Enforced Security',
preview_urls = {'github_pr': {'url': 'https://github.com/status-im/status-react/pull/11707',
'txt': 'Update translations by jinhojang6 · Pull Request #11707 · status-im/status-react',
'subtitle': 'GitHub'},
'yotube': {
'url': 'https://www.youtube.com/watch?v=XN-SVmuJH2g&list=PLbrz7IuP1hrgNtYe9g6YHwHO6F3OqNMao',
'txt': 'Status & Keycard Hardware-Enforced Security',
'subtitle': 'YouTube'}}
home_1.just_fyi("Check enabling and sending first gif")
@ -480,13 +484,12 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
device_2_chat = device_2_home.add_contact(device_1_public_key)
message, message_2= 'test message', 'test message2'
message, message_2 = 'test message', 'test message2'
device_2_chat.send_message(message)
chat_element = device_1_home.get_chat(default_username_2)
device_1.dapp_tab_button.click()
device_2_chat.send_message(message_2)
if device_1_home.home_button.counter.text != '1':
self.errors.append('New messages counter is not shown on Home button')
device_1.home_button.click()
@ -522,12 +525,12 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
device_1_chat = device_1_home.get_chat(default_username_2).click()
markdown = {
'bold text in asterics' : '**',
'bold text in underscores' : '__',
'bold text in asterics': '**',
'bold text in underscores': '__',
'italic text in asteric': '*',
'italic text in underscore' : '_',
'inline code' : '`',
'code blocks' : '```',
'italic text in underscore': '_',
'inline code': '`',
'code blocks': '```',
# 'quote reply (one row)' : '>',
}
@ -573,9 +576,9 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
home.join_public_chat(''.join(random.choice(string.ascii_lowercase) for _ in range(7)))
chat = sign_in.get_chat_view()
message_text = {'text_message': 'mmmeowesage_text'}
formatted_message = {'message_with_link':'https://status.im',
#TODO: blocked with 11161
#'message_with_tag': '#successishere'
formatted_message = {'message_with_link': 'https://status.im',
# TODO: blocked with 11161
# 'message_with_tag': '#successishere'
}
message_input = chat.chat_message_input
message_input.send_keys(message_text['text_message'])
@ -626,7 +629,6 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
chat.chat_element_by_text(message_text[:-2]).wait_for_visibility_of_element(2)
@marks.testrail_id(5783)
@marks.critical
def test_can_use_purchased_stickers_on_recovered_account(self):
@ -685,7 +687,20 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
chat.select_mention_from_suggestion_list(russian_nickname + ' @' + ens)
chat.chat_element_by_text('%s hey!' % russian_nickname).click()
if not chat.profile_block_contact.is_element_displayed():
self.errors.append('No redirect to user profile after tapping on message with mention (nickname) in 1-1 chat')
self.errors.append(
'No redirect to user profile after tapping on message with mention (nickname) in 1-1 chat')
home.just_fyi('My_profile button at Start new chat view opens own QR code with public key pop-up')
chat.back_button.click()
home.home_button.double_click()
home.plus_button.click()
home.start_new_chat_button.click()
home.my_profile_on_start_new_chat_button.click()
account = home.get_profile_view()
if not (account.public_key_text.is_element_displayed() and account.share_button.is_element_displayed()
and account.qr_code_image.is_element_displayed()):
self.errors.append('No self profile pop-up data displayed after My_profile button tap')
self.errors.verify_no_errors()
@marks.testrail_id(6298)
@ -713,11 +728,11 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
'url': 'https://join.status.im/u/%s' % basic_user['public_key'],
'error': "That's you"
},
'other_user_profile_key_deep_link':{
'other_user_profile_key_deep_link': {
'url': 'https://join.status.im/u/%s' % ens_user['public_key'],
'username': ens_user['username']
},
'other_user_profile_key_deep_link_invalid':{
'other_user_profile_key_deep_link_invalid': {
'url': 'https://join.status.im/u/%sinvalid' % ens_user['public_key'],
'error': 'Please enter or scan a valid chat key'
},
@ -760,7 +775,8 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
chat_view.ok_button.click()
if url_data[key].get('username'):
if not chat_view.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)
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():
self.errors.append('In "%s" case "%s" not found after scanning' % (key, url_data[key]['username']))
chat_view.back_button.click()

View File

@ -233,6 +233,8 @@ class BaseView(object):
self.cancel_button = Button(self.driver, translation_id="cancel", uppercase=True)
self.search_input = EditBox(self.driver, accessibility_id="search-input")
self.share_button = Button(self.driver, accessibility_id="share-my-contact-code-button")
self.qr_code_image = Button(self.driver, accessibility_id="qr-code-image")
# external browser
self.open_in_status_button = OpenInStatusButton(self.driver)

View File

@ -84,6 +84,7 @@ class HomeView(BaseView):
self.universal_qr_scanner_button = Button(self.driver, accessibility_id="universal-qr-scanner")
self.invite_friends_button = Button(self.driver, accessibility_id="invite-friends-button")
self.stop_status_service_button = Button(self.driver, accessibility_id="STOP")
self.my_profile_on_start_new_chat_button = Button(self.driver, xpath="//*[@content-desc='current-account-photo']")
# Notification centre
self.notifications_button = Button(self.driver, accessibility_id="notifications-button")

View File

@ -101,8 +101,6 @@ class WalletView(BaseView):
self.all_assets_symbols = Button(self.driver, xpath="//*[@content-desc='checkbox']/../android.widget.TextView[2]")
self.currency_item_text = Text(self.driver, xpath="//*[@content-desc='currency-item']//android.widget.TextView")
self.qr_code_image = Button(self.driver, accessibility_id="qr-code-image")
self.address_text = Text(self.driver, accessibility_id="address-text")
self.sign_in_phrase = SignInPhraseText(self.driver)