test(suite_communities): Created `bdd_hook` for each `suite_communities` test case

- Created `bdd_hooks` that contain the sing up steps just only once in the feature start and the needed start steps depending on the test case.

- Updated feature files removing sign up steps and given/when/then reorganization.

- Done some cleanups and reorganization in `communitySteps.py` and `searchSteps.py`.

Closes #7955
This commit is contained in:
Noelia 2022-10-25 14:44:28 +02:00 committed by Noelia
parent 57e80255bf
commit fa265b5e79
20 changed files with 481 additions and 293 deletions

View File

@ -34,7 +34,6 @@ class CommunityScreenComponents(Enum):
COMMUNITY_EDIT_CATEGORY_MENU_ITEM = "edit_сategory_StatusMenuItemDelegate"
COMMUNITY_DELETE_CATEGORY_MENU_ITEM = "delete_сategory_StatusMenuItemDelegate"
COMMUNITY_CONFIRM_DELETE_CATEGORY_BUTTON = "confirmDeleteCategoryButton_StatusButton"
CHAT_IDENTIFIER_CHANNEL_NAME = "msgDelegate_channelIdentifierNameText_StyledText"
CHAT_IDENTIFIER_CHANNEL_ICON = "mainWindow_chatInfoBtnInHeader_StatusChatInfoButton"
CHAT_MORE_OPTIONS_BUTTON = "chat_moreOptions_menuButton"
EDIT_CHANNEL_MENU_ITEM = "edit_Channel_StatusMenuItemDelegate"
@ -146,10 +145,6 @@ class StatusCommunityScreen:
click_obj_by_name(CreateOrEditCommunityChannelPopup.COMMUNITY_CHANNEL_SAVE_OR_CREATE_BUTTON.value)
# TODO check if this function is needed, it seems to do the same as verify_chat_title in StatusChatScreen
def verify_channel_name(self, community_channel_name: str):
verify_text_matching(CommunityScreenComponents.CHAT_IDENTIFIER_CHANNEL_NAME.value, community_channel_name)
def edit_community_channel(self, new_community_channel_name: str):
self._open_edit_channel_popup()
@ -256,7 +251,6 @@ class StatusCommunityScreen:
def check_channel_count(self, count_to_check: int):
chatListObj = get_obj(CommunityScreenComponents.NOT_CATEGORIZED_CHAT_LIST.value)
# Squish doesn't follow the type hints when parsing gherkin values
verify_equals(chatListObj.statusChatListItems.count, int(count_to_check))
def search_and_change_community_channel_emoji(self, emoji_description: str):

View File

@ -4,7 +4,7 @@
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../testSuites/global_shared/"))
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../src/"))
from steps.startupSteps import *
from steps.startupSteps import context_init
@OnScenarioStart
def hook(context):

View File

@ -38,6 +38,7 @@ chatView_StatusChatInfoButton = {"container": statusDesktop_mainWindow, "objectN
chatInfoButton_Pin_Text = {"container": chatView_StatusChatInfoButton, "objectName": "StatusChatInfo_pinText", "type": "StatusBaseText", "visible": True}
joinPublicChat_input = {"container": statusDesktop_mainWindow_overlay, "objectName": "joinPublicChannelInput", "type": "TextEdit", "visible": True}
startChat_Btn = {"container": statusDesktop_mainWindow_overlay, "objectName": "startChatButton", "type": "StatusButton"}
navBarListView_Chat_navbar_StatusNavBarTabButton = {"checkable": True, "container": mainWindow_navBarListView_ListView, "objectName": "Chat-navbar", "type": "StatusNavBarTabButton", "visible": True}
# My Profile Popup
ProfileHeader_userImage = {"container": statusDesktop_mainWindow_overlay, "objectName": "ProfileHeader_userImage", "type": "UserImage", "visible": True}

View File

@ -6,6 +6,8 @@ from common.Common import *
from screens.StatusWelcomeScreen import StatusWelcomeScreen
from screens.StatusMainScreen import StatusMainScreen
from screens.StatusChatScreen import StatusChatScreen
from screens.StatusCommunityPortalScreen import StatusCommunityPortalScreen
from screens.StatusCommunityScreen import StatusCommunityScreen
# Project settings properties:
_status_desktop_app_name = "nim_status_client"
@ -21,11 +23,6 @@ _status_data_folder = "status_data_folder_path"
_fixtures_root = "fixtures_root"
_search_images = "search_images"
_scenario_name = "scenario_name"
# Test static objects creation:
_welcome_screen = StatusWelcomeScreen()
_main_screen = StatusMainScreen()
_chat_screen = StatusChatScreen()
def context_init(context):
erase_directory(_status_qt_path)
@ -54,28 +51,57 @@ def context_init(context):
def given_a_first_time_user_lands_on_and_generates_new_key(context):
erase_directory(context.userData[_status_data_folder])
start_application(context.userData[_aut_name])
_welcome_screen.agree_terms_conditions_and_generate_new_key()
welcome_screen = StatusWelcomeScreen()
welcome_screen.agree_terms_conditions_and_generate_new_key()
def given_a_first_time_user_lands_on_and_navigates_to_import_seed_phrase(context):
erase_directory(context.userData[_status_data_folder])
start_application(context.userData[_aut_name])
_welcome_screen.agree_terms_conditions_and_navigate_to_import_seed_phrase()
welcome_screen = StatusWelcomeScreen()
welcome_screen.agree_terms_conditions_and_navigate_to_import_seed_phrase()
def when_the_user_signs_up(user, password):
_welcome_screen = StatusWelcomeScreen()
_welcome_screen.input_username_and_password_and_finalize_sign_up(user, password)
welcome_screen = StatusWelcomeScreen()
welcome_screen.input_username_and_password_and_finalize_sign_up(user, password)
def when_the_user_lands_on_the_signed_in_app():
_main_screen.is_ready()
main_screen = StatusMainScreen()
main_screen.is_ready()
def signs_up_process_steps(context, user, password):
given_a_first_time_user_lands_on_and_generates_new_key(context)
when_the_user_signs_up(user, password)
when_the_user_lands_on_the_signed_in_app()
def when_the_user_joins_chat_room(_chat_room):
_main_screen.join_chat_room(_chat_room)
_chat_screen.verify_chat_title(_chat_room)
def when_the_user_joins_chat_room(_chat_room):
main_screen = StatusMainScreen()
main_screen.join_chat_room(_chat_room)
chat_screen = StatusChatScreen()
chat_screen.verify_chat_title(_chat_room)
def when_the_user_opens_the_chat_section():
_main_screen.open_chat_section()
def when_the_user_opens_the_chat_section():
main_screen = StatusMainScreen()
main_screen.open_chat_section()
def the_user_opens_the_community_portal_section():
main_screen = StatusMainScreen()
main_screen.open_community_portal()
def the_user_lands_on_the_community_portal_section():
StatusCommunityPortalScreen()
def the_user_creates_a_community(name: str, description: str, intro: str, outro: str):
communitity_portal_screen = StatusCommunityPortalScreen()
communitity_portal_screen.create_community(name, description, intro, outro)
def the_user_lands_on_the_community(name: str):
community_screen = StatusCommunityScreen()
community_screen.verify_community_name(name)
def the_admin_creates_a_community_channel(name: str, description: str, method: str):
community_screen = StatusCommunityScreen()
community_screen.create_community_channel(name, description, method)
def the_channel_is_open(name: str):
chat_screen = StatusChatScreen()
chat_screen.verify_chat_title(name)

View File

@ -37,6 +37,10 @@ def step(context, data_folder_path):
def step(context):
the_user_restarts_the_app(context)
@Given("the user joins chat room \"|any|\"")
def step(context, room):
the_user_joins_chat_room(room)
#########################
### ACTIONS region:
#########################
@ -55,7 +59,7 @@ def step(context, obj):
@When("the user joins chat room \"|any|\"")
def step(context, room):
when_the_user_joins_chat_room(room)
the_user_joins_chat_room(room)
#########################
### VERIFICATIONS region:
@ -72,4 +76,7 @@ def step(context, obj):
def the_user_restarts_the_app(context: any):
waitFor(lambda: currentApplicationContext().detach(), 500)
time.sleep(5)
startApplication(context.userData["aut_name"])
startApplication(context.userData["aut_name"])
def the_user_joins_chat_room(room: str):
when_the_user_joins_chat_room(room)

View File

@ -12,13 +12,13 @@ delete_сategory_StatusMenuItemDelegate = {"container": statusDesktop_mainWindow
confirmDeleteCategoryButton_StatusButton = {"container": statusDesktop_mainWindow, "objectName": "confirmDeleteCategoryButton", "type": "StatusButton"}
chat_moreOptions_menuButton = {"container": statusDesktop_mainWindow, "objectName": "chatToolbarMoreOptionsButton", "type": "StatusFlatRoundButton", "visible": True}
edit_Channel_StatusMenuItemDelegate = {"container": statusDesktop_mainWindow_overlay, "enabled": True, "objectName": "editChannelMenuItem", "type": "StatusMenuItemDelegate", "visible": True}
msgDelegate_channelIdentifierNameText_StyledText = {"container": chatMessageListView_msgDelegate_MessageView, "objectName": "channelIdentifierNameText", "type": "StyledText", "visible": True}
delete_Channel_StatusMenuItemDelegate = {"container": statusDesktop_mainWindow_overlay, "enabled": True, "objectName": "deleteOrLeaveMenuItem", "type": "StatusMenuItemDelegate", "visible": True}
mainWindow_communityColumnView_statusChatList = {"container": mainWindow_communityColumnView_CommunityColumnView, "objectName": "statusChatListAndCategoriesChatList", "type": "StatusChatList"}
delete_Channel_ConfirmationDialog_DeleteButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "deleteChatConfirmationDialogDeleteButton", "type": "StatusButton"}
mainWindow_chatInfoBtnInHeader_StatusChatInfoButton = {"container": statusDesktop_mainWindow, "objectName": "chatInfoBtnInHeader", "type": "StatusChatInfoButton", "visible": True}
communityChatListCategories_Repeater = {"container": statusDesktop_mainWindow, "objectName": "communityChatListCategories", "type": "Repeater"}
chatInput_Root = {"container": statusDesktop_mainWindow, "objectName": "statusChatInput", "type": "Rectangle", "visible": True}
emojiPopup_Emoji_Button_Placeholder = {"container": statusDesktop_mainWindow, "objectName": "statusEmoji_%NAME%", "type": "StatusEmoji", "visible": True}
# Community channel popup:
createOrEditCommunityChannelNameInput_TextEdit = {"container": statusDesktop_mainWindow_overlay, "objectName": "createOrEditCommunityChannelNameInput", "type": "TextEdit", "visible": True}

View File

@ -1,4 +1,4 @@
import steps.startupSteps as init_steps
from screens.StatusMainScreen import StatusMainScreen
from screens.StatusCommunityPortalScreen import StatusCommunityPortalScreen
from screens.StatusCommunityScreen import StatusCommunityScreen
@ -7,118 +7,181 @@ _statusCommunityScreen = StatusCommunityScreen()
_statusCommunitityPortal = StatusCommunityPortalScreen()
_statusMainScreen = StatusMainScreen()
@When("the user opens the community portal section")
#########################
### PRECONDITIONS region:
#########################
@Given("the user opens the community portal section")
def step(context: any):
_statusMainScreen.open_community_portal()
init_steps.the_user_opens_the_community_portal_section()
@Then("the user lands on the community portal section")
@Given("the user lands on the community portal section")
def step(context):
StatusCommunityPortalScreen()
@When("the user creates a community named |any|, with description |any|, intro |any| and outro |any|")
def step(context, community_name, community_description, community_intro, community_outro):
_statusCommunitityPortal.create_community(community_name, community_description, community_intro, community_outro)
@Then("the user lands on the community named |any|")
def step(context, community_name):
StatusCommunityScreen()
_statusCommunityScreen.verify_community_name(community_name)
@When("the admin creates a community channel named |any|, with description |any| with the method |any|")
def step(context, community_channel_name, community_channel_description, method):
_statusCommunityScreen.create_community_channel(community_channel_name, community_channel_description, method)
@When("the admin edits the current community channel to the name |any|")
def step(context, new_community_channel_name):
_statusCommunityScreen.edit_community_channel(new_community_channel_name)
init_steps.the_user_lands_on_the_community_portal_section()
@Then("the user lands on the channel named |any|")
@Given("the user creates a community named \"|any|\", with description \"|any|\", intro \"|any|\" and outro \"|any|\"")
def step(context: any, community_name: str, community_description: str, community_intro: str, community_outro: str):
the_user_creates_a_community(community_name, community_description, community_intro, community_outro)
@Given("the admin creates a community channel named \"|any|\", with description \"|any|\", with the method \"|any|\"")
def step(context, community_channel_name, community_channel_description, method):
the_admin_creates_a_community_channel(community_channel_name, community_channel_description, method)
@Given("the user lands on the community named \"|any|\"")
def step(context: any, community_name: str):
the_user_lands_on_the_community(community_name)
@Given("the channel named \"|any|\" is open")
def step(context, community_channel_name):
_statusCommunityScreen.verify_channel_name(community_channel_name)
the_channel_is_open(community_channel_name)
@Given("the channel count is |integer|")
def step(context, community_channel_count: int):
the_channel_count_is(community_channel_count)
@Given("the admin creates a community category named \"|any|\", with channels \"|any|\" and with the method \"|any|\"")
def step(context, category_name, channel_names, method):
the_admin_creates_a_community_category(category_name, channel_names, method)
@Given("the category named \"|any|\" contains channels \"|any|\"")
def step(context, category_name, channel_names):
the_category_contains_channels(category_name, channel_names)
@When("the admin creates a community category named |any|, with channels |any| and with the method |any|")
def step(context, community_category_name, community_channel_names, method):
_statusCommunityScreen.create_community_category(community_category_name, community_channel_names, method)
@When("the admin edits category named |any| to the name |any| and channels |any|")
#########################
### ACTIONS region:
#########################
@When("the user sends a test image in the current channel")
def step(context):
_statusCommunityScreen.send_test_image(context.userData["fixtures_root"], False, "")
@When("the user sends a test image in the current channel with message \"|any|\" with an image")
def step(context, message):
_statusCommunityScreen.send_test_image(context.userData["fixtures_root"], False, message)
@When("the user sends multiple test images in the current channel with message \"|any|\" with an image again")
def step(context, message):
_statusCommunityScreen.send_test_image(context.userData["fixtures_root"], True, message)
@When("the user pins the message at index |integer|")
def step(context, message_index: int):
_statusCommunityScreen.toggle_pin_message_at_index(message_index)
@When("the user unpins the message at index |integer|")
def step(context, message_index: int):
_statusCommunityScreen.toggle_pin_message_at_index(message_index)
@When("the user creates a community named \"|any|\", with description \"|any|\", intro \"|any|\" and outro \"|any|\"")
def step(context: any, community_name: str, community_description: str, community_intro: str, community_outro: str):
the_user_creates_a_community(community_name, community_description, community_intro, community_outro)
@When("the admin creates a community channel named \"|any|\", with description \"|any|\", with the method \"|any|\"")
def step(context, community_channel_name, community_channel_description, method):
the_admin_creates_a_community_channel(community_channel_name, community_channel_description, method)
@When("the admin edits the current community channel to the name \"|any|\"")
def step(context, new_community_channel_name):
_statusCommunityScreen.edit_community_channel(new_community_channel_name)
@When("the admin creates a community category named \"|any|\", with channels \"|any|\" and with the method \"|any|\"")
def step(context, category_name, channel_names, method):
the_admin_creates_a_community_category(category_name, channel_names, method)
@When("the admin renames the category \"|any|\" to \"|any|\" and toggles the channels \"|any|\"")
def step(context, community_category_name, new_community_category_name, community_channel_names):
_statusCommunityScreen.edit_community_category(community_category_name, new_community_category_name, community_channel_names)
_statusCommunityScreen.edit_community_category(community_category_name, new_community_category_name, community_channel_names)
@When("the admin deletes category named |any|")
@When("the admin deletes category named \"|any|\"")
def step(context, community_category_name):
_statusCommunityScreen.delete_community_category(community_category_name)
@Then("the category named |any| is missing")
def step(context, community_category_name):
_statusCommunityScreen.verify_category_name_missing(community_category_name)
@Then("the category named |any| has channels |any|")
def step(context, community_category_name, community_channel_names):
_statusCommunityScreen.verify_category_contains_channels(community_category_name, community_channel_names)
@When("the admin edits the current community to the name |any| and description |any| and color |any|")
_statusCommunityScreen.delete_community_category(community_category_name)
@When("the admin renames the community to \"|any|\" and description to \"|any|\" and color to \"|any|\"")
def step(context, new_community_name, new_community_description, new_community_color):
_statusCommunityScreen.edit_community(new_community_name, new_community_description, new_community_color)
@When("the admin goes back to the community")
def step(context):
_statusCommunityScreen.go_back_to_community()
@When("the admin changes the current community channel emoji to \"|any|\"")
def step(context, emoji_description: str):
_statusCommunityScreen.search_and_change_community_channel_emoji(emoji_description)
@When("the admin deletes current channel")
def step(context):
_statusCommunityScreen.delete_current_community_channel()
@Then("the channel count is |any|")
def step(context, community_channel_count: int):
_statusCommunityScreen.check_channel_count(community_channel_count)
@Then("the count of communities in navbar is |any|")
#########################
### VERIFICATIONS region:
#########################
@Then("the user lands on the community named \"|any|\"")
def step(context: any, community_name: str):
the_user_lands_on_the_community(community_name)
@Then("the channel named \"|any|\" is open")
def step(context, community_channel_name):
the_channel_is_open(community_channel_name)
@Then("the amount of pinned messages is |integer|")
def step(context, amount: int):
_statusCommunityScreen.check_pin_count(amount)
@Then("the channel count is |integer|")
def step(context, community_channel_count: int):
the_channel_count_is(community_channel_count)
@Then("the category named \"|any|\" contains channels \"|any|\"")
def step(context, category_name, channel_names):
the_category_contains_channels(category_name, channel_names)
@Then("the category named \"|any|\" is missing")
def step(context, category_name):
_statusCommunityScreen.verify_category_name_missing(category_name)
@Then("the community channel has emoji \"|any|\"")
def step(context, emoji: str):
_statusCommunityScreen.check_community_channel_emoji(emoji)
@Then("the count of communities in navbar is |integer|")
def step(context: any, expected_count: int):
_statusMainScreen.verify_communities_count(expected_count)
@When("the user changes emoji of the current community channel with emoji by description |any|")
def step(context, emoji_description: str):
_statusCommunityScreen.search_and_change_community_channel_emoji(emoji_description)
@Then("the community channel has emoji |any|")
def step(context, emoji: str):
_statusCommunityScreen.check_community_channel_emoji(emoji)
@When("the user sends a test image in the current channel")
def step(context):
_statusCommunityScreen.send_test_image(context.userData["fixtures_root"], False, "")
@When("the user sends a test image in the current channel with message |any|")
def step(context, message):
_statusCommunityScreen.send_test_image(context.userData["fixtures_root"], False, message)
@When("the user sends multiple test images in the current channel with message |any|")
def step(context, message):
_statusCommunityScreen.send_test_image(context.userData["fixtures_root"], True, message)
@Then("the test image is displayed in the last message")
@Then("the last chat message contains the test image")
def step(context):
_statusCommunityScreen.verify_sent_test_image(False, False)
@Then("the test image is displayed just before the last message")
def step(context):
_statusCommunityScreen.verify_sent_test_image(False, True)
@Then("the test images are displayed just before the last message")
def step(context):
_statusCommunityScreen.verify_sent_test_image(True, True)
_statusCommunityScreen.verify_sent_test_image(True, True)
@When("the user pins the message at index |any|")
def step(context, message_index):
_statusCommunityScreen.toggle_pin_message_at_index(message_index)
###########################################################################
### COMMON methods used in different steps given/when/then region:
###########################################################################
@When("the user unpins the message at index |any|")
def step(context, message_index):
_statusCommunityScreen.toggle_pin_message_at_index(message_index)
@Then("the amount of pinned messages is |any|")
def step(context, amount):
_statusCommunityScreen.check_pin_count(amount)
def the_user_creates_a_community(name:str, description: str, intro:str, outro:str):
init_steps.the_user_creates_a_community(name, description, intro, outro)
def the_user_lands_on_the_community(name: str):
init_steps.the_user_lands_on_the_community(name)
def the_admin_creates_a_community_channel(name: str, description: str, method: str):
init_steps.the_admin_creates_a_community_channel(name, description, method)
def the_channel_is_open(name: str):
init_steps.the_channel_is_open(name)
def the_channel_count_is(community_channel_count: int):
_statusCommunityScreen.check_channel_count(community_channel_count)
def the_admin_creates_a_community_category(name: str, channels: str, method: str):
_statusCommunityScreen.create_community_category(name, channels, method)
def the_category_contains_channels(category_name: str, channels: str):
_statusCommunityScreen.verify_category_contains_channels(category_name, channels)

View File

@ -2,27 +2,37 @@ from screens.StatusSearchScreen import StatusSearchScreen
_searchScreen = StatusSearchScreen()
@When("the user opens the search menu")
#########################
### PRECONDITIONS region:
#########################
@Given("the user opens the search menu")
def step(context):
_searchScreen.open_search_menu()
@When("the user searches for |any|")
@Given("the user searches for \"|any|\"")
def step(context, search_term):
_searchScreen.search_for(search_term)
#########################
### ACTIONS region:
#########################
@When("the user clicks on the search result for channel \"|any|\"")
def step(context, channel_name):
_searchScreen.click_on_channel(channel_name)
@When("the user searches the random message")
def step(context):
_searchScreen.search_for(context.userData["randomMessage"])
@Then("the search menu shows |any| results")
def step(context, amount):
_searchScreen.verify_number_of_results(amount)
@When("the user clicks on the search result for channel |any|")
def step(context, channel_name):
_searchScreen.click_on_channel(channel_name)
_searchScreen.search_for(context.userData["randomMessage"])
@When("the user clicks on the search result for the random message")
def step(context):
_searchScreen.click_on_message(context.userData["randomMessage"])
_searchScreen.click_on_message(context.userData["randomMessage"])
#########################
### VERIFICATIONS region:
#########################
@Then("the search menu shows |integer| results")
def step(context, amount: int):
_searchScreen.verify_number_of_results(amount)

View File

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# This file contains hook functions to run as the .feature file is executed
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../testSuites/global_shared/"))
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../src/"))
import steps.startupSteps as init_steps
# Global properties for the specific feature
_user = "tester123"
_password = "TesTEr16843/!@00"
@OnFeatureStart
def hook(context):
init_steps.context_init(context)
init_steps.signs_up_process_steps(context, _user, _password)
@OnFeatureEnd
def hook(context):
currentApplicationContext().detach()
snooze(_app_closure_timeout)
@OnStepEnd
def hook(context):
context.userData["step_name"] = context._data["text"]

View File

@ -11,133 +11,104 @@
Feature: Status Desktop community
As a user I want to create a community and chat
As an admin user I want to create a community and do some action in the community
The following scenarios cover basic flows of a community
The feature start sequence is the following (setup on its own `bdd_hooks`):
** given A first time user lands on the status desktop and generates new key
** when user signs up with username "tester123" and password "TesTEr16843/!@00"
** and the user lands on the signed in app
Background:
Given A first time user lands on the status desktop and generates new key
When user signs up with username "tester123" and password "TesTEr16843/!@00"
Then the user lands on the signed in app
When the user opens the community portal section
Then the user lands on the community portal section
@merge
Scenario Outline: User creates a community
When the user creates a community named <community_name>, with description <community_description>, intro <community_intro> and outro <community_outro>
Then the user lands on the community named <community_name>
Examples:
| community_name | community_description | community_intro | community_outro |
| testCommunity1 | Community tested 1 | My intro for the community | My community outro |
@merge @mayfail
Scenario Outline: Admin creates a community channel
When the user creates a community named myCommunity, with description My community description, intro Community Intro and outro Community Outro
Then the user lands on the community named myCommunity
When the admin creates a community channel named <community_channel_name>, with description <community_channel_description> with the method <method>
Then the user lands on the channel named <community_channel_name>
Given the user opens the community portal section
And the user lands on the community portal section
And the user creates a community named "myCommunity", with description "My community description", intro "Community Intro" and outro "Community Outro"
And the user lands on the community named "myCommunity"
@mayfail
# TODO: Scenario broken since in the action of creating a channel `mainWindow_CommunityColumnView_CommunityColumnView` object is not ready.
Scenario Outline: The admin creates a community channel
When the admin creates a community channel named "<community_channel_name>", with description "<community_channel_description>", with the method "<method>"
Then the channel named "<community_channel_name>" is open
Examples:
| community_channel_name | community_channel_description | method |
| test-channel | Community channel description tested 1 | bottom_menu |
| test-channel2 | Community channel description tested 2 | right_click_menu |
@mayfail
Scenario Outline: Admin edits a community channel
When the user creates a community named myCommunity, with description My community description, intro Community Intro and outro Community Outro
Then the user lands on the community named myCommunity
When the admin creates a community channel named test-channel, with description My description with the method bottom_menu
Then the user lands on the channel named test-channel
When the admin edits the current community channel to the name <new_community_channel_name>
Then the user lands on the channel named <new_community_channel_name>
Scenario Outline: The admin edits a community channel
Given the admin creates a community channel named "<community_channel_name>", with description "<community_channel_description>", with the method "bottom_menu"
And the channel named "<community_channel_name>" is open
When the admin edits the current community channel to the name "<new_community_channel_name>"
Then the channel named "<new_community_channel_name>" is open
Examples:
| community_channel_name | community_channel_description | new_community_channel_name |
| test-channel | Community channel description tested 1 | new-test-channel |
| community_channel_name | community_channel_description | new_community_channel_name |
| test-channel | Community channel description tested 1 | new-test-channel |
@merge @mayfail
Scenario: Admin deletes a community channel
When the user creates a community named myCommunity, with description My community description, intro Community Intro and outro Community Outro
Then the user lands on the community named myCommunity
When the admin creates a community channel named test-channel, with description My description with the method bottom_menu
Then the user lands on the channel named test-channel
@mayfail
# TODO: Weak. Sometimes passes sometimes fails (standalone or as part of the sequence). To anaylize.
Scenario: The admin deletes a community channel
Given the admin creates a community channel named "test-channel2", with description "My description", with the method "bottom_menu"
And the channel named "test-channel2" is open
And the channel count is 2
When the admin deletes current channel
Then the channel count is 1
@merge @mayfail
Scenario Outline: Admin creates a community category
When the user creates a community named myCommunity, with description My community description, intro Community Intro and outro Community Outro
Then the user lands on the community named myCommunity
When the admin creates a community channel named <community_channel_name>, with description Some description with the method <method>
And the admin creates a community category named <community_category_name>, with channels <community_channel_name> and with the method <method>
Then the category named <community_category_name> has channels <community_channel_name>
@mayfail
# TODO: Weak. Sometimes passes sometimes fails (standalone or as part of the sequence). To anaylize.
Scenario Outline: The admin creates a community category
Given the admin creates a community channel named "<channel_name>", with description "Some description", with the method "<method>"
When the admin creates a community category named "<category_name>", with channels "<channel_name>" and with the method "<method>"
Then the category named "<category_name>" contains channels "<channel_name>"
Examples:
| community_channel_name | community_category_name | method |
| test-channel-1 | test-category-1 | bottom_menu |
| test-channel-2 | test-category-2 | right_click_menu |
| channel_name | category_name | method |
| test-channel-1 | test-category-1 | bottom_menu |
| test-channel-2 | test-category-2 | right_click_menu |
@mayfail
Scenario: Admin edits a community category
When the user creates a community named myCommunity, with description My community description, intro Community Intro and outro Community Outro
Then the user lands on the community named myCommunity
When 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
Then the category named test-category has channels test-channel
When the admin edits category named test-category to the name new-test-category and channels test-channel, general
Then the category named new-test-category has channels general
And the category named test-category is missing
# 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"
And the category named "test-category" contains channels "test-channel"
When the admin renames the category "test-category" to "new-test-category" and toggles the channels "test-channel, general"
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"
And the category named "test-category" contains channels "test-channel"
When the admin deletes category named "test-category"
Then the category named "test-category" is missing
@merge
Scenario: Admin deletes a community category
When the user creates a community named myCommunity, with description My community description, intro Community Intro and outro Community Outro
Then the user lands on the community named myCommunity
When 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
Then the category named test-category has channels test-channel
When the admin deletes category named test-category
Then the category named test-category is missing
@merge @mayfail
Scenario Outline: Admin edits a community
When the user creates a community named myCommunity, with description My community description, intro Community Intro and outro Community Outro
Then the user lands on the community named myCommunity
When the admin edits the current community to the name <new_community_name> and description <new_community_description> and color <new_community_color>
When the admin goes back to the community
Then the user lands on the community named <new_community_name>
@mayfail
# TODO: Weak. Sometimes passes sometimes fails (standalone or as part of the sequence). To anaylize.
# Also TODO: Missing validation of description changed and color changed. Now validation only checks the new community name.
Scenario Outline: The admin edits a community
When the admin renames the community to "<new_community_name>" and description to "<new_community_description>" and color to "<new_community_color>"
And the admin goes back to the community
Then the user lands on the community named "<new_community_name>"
Examples:
| new_community_name | new_community_description | new_community_color |
| myCommunityNamedChanged | Cool new description 123 | #ff0000 |
@merge
Scenario: User leaves community
When the user creates a community named testCommunity, with description My community description, intro Community Intro and outro Community Outro
Then the user lands on the community named testCommunity
When the user opens app settings screen
And the user opens the communities settings
And the user leaves the community
Then the count of communities in navbar is 0
@merge @mayfail
Scenario Outline: User changes the emoji of a channel
When the user creates a community named myCommunity, with description My community description, intro Community Intro and outro Community Outro
Then the user lands on the community named myCommunity
When the admin creates a community channel named test-channel, with description My description with the method bottom_menu
Then the user lands on the channel named test-channel
When the user changes emoji of the current community channel with emoji by description <new_emoji_description>
Then the community channel has emoji <new_emoji>
@mayfail
# TODO: Test broken. Validation doesn't work (No attribute ` emoji`found error).
Scenario Outline: The admin changes the emoji of a channel
When the admin changes the current community channel emoji to "<new_emoji_description>"
Then the community channel has emoji "<new_emoji>"
Examples:
| new_emoji_description | new_emoji |
| thumbs up | 👍 |
# TODO: This scenario must be in a different feature since it does not accomplishe the start/en sequence and / or background
# Add new test case that contains scenarios related to create/delete and navigate throw communities and usage of navbar.
#@merge
#Scenario: User leaves community
# When the user opens app settings screen
# And the user opens the communities settings
# And the user leaves the community
# Then the count of communities in navbar is 0

View File

@ -1,7 +1,7 @@
source(findFile('scripts', 'python/bdd.py'))
setupHooks('../../global_shared/scripts/bdd_hooks.py')
collectStepDefinitions('./steps', '../shared/steps/', '../../global_shared/steps/', '../../suite_onboarding/shared/steps/')
setupHooks('bdd_hooks.py')
collectStepDefinitions('./steps', '../shared/steps/', '../../global_shared/steps/', '../../suite_messaging/shared/steps/')
def main():
testSettings.throwOnFailure = True

View File

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# This file contains hook functions to run as the .feature file is executed
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../testSuites/global_shared/"))
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../src/"))
from steps.startupSteps import *
# Global properties for the specific feature
_user = "tester123"
_password = "TesTEr16843/!@00"
@OnFeatureStart
def hook(context):
context_init(context)
signs_up_process_steps(context, _user, _password)
@OnFeatureEnd
def hook(context):
currentApplicationContext().detach()
snooze(_app_closure_timeout)
@OnStepEnd
def hook(context):
context.userData["step_name"] = context._data["text"]

View File

@ -13,47 +13,49 @@ Feature: Status Desktop community messages
As a user I want to send messages and interact with channels in a community
The feature start sequence is the following (setup on its own `bdd_hooks`):
** given A first time user lands on the status desktop and generates new key
** when user signs up with username "tester123" and password "TesTEr16843/!@00"
** and the user lands on the signed in app
Background:
Given A first time user lands on the status desktop and generates new key
When user signs up with username "tester123" and password "TesTEr16843/!@00"
Then the user lands on the signed in app
When the user opens the community portal section
Then the user lands on the community portal section
When the user creates a community named test_community, with description Community description, intro community intro and outro commmunity outro
Then the user lands on the community named test_community
Given the user opens the community portal section
And the user lands on the community portal section
And the user creates a community named "test_community", with description "Community description", intro "community intro" and outro "commmunity outro"
Then the user lands on the community named "test_community"
@mayfail @merge
Scenario: User sends a test image
@mayfail
# TODO: Verification is broken.
Scenario: The user sends a test image
When the user sends a test image in the current channel
Then the test image is displayed in the last message
Then the last chat message contains the test image
@mayfail @merge
Scenario: User sends a test image with a message
When the user sends a test image in the current channel with message Mesage with an image
@mayfail
# TODO: Verification is broken.
Scenario: The user sends a test image with a message
When the user sends a test image in the current channel with message "Message" with an image
Then the test image is displayed just before the last message
And the message Mesage with an image is displayed in the last message
And the last chat message contains "Message"
@mayfail @merge
Scenario: User sends multiple test images with a message
When the user sends multiple test images in the current channel with message Mesage with an image again
@mayfail
# TODO: Verification is broken and the action of multiple images doesn't work. It is only sent one.
Scenario: The user sends multiple test images with a message
When the user sends multiple test images in the current channel with message "Message" with an image again
Then the test images are displayed just before the last message
And the message Mesage with an image again is displayed in the last message
And the last chat message contains "Message"
@mayfail @merge
Scenario: User pins and unpins messages
@mayfail
# TODO: The action is broken. Review it.
Scenario: The user pins and unpins messages
# This one wont work until #6554 is fixed
# And the amount of pinned messages is 0
When the user sends the chat message "Message 1"
And the user pins the message at index 0
Given the user sends a chat message "Message 1"
When the user pins the message at index 0
Then the amount of pinned messages is 1
Then the user is able to send chat message
| message |
| Hello |
| How are you |
| I am from status |
| tell me how you do? |
Given the user sends a chat message "Message 2"
When the user pins the message at index 0
Then the amount of pinned messages is 2
When the user unpins the message at index 0
Then the amount of pinned messages is 1
Then the amount of pinned messages is 1

View File

@ -1,7 +1,7 @@
source(findFile('scripts', 'python/bdd.py'))
setupHooks('../../global_shared/scripts/bdd_hooks.py')
collectStepDefinitions('./steps', '../shared/steps/', '../../global_shared/steps/', '../../suite_onboarding/shared/steps/')
setupHooks('bdd_hooks.py')
collectStepDefinitions('./steps', '../shared/steps/', '../../global_shared/steps/', '../../suite_messaging/shared/steps/')
def main():
testSettings.throwOnFailure = True

View File

@ -0,0 +1,42 @@
# -*- coding: utf-8 -*-
# This file contains hook functions to run as the .feature file is executed
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../testSuites/global_shared/"))
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../src/"))
import steps.startupSteps as init_steps
# Global properties for the specific feature
_user = "tester123"
_password = "TesTEr16843/!@00"
_chat_room1 = "search-automation-test-1"
_chat_room2 = "search-automation-test-2"
_community_name = "myCommunity"
_community_description = "My community description"
_community_intro = "Community Intro"
_community_outro = "Commmunity Outro"
_channel_name = "automation-community"
_channel_description = "My description"
_method = "bottom_menu"
@OnFeatureStart
def hook(context):
init_steps.context_init(context)
init_steps.signs_up_process_steps(context, _user, _password)
init_steps.when_the_user_joins_chat_room(_chat_room1)
init_steps.when_the_user_joins_chat_room(_chat_room2)
init_steps.the_user_opens_the_community_portal_section()
init_steps.the_user_lands_on_the_community_portal_section()
init_steps.the_user_creates_a_community(_community_name, _community_description, _community_intro, _community_outro)
init_steps.the_user_lands_on_the_community(_community_name)
init_steps.the_admin_creates_a_community_channel(_channel_name, _channel_description, _method)
init_steps.the_channel_is_open(_channel_name)
@OnFeatureEnd
def hook(context):
currentApplicationContext().detach()
snooze(_app_closure_timeout)
@OnStepEnd
def hook(context):
context.userData["step_name"] = context._data["text"]

View File

@ -15,44 +15,52 @@ Feature: Search feature (ctrl+F)
Covers the search flows
Background:
Given A first time user lands on the status desktop and generates new key
When user signs up with username "tester123" and password "TesTEr16843/!@00"
Then the user lands on the signed in app
When the user joins chat room "search-automation-test-1"
And the user joins chat room "search-automation-test-2"
When the user opens the community portal section
Then the user lands on the community portal section
When the user creates a community named myCommunity, with description My community description, intro Community Intro and outro Community Outro
Then the user lands on the community named myCommunity
When the admin creates a community channel named automation-community, with description My description with the method bottom_menu
Then the user lands on the channel named automation-community
# Go back to the portal so that we see if the search really redirects
When the user opens the community portal section
The feature start sequence is the following (setup on its own `bdd_hooks`):
** given A first time user lands on the status desktop and generates new key
** when user signs up with username "tester123" and password "TesTEr16843/!@00"
** and the user lands on the signed in app
** and user joins chat room "search-automation-test-1"
** and user joins chat room "search-automation-test-2"
** given the user opens the community portal section
** and the user lands on the community portal section
** and the user creates a community named "myCommunity", with description "My community description", intro "Community Intro" and outro "Commmunity outro"
** and the user lands on the community named "myCommunity"
** and the admin creates a community channel named "automation-community", with description "My description" with the method "bottom_menu"
** and the user lands on the channel named "automation-community"
@merge @mayfail
Scenario: User can search for a community channel
When the user opens the search menu
And the user searches for automation
And the user clicks on the search result for channel automation-community
Then the user lands on the channel named automation-community
Background:
# It starts opening the portal so that we see if the search really redirects
Given the user opens the community portal section
And the user lands on the community portal section
@merge @mayfail
Scenario: User can search for a public channel
When the user opens the search menu
And the user searches for automation
And the user clicks on the search result for channel search-automation-test-2
Then the chat title is search-automation-test-2
@mayfail
# myfail because of dekstop issue #7989. Once it is fixed, remove tag.
Scenario: The user can search for a community channel
Given the user opens the search menu
And the user searches for "automation"
When the user clicks on the search result for channel "automation-community"
Then the channel named "automation-community" is open
@mayfail
Scenario: User can search for a message in a public channel
When the user opens the chat section
@mayfail
# myfail because of dekstop issue #7989. Once it is fixed, remove tag.
Scenario: The user can search for a public channel
Given the user opens the search menu
And the user searches for "automation"
When the user clicks on the search result for channel "search-automation-test-2"
Then the chat title is "search-automation-test-2"
@mayfail
# myfail because of desktop issue #7989. Once it is fixed, remove tag.
Scenario: The user can search for a message in a public channel
Given the user opens the chat section
And the user joins chat room "search-automation-test-1"
Then the user is able to send a random chat message
And the user sends a random chat message
# Go back to the portal so that we see if the search really redirects
When the user opens the community portal section
And the user opens the community portal section
And the user opens the search menu
And the user searches the random message
When the user searches the random message
Then the search menu shows 1 results
When the user clicks on the search result for the random message
Then the chat title is "search-automation-test-1"

View File

@ -1,8 +1,8 @@
source(findFile('scripts', 'python/bdd.py'))
setupHooks('../../global_shared/scripts/bdd_hooks.py')
collectStepDefinitions('./steps', '../shared/steps/', '../../global_shared/steps/', '../../suite_onboarding/shared/steps/')
setupHooks('bdd_hooks.py')
collectStepDefinitions('./steps', '../shared/steps/', '../../global_shared/steps/', '../../suite_messaging/shared/steps/')
def main():
testSettings.throwOnFailure = True

View File

@ -1,7 +1,6 @@
from scripts.global_names import *
# Chat view:
navBarListView_Chat_navbar_StatusNavBarTabButton = {"checkable": True, "container": mainWindow_navBarListView_ListView, "objectName": "Chat-navbar", "type": "StatusNavBarTabButton", "visible": True}
mainWindow_scrollView_ScrollView = {"container": statusDesktop_mainWindow, "id": "scrollView", "type": "StatusScrollView", "unnamed": 1, "visible": True}
chatView_chatLogView_lastMsg_MessageView = {"container": chatView_log, "index": 0, "type": "MessageView"}
chatView_lastChatText_Text = {"container": chatView_chatLogView_lastMsg_MessageView, "type": "TextEdit", "objectName": "StatusTextMessage_chatText", "visible": True}

View File

@ -68,6 +68,14 @@ def step(context, createdTxt):
@Given("the group chat contains the following members")
def step(context):
_statusChat.verify_members_added(context.table)
@Given("the user opens the chat section")
def step(context):
the_user_opens_the_chat_section()
@Given("the user sends a random chat message")
def step(context):
the_user_sends_a_random_chat_message(context)
#########################
### ACTIONS region:
@ -75,7 +83,7 @@ def step(context):
@When("the user opens the chat section")
def step(context):
when_the_user_opens_the_chat_section()
the_user_opens_the_chat_section()
@When("the user sends a chat message \"|any|\"")
def step(context, message):
@ -129,10 +137,7 @@ def step(context, sticker_index):
@When("the user sends a random chat message")
def step(context):
random_int = randint(0, 10000)
message = "random message " + str(random_int)
_statusChat.send_message(message)
context.userData["randomMessage"] = message
the_user_sends_a_random_chat_message(context)
@When("the user switches to \"|any|\" chat")
def step(context, chatName):
@ -244,4 +249,13 @@ def the_user_creates_a_group_chat_adding_users(context: any):
_statusCreateChatView.create_chat(context.table)
def the_group_chat_is_created():
_statusChat = StatusChatScreen()
_statusChat = StatusChatScreen()
def the_user_opens_the_chat_section():
when_the_user_opens_the_chat_section()
def the_user_sends_a_random_chat_message(context):
random_int = randint(0, 10000)
message = "random message " + str(random_int)
_statusChat.send_message(message)
context.userData["randomMessage"] = message

View File

@ -36,5 +36,6 @@ Feature: Status Desktop Group Chat
When the user saves changes
Then the chat image is changed
Scenario: As an admin user I want to leave current chat
When the user leaves current chat
Then the chat "Fat&Lazy" does not exist