Skip to content

Commit

Permalink
Merge branch 'develop' into issue-13832
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrkhalil authored Sep 20, 2022
2 parents 75d7eff + b47fdc6 commit 80a7ca8
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 75 deletions.
24 changes: 15 additions & 9 deletions test/appium/tests/critical/chats/test_group_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ def prepare_devices(self):
self.homes[0].add_contact(self.public_keys[i])
self.homes[0].home_button.double_click()

self.homes[0].just_fyi('Member adds admin to contacts to see PNs and put app in background')
self.homes[1].add_contact(self.public_keys[0])
self.homes[1].home_button.double_click()
self.homes[0].just_fyi('Members add admin to contacts to see PNs and put app in background')
for i in range(1, 3):
self.homes[i].handle_contact_request(self.usernames[0])
self.homes[i].home_button.double_click()

self.homes[0].just_fyi('Admin creates group chat')
self.chats[0] = self.homes[0].create_group_chat([self.usernames[1]], self.chat_name)
Expand Down Expand Up @@ -102,19 +103,24 @@ def test_group_chat_join_send_text_messages_push(self):
self.errors.verify_no_errors()

@marks.testrail_id(700732)
def test_group_chat_add_new_member_activity_centre(self):
def test_group_chat_add_new_member(self):
[self.homes[i].home_button.double_click() for i in range(3)]
self.homes[0].get_chat(self.chat_name).click()
self.chats[0].add_members_to_group_chat([self.usernames[2]])

self.chats[2].just_fyi("Check there will be no PN but unread in AC if got invite from non-contact")
if not self.homes[2].notifications_unread_badge.is_element_displayed(60):
self.drivers[2].fail("Group chat is not appeared in AC!")
self.chats[2].just_fyi("Check there will be PN and no unread in AC for a new member")
if self.homes[2].notifications_unread_badge.is_element_displayed(60):
self.drivers[2].fail("Group chat appeared in AC!")
self.homes[2].open_notification_bar()
if self.homes[2].element_by_text_part(self.usernames[0]).is_element_displayed():
self.errors.append("PN about group chat invite is shown when invited by non-contact")
if not self.homes[2].element_by_text_part(self.usernames[0]).is_element_displayed():
self.errors.append("PN about group chat invite is not shown when invited by mutual contact")

self.homes[2].click_system_back_button()

self.homes[2].just_fyi("Check new group appeared in chat list for a new member")
if not self.homes[2].get_chat(self.chat_name).is_element_displayed(60):
self.drivers[2].fail("New group chat hasn't appeared in chat list")

self.homes[2].get_chat(self.chat_name).click()

for message in (self.message_to_admin, self.message_before_adding):
Expand Down
2 changes: 2 additions & 0 deletions test/appium/tests/critical/test_pairing_devices_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ def prepare_devices(self):
dapp = self.home_1.dapp_tab_button.click()
web_page = dapp.open_url('status.im')
web_page.add_to_bookmarks()
if not web_page.home_button.is_element_displayed():
web_page.click_system_back_button_until_element_is_shown()

self.home_1.just_fyi("Close the ENS banner")
[home.home_button.double_click() for home in (self.home_1, self.home_2)]
Expand Down
57 changes: 18 additions & 39 deletions test/appium/tests/medium/test_activity_center.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ def prepare_devices(self):
self.home_1, self.home_2 = self.device_1.create_user(enable_notifications=True), self.device_2.create_user()
self.public_key_user_1, self.username_1 = self.home_1.get_public_key_and_username(return_username=True)
self.public_key_user_2, self.username_2 = self.home_2.get_public_key_and_username(return_username=True)
[self.group_chat_name_1, self.group_chat_name_2, self.group_chat_name_3, self.group_chat_name_4, \
self.group_chat_name_5] = "GroupChat1", "GroupChat2", "GroupChat3", "GroupChat4", "GroupChat5"
[self.group_chat_name_1, self.group_chat_name_2] = "GroupChat1", "GroupChat2"

self.message_from_sender = "Message sender"
self.home_2.home_button.double_click()
Expand All @@ -36,67 +35,48 @@ def test_activity_center_reject_chats_no_pn(self):

[home.home_button.double_click() for home in [self.home_1, self.home_2]]

self.device_2.just_fyi('Device2 creates Group chat 1 with Device1')
self.home_2.create_group_chat([self.username_1], group_chat_name=self.group_chat_name_1)
self.home_2.home_button.double_click()
self.home_1.home_button.double_click()

self.device_1.just_fyi('Device1 rejects both chats and verifies they disappeared and not in Chats too')
self.device_1.just_fyi('Device1 rejects chat and verifies it disappeared and not in Chats too')
self.home_1.notifications_unread_badge.wait_and_click(20)
self.home_1.notifications_select_button.click()
self.home_1.element_by_text_part(self.username_2[:10]).click()
self.home_1.element_by_text_part("Please add me to your contacts").click()
self.home_1.element_by_text_part(self.group_chat_name_1).click()
self.home_1.notifications_reject_and_delete_button.click()
if self.home_1.element_by_text_part(self.username_2[:20]).is_element_displayed(2):
self.errors.append("1-1 chat is on Activity Center view after action made on it")
if self.home_1.element_by_text_part(self.group_chat_name_1).is_element_displayed(2):
self.errors.append("Group chat is on Activity Center view after action made on it")
self.home_1.home_button.double_click()
if self.home_1.element_by_text_part(self.username_2[:20]).is_element_displayed(2):
self.errors.append("1-1 chat is added on home after rejection")
if self.home_1.element_by_text_part(self.group_chat_name_1).is_element_displayed(2):
self.errors.append("Group chat is added on home after rejection")

self.home_1.just_fyi("Verify there are still no chats after relogin")
self.home_1.just_fyi("Verify there is still no chat after relogin")
self.home_1.reopen_app()
if self.home_1.element_by_text_part(self.username_2[:20]).is_element_displayed(2):
self.errors.append("1-1 chat appears on Chats view after relogin")
if self.home_1.element_by_text_part(self.group_chat_name_1).is_element_displayed(2):
self.errors.append("Group chat appears on Chats view after relogin")
self.home_1.notifications_button.click()
if self.home_1.element_by_text_part(self.username_2[:20]).is_element_displayed(2):
self.errors.append("1-1 chat request reappears back in Activity Center view after relogin")
if self.home_1.element_by_text_part(self.group_chat_name_1).is_element_displayed(2):
self.errors.append("Group chat request reappears back in Activity Center view after relogin")

self.errors.verify_no_errors()

@marks.testrail_id(702184)
def test_activity_center_accept_chats(self):
[home.home_button.double_click() for home in [self.home_1, self.home_2]]

self.device_2.just_fyi('Device2 sends a message in 1-1 and creates Group chat 2')
self.device_2.just_fyi('Device2 sends a message in 1-1')
self.home_2.get_chat_from_home_view(self.username_1).click()
self.device_2_one_to_one_chat.send_message(self.message_from_sender)
self.device_2_one_to_one_chat.home_button.double_click()
self.home_2.create_group_chat([self.username_1], group_chat_name=self.group_chat_name_2)

self.device_1.just_fyi('Device1 accepts both chats (via Select All button) and verifies they disappeared '
self.device_1.just_fyi('Device1 accepts chat (via Select All button) and verifies it disappeared '
'from activity center view but present on Chats view')
self.home_1.notifications_unread_badge.wait_and_click(20)
self.home_1.notifications_select_button.click()
self.home_1.notifications_select_all.click()
self.home_1.notifications_accept_and_add_button.click()
if self.home_1.element_by_text_part(self.username_2[:20]).is_element_displayed(2):
self.errors.append("1-1 chat request stays on Activity Center view after it was accepted")
if self.home_1.element_by_text_part(self.group_chat_name_2).is_element_displayed(2):
self.errors.append("Group chat request stays on Activity Center view after it was accepted")

self.home_1.home_button.double_click()
if not self.home_1.element_by_text_part(self.username_2[:20]).is_element_displayed(2):
self.errors.append("1-1 chat is not added on home after accepted from Activity Center")
if not self.home_1.element_by_text_part(self.group_chat_name_2).is_element_displayed(2):
self.errors.append("Group chat is not added on home after accepted from Activity Center")

self.errors.verify_no_errors()

Expand All @@ -114,22 +94,21 @@ def test_activity_center_accept_chats_only_from_contacts(self):
profile_1.accept_new_chats_from_contacts_only.click()
profile_1.profile_button.click()

self.device_1.just_fyi('Device2 creates 1-1 chat Group chats')
self.device_1.just_fyi('Device2 creates 1-1 chat')
self.home_2.home_button.double_click()
self.home_2.get_chat(self.username_1).click()
self.device_2_one_to_one_chat.send_message(self.message_from_sender)
self.device_2_one_to_one_chat.home_button.double_click()
self.home_2.create_group_chat([self.username_1], group_chat_name=self.group_chat_name_4)

self.device_1.just_fyi('Device1 check there are no any chats in Activity Center nor Chats view')
self.home_1.home_button.double_click()
if self.home_1.element_by_text_part(self.username_2).is_element_displayed() or self.home_1.element_by_text_part(
self.group_chat_name_4).is_element_displayed():

if self.home_1.element_by_text_part(self.username_2).is_element_displayed():
self.errors.append("Chats are present on Chats view despite they created by non-contact")
self.home_1.notifications_button.click()
if self.home_1.element_by_text_part(self.username_2).is_element_displayed() or self.home_1.element_by_text_part(
self.group_chat_name_4).is_element_displayed():
self.errors.append("Chats are present in Activity Center view despite they created by non-contact")

if self.home_1.element_by_text_part(self.username_2).is_element_displayed():
self.errors.append("Chat is present in Activity Center view despite they created by non-contact")

self.device_1.just_fyi('Device1 adds Device2 in Contacts so chat requests should be visible now')
self.home_1.home_button.double_click()
Expand All @@ -140,13 +119,13 @@ def test_activity_center_accept_chats_only_from_contacts(self):
self.home_2.get_chat_from_home_view(self.username_1).click()
self.device_2_one_to_one_chat.send_message(self.message_from_sender)
self.device_2_one_to_one_chat.home_button.double_click()
self.home_2.create_group_chat([self.username_1], group_chat_name=self.group_chat_name_5)
self.home_2.create_group_chat([self.username_1], group_chat_name=self.group_chat_name_2)

self.device_1.just_fyi('Device1 verifies 1-1 chat Group chats are visible')
self.home_1.home_button.double_click()
if not self.home_1.element_by_text_part(
self.username_2).is_element_displayed() or not self.home_1.element_by_text_part(
self.group_chat_name_5).is_element_displayed():
self.group_chat_name_2).is_element_displayed():
self.errors.append("Chats are not present on Chats view while they have to!")

self.errors.verify_no_errors()
Expand All @@ -156,16 +135,16 @@ def test_activity_center_notifications_on_mentions_in_groups_and_empty_state(sel
[home.home_button.double_click() for home in [self.home_1, self.home_2]]

self.device_2.just_fyi('Device2 creates Group chat 3')
self.home_2.create_group_chat([self.username_1], group_chat_name=self.group_chat_name_3)
self.home_2.create_group_chat([self.username_1], group_chat_name=self.group_chat_name_1)
self.home_2.home_button.double_click()

self.home_1.just_fyi("Device1 joins Group chat 3")
group_chat_1 = self.home_1.get_chat(self.group_chat_name_3).click()
group_chat_1 = self.home_1.get_chat(self.group_chat_name_1).click()
group_chat_1.join_chat_button.click_if_shown()
group_chat_1.home_button.double_click()

self.home_2.just_fyi("Device2 mentions Device1 in Group chat 3")
chat_2 = self.home_2.get_chat_from_home_view(self.group_chat_name_3).click()
chat_2 = self.home_2.get_chat_from_home_view(self.group_chat_name_1).click()
chat_2.select_mention_from_suggestion_list(self.username_1, self.username_1[:2])
chat_2.send_as_keyevent("group")
group_chat_message = self.username_1 + " group"
Expand All @@ -187,7 +166,7 @@ def test_activity_center_notifications_on_mentions_in_groups_and_empty_state(sel

self.home_1.just_fyi("Check there are no unread messages counter on chats after message is read")
if (self.home_1.notifications_unread_badge.is_element_present() or
self.home_1.get_chat_from_home_view(self.group_chat_name_3).new_messages_counter.text == "1"):
self.home_1.get_chat_from_home_view(self.group_chat_name_1).new_messages_counter.text == "1"):
self.errors.append("Unread message indicator is kept after message is read in chat")

self.home_1.just_fyi("Check there is an empty view on Activity Center")
Expand Down
12 changes: 6 additions & 6 deletions test/appium/tests/medium/test_browser_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_browser_can_access_images_by_link(self):
dapp.open_url(url)
if dapp.web_page.is_element_differs_from_template(urls[url], 5):
self.errors.append('Web page does not match expected template %s' % urls[url])
base_web.browser_previous_page_button.click_until_presence_of_element(dapp.element_by_text_part('Discover'))
base_web.browser_previous_page_button.click_until_presence_of_element(dapp.element_by_text_part('Discover'), attempts=2)

self.errors.verify_no_errors()

Expand All @@ -47,19 +47,19 @@ def test_browser_back_forward_navigation_history_kept_after_relogin(self):

browsing.just_fyi("Check next page")
browsing.just_fyi('Navigate to next page and back')
browsing.element_by_text_part('може редагувати кожен').click()
browsing.element_by_text_part('написана спільно її читачами').wait_for_element(30)
browsing.element_by_text_part('може редагувати кожен').scroll_and_click()
browsing.element_by_text_part('написана спільно її читачами').scroll_to_element()
browsing.browser_previous_page_button.click()
browsing.wait_for_element_starts_with_text('може редагувати кожен')
browsing.wait_for_element_starts_with_text('Головна сторінка')

browsing.just_fyi('Relogin and check that tap on "Next" navigates to next page')
browsing.reopen_app()
self.home.dapp_tab_button.click()
browsing.open_tabs_button.click()
dapp.element_by_text_part(ua_url).click()
browsing.wait_for_element_starts_with_text('може редагувати кожен')
browsing.element_by_text_part('може редагувати кожен').scroll_to_element()
browsing.browser_next_page_button.click()
browsing.element_by_text_part('написана спільно її читачами').wait_for_element(30)
browsing.element_by_text_part('написана спільно її читачами').scroll_to_element()

self.errors.verify_no_errors()

Expand Down
22 changes: 7 additions & 15 deletions test/appium/tests/medium/test_chats_m.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def prepare_devices(self):
self.home_1.just_fyi("Creating group chats")
self.initial_group_chat_name = "GroupChat before rename"
self.new_group_chat_name = "GroupChat after rename"
self.group_user_not_a_contact = basic_user
# self.group_user_not_a_contact = basic_user
self.group_chat_1 = self.home_1.create_group_chat(user_names_to_add=[self.default_username_2],
group_chat_name=self.initial_group_chat_name)
self.group_chat_2 = self.home_2.get_chat(self.initial_group_chat_name).click()
Expand Down Expand Up @@ -640,9 +640,7 @@ def test_chat_group_chat_set_nickname_and_ens_via_group_info_mention(self):
chat_2.send_message("first")
chat_2.home_button.click()
chat_1.home_button.click()
chat_1 = self.home_1.add_contact(self.group_user_not_a_contact['public_key'])
chat_1.home_button.click()
chat_1 = self.home_1.create_group_chat([full_ens, self.group_user_not_a_contact['username']], group_name)
chat_1 = self.home_1.create_group_chat([full_ens], group_name)
chat_2 = self.home_2.get_chat(group_name).click()
chat_2.join_chat_button.click_if_shown()

Expand Down Expand Up @@ -690,17 +688,6 @@ def test_chat_group_chat_set_nickname_and_ens_via_group_info_mention(self):
'ENS is not resolved in chat input after setting nickname in mention suggestions list (search by nickname)!')
chat_1.chat_message_input.clear()

self.home_1.just_fyi("Check can mention not a contact group member who hasn't sent messages yet")
chat_2.chat_message_input.send_keys('@')
if not chat_2.element_by_text('%s' % self.group_user_not_a_contact['username']).is_element_displayed():
self.errors.append("Username of not a contact group member is not shown in mention input")
chat_2.chat_message_input.clear()
chat_2.select_mention_from_suggestion_list('%s' % self.group_user_not_a_contact['username'], typed_search_pattern=self.group_user_not_a_contact['username'][:2])
if chat_2.chat_message_input.text != '@' + self.group_user_not_a_contact['username'] + ' ':
self.errors.append(
'Can not select mention of not a contact member from suggestions list')
chat_2.chat_message_input.clear()

self.home_1.just_fyi('Can delete nickname via group info and recheck received messages')
device_2_options = chat_1.get_user_options(full_ens)
device_2_options.view_profile_button.click()
Expand Down Expand Up @@ -737,6 +724,11 @@ def prepare_devices(self):
for member in (self.public_keys[1], self.public_keys[2]):
self.homes[0].add_contact(member)
self.homes[0].home_button.click()

for i in range(1, 3):
self.homes[i].handle_contact_request(self.usernames[0])
self.homes[i].home_button.double_click()

[SignInView(self.drivers[i]).put_app_to_background_and_back() for i in range(1, 3)]
self.chat_name = self.homes[0].get_random_chat_name()
self.invite_chat_name = '%s_invite' % self.homes[0].get_random_chat_name()
Expand Down
6 changes: 6 additions & 0 deletions test/appium/tests/medium/test_pairing_devices_sync_m.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def prepare_devices(self):
self.drivers[1]), SignInView(self.drivers[2])
self.home_1 = self.device_1.create_user()

self.public_key_1, self.username_1 = self.home_1.get_public_key_and_username(return_username=True)

self.profile_1 = self.home_1.profile_button.click()
self.profile_1.privacy_and_security_button.click()
self.profile_1.backup_recovery_phrase_button.click()
Expand Down Expand Up @@ -81,6 +83,10 @@ def prepare_devices(self):
self.device_1.just_fyi('Add contact, start group chat')
self.home_1.home_button.click()
self.home_1.add_contact(self.public_key_3)

self.home_3.handle_contact_request(self.username_1)
self.home_3.home_button.double_click()

self.device_2.put_app_to_background_and_back()
self.home_1.get_back_to_home_view()
self.chat_1 = self.home_1.create_group_chat([self.username_3], self.group_chat_name)
Expand Down
Loading

0 comments on commit 80a7ca8

Please sign in to comment.