From 7619eae9c91107d1cdb7ef2cb37e622b06e42a98 Mon Sep 17 00:00:00 2001 From: Valentina Novgorodtceva Date: Mon, 22 Jul 2024 17:40:18 +0700 Subject: [PATCH] added steps to skip dialog in tests --- .../tests/communities/test_communities_categories.py | 4 ++++ .../tests/communities/test_communities_channels.py | 11 ++++++++++- ...nities_send_accept_decline_request_from_profile.py | 6 ++++++ test/e2e/tests/messages/test_messaging_group_chat.py | 8 ++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/test/e2e/tests/communities/test_communities_categories.py b/test/e2e/tests/communities/test_communities_categories.py index 714bea47d4..432b1fc467 100644 --- a/test/e2e/tests/communities/test_communities_categories.py +++ b/test/e2e/tests/communities/test_communities_categories.py @@ -5,6 +5,7 @@ from allure_commons._allure import step import configs import constants from gui.components.context_menu import ContextMenu +from gui.components.onboarding.share_usage_data_popup import ShareUsageDataPopup from gui.main_window import MainWindow from . import marks @@ -87,6 +88,9 @@ def test_create_edit_remove_community_category(main_screen: MainWindow, category @pytest.mark.parametrize('user_data', [configs.testpath.TEST_USER_DATA / 'squisher']) def test_member_role_cannot_add_edit_or_delete_category(main_screen: MainWindow): with step('Choose community user is not owner of'): + share_updates_popup = ShareUsageDataPopup() + if share_updates_popup.exists: + share_updates_popup.skip() community_screen = main_screen.left_panel.select_community('Community with 2 users') with step('Verify that member cannot add category'): diff --git a/test/e2e/tests/communities/test_communities_channels.py b/test/e2e/tests/communities/test_communities_channels.py index 30a1140542..21fea52e2b 100644 --- a/test/e2e/tests/communities/test_communities_channels.py +++ b/test/e2e/tests/communities/test_communities_channels.py @@ -10,8 +10,8 @@ import constants import driver from constants import UserAccount from gui.components.context_menu import ContextMenu +from gui.components.onboarding.share_usage_data_popup import ShareUsageDataPopup from gui.main_window import MainWindow -from gui.screens.messages import MessagesScreen from . import marks pytestmark = marks @@ -89,6 +89,9 @@ def test_create_edit_remove_community_channel(main_screen, channel_name, channel @pytest.mark.parametrize('user_data', [configs.testpath.TEST_USER_DATA / 'squisher']) def test_member_role_cannot_add_edit_and_delete_channels(main_screen: MainWindow): with step('Choose community user is not owner of'): + share_updates_popup = ShareUsageDataPopup() + if share_updates_popup.exists: + share_updates_popup.skip() community_screen = main_screen.left_panel.select_community('Community with 2 users') with step('Verify that member cannot add new channel'): with step('Verify that create channel or category button is not present'): @@ -147,6 +150,9 @@ def test_member_cannot_see_hidden_channel(multiple_instances, user_data_one, use with step(f'User {user_two.name}, select non-restricted channel and can send message'): aut_two.attach() main_screen.prepare() + share_updates_popup = ShareUsageDataPopup() + if share_updates_popup.exists: + share_updates_popup.skip() community_screen = main_screen.left_panel.select_community('Community with 2 users') with step(f'User {user_two.name}, create hidden channel, verify that it is in the list'): @@ -165,5 +171,8 @@ def test_member_cannot_see_hidden_channel(multiple_instances, user_data_one, use with step(f'User {user_one.name}, cannot see hidden channel in the list'): aut_one.attach() main_screen.prepare() + share_updates_popup = ShareUsageDataPopup() + if share_updates_popup.exists: + share_updates_popup.skip() assert driver.waitFor(lambda: channel not in community_screen.left_panel.channels, configs.timeouts.UI_LOAD_TIMEOUT_MSEC) diff --git a/test/e2e/tests/communities/test_communities_send_accept_decline_request_from_profile.py b/test/e2e/tests/communities/test_communities_send_accept_decline_request_from_profile.py index 203114ce53..aa46812b98 100644 --- a/test/e2e/tests/communities/test_communities_send_accept_decline_request_from_profile.py +++ b/test/e2e/tests/communities/test_communities_send_accept_decline_request_from_profile.py @@ -3,6 +3,7 @@ import pytest from allure_commons._allure import step import driver +from gui.components.onboarding.share_usage_data_popup import ShareUsageDataPopup from gui.components.profile_popup import ProfilePopupFromMembers from gui.components.remove_contact_popup import RemoveContactPopup from gui.main_window import MainWindow @@ -28,6 +29,7 @@ def test_communities_send_accept_decline_request_remove_contact_from_profile(mul user_three: UserAccount = constants.user_account_three timeout = configs.timeouts.UI_LOAD_TIMEOUT_MSEC main_screen = MainWindow() + share_updates_popup = ShareUsageDataPopup() with multiple_instances(user_data=user_data_one) as aut_one, multiple_instances( user_data=user_data_two) as aut_two, multiple_instances(user_data=user_data_three) as aut_three: @@ -41,6 +43,8 @@ def test_communities_send_accept_decline_request_remove_contact_from_profile(mul with step(f'User {user_one.name}, send contact request to {user_three.name} from user profile'): aut_one.attach() main_screen.prepare() + if share_updates_popup.exists: + share_updates_popup.skip() community_screen = main_screen.left_panel.select_community('Community with 2 users') profile_popup = community_screen.right_panel.click_member(user_three.name) profile_popup.send_request().send(f'Hello {user_three.name}') @@ -50,6 +54,8 @@ def test_communities_send_accept_decline_request_remove_contact_from_profile(mul with step(f'User {user_three.name}, accept contact request from {user_one.name} from user profile'): aut_three.attach() main_screen.prepare() + if share_updates_popup.exists: + share_updates_popup.skip() community_screen = main_screen.left_panel.select_community('Community with 2 users') profile_popup = community_screen.right_panel.click_member(user_one.name) profile_popup.review_contact_request().accept() diff --git a/test/e2e/tests/messages/test_messaging_group_chat.py b/test/e2e/tests/messages/test_messaging_group_chat.py index 5a02cc5cfe..dbb530cf21 100644 --- a/test/e2e/tests/messages/test_messaging_group_chat.py +++ b/test/e2e/tests/messages/test_messaging_group_chat.py @@ -7,6 +7,7 @@ import pytest from allure_commons._allure import step import driver +from gui.components.onboarding.share_usage_data_popup import ShareUsageDataPopup from . import marks import configs.testpath @@ -33,6 +34,7 @@ def test_group_chat(multiple_instances, user_data_one, user_data_two, user_data_ members = [user_two.name, user_three.name] main_window = MainWindow() messages_screen = MessagesScreen() + share_updates_popup = ShareUsageDataPopup() with multiple_instances(user_data=user_data_one) as aut_one, multiple_instances( user_data=user_data_two) as aut_two, multiple_instances( @@ -47,6 +49,8 @@ def test_group_chat(multiple_instances, user_data_one, user_data_two, user_data_ with step(f'User {user_one.name}, start chat and add {members}'): aut_one.attach() main_window.prepare() + if share_updates_popup.exists: + share_updates_popup.skip() main_window.left_panel.open_messages_screen() messages_screen.left_panel.start_chat().create_chat(members) @@ -99,6 +103,8 @@ def test_group_chat(multiple_instances, user_data_one, user_data_two, user_data_ with step(f'Check group members and message for {user_two.name}'): aut_two.attach() main_window.prepare() + if share_updates_popup.exists: + share_updates_popup.skip() assert driver.waitFor(lambda: group_chat_new_name in messages_screen.left_panel.get_chats_names, 10000), f'{group_chat_new_name} is not present in chats list for {aut_two}' messages_screen.left_panel.click_chat_by_name(group_chat_new_name) @@ -132,6 +138,8 @@ def test_group_chat(multiple_instances, user_data_one, user_data_two, user_data_ with step(f'Check group members and message for {user_three.name}'): aut_three.attach() main_window.prepare() + if share_updates_popup.exists: + share_updates_popup.skip() with step(f'Check that {user_three.name} is not a member of a group'): assert driver.waitFor(lambda: group_chat_new_name in messages_screen.left_panel.get_chats_names,