fix(community-tests): fix edit and delete category tests

This commit is contained in:
Jonathan Rainville 2023-03-27 15:24:41 -04:00
parent 75571c9f22
commit b45cc15e32
3 changed files with 6 additions and 8 deletions

View File

@ -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")

View File

@ -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"