chore: edited tests with steps of creation community
This commit is contained in:
parent
0e1d0bc854
commit
56f8359296
|
@ -26,7 +26,7 @@ class AuthenticatePopup(BasePopup):
|
|||
def authenticate(self, password: str):
|
||||
self._password_text_edit.type_text(password)
|
||||
self._authenticate_button.click()
|
||||
self._authenticate_button.wait_until_hidden(8000)
|
||||
self._authenticate_button.wait_until_hidden(10000)
|
||||
|
||||
@allure.step('Close authenticate popup by close button')
|
||||
def close_authenticate_popup(self):
|
||||
|
|
|
@ -221,3 +221,18 @@ class CreateCommunityPopup(BasePopup):
|
|||
self._create_community_button.click()
|
||||
self.wait_until_hidden()
|
||||
return CommunityScreen().wait_until_appears()
|
||||
|
||||
@allure.step('Create simple community without verifications')
|
||||
def create_simple_community(self, name: str, description: str, intro: str, outro: str, logo, banner):
|
||||
self.set_name(name)
|
||||
self.set_description(description)
|
||||
self.set_logo_without_file_upload_dialog(logo)
|
||||
PictureEditPopup().set_zoom_shift_for_picture(None, None)
|
||||
self.set_banner_without_file_upload_dialog(banner)
|
||||
PictureEditPopup().set_zoom_shift_for_picture(None, None)
|
||||
self._next_button.click()
|
||||
self.set_intro(intro)
|
||||
self.set_outro(outro)
|
||||
self._create_community_button.click()
|
||||
self.wait_until_hidden()
|
||||
return CommunityScreen().wait_until_appears()
|
||||
|
|
|
@ -214,7 +214,7 @@ class MainWindow(Window):
|
|||
def create_community(self, name, description, intro, outro, logo, banner) -> CommunityScreen:
|
||||
communities_portal = self.left_panel.open_communities_portal()
|
||||
create_community_form = communities_portal.open_create_community_popup()
|
||||
app_screen = create_community_form.create_community(name, description, intro, outro, logo, banner)
|
||||
app_screen = create_community_form.create_simple_community(name, description, intro, outro, logo, banner)
|
||||
return app_screen
|
||||
|
||||
@allure.step('Wait for notification and get text')
|
||||
|
|
|
@ -90,6 +90,9 @@ def test_create_community(user_account, main_screen: MainWindow, params):
|
|||
}
|
||||
])
|
||||
def test_edit_community(main_screen: MainWindow, params):
|
||||
with step('Enable creation of community option'):
|
||||
settings = main_screen.left_panel.open_settings()
|
||||
settings.left_panel.open_advanced_settings().enable_creation_of_communities()
|
||||
community_params = constants.community_params
|
||||
main_screen.create_community(community_params['name'], community_params['description'],
|
||||
community_params['intro'], community_params['outro'],
|
||||
|
@ -169,6 +172,10 @@ def test_community_admin_kick_member_and_delete_message(multiple_instances):
|
|||
contacts_settings.accept_contact_request(user_one.name)
|
||||
|
||||
with step(f'User {user_two.name}, create community and invite {user_one.name}'):
|
||||
with step('Enable creation of community option'):
|
||||
settings = main_screen.left_panel.open_settings()
|
||||
settings.left_panel.open_advanced_settings().enable_creation_of_communities()
|
||||
|
||||
main_screen.create_community(community_params['name'], community_params['description'],
|
||||
community_params['intro'], community_params['outro'],
|
||||
community_params['logo']['fp'], community_params['banner']['fp'])
|
||||
|
|
|
@ -25,6 +25,9 @@ pytestmark = marks
|
|||
def test_create_edit_remove_community_category(main_screen: MainWindow, category_name, general_checkbox, channel_name,
|
||||
channel_description, channel_emoji, second_channel_name, second_channel_description,
|
||||
second_channel_emoji):
|
||||
with step('Enable creation of community option'):
|
||||
settings = main_screen.left_panel.open_settings()
|
||||
settings.left_panel.open_advanced_settings().enable_creation_of_communities()
|
||||
with step('Create community and select it'):
|
||||
community_params = constants.community_params
|
||||
main_screen.create_community(community_params['name'], community_params['description'],
|
||||
|
@ -114,6 +117,10 @@ def test_member_role_cannot_add_edit_or_delete_category(main_screen: MainWindow)
|
|||
@pytest.mark.parametrize('category_name, general_checkbox',
|
||||
[pytest.param('Category in general', True)])
|
||||
def test_clicking_community_category(main_screen: MainWindow, category_name, general_checkbox):
|
||||
with step('Enable creation of community option'):
|
||||
settings = main_screen.left_panel.open_settings()
|
||||
settings.left_panel.open_advanced_settings().enable_creation_of_communities()
|
||||
|
||||
with step('Create community and select it'):
|
||||
community_params = constants.community_params
|
||||
main_screen.create_community(community_params['name'], community_params['description'],
|
||||
|
|
|
@ -22,6 +22,10 @@ pytestmark = marks
|
|||
# @pytest.mark.critical TODO: https://github.com/status-im/desktop-qa-automation/issues/658
|
||||
def test_create_edit_remove_community_channel(main_screen, channel_name, channel_description, channel_emoji, channel_emoji_image,
|
||||
channel_color, new_channel_name, new_channel_description, new_channel_emoji):
|
||||
with step('Enable creation of community option'):
|
||||
settings = main_screen.left_panel.open_settings()
|
||||
settings.left_panel.open_advanced_settings().enable_creation_of_communities()
|
||||
|
||||
with step('Create simple community'):
|
||||
community_params = constants.community_params
|
||||
main_screen.create_community(community_params['name'], community_params['description'],
|
||||
|
|
|
@ -21,6 +21,10 @@ pytestmark = marks
|
|||
@pytest.mark.case(703632, 705014, 705016)
|
||||
@pytest.mark.parametrize('params', [constants.community_params])
|
||||
def test_add_edit_and_remove_permissions(main_screen: MainWindow, params):
|
||||
with step('Enable creation of community option'):
|
||||
settings = main_screen.left_panel.open_settings()
|
||||
settings.left_panel.open_advanced_settings().enable_creation_of_communities()
|
||||
|
||||
main_screen.create_community(params['name'], params['description'],
|
||||
params['intro'], params['outro'],
|
||||
params['logo']['fp'], params['banner']['fp'])
|
||||
|
@ -92,8 +96,10 @@ def test_add_edit_and_remove_permissions(main_screen: MainWindow, params):
|
|||
with step('Create new permission'):
|
||||
permissions_settings = permissions_intro_view.add_new_permission()
|
||||
permissions_settings.set_who_holds_checkbox_state(permission_data[index]['checkbox_state'])
|
||||
permissions_settings.set_who_holds_asset_and_amount(permission_data[index]['first_asset'], permission_data[index]['amount'])
|
||||
permissions_settings.set_who_holds_asset_and_amount(permission_data[index]['second_asset'], permission_data[index]['amount'])
|
||||
permissions_settings.set_who_holds_asset_and_amount(permission_data[index]['first_asset'],
|
||||
permission_data[index]['amount'])
|
||||
permissions_settings.set_who_holds_asset_and_amount(permission_data[index]['second_asset'],
|
||||
permission_data[index]['amount'])
|
||||
permissions_settings.set_is_allowed_to(permission_data[index]['allowed_to'])
|
||||
permissions_settings.set_in(permission_data[index]['in_channel'])
|
||||
permissions_settings.create_permission()
|
||||
|
@ -106,25 +112,30 @@ def test_add_edit_and_remove_permissions(main_screen: MainWindow, params):
|
|||
|
||||
with step('Created permission is displayed on permission page'):
|
||||
if permission_data[index]['asset_title'] is not False:
|
||||
assert driver.waitFor(lambda: permission_data[index]['asset_title'] in permissions_settings.get_who_holds_tags_titles(),
|
||||
assert driver.waitFor(
|
||||
lambda: permission_data[index]['asset_title'] in permissions_settings.get_who_holds_tags_titles(),
|
||||
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
|
||||
if permission_data[index]['second_asset_title'] is not False:
|
||||
assert driver.waitFor(lambda: permission_data[index]['second_asset_title'] in permissions_settings.get_who_holds_tags_titles(),
|
||||
assert driver.waitFor(lambda: permission_data[index][
|
||||
'second_asset_title'] in permissions_settings.get_who_holds_tags_titles(),
|
||||
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
|
||||
if permission_data[index]['allowed_to_title'] is not False:
|
||||
assert driver.waitFor(lambda: permission_data[index]['allowed_to_title'] in permissions_settings.get_is_allowed_tags_titles(),
|
||||
assert driver.waitFor(lambda: permission_data[index][
|
||||
'allowed_to_title'] in permissions_settings.get_is_allowed_tags_titles(),
|
||||
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
|
||||
if permission_data[index]['in_channel'] is False:
|
||||
assert driver.waitFor(
|
||||
lambda: params['name'] in permissions_settings.get_in_community_in_channel_tags_titles(),
|
||||
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
|
||||
if permission_data[index]['in_channel']:
|
||||
assert driver.waitFor(lambda: permission_data[index]['in_channel'] in permissions_settings.get_in_community_in_channel_tags_titles(),
|
||||
assert driver.waitFor(lambda: permission_data[index][
|
||||
'in_channel'] in permissions_settings.get_in_community_in_channel_tags_titles(),
|
||||
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
|
||||
|
||||
with step('Edit permission'):
|
||||
edit_permission_view = permissions_intro_view.open_edit_permission_view()
|
||||
if permission_data[index]['allowed_to'] is 'becomeAdmin' and permission_data[index]['checkbox_state'] is True:
|
||||
if permission_data[index]['allowed_to'] is 'becomeAdmin' and permission_data[index][
|
||||
'checkbox_state'] is True:
|
||||
permissions_settings.set_who_holds_checkbox_state(False)
|
||||
elif permission_data[index]['checkbox_state'] is False:
|
||||
permissions_settings.set_allowed_to_from_permission('becomeMember')
|
||||
|
@ -135,13 +146,16 @@ def test_add_edit_and_remove_permissions(main_screen: MainWindow, params):
|
|||
|
||||
with step('Confirm changes and verify that permission was changed'):
|
||||
changes_popup.update_permission()
|
||||
if permission_data[index]['allowed_to'] is 'becomeAdmin' and permission_data[index]['checkbox_state'] is True:
|
||||
if permission_data[index]['allowed_to'] is 'becomeAdmin' and permission_data[index][
|
||||
'checkbox_state'] is True:
|
||||
if permission_data[index]['asset_title'] is not False:
|
||||
assert driver.waitFor(lambda: permission_data[index]['asset_title'] not in permissions_settings.get_who_holds_tags_titles(),
|
||||
assert driver.waitFor(lambda: permission_data[index][
|
||||
'asset_title'] not in permissions_settings.get_who_holds_tags_titles(),
|
||||
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
|
||||
if permission_data[index]['second_asset_title'] is not False:
|
||||
assert driver.waitFor(
|
||||
lambda: permission_data[index]['second_asset_title'] not in permissions_settings.get_who_holds_tags_titles(),
|
||||
lambda: permission_data[index][
|
||||
'second_asset_title'] not in permissions_settings.get_who_holds_tags_titles(),
|
||||
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
|
||||
elif permission_data[index]['checkbox_state'] is False:
|
||||
assert driver.waitFor(lambda: 'Become member' in permissions_settings.get_is_allowed_tags_titles(),
|
||||
|
@ -170,6 +184,10 @@ def test_add_edit_and_remove_permissions(main_screen: MainWindow, params):
|
|||
|
||||
@pytest.mark.parametrize('params', [constants.community_params])
|
||||
def test_add_5_member_role_permissions(main_screen: MainWindow, params):
|
||||
with step('Enable creation of community option'):
|
||||
settings = main_screen.left_panel.open_settings()
|
||||
settings.left_panel.open_advanced_settings().enable_creation_of_communities()
|
||||
|
||||
main_screen.create_community(params['name'], params['description'],
|
||||
params['intro'], params['outro'],
|
||||
params['logo']['fp'], params['banner']['fp'])
|
||||
|
|
|
@ -66,6 +66,9 @@ def test_join_community_and_pin_unpin_message(multiple_instances):
|
|||
contacts_settings.accept_contact_request(user_one.name)
|
||||
|
||||
with step(f'User {user_two.name}, create community and invite {user_one.name}'):
|
||||
with step('Enable creation of community option'):
|
||||
settings = main_screen.left_panel.open_settings()
|
||||
settings.left_panel.open_advanced_settings().enable_creation_of_communities()
|
||||
main_screen.create_community(community_params['name'], community_params['description'],
|
||||
community_params['intro'], community_params['outro'],
|
||||
community_params['logo']['fp'], community_params['banner']['fp'])
|
||||
|
|
|
@ -20,6 +20,9 @@ pytestmark = marks
|
|||
@pytest.mark.case(703198, 703199, 703200)
|
||||
@pytest.mark.parametrize('params', [constants.community_params])
|
||||
def test_manage_community_screens_overview(main_screen: MainWindow, params):
|
||||
with step('Enable creation of community option'):
|
||||
settings = main_screen.left_panel.open_settings()
|
||||
settings.left_panel.open_advanced_settings().enable_creation_of_communities()
|
||||
with step('Create community'):
|
||||
main_screen.create_community(params['name'], params['description'],
|
||||
params['intro'], params['outro'],
|
||||
|
|
|
@ -83,6 +83,9 @@ def test_switch_state_to_offline_online_automatic(multiple_instances):
|
|||
contacts_settings.accept_contact_request(user_one.name)
|
||||
|
||||
with step(f'User {user_two.name}, create community and invite {user_one.name}'):
|
||||
with step('Enable creation of community option'):
|
||||
settings = main_screen.left_panel.open_settings()
|
||||
settings.left_panel.open_advanced_settings().enable_creation_of_communities()
|
||||
main_screen.create_community(community_params['name'], community_params['description'],
|
||||
community_params['intro'], community_params['outro'],
|
||||
community_params['logo']['fp'], community_params['banner']['fp'])
|
||||
|
|
Loading…
Reference in New Issue