e2e: Updated error message in 702783
This commit is contained in:
parent
ab16ca34dd
commit
cd32806c96
|
@ -1243,9 +1243,8 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
|
||||||
home.get_chat(self.username_2 if i == 0 else self.username_1).click()
|
home.get_chat(self.username_2 if i == 0 else self.username_1).click()
|
||||||
try:
|
try:
|
||||||
chat_element.wait_for_status_to_be(expected_status='Delivered', timeout=120)
|
chat_element.wait_for_status_to_be(expected_status='Delivered', timeout=120)
|
||||||
except TimeoutException:
|
except TimeoutException as e:
|
||||||
self.errors.append(
|
self.errors.append('%s after back up online!' % e.msg)
|
||||||
'Message status was not delivered after back up online, it is "%s"!' % status)
|
|
||||||
|
|
||||||
self.home_1.just_fyi('Device1 goes back online and checks that 1-1 chat will be fetched')
|
self.home_1.just_fyi('Device1 goes back online and checks that 1-1 chat will be fetched')
|
||||||
if not self.chat_1.chat_element_by_text(message_1).is_element_displayed(60):
|
if not self.chat_1.chat_element_by_text(message_1).is_element_displayed(60):
|
||||||
|
|
|
@ -367,9 +367,34 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase):
|
||||||
self.home.just_fyi("Check contacts/blocked users")
|
self.home.just_fyi("Check contacts/blocked users")
|
||||||
self.home.chats_tab.click()
|
self.home.chats_tab.click()
|
||||||
self.home.contacts_tab.click()
|
self.home.contacts_tab.click()
|
||||||
for contact in waku_user.contacts:
|
contacts_number = self.home.get_contact_rows_count()
|
||||||
if not self.home.element_by_text(contact).is_element_displayed(30):
|
if contacts_number != len(waku_user.contacts):
|
||||||
self.errors.append("Contact %s was not restored from backup!" % contact)
|
self.errors.append(
|
||||||
|
"Incorrect contacts number restored: %s instead of %s" % (contacts_number, len(waku_user.contacts)))
|
||||||
|
else:
|
||||||
|
for i in range(contacts_number):
|
||||||
|
self.home.click_system_back_button_until_element_is_shown()
|
||||||
|
contact_row = self.home.contact_details_row(index=i + 1)
|
||||||
|
shown_name_text = contact_row.username_text.text
|
||||||
|
if shown_name_text in waku_user.contacts:
|
||||||
|
waku_user.contacts.remove(shown_name_text)
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
contact_row.click()
|
||||||
|
shown_name_text = profile.default_username_text.text
|
||||||
|
if shown_name_text in waku_user.contacts:
|
||||||
|
waku_user.contacts.remove(shown_name_text)
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
chat = self.home.get_chat_view()
|
||||||
|
chat.profile_send_message_button.click()
|
||||||
|
shown_name_text = chat.user_name_text_new_UI.text
|
||||||
|
if shown_name_text in waku_user.contacts:
|
||||||
|
waku_user.contacts.remove(shown_name_text)
|
||||||
|
continue
|
||||||
|
if waku_user.contacts:
|
||||||
|
self.errors.append(
|
||||||
|
"Contact(s) was (were) not restored from backup: %s!" % ", ".join(waku_user.contacts))
|
||||||
|
|
||||||
if not pytest_config_global['pr_number']:
|
if not pytest_config_global['pr_number']:
|
||||||
self.home.just_fyi("Perform back up")
|
self.home.just_fyi("Perform back up")
|
||||||
|
|
|
@ -104,13 +104,13 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC
|
||||||
self.home_1.activity_notification_swipe_button.click()
|
self.home_1.activity_notification_swipe_button.click()
|
||||||
self.home_1.close_activity_centre.click()
|
self.home_1.close_activity_centre.click()
|
||||||
self.home_1.contacts_tab.click()
|
self.home_1.contacts_tab.click()
|
||||||
if not self.home_1.contact_details(username=self.username_2).is_element_displayed(20):
|
if not self.home_1.contact_details_row(username=self.username_2).is_element_displayed(20):
|
||||||
self.errors.append("Contact was not added to contact list after accepting contact request (as receiver)")
|
self.errors.append("Contact was not added to contact list after accepting contact request (as receiver)")
|
||||||
|
|
||||||
self.device_2.just_fyi('Device1 check that contact appeared in contact list mutually')
|
self.device_2.just_fyi('Device1 check that contact appeared in contact list mutually')
|
||||||
self.home_2.chats_tab.click()
|
self.home_2.chats_tab.click()
|
||||||
self.home_2.contacts_tab.click()
|
self.home_2.contacts_tab.click()
|
||||||
if not self.home_2.contact_details(username=self.username_1).is_element_displayed(20):
|
if not self.home_2.contact_details_row(username=self.username_1).is_element_displayed(20):
|
||||||
self.errors.append("Contact was not added to contact list after accepting contact request (as sender)")
|
self.errors.append("Contact was not added to contact list after accepting contact request (as sender)")
|
||||||
|
|
||||||
self.errors.verify_no_errors()
|
self.errors.verify_no_errors()
|
||||||
|
|
|
@ -714,7 +714,9 @@ class ChatView(BaseView):
|
||||||
|
|
||||||
# Chat header
|
# Chat header
|
||||||
self.user_name_text = Text(self.driver, accessibility_id="chat-name-text")
|
self.user_name_text = Text(self.driver, accessibility_id="chat-name-text")
|
||||||
self.user_name_text_new_UI = Text(self.driver, xpath="//android.view.ViewGroup/android.widget.TextView")
|
self.user_name_text_new_UI = Text(
|
||||||
|
self.driver,
|
||||||
|
xpath="//*[@content-desc='user-avatar']/../following-sibling::android.widget.TextView")
|
||||||
self.add_to_contacts = Button(self.driver, accessibility_id="add-to-contacts-button")
|
self.add_to_contacts = Button(self.driver, accessibility_id="add-to-contacts-button")
|
||||||
## Options
|
## Options
|
||||||
self.chat_options = ChatOptionsButton(self.driver)
|
self.chat_options = ChatOptionsButton(self.driver)
|
||||||
|
|
|
@ -22,7 +22,8 @@ class ActivityTabButton(Button):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def counter(self):
|
def counter(self):
|
||||||
return BaseElement(self.driver, xpath='//*[@content-desc="%s"]//*[@content-desc="notification-dot"]'% self.accessibility_id)
|
return BaseElement(self.driver,
|
||||||
|
xpath='//*[@content-desc="%s"]//*[@content-desc="notification-dot"]' % self.accessibility_id)
|
||||||
|
|
||||||
|
|
||||||
class ChatElement(SilentButton):
|
class ChatElement(SilentButton):
|
||||||
|
@ -31,11 +32,13 @@ class ChatElement(SilentButton):
|
||||||
self.community = community
|
self.community = community
|
||||||
self.community_channel = community_channel
|
self.community_channel = community_channel
|
||||||
if self.community_channel is True:
|
if self.community_channel is True:
|
||||||
super().__init__(driver,
|
super().__init__(
|
||||||
xpath="//*[@content-desc='chat-name-text']//*[starts-with(@text,'# %s')]/../.." % username_part)
|
driver,
|
||||||
|
xpath="//*[@content-desc='chat-name-text']//*[starts-with(@text,'# %s')]/../.." % username_part)
|
||||||
else:
|
else:
|
||||||
super().__init__(driver,
|
super().__init__(
|
||||||
xpath="//*[@content-desc='chat-name-text'][starts-with(@text,'%s')]/.." % username_part)
|
driver,
|
||||||
|
xpath="//*[@content-desc='chat-name-text'][starts-with(@text,'%s')]/.." % username_part)
|
||||||
|
|
||||||
def navigate(self):
|
def navigate(self):
|
||||||
if self.community:
|
if self.community:
|
||||||
|
@ -86,6 +89,7 @@ class ChatElement(SilentButton):
|
||||||
class NoMessageText(Text):
|
class NoMessageText(Text):
|
||||||
def __init__(self, driver, parent_locator: str):
|
def __init__(self, driver, parent_locator: str):
|
||||||
super().__init__(driver, xpath="%s//*[@content-desc='no-messages-text']" % parent_locator)
|
super().__init__(driver, xpath="%s//*[@content-desc='no-messages-text']" % parent_locator)
|
||||||
|
|
||||||
return NoMessageText(self.driver, self.locator)
|
return NoMessageText(self.driver, self.locator)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -121,7 +125,7 @@ class ActivityCenterElement(SilentButton):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def title(self):
|
def title(self):
|
||||||
return Button(self.driver, xpath=self.locator+'//*[@content-desc="activity-title"]')
|
return Button(self.driver, xpath=self.locator + '//*[@content-desc="activity-title"]')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unread_indicator(self):
|
def unread_indicator(self):
|
||||||
|
@ -183,6 +187,21 @@ class PushNotificationElement(SilentButton):
|
||||||
return GroupChatIconElement(self.driver, self.locator)
|
return GroupChatIconElement(self.driver, self.locator)
|
||||||
|
|
||||||
|
|
||||||
|
class ContactDetailsRow(BaseElement):
|
||||||
|
def __init__(self, driver, username=None, index=None):
|
||||||
|
main_locator = "//*[@content-desc='user-list']"
|
||||||
|
if username:
|
||||||
|
xpath_locator = "%s[*[contains(@text,'%s')]]" % (main_locator, username)
|
||||||
|
elif index:
|
||||||
|
xpath_locator = "%s[%s]" % (main_locator, index)
|
||||||
|
else:
|
||||||
|
xpath_locator = main_locator
|
||||||
|
super().__init__(driver, xpath=xpath_locator)
|
||||||
|
|
||||||
|
self.options_button = Button(self.driver, xpath="(%s//android.widget.ImageView)[2]" % xpath_locator)
|
||||||
|
self.username_text = Text(self.driver, xpath="(%s//android.widget.TextView)[2]" % xpath_locator)
|
||||||
|
|
||||||
|
|
||||||
class HomeView(BaseView):
|
class HomeView(BaseView):
|
||||||
def __init__(self, driver):
|
def __init__(self, driver):
|
||||||
super().__init__(driver)
|
super().__init__(driver)
|
||||||
|
@ -220,8 +239,11 @@ class HomeView(BaseView):
|
||||||
self.groups_tab = Button(self.driver, accessibility_id="tab-groups")
|
self.groups_tab = Button(self.driver, accessibility_id="tab-groups")
|
||||||
self.contacts_tab = Button(self.driver, accessibility_id="tab-contacts")
|
self.contacts_tab = Button(self.driver, accessibility_id="tab-contacts")
|
||||||
self.contact_new_badge = Button(self.driver, accessibility_id="notification-dot")
|
self.contact_new_badge = Button(self.driver, accessibility_id="notification-dot")
|
||||||
self.pending_contact_request_button = Button(self.driver, accessibility_id="open-activity-center-contact-requests")
|
self.pending_contact_request_button = Button(self.driver,
|
||||||
self.pending_contact_request_text = Text(self.driver, xpath='//*[@content-desc="pending-contact-requests-count"]/android.widget.TextView')
|
accessibility_id="open-activity-center-contact-requests")
|
||||||
|
self.pending_contact_request_text = Text(
|
||||||
|
self.driver,
|
||||||
|
xpath='//*[@content-desc="pending-contact-requests-count"]/android.widget.TextView')
|
||||||
|
|
||||||
# Tabs and elements on community home view
|
# Tabs and elements on community home view
|
||||||
self.pending_communities_tab = Button(self.driver, accessibility_id="pending-tab")
|
self.pending_communities_tab = Button(self.driver, accessibility_id="pending-tab")
|
||||||
|
@ -362,7 +384,7 @@ class HomeView(BaseView):
|
||||||
self.driver.info("## Group chat %s is created successfully!" % group_chat_name, device=False)
|
self.driver.info("## Group chat %s is created successfully!" % group_chat_name, device=False)
|
||||||
return chat
|
return chat
|
||||||
|
|
||||||
def send_contact_request_via_bottom_sheet(self, key:str):
|
def send_contact_request_via_bottom_sheet(self, key: str):
|
||||||
chat = self.get_chat_view()
|
chat = self.get_chat_view()
|
||||||
self.new_chat_button.click()
|
self.new_chat_button.click()
|
||||||
self.add_a_contact_chat_bottom_sheet_button.click()
|
self.add_a_contact_chat_bottom_sheet_button.click()
|
||||||
|
@ -458,5 +480,8 @@ class HomeView(BaseView):
|
||||||
expected_element = PushNotificationElement(self.driver, pn_text)
|
expected_element = PushNotificationElement(self.driver, pn_text)
|
||||||
return expected_element if expected_element.is_element_displayed(60) else False
|
return expected_element if expected_element.is_element_displayed(60) else False
|
||||||
|
|
||||||
def contact_details(self, username):
|
def contact_details_row(self, username=None, index=None):
|
||||||
return Button(self.driver, xpath="//*[contains(@text,'%s')]/../android.view.ViewGroup/android.widget.ImageView" % username)
|
return ContactDetailsRow(self.driver, username=username, index=index)
|
||||||
|
|
||||||
|
def get_contact_rows_count(self):
|
||||||
|
return len(ContactDetailsRow(self.driver).find_elements())
|
||||||
|
|
Loading…
Reference in New Issue