From b45cc15e32ad6ab0c55b1f7be268cd7815b07800 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Mon, 27 Mar 2023 15:24:41 -0400 Subject: [PATCH] fix(community-tests): fix edit and delete category tests --- src/app_service/service/community/service.nim | 2 +- test/ui-test/src/screens/StatusCommunityScreen.py | 8 +++++--- .../suite_communities/tst_communityFlows/test.feature | 4 ---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/app_service/service/community/service.nim b/src/app_service/service/community/service.nim index ef886adf55..fa728cd065 100644 --- a/src/app_service/service/community/service.nim +++ b/src/app_service/service/community/service.nim @@ -1269,7 +1269,7 @@ QtObject: # Update communities objects let updatedCommunity = response.result["communities"][0].toCommunityDto - + self.checkForCategoryPropertyUpdates( updatedCommunity, self.communities[communityId] diff --git a/test/ui-test/src/screens/StatusCommunityScreen.py b/test/ui-test/src/screens/StatusCommunityScreen.py index b6be5ce6d1..9f8486b965 100644 --- a/test/ui-test/src/screens/StatusCommunityScreen.py +++ b/test/ui-test/src/screens/StatusCommunityScreen.py @@ -112,7 +112,7 @@ class StatusCommunityScreen: chat_and_category_list = get_obj(CommunityScreenComponents.CHAT_LIST.value) for i in range(chat_and_category_list.count): chat_or_cat_loader = chat_and_category_list.itemAtIndex(i) - if chat_or_cat_loader.item.objectName != "categoryItem": + if not chat_or_cat_loader or chat_or_cat_loader.item.objectName != "categoryItem": continue if str(chat_or_cat_loader.item.title).lower() == community_category_name.lower(): return True, chat_or_cat_loader.item @@ -227,13 +227,15 @@ class StatusCommunityScreen: verify(loaded, "Finding category: " + community_category_name) # For some reason it clicks on a first channel in category instead of category - click_obj(category.chatListCategory.statusChatListCategoryItem) - right_click_obj(category.chatListCategory.statusChatListCategoryItem) + click_obj(category) + right_click_obj(category) click_obj_by_name(CommunityScreenComponents.COMMUNITY_DELETE_CATEGORY_MENU_ITEM.value) click_obj_by_name(CommunityScreenComponents.COMMUNITY_CONFIRM_DELETE_CATEGORY_BUTTON.value) def verify_category_name_missing(self, community_category_name): + # Make sure the event was propagated + time.sleep(0.2) [result, _] = self._find_category_in_chat(community_category_name) verify_false(result, "Category " + community_category_name + " still exist") diff --git a/test/ui-test/testSuites/suite_communities/tst_communityFlows/test.feature b/test/ui-test/testSuites/suite_communities/tst_communityFlows/test.feature index e114c602b6..f920f91845 100644 --- a/test/ui-test/testSuites/suite_communities/tst_communityFlows/test.feature +++ b/test/ui-test/testSuites/suite_communities/tst_communityFlows/test.feature @@ -59,8 +59,6 @@ Feature: Status Desktop community | test-channel-1 | test-category-1 | bottom_menu | | test-channel-2 | test-category-2 | right_click_menu | - @mayfail - # TODO: It works standalone. There is an issue with the background sequence. Community Portal is not clicked sometimes. Scenario: The admin edits a community category Given the admin creates a community channel named "test-channel", with description "My description", with the method "bottom_menu" And the admin creates a community category named "test-category", with channels "test-channel" and with the method "bottom_menu" @@ -69,8 +67,6 @@ Feature: Status Desktop community Then the category named "new-test-category" contains channels "general" And the category named "test-category" is missing - @mayfail - # TODO: It works standalone. There is an issue with the background sequence. Community Portal is not clicked sometimes. Scenario: The admin deletes a community category Given the admin creates a community channel named "test-channel", with description "My description", with the method "bottom_menu" And the admin creates a community category named "test-category", with channels "test-channel" and with the method "bottom_menu"