11import time
22
3- import allure
43import pytest
54from allure_commons ._allure import step
65
76import driver
8- from configs import get_platform
97from constants import UserAccount , RandomUser , RandomCommunity , CommunityData
108from constants .community import ToastMessages
119from gui .screens .community import MembersListPanel
1715
1816@pytest .mark .case (703252 , 703252 , 736991 )
1917@pytest .mark .communities
20- @ pytest . mark . skipif ( get_platform () != 'Windows' , reason = 'Does not work on Linux anymore, needs investigation' )
18+ # TODO: investigate the reason of failures on CI https://github.com/status-im/status-desktop/issues/19284
2119def test_community_admin_ban_kick_member_and_delete_message (multiple_instances ):
2220 user_one : UserAccount = RandomUser ()
2321 user_two : UserAccount = RandomUser ()
@@ -32,9 +30,11 @@ def test_community_admin_ban_kick_member_and_delete_message(multiple_instances):
3230
3331 with step (f'User { user_two .name } , get chat key' ):
3432 chat_key = get_chat_key (aut_two , main_screen )
33+ main_screen .minimize ()
3534
3635 with step (f'User { user_one .name } , send contact request to { user_two .name } ' ):
3736 send_contact_request_from_settings (aut_one , main_screen , chat_key , f'Hello { user_two .name } ' )
37+ main_screen .minimize ()
3838
3939 with step (f'User { user_two .name } , accept contact request from { user_one .name } ' ):
4040 accept_contact_request_from_settings (aut_two , main_screen , user_one .name )
@@ -44,7 +44,7 @@ def test_community_admin_ban_kick_member_and_delete_message(multiple_instances):
4444 community_screen = main_screen .left_panel .select_community (community .name )
4545 add_members = community_screen .left_panel .open_add_members_popup ()
4646 add_members .invite ([user_one .name ], message = random_text_message ())
47- main_screen .hide ()
47+ main_screen .minimize ()
4848
4949
5050 with step (f'User { user_one .name } , accept invitation from { user_two .name } ' ):
@@ -62,7 +62,7 @@ def test_community_admin_ban_kick_member_and_delete_message(multiple_instances):
6262 welcome_popup .join ().authenticate (user_one .password )
6363 assert driver .waitFor (lambda : not community_screen .left_panel .is_join_community_visible ,
6464 10000 ), 'Join community button not hidden'
65- main_screen .hide ()
65+ main_screen .minimize ()
6666
6767 with step (f'User { user_two .name } , ban { user_one .name } from the community' ):
6868 switch_to_aut (aut_two , main_screen )
@@ -82,7 +82,7 @@ def test_community_admin_ban_kick_member_and_delete_message(multiple_instances):
8282 with step (f'User { user_two .name } , see { user_one .name } in banned members list' ):
8383 community_screen .right_panel .click_banned_button ()
8484 assert driver .waitFor (lambda : user_one .name not in members_list , timeout )
85- main_screen .hide ()
85+ main_screen .minimize ()
8686
8787 with step (f'User { user_one .name } tries to join community when being banned by { user_two .name } ' ):
8888 switch_to_aut (aut_one , main_screen )
@@ -92,7 +92,7 @@ def test_community_admin_ban_kick_member_and_delete_message(multiple_instances):
9292 assert banned_community_screen .banned_title () == f"You've been banned from { community .name } "
9393 main_screen .left_panel .open_community_context_menu (community .name ).leave_community_option .click ()
9494 # TODO: think of better check here assert not main_screen.left_panel.communities()
95- main_screen .hide ()
95+ main_screen .minimize ()
9696
9797
9898 with step (f'User { user_two .name } , unban { user_one .name } in banned members list' ):
@@ -101,7 +101,7 @@ def test_community_admin_ban_kick_member_and_delete_message(multiple_instances):
101101 # toast_messages = main_screen.wait_for_toast_notifications()
102102 # assert user_one.name + ToastMessages.UNBANNED_USER_TOAST.value + community.name in toast_messages, \
103103 # f"{user_one.name + ToastMessages.UNBANNED_USER_TOAST.value + community.name} is not found in {toast_messages}"
104- main_screen .hide ()
104+ main_screen .minimize ()
105105
106106 with step (f'User { user_one .name } joins community again' ):
107107 switch_to_aut (aut_one , main_screen )
@@ -121,7 +121,7 @@ def test_community_admin_ban_kick_member_and_delete_message(multiple_instances):
121121 welcome_popup .join ().authenticate (user_one .password )
122122 assert driver .waitFor (lambda : not community_screen .left_panel .is_join_community_visible ,
123123 10000 ), 'Join community button not hidden'
124- main_screen .hide ()
124+ main_screen .minimize ()
125125
126126 with step (f'User { user_two .name } , kick { user_one .name } from the community' ):
127127 switch_to_aut (aut_two , main_screen )
@@ -136,7 +136,7 @@ def test_community_admin_ban_kick_member_and_delete_message(multiple_instances):
136136
137137 with step (f'User { user_two .name } , does not see { user_one .name } in members list' ):
138138 assert driver .waitFor (lambda : user_one .name not in community_screen .right_panel .members , timeout )
139- main_screen .hide ()
139+ main_screen .minimize ()
140140
141141 with step (f'User { user_one .name } can rejoin community after being kicked' ):
142142 switch_to_aut (aut_one , main_screen )
0 commit comments