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() chat_view.back_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')
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() self.errors.verify_no_errors()
@marks.testrail_id(5431) @marks.testrail_id(5431)

View File

@ -93,7 +93,8 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
home_1.connection_offline_icon.wait_and_click(20) 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: for element in home_1.not_connected_to_node_text, home_1.not_connected_to_peers_text:
if not element.is_element_displayed(): 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() home_1.click_system_back_button()
profile_2 = home_2.profile_button.click() 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') home_1.just_fyi('checking offline fetching for another message, check delivered stutus for first message')
chat_2.toggle_airplane_mode() chat_2.toggle_airplane_mode()
if chat_2.chat_element_by_text(message_1).status != 'delivered': 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() home_1.toggle_airplane_mode()
message_2 = 'one more message' message_2 = 'one more message'
chat_2.send_message(message_2) chat_2.send_message(message_2)
@ -131,7 +133,8 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
@marks.high @marks.high
def test_send_non_english_message_to_newly_added_contact_on_different_networks(self): def test_send_non_english_message_to_newly_added_contact_on_different_networks(self):
self.create_drivers(2) 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 = device_1_home.profile_button.click()
profile_1.switch_network() profile_1.switch_network()
@ -167,7 +170,8 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
chat.verify_message_is_under_today_text(timestamp_message, self.errors) chat.verify_message_is_under_today_text(timestamp_message, self.errors)
timestamp = chat.chat_element_by_text(timestamp_message).timestamp_message.text timestamp = chat.chat_element_by_text(timestamp_message).timestamp_message.text
if timestamp not in sent_time_variants: 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_home.just_fyi("Add user to contact and verify his default username")
device_2_chat.add_to_contacts.click() 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(): if not device2_one_to_one_chat.profile_add_to_contacts.is_element_displayed():
self.errors.append('No navigate to user profile after tapping View Details on sticker message') self.errors.append('No navigate to user profile after tapping View Details on sticker message')
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(6305) @marks.testrail_id(6305)
@ -436,7 +439,8 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
preview_urls = {'github_pr': {'url': 'https://github.com/status-im/status-react/pull/11707', 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', 'txt': 'Update translations by jinhojang6 · Pull Request #11707 · status-im/status-react',
'subtitle': 'GitHub'}, 'subtitle': 'GitHub'},
'yotube':{'url':'https://www.youtube.com/watch?v=XN-SVmuJH2g&list=PLbrz7IuP1hrgNtYe9g6YHwHO6F3OqNMao', 'yotube': {
'url': 'https://www.youtube.com/watch?v=XN-SVmuJH2g&list=PLbrz7IuP1hrgNtYe9g6YHwHO6F3OqNMao',
'txt': 'Status & Keycard Hardware-Enforced Security', 'txt': 'Status & Keycard Hardware-Enforced Security',
'subtitle': 'YouTube'}} 'subtitle': 'YouTube'}}
@ -486,7 +490,6 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
device_1.dapp_tab_button.click() device_1.dapp_tab_button.click()
device_2_chat.send_message(message_2) device_2_chat.send_message(message_2)
if device_1_home.home_button.counter.text != '1': if device_1_home.home_button.counter.text != '1':
self.errors.append('New messages counter is not shown on Home button') self.errors.append('New messages counter is not shown on Home button')
device_1.home_button.click() device_1.home_button.click()
@ -626,7 +629,6 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
chat.chat_element_by_text(message_text[:-2]).wait_for_visibility_of_element(2) chat.chat_element_by_text(message_text[:-2]).wait_for_visibility_of_element(2)
@marks.testrail_id(5783) @marks.testrail_id(5783)
@marks.critical @marks.critical
def test_can_use_purchased_stickers_on_recovered_account(self): 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.select_mention_from_suggestion_list(russian_nickname + ' @' + ens)
chat.chat_element_by_text('%s hey!' % russian_nickname).click() chat.chat_element_by_text('%s hey!' % russian_nickname).click()
if not chat.profile_block_contact.is_element_displayed(): 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() self.errors.verify_no_errors()
@marks.testrail_id(6298) @marks.testrail_id(6298)
@ -760,7 +775,8 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
chat_view.ok_button.click() chat_view.ok_button.click()
if url_data[key].get('username'): if url_data[key].get('username'):
if not chat_view.chat_message_input.is_element_displayed(): 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(): 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'])) self.errors.append('In "%s" case "%s" not found after scanning' % (key, url_data[key]['username']))
chat_view.back_button.click() 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.cancel_button = Button(self.driver, translation_id="cancel", uppercase=True)
self.search_input = EditBox(self.driver, accessibility_id="search-input") self.search_input = EditBox(self.driver, accessibility_id="search-input")
self.share_button = Button(self.driver, accessibility_id="share-my-contact-code-button") 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 # external browser
self.open_in_status_button = OpenInStatusButton(self.driver) 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.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.invite_friends_button = Button(self.driver, accessibility_id="invite-friends-button")
self.stop_status_service_button = Button(self.driver, accessibility_id="STOP") 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 # Notification centre
self.notifications_button = Button(self.driver, accessibility_id="notifications-button") 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.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.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.address_text = Text(self.driver, accessibility_id="address-text")
self.sign_in_phrase = SignInPhraseText(self.driver) self.sign_in_phrase = SignInPhraseText(self.driver)