added steps to skip dialog in tests

This commit is contained in:
Valentina Novgorodtceva 2024-07-22 17:40:18 +07:00
parent bd56e59a83
commit 7619eae9c9
4 changed files with 28 additions and 1 deletions

View File

@ -5,6 +5,7 @@ from allure_commons._allure import step
import configs import configs
import constants import constants
from gui.components.context_menu import ContextMenu 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.main_window import MainWindow
from . import marks 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']) @pytest.mark.parametrize('user_data', [configs.testpath.TEST_USER_DATA / 'squisher'])
def test_member_role_cannot_add_edit_or_delete_category(main_screen: MainWindow): def test_member_role_cannot_add_edit_or_delete_category(main_screen: MainWindow):
with step('Choose community user is not owner of'): 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') community_screen = main_screen.left_panel.select_community('Community with 2 users')
with step('Verify that member cannot add category'): with step('Verify that member cannot add category'):

View File

@ -10,8 +10,8 @@ import constants
import driver import driver
from constants import UserAccount from constants import UserAccount
from gui.components.context_menu import ContextMenu 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.main_window import MainWindow
from gui.screens.messages import MessagesScreen
from . import marks from . import marks
pytestmark = 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']) @pytest.mark.parametrize('user_data', [configs.testpath.TEST_USER_DATA / 'squisher'])
def test_member_role_cannot_add_edit_and_delete_channels(main_screen: MainWindow): def test_member_role_cannot_add_edit_and_delete_channels(main_screen: MainWindow):
with step('Choose community user is not owner of'): 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') 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 member cannot add new channel'):
with step('Verify that create channel or category button is not present'): 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'): with step(f'User {user_two.name}, select non-restricted channel and can send message'):
aut_two.attach() aut_two.attach()
main_screen.prepare() 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') 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'): 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'): with step(f'User {user_one.name}, cannot see hidden channel in the list'):
aut_one.attach() aut_one.attach()
main_screen.prepare() 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, assert driver.waitFor(lambda: channel not in community_screen.left_panel.channels,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC) configs.timeouts.UI_LOAD_TIMEOUT_MSEC)

View File

@ -3,6 +3,7 @@ import pytest
from allure_commons._allure import step from allure_commons._allure import step
import driver import driver
from gui.components.onboarding.share_usage_data_popup import ShareUsageDataPopup
from gui.components.profile_popup import ProfilePopupFromMembers from gui.components.profile_popup import ProfilePopupFromMembers
from gui.components.remove_contact_popup import RemoveContactPopup from gui.components.remove_contact_popup import RemoveContactPopup
from gui.main_window import MainWindow 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 user_three: UserAccount = constants.user_account_three
timeout = configs.timeouts.UI_LOAD_TIMEOUT_MSEC timeout = configs.timeouts.UI_LOAD_TIMEOUT_MSEC
main_screen = MainWindow() main_screen = MainWindow()
share_updates_popup = ShareUsageDataPopup()
with multiple_instances(user_data=user_data_one) as aut_one, multiple_instances( 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: 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'): with step(f'User {user_one.name}, send contact request to {user_three.name} from user profile'):
aut_one.attach() aut_one.attach()
main_screen.prepare() main_screen.prepare()
if share_updates_popup.exists:
share_updates_popup.skip()
community_screen = main_screen.left_panel.select_community('Community with 2 users') 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 = community_screen.right_panel.click_member(user_three.name)
profile_popup.send_request().send(f'Hello {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'): with step(f'User {user_three.name}, accept contact request from {user_one.name} from user profile'):
aut_three.attach() aut_three.attach()
main_screen.prepare() main_screen.prepare()
if share_updates_popup.exists:
share_updates_popup.skip()
community_screen = main_screen.left_panel.select_community('Community with 2 users') 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 = community_screen.right_panel.click_member(user_one.name)
profile_popup.review_contact_request().accept() profile_popup.review_contact_request().accept()

View File

@ -7,6 +7,7 @@ import pytest
from allure_commons._allure import step from allure_commons._allure import step
import driver import driver
from gui.components.onboarding.share_usage_data_popup import ShareUsageDataPopup
from . import marks from . import marks
import configs.testpath 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] members = [user_two.name, user_three.name]
main_window = MainWindow() main_window = MainWindow()
messages_screen = MessagesScreen() messages_screen = MessagesScreen()
share_updates_popup = ShareUsageDataPopup()
with multiple_instances(user_data=user_data_one) as aut_one, multiple_instances( 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_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}'): with step(f'User {user_one.name}, start chat and add {members}'):
aut_one.attach() aut_one.attach()
main_window.prepare() main_window.prepare()
if share_updates_popup.exists:
share_updates_popup.skip()
main_window.left_panel.open_messages_screen() main_window.left_panel.open_messages_screen()
messages_screen.left_panel.start_chat().create_chat(members) 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}'): with step(f'Check group members and message for {user_two.name}'):
aut_two.attach() aut_two.attach()
main_window.prepare() 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, 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}' 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) 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}'): with step(f'Check group members and message for {user_three.name}'):
aut_three.attach() aut_three.attach()
main_window.prepare() 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'): 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, assert driver.waitFor(lambda: group_chat_new_name in messages_screen.left_panel.get_chats_names,