e2e: new tests automated

This commit is contained in:
pavloburykh 2022-06-27 16:34:07 +03:00
parent e9c0decd68
commit ff190c177a
No known key found for this signature in database
GPG Key ID: 11D9383A6FB7F1D8
4 changed files with 89 additions and 5 deletions

View File

@ -825,6 +825,14 @@ class TestContactBlockMigrateKeycardMultipleSharedDevices(MultipleSharedDeviceTe
self.errors.append(
"'%s' from blocked user is fetched from offline in public chat" % message)
self.home_1.just_fyi('Verify input field is disabled in 1-1 chat with blocked user')
self.home_1.home_button.double_click()
chat_1_1 = self.home_1.add_contact(self.public_key_2, add_in_contacts=False)
if chat_1_1.chat_message_input.is_element_displayed():
self.errors.append("Chat input field is displayed in chat with blocked user")
self.home_1.home_button.double_click()
self.home_1.get_chat("#%s" % self.pub_chat_name).click()
self.chat_2.just_fyi('Unblock user and check that can see further messages')
profile_1 = self.home_1.get_profile_view()
self.chat_1.profile_button.double_click()

View File

@ -7,7 +7,7 @@ import pytest
from tests import bootnode_address, mailserver_address, mailserver_ams, used_fleet, background_service_message
from tests import marks
from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers
from tests.users import transaction_senders, ens_user
from tests.users import transaction_senders, ens_user, basic_user
from views.sign_in_view import SignInView
@ -315,6 +315,7 @@ class TestChatMediumMultipleDevice(MultipleSharedDeviceTestCase):
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_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()
@ -636,7 +637,9 @@ class TestChatMediumMultipleDevice(MultipleSharedDeviceTestCase):
chat_2.send_message("first")
chat_2.home_button.click()
chat_1.home_button.click()
chat_1 = self.home_1.create_group_chat([full_ens], group_name)
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_2 = self.home_2.get_chat(group_name).click()
chat_2.join_chat_button.click_if_shown()
@ -684,6 +687,17 @@ class TestChatMediumMultipleDevice(MultipleSharedDeviceTestCase):
'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()
@ -701,7 +715,6 @@ class TestChatMediumMultipleDevice(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors()
@pytest.mark.xdist_group(name="one_3")
@marks.medium
class TestGroupChatMultipleDeviceMediumMerged(MultipleSharedDeviceTestCase):

View File

@ -16,7 +16,7 @@ class TestProfileGapsCommunityMediumMultipleDevicesMerged(MultipleSharedDeviceTe
def prepare_devices(self):
self.drivers, self.loop = create_shared_drivers(2)
self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
self.home_1, self.home_2 = self.device_1.create_user(), self.device_2.create_user(enable_notifications=True)
self.home_1, self.home_2 = self.device_1.create_user(enable_notifications=True), self.device_2.create_user(enable_notifications=True)
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)
[home.home_button.click() for home in (self.home_1, self.home_2)]
@ -200,6 +200,68 @@ class TestProfileGapsCommunityMediumMultipleDevicesMerged(MultipleSharedDeviceTe
chat_view.back_button.click()
self.errors.verify_no_errors()
@marks.testrail_id(702367)
def test_chat_push_on_mute_unmute_contact(self):
[home.home_button.double_click() for home in (self.home_1, self.home_2)]
chat_1 = self.home_1.get_chat(self.default_username_2).click()
chat_2 = self.home_2.get_chat(self.default_username_1).click()
self.home_1.just_fyi('Mute a contact and verify notifications are not received from muted contact')
chat_1.chat_options.click()
chat_1.view_profile_button.click()
chat_1.profile_mute_contact.scroll_and_click()
chat_1.close_button.click()
chat_1.put_app_to_background()
self.home_2.just_fyi('Muted contact sends a message')
message_after_mute = 'message after mute'
chat_2.send_message(message_after_mute)
self.device_1.open_notification_bar()
if self.device_1.element_by_text(message_after_mute).is_element_displayed(15):
self.errors.append("Push notification is received from muted contact")
# self.device_1.click_system_back_button()
self.device_1.get_app_from_background()
chat_1.just_fyi('Verify that message from muted user is actually received')
if not chat_1.chat_element_by_text(message_after_mute).is_element_displayed():
self.errors.append("Message from muted contact hasn't been received")
self.home_1.just_fyi('Unmute contact and verify that notifications are received after unmute')
chat_1.chat_options.click()
chat_1.view_profile_button.click()
chat_1.profile_unmute_contact.scroll_and_click()
chat_1.close_button.click()
chat_1.put_app_to_background()
self.home_2.just_fyi('Unmuted contact sends a message')
message_after_unmute = 'message after unmute'
chat_2.send_message(message_after_unmute)
self.device_1.open_notification_bar()
if not self.device_1.element_by_text(message_after_unmute).is_element_displayed(15):
self.errors.append("Push notification is not received from unmuted contact")
# self.device_1.click_system_back_button()
self.device_1.get_app_from_background()
chat_1.just_fyi('Verify that message from unmuted user is actually received')
if not chat_1.chat_element_by_text(message_after_unmute).is_element_displayed():
self.errors.append("Message from unmuted contact hasn't been received")
self.errors.verify_no_errors()
@marks.testrail_id(702368)
def test_chat_reopen_app_on_last_viewed_chat(self):
self.home_2.home_button.double_click()
chat_2 = self.home_2.add_contact(self.public_key_1)
self.home_2.reopen_app()
if not chat_2.chat_message_input.is_element_displayed():
self.errors.append('last viewed chat is not opened after app reopening')
if not chat_2.element_by_text(self.default_username_1).is_element_displayed():
self.errors.append('wrong chat is opened after app reopening')
self.errors.verify_no_errors()
@marks.testrail_id(702283)
def test_community_create_approve_membership(self):
[home.home_button.double_click() for home in (self.home_1, self.home_2)]

View File

@ -113,7 +113,6 @@ class ProfileBlockContactButton(Button):
self.scroll_to_element()
self.wait_for_element().click()
class ChatElementByText(Text):
def __init__(self, driver, text):
self.message_text = text
@ -669,6 +668,8 @@ class ChatView(BaseView):
self.profile_block_contact = ProfileBlockContactButton(self.driver)
self.confirm_block_contact_button = Button(self.driver, accessibility_id="block-contact-confirm")
self.unblock_contact_button = UnblockContactButton(self.driver)
self.profile_mute_contact = Button(self.driver, accessibility_id="Mute-item-button")
self.profile_unmute_contact = Button(self.driver, accessibility_id="Unmute-item-button")
self.profile_add_to_contacts = Button(self.driver, accessibility_id="Add to contacts-item-button")
self.profile_details = Button(self.driver, accessibility_id="share-button")
self.profile_nickname = Text(self.driver,