tst_communityManageOverview: add test for Airdrop page navigation from Overview screen

This commit is contained in:
Anastasiya Semiankevich 2023-06-06 10:40:26 +03:00 committed by Anastasiya Semenkevich
parent e04487437d
commit 40d736aa44
5 changed files with 29 additions and 8 deletions

View File

@ -82,6 +82,9 @@ class CommunityWelcomeScreenComponents(Enum):
PERMISSIONS_OPTION = "Permissions" PERMISSIONS_OPTION = "Permissions"
TOKENS_OPTION = "Mint Tokens" TOKENS_OPTION = "Mint Tokens"
AIRDROPS_OPTION = "Airdrops" AIRDROPS_OPTION = "Airdrops"
WELCOME_SCREEN_TITLE_OPTION_AIRDROPS = "Airdrop community tokens"
WELCOME_SCREEN_TITLE_OPTION_PERMISSIONS = "Permissions"
WELCOME_SCREEN_TITLE_OPTION_TOKENS = "Community tokens"
# Components # Components
WELCOME_SCREEN_IMAGE = "community_welcome_screen_image" WELCOME_SCREEN_IMAGE = "community_welcome_screen_image"
WELCOME_SCREEN_TITLE = "community_welcome_screen_title" WELCOME_SCREEN_TITLE = "community_welcome_screen_title"
@ -115,6 +118,7 @@ class CommunityOverviewScreenComponents(Enum):
COMMUNITY_PRIVATE_KEY_LENGHT_UI = 35 # length of community PK on the Transfer Ownership popup COMMUNITY_PRIVATE_KEY_LENGHT_UI = 35 # length of community PK on the Transfer Ownership popup
# Components: # Components:
COMMUNITY_OVERVIEW_BACK_UP_BUTTON ="communityOverview_Back_up_StatusButton" COMMUNITY_OVERVIEW_BACK_UP_BUTTON ="communityOverview_Back_up_StatusButton"
COMMUNITY_OVERVIEW_AIRDROP_TOKENS_BUTTON="communityOverview_Airdrop_Tokens_StatusButton"
class StatusCommunityScreen: class StatusCommunityScreen:
@ -536,11 +540,11 @@ class StatusCommunityScreen:
def verify_welcome_title(self, option:str): def verify_welcome_title(self, option:str):
title = get_obj(CommunityWelcomeScreenComponents.WELCOME_SCREEN_TITLE.value).text title = get_obj(CommunityWelcomeScreenComponents.WELCOME_SCREEN_TITLE.value).text
if option==CommunityWelcomeScreenComponents.PERMISSIONS_OPTION.value: if option==CommunityWelcomeScreenComponents.PERMISSIONS_OPTION.value:
verify_equals(title, "Permissions") verify_equals(title, CommunityWelcomeScreenComponents.WELCOME_SCREEN_TITLE_OPTION_PERMISSIONS.value)
elif option==CommunityWelcomeScreenComponents.TOKENS_OPTION.value: elif option==CommunityWelcomeScreenComponents.TOKENS_OPTION.value:
verify_equals(title, "Community tokens") verify_equals(title, CommunityWelcomeScreenComponents.WELCOME_SCREEN_TITLE_OPTION_TOKENS.value)
elif option==CommunityWelcomeScreenComponents.AIRDROPS_OPTION.value: elif option==CommunityWelcomeScreenComponents.AIRDROPS_OPTION.value:
verify_equals(title, "Airdrop community tokens") verify_equals(title, CommunityWelcomeScreenComponents.WELCOME_SCREEN_TITLE_OPTION_AIRDROPS.value)
def verify_welcome_subtitle(self, option:str): def verify_welcome_subtitle(self, option:str):
subtitle = get_obj(CommunityWelcomeScreenComponents.WELCOME_SCREEN_SUBTITLE.value).text subtitle = get_obj(CommunityWelcomeScreenComponents.WELCOME_SCREEN_SUBTITLE.value).text
@ -579,3 +583,10 @@ class StatusCommunityScreen:
community_private_key = transferOwnershipPopup.private_key community_private_key = transferOwnershipPopup.private_key
assert len(community_private_key) == (CommunityOverviewScreenComponents.COMMUNITY_PRIVATE_KEY_LENGHT_UI.value), f"Current key length: {len(community_private_key)}" assert len(community_private_key) == (CommunityOverviewScreenComponents.COMMUNITY_PRIVATE_KEY_LENGHT_UI.value), f"Current key length: {len(community_private_key)}"
assert community_private_key.startswith("0x"), f"Current private key does not start with 0x: {community_private_key}" assert community_private_key.startswith("0x"), f"Current private key does not start with 0x: {community_private_key}"
def open_airdrops_from_overview(self):
Button(CommunityOverviewScreenComponents.COMMUNITY_OVERVIEW_AIRDROP_TOKENS_BUTTON.value).click()
welcome_screen_title = get_obj(CommunityWelcomeScreenComponents.WELCOME_SCREEN_TITLE.value).text
ref_value = CommunityWelcomeScreenComponents.WELCOME_SCREEN_TITLE_OPTION_AIRDROPS.value
assert welcome_screen_title == ref_value, f"Current screen title: {welcome_screen_title}, expected: {ref_value}"

View File

@ -88,6 +88,8 @@ communitySettings_SaveColor_Button = {"container": statusDesktop_mainWindow_over
# Community Overview # Community Overview
communityOverview_Back_up_Banner = {"container": statusDesktop_mainWindow, "objectName": "backUpBanner", "type": "CommunityBanner", "visible": True} communityOverview_Back_up_Banner = {"container": statusDesktop_mainWindow, "objectName": "backUpBanner", "type": "CommunityBanner", "visible": True}
communityOverview_Back_up_StatusButton = {"container": communityOverview_Back_up_Banner, "objectName": "communityBannerButton", "type": "StatusButton", "visible": True} communityOverview_Back_up_StatusButton = {"container": communityOverview_Back_up_Banner, "objectName": "communityBannerButton", "type": "StatusButton", "visible": True}
communityOverview_Airdrop_Tokens_Banner = {"container": statusDesktop_mainWindow, "objectName": "airdropBanner", "type": "CommunityBanner", "visible": True}
communityOverview_Airdrop_Tokens_StatusButton = {"container": communityOverview_Airdrop_Tokens_Banner, "objectName": "communityBannerButton", "type": "StatusButton", "visible": True}
transferOwnerShipTextEdit = {"container": statusDesktop_mainWindow_overlay, "id": "edit", "type": "TextEdit", "unnamed": 1, "visible": True} transferOwnerShipTextEdit = {"container": statusDesktop_mainWindow_overlay, "id": "edit", "type": "TextEdit", "unnamed": 1, "visible": True}
# Community transfer ownership # Community transfer ownership

View File

@ -272,6 +272,9 @@ def step (context, action_button_name):
def step(context): def step(context):
_statusCommunityScreen.verify_community_private_key() _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()
########################################################################### ###########################################################################
### COMMON methods used in different steps given/when/then region: ### COMMON methods used in different steps given/when/then region:

View File

@ -18,6 +18,11 @@ Scenario: Community admin is able to back up community key from community overv
And "Overview" section is selected And "Overview" section is selected
Then the user is able to open Back up modal and copy private key Then the user is able to open Back up modal and copy private key
Scenario: Community admin is able to navigate to Airdrops page from Overview screen
When "Manage Community" is clicked in the community sidebar
And "Overview" section is selected
Then the user is able to click Airdrop Tokens button and navigate to Airdrops screen
Scenario Outline: Manage community -> Overview: community admin edits the community name, description and color Scenario Outline: Manage community -> Overview: community admin edits the community name, description and color
When the admin renames the community to "<new_community_name>" and description to "<new_community_description>" and color to "<new_community_color>" When the admin renames the community to "<new_community_name>" and description to "<new_community_description>" and color to "<new_community_color>"

View File

@ -1,7 +1,7 @@
source(findFile('scripts', 'python/bdd.py')) source(findFile('scripts', 'python/bdd.py'))
setupHooks('bdd_hooks.py') setupHooks('../../global_shared/scripts/bdd_hooks.py')
collectStepDefinitions('./steps', '../shared/steps/', '../../global_shared/steps/') collectStepDefinitions('./steps', '../shared/steps/', '../../global_shared/steps/','../../suite_onboarding/shared/steps/')
import configs import configs