2022-11-21 12:56:06 +00:00
|
|
|
import steps.commonInitSteps as init_steps
|
2022-07-18 20:56:33 +00:00
|
|
|
from screens.StatusMainScreen import StatusMainScreen
|
|
|
|
from screens.StatusCommunityPortalScreen import StatusCommunityPortalScreen
|
|
|
|
from screens.StatusCommunityScreen import StatusCommunityScreen
|
|
|
|
|
2022-07-21 16:16:25 +00:00
|
|
|
_statusCommunityScreen = StatusCommunityScreen()
|
2022-07-18 20:56:33 +00:00
|
|
|
_statusCommunitityPortal = StatusCommunityPortalScreen()
|
|
|
|
_statusMainScreen = StatusMainScreen()
|
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
#########################
|
|
|
|
### PRECONDITIONS region:
|
|
|
|
#########################
|
|
|
|
@Given("the user opens the community portal section")
|
2022-07-18 20:56:33 +00:00
|
|
|
def step(context: any):
|
2022-10-25 12:44:28 +00:00
|
|
|
init_steps.the_user_opens_the_community_portal_section()
|
2022-07-18 20:56:33 +00:00
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
@Given("the user lands on the community portal section")
|
2022-08-01 18:34:31 +00:00
|
|
|
def step(context):
|
2022-10-25 12:44:28 +00:00
|
|
|
init_steps.the_user_lands_on_the_community_portal_section()
|
|
|
|
|
|
|
|
@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)
|
2022-10-21 07:17:48 +00:00
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
@Given("the channel named \"|any|\" is open")
|
|
|
|
def step(context, 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)
|
2022-07-18 20:56:33 +00:00
|
|
|
|
2023-03-15 12:53:56 +00:00
|
|
|
@Given("\"|any|\" is toggled on under Experimental features")
|
|
|
|
def step(context: any, settings_type:str):
|
2023-04-26 16:22:57 +00:00
|
|
|
_settingsScreen.toggle_experimental_feature(settings_type)
|
2022-07-18 20:56:33 +00:00
|
|
|
|
2023-05-03 16:24:21 +00:00
|
|
|
@Given("\"|any|\" is clicked in the community sidebar")
|
|
|
|
def step(context, community_sidebar_option:str):
|
|
|
|
_statusCommunityScreen.click_sidebar_option(community_sidebar_option)
|
|
|
|
|
|
|
|
@Given("\"|any|\" should be an available option in Community Settings")
|
|
|
|
def step(context, manage_community_option:str):
|
|
|
|
_statusCommunityScreen.verify_option_exists(manage_community_option)
|
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
#########################
|
|
|
|
### ACTIONS region:
|
|
|
|
#########################
|
2022-08-01 18:34:31 +00:00
|
|
|
|
2022-10-25 19:08:15 +00:00
|
|
|
@When("the user opens the community named \"|any|\"")
|
|
|
|
def step(context, community_name):
|
|
|
|
_statusMainScreen.click_community(community_name)
|
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
@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)
|
2022-11-25 09:04:15 +00:00
|
|
|
|
|
|
|
@When("the user replies to community chat message at index |integer| with \"|any|\"")
|
|
|
|
def step(context, message_index: int, message: str):
|
|
|
|
_statusCommunityScreen.toggle_reply_message_at_index(message_index)
|
|
|
|
the_user_sends_a_chat_message(message)
|
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
@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)
|
2022-10-21 07:17:48 +00:00
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
@When("the admin creates a community channel named \"|any|\", with description \"|any|\", with the method \"|any|\"")
|
2022-07-25 20:30:34 +00:00
|
|
|
def step(context, community_channel_name, community_channel_description, method):
|
2022-10-25 12:44:28 +00:00
|
|
|
the_admin_creates_a_community_channel(community_channel_name, community_channel_description, method)
|
2022-08-01 18:34:31 +00:00
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
@When("the admin edits the current community channel to the name \"|any|\"")
|
2022-08-03 20:16:43 +00:00
|
|
|
def step(context, new_community_channel_name):
|
2022-10-25 12:44:28 +00:00
|
|
|
_statusCommunityScreen.edit_community_channel(new_community_channel_name)
|
2022-08-03 20:16:43 +00:00
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
@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)
|
2022-08-18 12:36:38 +00:00
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
@When("the admin renames the category \"|any|\" to \"|any|\" and toggles the channels \"|any|\"")
|
2022-08-18 12:36:38 +00:00
|
|
|
def step(context, community_category_name, new_community_category_name, community_channel_names):
|
2022-10-25 12:44:28 +00:00
|
|
|
_statusCommunityScreen.edit_community_category(community_category_name, new_community_category_name, community_channel_names)
|
2022-08-16 10:21:39 +00:00
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
@When("the admin deletes category named \"|any|\"")
|
2022-08-16 19:39:32 +00:00
|
|
|
def step(context, community_category_name):
|
2022-10-25 12:44:28 +00:00
|
|
|
_statusCommunityScreen.delete_community_category(community_category_name)
|
|
|
|
|
|
|
|
@When("the admin renames the community to \"|any|\" and description to \"|any|\" and color to \"|any|\"")
|
2022-08-03 20:16:43 +00:00
|
|
|
def step(context, new_community_name, new_community_description, new_community_color):
|
|
|
|
_statusCommunityScreen.edit_community(new_community_name, new_community_description, new_community_color)
|
|
|
|
|
2023-01-03 23:31:20 +00:00
|
|
|
@When("the admin changes the community name to \"|any|\"")
|
|
|
|
def step(context, new_community_name):
|
|
|
|
_statusCommunityScreen.open_edit_community_by_community_header()
|
|
|
|
_statusCommunityScreen.change_community_name(new_community_name)
|
|
|
|
_statusCommunityScreen.save_community_changes()
|
|
|
|
|
|
|
|
@When("the admin changes the community description to \"|any|\"")
|
|
|
|
def step(context, new_community_description):
|
|
|
|
_statusCommunityScreen.open_edit_community_by_community_header()
|
|
|
|
_statusCommunityScreen.change_community_description(new_community_description)
|
|
|
|
_statusCommunityScreen.save_community_changes()
|
|
|
|
|
|
|
|
@When("the admin changes the community color to \"|any|\"")
|
|
|
|
def step(context, new_community_color):
|
|
|
|
_statusCommunityScreen.open_edit_community_by_community_header()
|
|
|
|
_statusCommunityScreen.change_community_color(new_community_color)
|
|
|
|
_statusCommunityScreen.save_community_changes()
|
|
|
|
|
2022-08-03 20:16:43 +00:00
|
|
|
@When("the admin goes back to the community")
|
|
|
|
def step(context):
|
|
|
|
_statusCommunityScreen.go_back_to_community()
|
2022-10-25 12:44:28 +00:00
|
|
|
|
|
|
|
@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)
|
2022-08-01 18:34:31 +00:00
|
|
|
|
|
|
|
@When("the admin deletes current channel")
|
|
|
|
def step(context):
|
|
|
|
_statusCommunityScreen.delete_current_community_channel()
|
|
|
|
|
2022-10-25 18:39:21 +00:00
|
|
|
@When("the admin invites the user named |any| to the community with message |any|")
|
|
|
|
def step(context, user_name, message):
|
|
|
|
_statusCommunityScreen.invite_user_to_community(user_name, message)
|
2022-08-11 12:24:49 +00:00
|
|
|
|
2022-10-25 19:08:15 +00:00
|
|
|
@When("the admin kicks the user named |any|")
|
|
|
|
def step(context, user_name):
|
|
|
|
_statusCommunityScreen.kick_member_from_community(user_name)
|
|
|
|
|
2023-01-25 12:16:58 +00:00
|
|
|
@When("the user opens the community portal section")
|
|
|
|
def step(context: any):
|
|
|
|
init_steps.the_user_opens_the_community_portal_section()
|
|
|
|
|
2023-01-26 19:36:36 +00:00
|
|
|
@When("the user marks the channel \"|any|\" as read")
|
|
|
|
def step(context, channel):
|
|
|
|
_statusCommunityScreen.mark_as_read(channel)
|
|
|
|
|
2023-03-15 12:53:56 +00:00
|
|
|
@When("\"|any|\" is clicked in the community sidebar")
|
|
|
|
def step(context, community_sidebar_option:str):
|
|
|
|
_statusCommunityScreen.click_sidebar_option(community_sidebar_option)
|
2023-05-15 16:43:21 +00:00
|
|
|
time.sleep(1)
|
2023-05-03 16:24:21 +00:00
|
|
|
|
|
|
|
@When("\"|any|\" section is selected")
|
|
|
|
def step(context, section_option:str):
|
2023-05-15 16:43:21 +00:00
|
|
|
_statusCommunityScreen.select_community_settings_option(section_option)
|
|
|
|
time.sleep(1)
|
2023-03-15 12:53:56 +00:00
|
|
|
|
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
#########################
|
|
|
|
### VERIFICATIONS region:
|
|
|
|
#########################
|
2022-08-19 14:57:09 +00:00
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
@Then("the user lands on the community named \"|any|\"")
|
|
|
|
def step(context: any, community_name: str):
|
|
|
|
the_user_lands_on_the_community(community_name)
|
2022-10-21 07:17:48 +00:00
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
@Then("the channel named \"|any|\" is open")
|
|
|
|
def step(context, community_channel_name):
|
|
|
|
the_channel_is_open(community_channel_name)
|
2022-10-21 07:17:48 +00:00
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
@Then("the amount of pinned messages is |integer|")
|
|
|
|
def step(context, amount: int):
|
|
|
|
_statusCommunityScreen.check_pin_count(amount)
|
2022-08-19 14:57:09 +00:00
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
@Then("the channel count is |integer|")
|
|
|
|
def step(context, community_channel_count: int):
|
|
|
|
the_channel_count_is(community_channel_count)
|
2022-08-19 14:57:09 +00:00
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
@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)
|
|
|
|
|
|
|
|
@Then("the last chat message contains the test image")
|
2022-08-19 14:57:09 +00:00
|
|
|
def step(context):
|
|
|
|
_statusCommunityScreen.verify_sent_test_image(False, False)
|
2022-10-25 12:44:28 +00:00
|
|
|
|
2022-08-19 14:57:09 +00:00
|
|
|
@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):
|
2022-10-25 12:44:28 +00:00
|
|
|
_statusCommunityScreen.verify_sent_test_image(True, True)
|
2022-08-22 21:12:35 +00:00
|
|
|
|
2022-10-25 19:08:15 +00:00
|
|
|
@Then("the number of members is |any|")
|
|
|
|
def step(context, amount):
|
|
|
|
_statusCommunityScreen.verify_number_of_members(amount)
|
2023-01-03 23:31:20 +00:00
|
|
|
|
|
|
|
@Then("the community overview name is \"|any|\"")
|
|
|
|
def step(context, name: str):
|
|
|
|
_statusCommunityScreen.verify_community_overview_name(name)
|
2022-10-25 19:08:15 +00:00
|
|
|
|
2023-01-03 23:31:20 +00:00
|
|
|
@Then("the community overview description is \"|any|\"")
|
|
|
|
def step(context, communityDescription: str):
|
|
|
|
_statusCommunityScreen.verify_community_overview_description(communityDescription)
|
|
|
|
|
|
|
|
@Then("the community overview color is \"|any|\"")
|
|
|
|
def step(context, color: str):
|
|
|
|
_statusCommunityScreen.verify_community_overview_color(color)
|
2023-05-03 16:24:21 +00:00
|
|
|
|
2023-05-15 16:43:21 +00:00
|
|
|
@Then("the welcome \"|any|\" image is present")
|
|
|
|
def step(context, option):
|
|
|
|
_statusCommunityScreen.verify_welcome_image(option)
|
2023-01-03 23:31:20 +00:00
|
|
|
|
2023-05-15 16:43:21 +00:00
|
|
|
@Then("\"|any|\" should be an available option in Community->Manage->left navigation")
|
|
|
|
def step(context, list):
|
|
|
|
_statusCommunityScreen.verify_option_exists(list)
|
2023-04-13 19:19:00 +00:00
|
|
|
|
|
|
|
@Then("\"|any|\" should be in the list of uncategorized channels")
|
|
|
|
def step(context, chat_name:str):
|
|
|
|
_statusCommunityScreen.check_channel_is_uncategorized(chat_name)
|
2023-03-15 12:53:56 +00:00
|
|
|
|
2023-05-15 16:43:21 +00:00
|
|
|
@Then("the welcome \"|any|\" title is present")
|
|
|
|
def step(context, option:str):
|
|
|
|
_statusCommunityScreen.verify_welcome_title(option)
|
2023-05-03 16:24:21 +00:00
|
|
|
|
2023-05-15 16:43:21 +00:00
|
|
|
@Then("the welcome \"|any|\" subtitle is present")
|
|
|
|
def step(context, option:str):
|
|
|
|
_statusCommunityScreen.verify_welcome_subtitle(option)
|
2023-05-03 16:24:21 +00:00
|
|
|
|
2023-05-15 16:43:21 +00:00
|
|
|
@Then("the welcome \"|any|\" settings \"|any|\" is present")
|
|
|
|
def step(context, option:str, list):
|
|
|
|
_statusCommunityScreen.verify_welcome_settings_checklist(option, list)
|
2023-05-03 16:24:21 +00:00
|
|
|
|
2023-05-15 16:43:21 +00:00
|
|
|
@Then("\"|any|\" button is present")
|
|
|
|
def step (context, action_button_name):
|
2023-07-06 12:33:27 +00:00
|
|
|
_statusCommunityScreen.verify_action_button_present(action_button_name, True)
|
|
|
|
|
|
|
|
@Then("\"|any|\" button is disabled")
|
|
|
|
def step (context, action_button_name):
|
|
|
|
_statusCommunityScreen.verify_action_button_present(action_button_name, False)
|
|
|
|
|
|
|
|
@Then("the user is able to open Back up modal and copy private key")
|
|
|
|
def step(context):
|
|
|
|
_statusCommunityScreen.verify_community_private_key()
|
|
|
|
|
|
|
|
@Then("the user is able to click Airdrop Tokens button and navigate to Airdrops screen")
|
|
|
|
def step(context):
|
|
|
|
_statusCommunityScreen.open_airdrops_from_overview()
|
2023-03-15 12:53:56 +00:00
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
###########################################################################
|
|
|
|
### COMMON methods used in different steps given/when/then region:
|
|
|
|
###########################################################################
|
2022-08-22 21:12:35 +00:00
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
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)
|
2022-08-22 21:12:35 +00:00
|
|
|
|
2022-10-25 12:44:28 +00:00
|
|
|
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):
|
2022-10-25 18:39:21 +00:00
|
|
|
_statusCommunityScreen.verify_category_contains_channels(category_name, channels)
|