diff --git a/gui/components/community/create_community_popups.py b/gui/components/community/create_community_popups.py index 545ddb3..2a701a9 100644 --- a/gui/components/community/create_community_popups.py +++ b/gui/components/community/create_community_popups.py @@ -212,3 +212,18 @@ class CreateCommunityPopup(BasePopup): self._next_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() diff --git a/gui/main_window.py b/gui/main_window.py index 2f002fc..fe26f2e 100644 --- a/gui/main_window.py +++ b/gui/main_window.py @@ -206,7 +206,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') diff --git a/tests/communities/test_communities.py b/tests/communities/test_communities.py index ecd0028..5dad547 100644 --- a/tests/communities/test_communities.py +++ b/tests/communities/test_communities.py @@ -94,6 +94,9 @@ def test_create_community(user_account, main_screen: MainWindow, params): ]) @pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/13783") 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'], @@ -173,6 +176,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']) diff --git a/tests/communities/test_communities_categories.py b/tests/communities/test_communities_categories.py index e0707a6..15e95b2 100644 --- a/tests/communities/test_communities_categories.py +++ b/tests/communities/test_communities_categories.py @@ -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'], diff --git a/tests/communities/test_communities_channels.py b/tests/communities/test_communities_channels.py index 415a083..3d95f32 100644 --- a/tests/communities/test_communities_channels.py +++ b/tests/communities/test_communities_channels.py @@ -22,6 +22,10 @@ pytestmark = marks # @pytest.mark.critical TODO: https://github.com/status-im/desktop-qa-automation/issues/535 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'], diff --git a/tests/communities/test_communities_permissions.py b/tests/communities/test_communities_permissions.py index 637adec..398ddd8 100644 --- a/tests/communities/test_communities_permissions.py +++ b/tests/communities/test_communities_permissions.py @@ -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(), - configs.timeouts.UI_LOAD_TIMEOUT_MSEC) + 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']) diff --git a/tests/communities/test_communities_pin_and_unpin_messages.py b/tests/communities/test_communities_pin_and_unpin_messages.py index ef6566d..e075ab6 100644 --- a/tests/communities/test_communities_pin_and_unpin_messages.py +++ b/tests/communities/test_communities_pin_and_unpin_messages.py @@ -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']) diff --git a/tests/communities/test_communities_screens_overview.py b/tests/communities/test_communities_screens_overview.py index e5105da..49c42ea 100644 --- a/tests/communities/test_communities_screens_overview.py +++ b/tests/communities/test_communities_screens_overview.py @@ -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'], diff --git a/tests/online_identifier/test_online_identifier.py b/tests/online_identifier/test_online_identifier.py index 926496a..edabc4b 100644 --- a/tests/online_identifier/test_online_identifier.py +++ b/tests/online_identifier/test_online_identifier.py @@ -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'])