tst_communityManageOverview): add scenario that copies community private key

This commit is contained in:
Anastasiya Semiankevich 2023-05-31 18:00:31 +03:00 committed by Anastasiya Semenkevich
parent 28654e0187
commit e88369a83e
15 changed files with 113 additions and 19 deletions

View File

@ -19,7 +19,7 @@ from utils.ObjectAccess import *
from .StatusMainScreen import MainScreenComponents
from .StatusMainScreen import authenticate_popup_enter_password
from .components.cahange_password_popup import ChangePasswordPopup
from .components.change_password_popup import ChangePasswordPopup
from .components.social_links_popup import SocialLinksPopup

View File

@ -19,6 +19,7 @@ from drivers.SDKeyboardCommands import *
from .StatusMainScreen import StatusMainScreen
from utils.FileManager import *
from screens.StatusChatScreen import MessageContentType
from screens.components.community_back_up_private_key_popup import BackUpCommunityPrivateKeyPopup
from utils.ObjectAccess import *
class CommunityCreateMethods(Enum):
@ -88,7 +89,7 @@ class CommunityWelcomeScreenComponents(Enum):
WELCOME_SCREEN_CHECKLIST_ELEMENT1 = "community_welcome_screen_checkList_element1"
WELCOME_SCREEN_CHECKLIST_ELEMENT2 = "community_welcome_screen_checkList_element2"
WELCOME_SCREEN_CHECKLIST_ELEMENT3 = "community_welcome_screen_checkList_element3"
ADD_NEW_ITEM_BUTTON = "community_welcome_screen_add_new_item"
ADD_NEW_ITEM_BUTTON = "community_welcome_screen_add_new_item"
class CommunityColorPanelComponents(Enum):
HEX_COLOR_INPUT = "communitySettings_ColorPanel_HexColor_Input"
@ -109,6 +110,12 @@ class CreateOrEditCommunityCategoryPopup(Enum):
COMMUNITY_CATEGORY_BUTTON: str = "createOrEditCommunityCategoryBtn_StatusButton"
MODAL_CLOSE_BUTTON = "modal_Close_Button"
class CommunityOverviewScreenComponents(Enum):
# Constants definitions:
COMMUNITY_PRIVATE_KEY_LENGHT_UI = 35 # length of community PK on the Transfer Ownership popup
# Components:
COMMUNITY_OVERVIEW_BACK_UP_BUTTON ="communityOverview_Back_up_StatusButton"
class StatusCommunityScreen:
def __init__(self):
@ -563,5 +570,12 @@ class StatusCommunityScreen:
def verify_action_button_enabled(self, option:str):
assert BaseElement(str(CommunityWelcomeScreenComponents.ADD_NEW_ITEM_BUTTON.value)).is_enabled
button_title = get_obj(CommunityWelcomeScreenComponents.ADD_NEW_ITEM_BUTTON.value).text
verify_equals(option, str(button_title))
verify_equals(option, str(button_title))
def verify_community_private_key(self):
Button(CommunityOverviewScreenComponents.COMMUNITY_OVERVIEW_BACK_UP_BUTTON.value).click()
transferOwnershipPopup = BackUpCommunityPrivateKeyPopup().wait_until_appears()
transferOwnershipPopup.copy_community_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 community_private_key.startswith("0x"), f"Current private key does not start with 0x: {community_private_key}"

View File

@ -0,0 +1,18 @@
from drivers.SquishDriver import *
from .base_popup import BasePopup
class BackUpCommunityPrivateKeyPopup(BasePopup):
def __init__(self):
super(BackUpCommunityPrivateKeyPopup, self).__init__()
self._copy_private_key_button = Button('copyCommunityPrivateKeyButton')
self._community_private_key_text_edit = TextEdit('transferOwnerShipTextEdit')
@property
def private_key(self) -> str:
return self._community_private_key_text_edit.text
def copy_community_private_key(self):
self._copy_private_key_button.click()

View File

@ -85,6 +85,14 @@ communitySettings_EditCommunity_ColorPicker_Button = {"container": communitySett
communitySettings_ColorPanel_HexColor_Input = {"container": statusDesktop_mainWindow_overlay, "objectName": "communityColorPanelHexInput", "type": "TextEdit", "visible": True}
communitySettings_SaveColor_Button = {"container": statusDesktop_mainWindow_overlay, "objectName": "communityColorPanelSelectColorButton", "type": "StatusButton", "visible": True}
# Community Overview
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}
transferOwnerShipTextEdit = {"container": statusDesktop_mainWindow_overlay, "id": "edit", "type": "TextEdit", "unnamed": 1, "visible": True}
# Community transfer ownership
copyCommunityPrivateKeyButton = {"container": statusDesktop_mainWindow, "objectName": "copyCommunityPrivateKeyButton", "type": "StatusButton", "visible": True}
# Community welcome screen
community_welcome_screen_image = {"container": statusDesktop_mainWindow, "objectName": "welcomeSettingsImage", "type": "Image", "visible": True}
community_welcome_screen_title = {"container": statusDesktop_mainWindow, "objectName": "welcomeSettingsTitle", "type": "StatusBaseText", "visible": True}

View File

@ -8,4 +8,4 @@ from scripts.settings_names import *
from community_names import *
from community_portal_names import *
from search_names import *
from search_names import *

View File

@ -266,7 +266,11 @@ def step(context, option:str, list):
@Then("\"|any|\" button is present")
def step (context, action_button_name):
_statusCommunityScreen.verify_action_button_enabled(action_button_name)
_statusCommunityScreen.verify_action_button_enabled(action_button_name)
@Then("the user is able to open Back up modal and copy private key")
def step(context):
_statusCommunityScreen.verify_community_private_key()
###########################################################################

View File

@ -4,6 +4,6 @@ HOOK_SUB_PROCESSES=true
IMPLICITAUTSTART=0
LANGUAGE=Python
OBJECTMAPSTYLE=script
TEST_CASES=tst_communityFlows tst_searchFlows tst_communityMessageFlows tst_communityMemberFlows tst_communityAdminFlows tst_communityManageCommunity tst_communityManagePermissions tst_communityManageMintTokens tst_communityManageAirdrops
TEST_CASES=tst_communityFlows tst_searchFlows tst_communityMessageFlows tst_communityMemberFlows tst_communityAdminFlows tst_communityManageCommunity tst_communityManageOverview tst_communityManageMembers tst_communityManagePermissions tst_communityManageMintTokens tst_communityManageAirdrops
VERSION=3
WRAPPERS=Qt

View File

@ -17,15 +17,4 @@ Background:
| Members |
| Permissions|
| Mint Tokens|
| Airdrops |
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>"
Then the community overview name is "<new_community_name>"
And the community overview description is "<new_community_description>"
And the community overview color is "<new_community_color>"
When 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 |
| Airdrops |

View File

@ -0,0 +1,13 @@
source(findFile('scripts', 'python/bdd.py'))
setupHooks('../../global_shared/scripts/bdd_hooks.py')
collectStepDefinitions('./steps', '../shared/steps/', '../../global_shared/steps/','../../suite_onboarding/shared/steps/')
import configs
def main():
testSettings.throwOnFailure = True
configs.path.TMP.mkdir(parents=True, exist_ok=True)
runFeatureFile('test.feature')
configs.path.TMP.rmtree(ignore_errors=True)

View File

@ -0,0 +1,31 @@
#******************************************************************************
# User flows that could be done (intiated) from Overview page, accessile by Open community - Manage button
#*****************************************************************************/
Feature: Community -> Manage Community -> Overview page
Background:
Given A first time user lands on the status desktop and generates new key
And the user signs up with username "tester123" and password "TesTEr16843/!@00"
And the user lands on the signed in app
And 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 "My community description", intro "Community Intro" and outro "Community Outro"
And the user lands on the community named "Test-Community"
Scenario: Community admin is able to back up community key from community overview page
When "Manage Community" is clicked in the community sidebar
And "Overview" section is selected
Then the user is able to open Back up modal and copy private key
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>"
Then the community overview name is "<new_community_name>"
And the community overview description is "<new_community_description>"
And the community overview color is "<new_community_color>"
When 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 |

View File

@ -0,0 +1,13 @@
source(findFile('scripts', 'python/bdd.py'))
setupHooks('../../global_shared/scripts/bdd_hooks.py')
collectStepDefinitions('./steps', '../shared/steps/', '../../global_shared/steps/','../../suite_onboarding/shared/steps/')
import configs
def main():
testSettings.throwOnFailure = True
configs.path.TMP.mkdir(parents=True, exist_ok=True)
runFeatureFile('test.feature')
configs.path.TMP.rmtree(ignore_errors=True)

View File

@ -136,6 +136,7 @@ StackLayout {
RowLayout {
CommunityBanner {
objectName: "invitePeopleBanner"
text: qsTr("Welcome to your community!")
buttonText: qsTr("Invite new people")
icon.name: "invite-users"
@ -145,6 +146,7 @@ StackLayout {
Layout.fillWidth: true
}
CommunityBanner {
objectName: "airdropBanner"
text: qsTr("Try an airdrop to reward your community for engagement!")
buttonText: qsTr("Airdrop Tokens")
icon.name: "airdrop"
@ -156,6 +158,7 @@ StackLayout {
}
CommunityBanner {
objectName: "backUpBanner"
text: qsTr("Back up community key")
buttonText: qsTr("Back up")
icon.name: "objects"

View File

@ -53,6 +53,7 @@ StatusDialog {
borderColor: Theme.palette.primaryColor1
size: StatusBaseButton.Size.Tiny
text: qsTr("Copy")
objectName: "copyCommunityPrivateKeyButton"
onClicked: {
text = qsTr("Copied")
root.store.copyToClipboard(root.privateKey)