From 09675826393928d44c5a41b41a6b17727f5f703b Mon Sep 17 00:00:00 2001 From: Churikova Tetiana Date: Fri, 28 Oct 2022 14:57:18 +0200 Subject: [PATCH] e2e: non-latin --- .../critical/chats/test_1_1_public_chats.py | 60 +++++++++++++++++- test/appium/views/chat_view.py | 14 ++-- .../views/elements_templates/member.png | Bin 0 -> 8122 bytes test/appium/views/profile_view.py | 11 ++++ 4 files changed, 74 insertions(+), 11 deletions(-) create mode 100644 test/appium/views/elements_templates/member.png diff --git a/test/appium/tests/critical/chats/test_1_1_public_chats.py b/test/appium/tests/critical/chats/test_1_1_public_chats.py index e98a5524f2..6c537e40b4 100644 --- a/test/appium/tests/critical/chats/test_1_1_public_chats.py +++ b/test/appium/tests/critical/chats/test_1_1_public_chats.py @@ -227,6 +227,7 @@ class TestOneToOneChatMultipleSharedDevices(MultipleSharedDeviceTestCase): self.chat_2 = self.home_2.get_chat(self.default_username_1).click() @marks.testrail_id(6315) + # moved def test_1_1_chat_message_reaction(self): message_from_sender = "Message sender" self.device_1.just_fyi("Sender start 1-1 chat, set emoji and check counter") @@ -378,6 +379,7 @@ class TestOneToOneChatMultipleSharedDevices(MultipleSharedDeviceTestCase): self.errors.verify_no_errors() @marks.testrail_id(5315) + # moved def test_1_1_chat_non_latin_message_to_newly_added_contact_with_profile_picture_on_different_networks(self): self.home_1.get_app_from_background() self.home_2.get_app_from_background() @@ -1223,11 +1225,10 @@ class TestOneToOneChatMultipleSharedDevices(MultipleSharedDeviceTestCase): self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) self.home_1 = self.device_1.create_user(enable_notifications=True) self.home_2 = self.device_2.create_user(enable_notifications=True) - self.home_1.browser_tab.click() #temp, until profile is on browser tab self.profile_1 = self.home_1.get_profile_view() - self.default_username_1 = self.profile_1.default_username_text.text - self.profile_1.chats_tab.click() + self.public_key_1, self.default_username_1 = self.home_1.get_public_key_and_username(return_username=True) self.public_key_2, self.default_username_2 = self.home_2.get_public_key_and_username(return_username=True) + self.profile_1.chats_tab.click() self.chat_1 = self.home_1.add_contact(self.public_key_2) self.chat_1.send_message('hey') self.home_2.click_system_back_button_until_element_is_shown() @@ -1260,3 +1261,56 @@ class TestOneToOneChatMultipleSharedDevices(MultipleSharedDeviceTestCase): if counter != 1: self.errors.append('Counter is not decreased after re-tapping emoji from receiver!') self.errors.verify_no_errors() + + @marks.testrail_id(702745) + 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.browser_tab.click() #temp, until profile is on browser tab + self.profile_1.edit_profile_picture('sauce_logo.png') + self.profile_1.chats_tab.click() + + self.chat_2.just_fyi("Send messages with non-latin symbols") + messages = ['hello', '¿Cómo estás tu año?', 'ё, доброго вечерочка', '® æ ç ♥'] + + for message in messages: + self.chat_2.send_message(message) + if not self.chat_1.chat_message_input.is_element_displayed(): + self.chat_1.click_system_back_button_until_element_is_shown() + self.home_1.get_chat(self.default_username_2).click() + + for message in messages: + 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.chat_2.just_fyi("Checking updated member photo, timestamp and username on message") + timestamp = self.chat_2.chat_element_by_text(messages[0]).timestamp + sent_time_variants = self.chat_2.convert_device_time_to_chat_timestamp() + if timestamp not in sent_time_variants: + self.errors.append('Timestamp on message %s does not correspond expected [%s]' % (timestamp, *sent_time_variants)) + + for message in [messages[1], messages[2]]: + if self.chat_2.chat_element_by_text(message).member_photo.is_element_displayed(): + self.errors.append('%s is not stack to 1st(they are sent in less than 5 minutes)!' % message) + + self.chat_1.just_fyi("Sending message while user is still not in contacts") + message = 'profile_photo' + self.chat_1.send_message(message) + self.chat_2.chat_element_by_text(message).wait_for_visibility_of_element(30) + if not self.chat_2.chat_element_by_text(message).member_photo.is_element_differs_from_template("member.png", + diff=5): + self.errors.append("Image of user in 1-1 chat is updated even when user is not added to contacts!") + + self.chat_1.just_fyi("Users add to contacts each other") + [home.click_system_back_button_until_element_is_shown() for home in (self.home_1, self.home_2)] + [home.browser_tab.click() for home in (self.home_1, self.home_2)] + self.profile_1.add_contact_via_contacts_list(self.public_key_2) + self.profile_2 = self.home_2.get_profile_view() + self.profile_2.add_contact_via_contacts_list(self.public_key_1) + + self.chat_1.just_fyi("Go back to chat view and checking that profile photo is updated") + [home.chats_tab.click() for home in (self.home_1, self.home_2)] + if not self.chat_2.chat_message_input.is_element_displayed(): + self.home_2.get_chat(self.default_username_1).click() + if self.chat_2.chat_element_by_text(message).member_photo.is_element_differs_from_template("member.png", diff=5): + self.errors.append("Image of user in 1-1 chat is too different from template!") + self.errors.verify_no_errors() diff --git a/test/appium/views/chat_view.py b/test/appium/views/chat_view.py index 7be0a69c47..a5b5a9a6fc 100644 --- a/test/appium/views/chat_view.py +++ b/test/appium/views/chat_view.py @@ -151,14 +151,11 @@ class ChatElementByText(Text): return TimeStampText(self.driver, self.locator) @property - def timestamp_on_tap(self): - timestamp_element = Text(self.driver, xpath="//*[@content-desc='message-timestamp']") - try: - self.sent_status_checkmark.wait_for_element(30) - self.sent_status_checkmark.click_until_presence_of_element(timestamp_element) - return timestamp_element.text - except (NoSuchElementException, TimeoutException): - return None + def timestamp(self): + class TimeStampText(Button): + def __init__(self, driver, parent_locator: str): + super().__init__(driver, xpath="%s//*[@content-desc='message-timestamp']" % parent_locator) + return TimeStampText(self.driver, self.locator).text @property def member_photo(self): @@ -265,6 +262,7 @@ class ChatElementByText(Text): return 0 return int(EmojisNumber(self.driver, self.locator).text) + @property def pinned_by_label(self): class PinnedByLabelText(Text): diff --git a/test/appium/views/elements_templates/member.png b/test/appium/views/elements_templates/member.png new file mode 100644 index 0000000000000000000000000000000000000000..f8c00be55df330e6624e73ec9a6ea19e1481b360 GIT binary patch literal 8122 zcmV;rA4TAaP)Nkl1v#)3ZRV14WpKel8@ zGzpO~NMgCbzUI+A-Cb3g5k6#A&ny9u00~NV?WebUx*nYw8L!_jqDub5fBa9*KjCI( zxI6cM@E+J6FasJO0#c81A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EI|5n3rl$i{`H67Fur$dU>s!a%ue zFqyGRBYiHQce<6cG*Ohi>*ixFWZ&^G`wlnDDBS(}-Ov3Hl+Rt84hvyIZ>BFDW4_mTLorM6t^9MtQah=$(toNGMmq>lEK%sNZjiJ&OLw!w8 z6LPM55~pp~OrcV4z`yPIk=Kp|U<+^l%QydN9xMRGFTD8r9p3-D_c%E?g$BNK^diUm zC;alsFL`wFi1n}`rBbur)$glX4R)g`v=q{(5^Mc|>yMMo3Y6N{&T-WP3n5-4eQ0p( z*Ja-Xas_|&uRlG{`EA?p_3VzXe&=hL*$r(9y!NHnxO3|ck1ii`zB*&IS+N>DC=CH%l(pmt1a^Ty3w|3>$W2JJ$*XAD7dw3kjz<-j3pU=ahRFrdgC`0q(wj z_y3*8ewHO${E#U@Rhot&}R+tk}~{Nvn10@iT%jn5yQKJ$G3 zAXlYCyI217mEA+$9{leI9L^7zwev!hYoPI_5MtAI!!cVn`qZ;&H_u;q0D8Fhr}zH< ze#qOjiAWLFx69qdQ_}Z~AO8Y!X|xRlYNsPms-{CbuxZw%kTAl%KfCwO@|eK?3wM&b U)(4vvbpQYW07*qoM6N<$f{IN^4FCWD literal 0 HcmV?d00001 diff --git a/test/appium/views/profile_view.py b/test/appium/views/profile_view.py index c159a1f319..0aa9417262 100644 --- a/test/appium/views/profile_view.py +++ b/test/appium/views/profile_view.py @@ -362,6 +362,17 @@ class ProfileView(BaseView): from views.chat_view import ChatView return ChatView(self.driver) + def add_contact_via_contacts_list(self, public_key): + self.driver.info("Adding user to Contacts via Profile > Contacts") + self.contacts_button.wait_and_click(30) + self.add_new_contact_button.wait_and_click() + chat = self.get_chat_view() + chat.public_key_edit_box.click() + chat.public_key_edit_box.send_keys(public_key) + chat.confirm_until_presence_of_element(self.add_new_contact_button) + self.click_system_back_button_until_element_is_shown() + + def add_custom_network(self, rpc_url: str, name: str, symbol: str, netwrok_id:str): self.driver.info("## Add custom network", device=False) self.advanced_button.click()