e2e: workarounds

This commit is contained in:
Churikova Tetiana 2023-01-05 18:00:58 +01:00
parent d6159ac269
commit b158310057
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
5 changed files with 61 additions and 61 deletions

View File

@ -1264,27 +1264,20 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
self.chat_1.set_reaction(message_from_sender) self.chat_1.set_reaction(message_from_sender)
message_sender = self.chat_1.chat_element_by_text(message_from_sender) message_sender = self.chat_1.chat_element_by_text(message_from_sender)
if message_sender.emojis_below_message() != 1: message_sender.emojis_below_message().wait_for_element_text(1)
self.errors.append("Counter of reaction is not updated on your own message!")
self.device_2.just_fyi("Receiver sets own emoji and verifies counter on received message in 1-1 chat") self.device_2.just_fyi("Receiver sets own emoji and verifies counter on received message in 1-1 chat")
message_receiver = self.chat_2.chat_element_by_text(message_from_sender) message_receiver = self.chat_2.chat_element_by_text(message_from_sender)
if message_receiver.emojis_below_message() != 1: message_receiver.emojis_below_message().wait_for_element_text(1, 90)
self.errors.append("Counter of reaction is not updated on received message!")
self.chat_2.set_reaction(message_from_sender) self.chat_2.set_reaction(message_from_sender)
for counter in message_sender.emojis_below_message(), message_receiver.emojis_below_message():
if counter != 2:
self.errors.append('Counter is not updated after setting emoji from receiver!')
self.device_2.just_fyi("Receiver pick the same emoji and verify that counter will decrease for both users") self.device_2.just_fyi("Receiver pick the same emoji and verify that counter will decrease for both users")
self.chat_2.set_reaction(message_from_sender) self.chat_2.set_reaction(message_from_sender)
for counter in message_sender.emojis_below_message(), message_receiver.emojis_below_message(): message_sender.emojis_below_message().wait_for_element_text(1)
if counter != 1: message_receiver.emojis_below_message().wait_for_element_text(1, 90)
self.errors.append('Counter is not decreased after re-tapping emoji from receiver!')
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(702731) @marks.testrail_id(702731)
@marks.xfail(reason="blocked by #14672")
def test_1_1_chat_pin_messages(self): def test_1_1_chat_pin_messages(self):
self.home_1.just_fyi("Check that Device1 can pin own message in 1-1 chat") self.home_1.just_fyi("Check that Device1 can pin own message in 1-1 chat")
self.chat_1.send_message(self.message_1) self.chat_1.send_message(self.message_1)
@ -1319,64 +1312,67 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
self.errors.append( self.errors.append(
"Message '%s' is missed on Pinned messages list for user %s" % (message, chat_number + 1) "Message '%s' is missed on Pinned messages list for user %s" % (message, chat_number + 1)
) )
chat.click_system_back_button() # workaround for 14672
chat.tap_by_coordinates(500, 100)
self.home_1.just_fyi("Check that Device1 can not pin more than 3 messages and 'Unpin' dialog appears") # Part of the test is blocked by #14637
self.chat_1.send_message(self.message_3) # chat.click_system_back_button()
self.chat_1.send_message(self.message_4) #
self.chat_1.pin_message(self.message_3, 'pin-to-chat') # self.home_1.just_fyi("Check that Device1 can not pin more than 3 messages and 'Unpin' dialog appears")
self.chat_1.pin_message(self.message_4, 'pin-to-chat') # self.chat_1.send_message(self.message_3)
if self.chat_1.pin_limit_popover.is_element_displayed(30): # self.chat_1.send_message(self.message_4)
self.chat_1.view_pinned_messages_button.click() # self.chat_1.pin_message(self.message_3, 'pin-to-chat')
self.chat_1.pinned_messages_list.message_element_by_text( # self.chat_1.pin_message(self.message_4, 'pin-to-chat')
self.message_2).click_inside_element_by_coordinate() # if self.chat_1.pin_limit_popover.is_element_displayed(30):
self.home_1.just_fyi("Unpin one message so that another could be pinned") # self.chat_1.view_pinned_messages_button.click()
self.chat_1.element_by_translation_id('unpin-from-chat').double_click() # self.chat_1.pinned_messages_list.message_element_by_text(
self.chat_1.chat_element_by_text(self.message_4).click() # self.message_2).click_inside_element_by_coordinate()
self.chat_1.pin_message(self.message_4, 'pin-to-chat') # self.home_1.just_fyi("Unpin one message so that another could be pinned")
if not (self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30) and # self.chat_1.element_by_translation_id('unpin-from-chat').double_click()
self.chat_2.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30)): # self.chat_1.chat_element_by_text(self.message_4).click()
self.errors.append("Message 4 is not pinned in chat after unpinning previous one") # self.chat_1.pin_message(self.message_4, 'pin-to-chat')
else: # if not (self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30) and
self.errors.append("Can pin more than 3 messages in chat") # self.chat_2.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(30)):
# self.errors.append("Message 4 is not pinned in chat after unpinning previous one")
self.home_1.just_fyi("Check pinned messages are visible in Pinned panel for both users") # else:
for chat_number, chat in enumerate([self.chat_1, self.chat_2]): # self.errors.append("Can pin more than 3 messages in chat")
count = chat.pinned_messages_count.text #
if count != '3': # self.home_1.just_fyi("Check pinned messages are visible in Pinned panel for both users")
self.errors.append("Pinned messages count is not 3 for user %s" % (chat_number + 1)) # for chat_number, chat in enumerate([self.chat_1, self.chat_2]):
# count = chat.pinned_messages_count.text
self.home_1.just_fyi("Unpin one message and check it's unpinned for another user") # if count != '3':
self.chat_2.chat_element_by_text(self.message_4).long_press_element() # self.errors.append("Pinned messages count is not 3 for user %s" % (chat_number + 1))
self.chat_2.element_by_translation_id("unpin-from-chat").click() #
self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.wait_for_invisibility_of_element() # self.home_1.just_fyi("Unpin one message and check it's unpinned for another user")
if self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed(): # self.chat_2.chat_element_by_text(self.message_4).long_press_element()
self.errors.append("Message_4 is not unpinned!") # self.chat_2.element_by_translation_id("unpin-from-chat").click()
# self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.wait_for_invisibility_of_element()
for chat_number, chat in enumerate([self.chat_1, self.chat_2]): # if self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed():
count = chat.pinned_messages_count.text # self.errors.append("Message_4 is not unpinned!")
if count != '2': #
self.errors.append( # for chat_number, chat in enumerate([self.chat_1, self.chat_2]):
"Pinned messages count is not 2 after unpinning the last pinned message for user %s" % ( # count = chat.pinned_messages_count.text
chat_number + 1) # if count != '2':
) # self.errors.append(
# workaround for 14672 # "Pinned messages count is not 2 after unpinning the last pinned message for user %s" % (
self.chat_1.tap_by_coordinates(500, 100) # chat_number + 1)
# )
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(702745) @marks.testrail_id(702745)
@marks.xfail(reason="On profile picture failed due to #14718")
def test_1_1_chat_non_latin_messages_stack_update_profile_photo(self): def test_1_1_chat_non_latin_messages_stack_update_profile_photo(self):
# self.home_1.click_system_back_button_until_element_is_shown() self.home_1.click_system_back_button_until_element_is_shown()
self.home_1.browser_tab.click() # temp, until profile is on browser tab self.home_1.browser_tab.click() # temp, until profile is on browser tab
self.profile_1.edit_profile_picture('sauce_logo.png') self.profile_1.edit_profile_picture('sauce_logo.png')
self.profile_1.chats_tab.click() self.profile_1.chats_tab.click()
self.chat_2.just_fyi("Send messages with non-latin symbols") self.chat_2.just_fyi("Send messages with non-latin symbols")
messages = ['hello', '¿Cómo estás tu año?', 'ё, доброго вечерочка', '® æ ç ♥']
[self.chat_2.send_message(message) for message in messages]
if not self.chat_1.chat_message_input.is_element_displayed(): if not self.chat_1.chat_message_input.is_element_displayed():
self.chat_1.click_system_back_button_until_element_is_shown() self.chat_1.click_system_back_button_until_element_is_shown()
self.home_1.get_chat(self.default_username_2).click() self.home_1.get_chat(self.default_username_2).click()
self.chat_1.send_message("workaround for 14637")
messages = ['hello', '¿Cómo estás tu año?', 'ё, доброго вечерочка', '® æ ç ♥']
[self.chat_2.send_message(message) for message in messages]
for message in messages: for message in messages:
if not self.chat_1.chat_element_by_text(message).is_element_displayed(): if not self.chat_1.chat_element_by_text(message).is_element_displayed():
self.errors.append("Message with test '%s' was not received" % message) self.errors.append("Message with test '%s' was not received" % message)

View File

@ -267,6 +267,7 @@ class TestGroupChatMultipleDeviceMergedNewUI(MultipleSharedDeviceTestCase):
if not self.homes[0].element_by_text(message).is_element_displayed(30): if not self.homes[0].element_by_text(message).is_element_displayed(30):
self.errors.append('%s PN was not fetched from offline' % message) self.errors.append('%s PN was not fetched from offline' % message)
self.homes[0].click_system_back_button() self.homes[0].click_system_back_button()
self.homes[0].chats_tab.click()
self.homes[0].get_chat(chat_name).click() self.homes[0].get_chat(chat_name).click()
self.homes[0].just_fyi("check that messages are shown for every member") self.homes[0].just_fyi("check that messages are shown for every member")

View File

@ -148,10 +148,13 @@ class BaseElement(object):
counter = 0 counter = 0
self.driver.info("Wait for text element `%s` to be equal to `%s`" % (self.name, text)) self.driver.info("Wait for text element `%s` to be equal to `%s`" % (self.name, text))
while True: while True:
text_element = self.find_element().text
if isinstance(text, int):
text_element = int(text_element.strip())
if counter >= wait_time: if counter >= wait_time:
self.driver.fail(message if message else "`%s` is not equal to expected `%s` in %s sec" % ( self.driver.fail(message if message else "`%s` is not equal to expected `%s` in %s sec" % (
self.find_element().text, text, wait_time)) text_element, text, wait_time))
elif self.find_element().text != text: elif text_element != text:
counter += 10 counter += 10
time.sleep(10) time.sleep(10)
else: else:

View File

@ -748,7 +748,7 @@ class BaseView(object):
def tap_by_coordinates(self, x, y): def tap_by_coordinates(self, x, y):
action = TouchAction(self.driver) action = TouchAction(self.driver)
action.press(None, x, y).perform() action.press(None, x, y).release().perform()
# Method-helper # Method-helper
def write_page_source_to_file(self, full_path_to_file): def write_page_source_to_file(self, full_path_to_file):

View File

@ -265,7 +265,7 @@ class ChatElementByText(Text):
except NoSuchElementException: except NoSuchElementException:
return 0 return 0
return int(EmojisNumber(self.driver, self.locator).text) return EmojisNumber(self.driver, self.locator)
@property @property
def pinned_by_label(self): def pinned_by_label(self):