e2e: activity centre and more checks

This commit is contained in:
Churikova Tetiana 2023-03-22 18:09:36 +01:00
parent c238ebe36e
commit 401f7d7383
No known key found for this signature in database
GPG Key ID: EDE559EC439D18A0
5 changed files with 29 additions and 57 deletions

View File

@ -1309,7 +1309,6 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
@marks.testrail_id(702784)
def test_1_1_chat_delete_via_long_press_relogin(self):
self.home_1.driver.quit()
self.home_2.click_system_back_button_until_element_is_shown()
self.home_2.chats_tab.click()

View File

@ -271,10 +271,8 @@ class TestGroupChatMultipleDeviceMergedNewUI(MultipleSharedDeviceTestCase):
@marks.testrail_id(702732)
def test_group_chat_pin_messages(self):
self.drivers[2].quit()
[self.homes[i].click_system_back_button_until_element_is_shown() for i in range(2)]
[self.homes[i].get_chat(self.chat_name).click() for i in range(2)]
[self.homes[i].click_system_back_button_until_element_is_shown() for i in range(3)]
[self.homes[i].get_chat(self.chat_name).click() for i in range(3)]
self.message_1, self.message_2, self.message_3, self.message_4 = \
"Message 1", "Message 2", "Message 3", "Message 4"

View File

@ -349,7 +349,7 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors()
@pytest.mark.xdist_group(name="new_two_2")
@pytest.mark.xdist_group(name="new_one_2")
@marks.new_ui_critical
class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):

View File

@ -4,7 +4,7 @@ from tests import marks, run_in_parallel
from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers
from views.sign_in_view import SignInView
from views.chat_view import CommunityView
from selenium.common.exceptions import TimeoutException
@pytest.mark.xdist_group(name="four_2")
@marks.medium
@ -95,47 +95,29 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC
[home.click_system_back_button_until_element_is_shown() for home in [self.home_1, self.home_2]]
[home.chats_tab.click() for home in [self.home_1, self.home_2]]
@marks.testrail_id(702871)
def test_activity_center_contact_request_cancel_outgoing_no_pn(self):
@marks.testrail_id(702850)
def test_activity_center_contact_request_decline(self):
self.device_1.put_app_to_background()
self.device_2.just_fyi('Device2 sends a contact request to Device1')
self.home_2.add_contact(self.public_key_1)
self.device_2.just_fyi('Device2 sends a contact request to Device1 via Paste button and check user details')
self.home_2.driver.set_clipboard_text(self.public_key_1)
self.home_2.new_chat_button.click_until_presence_of_element(self.home_2.add_a_contact_chat_bottom_sheet_button)
self.home_2.add_a_contact_chat_bottom_sheet_button.click()
self.home_2.element_by_translation_id("paste").click()
self.home_2.element_by_translation_id("user-found").wait_for_visibility_of_element(10)
if not self.home_2.element_by_text(self.default_username_1).is_element_displayed():
self.errors.append("Username is not shown on 'Add contact' page after entering valid public key")
chat = self.home_2.get_chat_view()
self.device_1.just_fyi("Device 2: check there is no PN when receiving new message to activity centre")
chat.view_profile_new_contact_button.click_until_presence_of_element(chat.profile_block_contact_button)
chat.profile_add_to_contacts_button.click()
self.home_2.click_system_back_button_until_element_is_shown()
self.device_1.just_fyi("Device 1: check there is no PN when receiving new message to activity centre")
self.device_1.open_notification_bar()
if self.home_1.element_by_text_part("Please add me to your contacts").is_element_displayed():
self.errors.append("Push notification with text was received for new message in activity centre")
self.device_1.click_system_back_button(2)
self.profile_2.just_fyi("Check outgoing contact request and cancel it")
for indicator in (self.home_2.notifications_unread_badge, self.home_2.contact_new_badge):
if not indicator.is_element_displayed():
self.errors.append("Unread indicator on contacts tab or on activity center is not shown for outgoing CR!")
self.home_2.contacts_tab.click()
if self.home_2.pending_contact_request_text.text != '1':
self.errors.append("The amount of contact requests is not shown for outgoing CR!")
self.home_2.pending_contact_request_button.click()
outgoing_cr = self.home_2.get_element_from_activity_center_view(self.default_username_1)
outgoing_cr.cancel_contact_request()
self.home_2.close_activity_centre.click()
self.profile_1.just_fyi("Check there is no unread indicator and pending CR")
self.device_1.chats_tab.click()
try:
self.home_1.pending_contact_request_button.wait_for_invisibility_of_element(30)
self.home_1.notifications_unread_badge.wait_for_invisibility_of_element(30)
except TimeoutException:
self.errors.append("Cancelled request is not disappeared!")
self.errors.verify_no_errors()
@marks.testrail_id(702850)
def test_activity_center_contact_request_decline(self):
[home.chats_tab.click() for home in [self.home_1, self.home_2]]
self.home_2.just_fyi("Device2 sends pending contact request after cancelling")
self.home_2.add_contact(self.public_key_1)
self.device_1.just_fyi('Device1 verifies pending contact request')
self.home_1.contacts_tab.click()
for indicator in (self.home_1.notifications_unread_badge, self.home_1.contact_new_badge):
@ -150,6 +132,13 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC
if indicator.is_element_displayed():
self.errors.append("Unread indicator on contacts tab or on activity center is shown after declining contact request!")
self.device_1.just_fyi("Check that it is still pending contact after declining on sender device")
self.home_2.jump_to_messages_home()
self.home_2.contacts_tab.click()
if self.home_2.pending_contact_request_text.text != '1':
self.errors.append("No pending CR for sender anymore after receiver has declined CR!")
self.home_2.recent_tab.click()
self.errors.verify_no_errors()
@marks.testrail_id(702851)

View File

@ -369,20 +369,6 @@ class TestDeeplinkOneDeviceNewUI(MultipleSharedDeviceTestCase):
self.errors.append("Can't navigate to profile from deep link with own public key")
self.errors.verify_no_errors()
@marks.testrail_id(702776)
def test_public_chat_open_using_deep_link(self):
self.drivers[0].close_app()
chat_name = self.home.get_random_chat_name()
deep_link = 'status-im://%s' % chat_name
self.sign_in.open_weblink_and_login(deep_link)
chat = self.sign_in.get_chat_view()
# ToDo: change to the next line when accessibility id is added for user_name_text_new_UI
# if not chat.user_name_text_new_UI.text == '#' + chat_name:
try:
chat.element_by_text(text=" #" + chat_name, element_type="text").wait_for_visibility_of_element()
except TimeoutException:
self.drivers[0].fail("Public chat '%s' is not opened" % chat_name)
@marks.testrail_id(702775)
@marks.xfail(reason="Profile is often not opened in e2e builds for some reason. Needs to be investigated.")
def test_deep_link_open_user_profile(self):
@ -391,9 +377,9 @@ class TestDeeplinkOneDeviceNewUI(MultipleSharedDeviceTestCase):
deep_link = 'status-im://u/%s' % user_ident
self.sign_in.open_weblink_and_login(deep_link)
chat = self.sign_in.get_chat_view()
chat.wait_for_element_starts_with_text(ens_user['username'])
chat.wait_for_element_starts_with_text(ens_user['ens'])
for text in ens_user['username'], self.sign_in.get_translation_by_key("add-to-contacts"):
for text in ens_user['ens'], self.sign_in.get_translation_by_key("add-to-contacts"):
if not chat.element_by_text(text).scroll_to_element(10):
self.drivers[0].fail("User profile screen is not opened")