Tests Manage Tokens screen overview and Manage Airdrops screen overview added (#210)

This commit is contained in:
Valentina1133 2023-10-26 08:15:00 +02:00 committed by GitHub
parent f6e9f41311
commit 285715be97
9 changed files with 267 additions and 10 deletions

View File

@ -0,0 +1,28 @@
from enum import Enum
class PermissionsElements(Enum):
WELCOME_TITLE = "Permissions"
WELCOME_SUBTITLE = 'You can manage your community by creating and issuing membership and access permissions'
WELCOME_CHECKLIST_ELEMENT_1 = 'Give individual members access to private channels'
WELCOME_CHECKLIST_ELEMENT_2 = 'Monetise your community with subscriptions and fees'
WELCOME_CHECKLIST_ELEMENT_3 = 'Require holding a token or NFT to obtain exclusive membership rights'
class TokensElements(Enum):
WELCOME_TITLE = "Community tokens"
WELCOME_SUBTITLE = 'You can mint custom tokens and import tokens for your community'
WELCOME_CHECKLIST_ELEMENT_1 = 'Create remotely destructible soulbound tokens for admin permissions'
WELCOME_CHECKLIST_ELEMENT_2 = 'Reward individual members with custom tokens for their contribution'
WELCOME_CHECKLIST_ELEMENT_3 = 'Mint tokens for use with community and channel permissions'
INFOBOX_TITLE = 'Get started'
INFOBOX_TEXT = 'In order to Mint, Import and Airdrop community tokens, you first need to mint your Owner token which will give you permissions to access the token management features for your community.'
class AirdropsElements(Enum):
WELCOME_TITLE = "Airdrop community tokens"
WELCOME_SUBTITLE = 'You can mint custom tokens and collectibles for your community'
WELCOME_CHECKLIST_ELEMENT_1 = 'Reward individual members with custom tokens for their contribution'
WELCOME_CHECKLIST_ELEMENT_2 = 'Incentivise joining, retention, moderation and desired behaviour'
WELCOME_CHECKLIST_ELEMENT_3 = 'Require holding a token or NFT to obtain exclusive membership rights'
INFOBOX_TITLE = 'Get started'
INFOBOX_TEXT = 'In order to Mint, Import and Airdrop community tokens, you first need to mint your Owner token which will give you permissions to access the token management features for your community.'

View File

@ -1,8 +0,0 @@
from enum import Enum
class PermissionsElements(Enum):
WELCOME_TITLE = "Permissions"
WELCOME_SUBTITLE = 'You can manage your community by creating and issuing membership and access permissions'
WELCOME_CHECKLIST_ELEMENT_1 = 'Give individual members access to private channels'
WELCOME_CHECKLIST_ELEMENT_2 = 'Monetise your community with subscriptions and fees'
WELCOME_CHECKLIST_ELEMENT_3 = 'Require holding a token or NFT to obtain exclusive membership rights'

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

View File

@ -1,4 +1,4 @@
from .main_names import statusDesktop_mainWindow, statusDesktop_mainWindow_overlay
from .main_names import statusDesktop_mainWindow, statusDesktop_mainWindow_overlay, mainWindow_StatusWindow
# Community Portal
mainWindow_communitiesPortalLayout_CommunitiesPortalLayout = {"container": statusDesktop_mainWindow, "objectName": "communitiesPortalLayout", "type": "CommunitiesPortalLayout", "visible": True}
@ -45,16 +45,46 @@ mainWindow_listView_StatusListView = {"container": mainWindow_communityLoader_Lo
overview_StatusNavigationListItem = {"container": mainWindow_listView_StatusListView, "objectName": "CommunitySettingsView_NavigationListItem_Overview", "type": "StatusNavigationListItem", "visible": True}
members_StatusNavigationListItem = {"container": mainWindow_listView_StatusListView, "index": 1, "objectName": "CommunitySettingsView_NavigationListItem_Members", "type": "StatusNavigationListItem", "visible": True}
permissions_StatusNavigationListItem = {"container": mainWindow_listView_StatusListView, "index": 2, "objectName": "CommunitySettingsView_NavigationListItem_Permissions", "type": "StatusNavigationListItem", "visible": True}
tokens_StatusNavigationListItem = {"container": mainWindow_listView_StatusListView, "index": 3, "objectName": "CommunitySettingsView_NavigationListItem_Tokens", "type": "StatusNavigationListItem", "visible": True}
airdrops_StatusNavigationListItem = {"container": mainWindow_listView_StatusListView, "index": 4, "objectName": "CommunitySettingsView_NavigationListItem_Airdrops", "type": "StatusNavigationListItem", "visible": True}
# Overview Settings View
mainWindow_OverviewSettingsPanel = {"container": mainWindow_communityLoader_Loader, "type": "OverviewSettingsPanel", "unnamed": 1, "visible": True}
communityOverviewSettingsCommunityName_StatusBaseText = {"container": mainWindow_OverviewSettingsPanel, "objectName": "communityOverviewSettingsCommunityName", "type": "StatusBaseText", "visible": True}
communityOverviewSettingsCommunityDescription_StatusBaseText = {"container": mainWindow_OverviewSettingsPanel, "objectName": "communityOverviewSettingsCommunityDescription", "type": "StatusBaseText", "visible": True}
mainWindow_Edit_Community_StatusButton = {"checkable": False, "container": mainWindow_OverviewSettingsPanel, "objectName": "communityOverviewSettingsEditCommunityButton", "text": "Edit Community", "type": "StatusButton", "visible": True}
# Members Settings View
mainWindow_MembersSettingsPanel = {"container": mainWindow_communityLoader_Loader, "type": "MembersSettingsPanel", "unnamed": 1, "visible": True}
embersListViews_ListView = {"container": mainWindow_MembersSettingsPanel, "objectName": "CommunityMembersTabPanel_MembersListViews", "type": "ListView", "visible": True}
memberItem_StatusMemberListItem = {"container": embersListViews_ListView, "id": "memberItem", "type": "StatusMemberListItem", "unnamed": 1, "visible": True}
# Tokens View
mainWindow_mintPanel_MintTokensSettingsPanel = {"container": mainWindow_StatusWindow, "id": "mintPanel", "type": "MintTokensSettingsPanel", "unnamed": 1, "visible": True}
mainWindow_MintedTokensView = {"container": mainWindow_StatusWindow, "type": "MintedTokensView", "unnamed": 1, "visible": True}
mainWindow_Mint_token_StatusButton = {"checkable": False, "container": mainWindow_StatusWindow, "objectName": "addNewItemButton", "type": "StatusButton", "visible": True}
welcomeSettingsTokens_Image = {"container": mainWindow_MintedTokensView, "objectName": "welcomeSettingsImage", "type": "Image", "visible": True}
welcomeSettingsTokens_Title = {"container": mainWindow_MintedTokensView, "objectName": "welcomeSettingsTitle", "type": "StatusBaseText", "visible": True}
welcomeSettingsTokensSubtitle = {"container": mainWindow_MintedTokensView, "objectName": "welcomeSettingsSubtitle", "type": "StatusBaseText", "visible": True}
checkListText_0_Tokens = {"container": mainWindow_MintedTokensView, "objectName": "checkListText_0", "type": "StatusBaseText", "visible": True}
checkListText_1_Tokens = {"container": mainWindow_MintedTokensView, "objectName": "checkListText_1", "type": "StatusBaseText", "visible": True}
checkListText_2_Tokens = {"container": mainWindow_MintedTokensView, "objectName": "checkListText_2", "type": "StatusBaseText", "visible": True}
mint_Owner_Tokens_InfoBoxPanel = {"container": mainWindow_MintedTokensView, "type": "StatusInfoBoxPanel", "unnamed": 1, "visible": True}
mint_Owner_Tokens_StatusButton = {"checkable": False, "container": mainWindow_MintedTokensView, "id": "button", "type": "StatusButton", "unnamed": 1, "visible": True}
# Airdrops View
mainWindow_airdropPanel_AirdropsSettingsPanel = {"container": mainWindow_StatusWindow, "id": "airdropPanel", "type": "AirdropsSettingsPanel", "unnamed": 1, "visible": True}
mainWindow_WelcomeSettingsView = {"container": mainWindow_StatusWindow, "type": "WelcomeSettingsView", "unnamed": 1, "visible": True}
mainWindow_New_Airdrop_StatusButton = {"checkable": False, "container": mainWindow_StatusWindow, "objectName": "addNewItemButton", "type": "StatusButton", "visible": True}
welcomeSettingsAirdrops_Image = {"container": mainWindow_WelcomeSettingsView, "objectName": "welcomeSettingsImage", "type": "Image", "visible": True}
welcomeSettingsAirdrops_Title = {"container": mainWindow_WelcomeSettingsView, "objectName": "welcomeSettingsTitle", "type": "StatusBaseText", "visible": True}
welcomeSettingsAirdrops_Subtitle = {"container": mainWindow_WelcomeSettingsView, "objectName": "welcomeSettingsSubtitle", "type": "StatusBaseText", "visible": True}
checkListText_0_Airdrops = {"container": mainWindow_WelcomeSettingsView, "objectName": "checkListText_0", "type": "StatusBaseText", "visible": True}
checkListText_1_Airdrops = {"container": mainWindow_WelcomeSettingsView, "objectName": "checkListText_1", "type": "StatusBaseText", "visible": True}
checkListText_2_Airdrops = {"container": mainWindow_WelcomeSettingsView, "objectName": "checkListText_2", "type": "StatusBaseText", "visible": True}
infoBox_StatusInfoBoxPanel = {"container": mainWindow_WelcomeSettingsView, "id": "infoBox", "type": "StatusInfoBoxPanel", "unnamed": 1, "visible": True}
mint_Owner_token_Airdrops_StatusButton = {"checkable": False, "container": mainWindow_WelcomeSettingsView, "id": "button", "type": "StatusButton", "unnamed": 1, "visible": True}
# Permissions Intro View
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}
@ -63,6 +93,7 @@ community_welcome_screen_checkList_element1 = {"container": statusDesktop_mainWi
community_welcome_screen_checkList_element2 = {"container": statusDesktop_mainWindow, "objectName": "checkListText_1", "type": "StatusBaseText", "visible": True}
community_welcome_screen_checkList_element3 = {"container": statusDesktop_mainWindow, "objectName": "checkListText_2", "type": "StatusBaseText", "visible": True}
add_new_permission_button = {"container": statusDesktop_mainWindow, "objectName": "addNewItemButton", "type": "StatusButton", "visible": True}
# Permissions Settings View
mainWindow_editPermissionView_EditPermissionView = {"container": statusDesktop_mainWindow, "id": "editPermissionView", "type": "EditPermissionView", "unnamed": 1, "visible": True}
editPermissionView_Who_holds_StatusItemSelector = {"container": mainWindow_editPermissionView_EditPermissionView, "id": "tokensSelector", "type": "StatusItemSelector", "unnamed": 1, "visible": True}

View File

@ -32,6 +32,8 @@ class LeftPanel(QObject):
self._overview_button = Button('overview_StatusNavigationListItem')
self._members_button = Button('members_StatusNavigationListItem')
self._permissions_button = Button('permissions_StatusNavigationListItem')
self._tokens_button = Button('tokens_StatusNavigationListItem')
self._airdrops_button = Button('airdrops_StatusNavigationListItem')
@allure.step('Open community main view')
def back_to_community(self):
@ -54,6 +56,16 @@ class LeftPanel(QObject):
self._permissions_button.click()
return PermissionsIntroView().wait_until_appears()
@allure.step('Open tokens')
def open_tokens(self) -> 'TokensView':
self._tokens_button.click()
return TokensView().wait_until_appears()
@allure.step('Open airdrops')
def open_airdrops(self) -> 'AirdropsView':
self._airdrops_button.click()
return AirdropsView().wait_until_appears()
class OverviewView(QObject):
@ -213,6 +225,118 @@ class MembersView(QObject):
return [str(member.title) for member in driver.findAllObjects(self._member_list_item.real_name)]
class TokensView(QObject):
def __init__(self):
super(TokensView, self).__init__('mainWindow_mintPanel_MintTokensSettingsPanel')
self._mint_token_button = Button('mainWindow_Mint_token_StatusButton')
self._welcome_image = QObject('welcomeSettingsTokens_Image')
self._welcome_title = TextLabel('welcomeSettingsTokens_Title')
self._welcome_subtitle = TextLabel('welcomeSettingsTokensSubtitle')
self._welcome_checklist_1 = TextLabel('checkListText_0_Tokens')
self._welcome_checklist_2 = TextLabel('checkListText_1_Tokens')
self._welcome_checklist_3 = TextLabel('checkListText_2_Tokens')
self._get_started_infobox = QObject('mint_Owner_Tokens_InfoBoxPanel')
self._mint_owner_token_button = Button('mint_Owner_Tokens_StatusButton')
@property
@allure.step('Get mint token button visibility state')
def is_mint_token_button_visible(self) -> bool:
return self._mint_token_button.is_visible
@property
@allure.step('Get tokens welcome image')
def tokens_welcome_image(self) -> Image:
return self._welcome_image.image
@property
@allure.step('Get tokens welcome title')
def tokens_welcome_title(self) -> str:
return self._welcome_title.text
@property
@allure.step('Get tokens welcome subtitle')
def tokens_welcome_subtitle(self) -> str:
return self._welcome_subtitle.text
@property
@allure.step('Get tokens checklist')
def tokens_checklist(self) -> typing.List[str]:
tokens_checklist = [str(self._welcome_checklist_1.object.text), str(self._welcome_checklist_2.object.text),
str(self._welcome_checklist_3.object.text)]
return tokens_checklist
@property
@allure.step('Get tokens info box title')
def tokens_infobox_title(self) -> str:
return str(self._get_started_infobox.object.title)
@property
@allure.step('Get tokens info box text')
def tokens_infobox_text(self) -> str:
return str(self._get_started_infobox.object.text)
@property
@allure.step('Get tokens mint owner token button visibility state')
def is_tokens_owner_token_button_visible(self) -> bool:
return self._mint_owner_token_button.is_visible
class AirdropsView(QObject):
def __init__(self):
super(AirdropsView, self).__init__('mainWindow_airdropPanel_AirdropsSettingsPanel')
self._new_airdrop_button = Button('mainWindow_New_Airdrop_StatusButton')
self._welcome_image = QObject('welcomeSettingsAirdrops_Image')
self._welcome_title = TextLabel('welcomeSettingsAirdrops_Title')
self._welcome_subtitle = TextLabel('welcomeSettingsAirdrops_Subtitle')
self._welcome_checklist_1 = TextLabel('checkListText_0_Airdrops')
self._welcome_checklist_2 = TextLabel('checkListText_1_Airdrops')
self._welcome_checklist_3 = TextLabel('checkListText_2_Airdrops')
self._get_started_infobox = QObject('infoBox_StatusInfoBoxPanel')
self._mint_owner_token_button = Button('mint_Owner_token_Airdrops_StatusButton')
@property
@allure.step('Get new airdrop button visibility state')
def is_new_airdrop_button_visible(self) -> bool:
return self._new_airdrop_button.is_visible
@property
@allure.step('Get airdrops welcome image')
def airdrops_welcome_image(self) -> Image:
return self._welcome_image.image
@property
@allure.step('Get airdrops welcome title')
def airdrops_welcome_title(self) -> str:
return self._welcome_title.text
@property
@allure.step('Get airdrops welcome subtitle')
def airdrops_welcome_subtitle(self) -> str:
return self._welcome_subtitle.text
@property
@allure.step('Get airdrops checklist')
def airdrops_checklist(self) -> typing.List[str]:
airdrops_checklist = [str(self._welcome_checklist_1.object.text), str(self._welcome_checklist_2.object.text),
str(self._welcome_checklist_3.object.text)]
return airdrops_checklist
@property
@allure.step('Get airdrops info box title')
def airdrops_infobox_title(self) -> str:
return self._get_started_infobox.object.title
@property
@allure.step('Get airdrops info box text')
def airdrops_infobox_text(self) -> str:
return self._get_started_infobox.object.text
@property
@allure.step('Get airdrops mint owner token button visibility state')
def is_airdrops_owner_token_button_visible(self) -> bool:
return self._mint_owner_token_button.is_visible
class PermissionsIntroView(QObject):
def __init__(self):
super(PermissionsIntroView, self).__init__('o_IntroPanel')

View File

@ -0,0 +1,41 @@
import allure
import pytest
from allure_commons._allure import step
import constants
from constants.community_settings import AirdropsElements
from gui.main_window import MainWindow
from scripts.tools import image
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703200',
'Manage community: Manage Airdrops screen overview')
@pytest.mark.case(703200)
@pytest.mark.parametrize('params', [constants.community_params])
def test_airdrops_screen(main_screen: MainWindow, params):
with step('Create community'):
main_screen.create_community(params)
with step('Open airdrops view from community settings'):
community_screen = main_screen.left_panel.select_community(params['name'])
community_setting = community_screen.left_panel.open_community_settings()
airdrops_screen = community_setting.left_panel.open_airdrops()
with step('Verify all elements on airdrops screen'):
with step('New airdrop button is present'):
assert airdrops_screen.is_airdrops_owner_token_button_visible is True
with step('Airdrops welcome image is correct'):
welcome_image = airdrops_screen.airdrops_welcome_image
image.compare(welcome_image, 'airdrops_welcome_image.png')
with step('Airdrops welcome title is correct'):
assert airdrops_screen.airdrops_welcome_title == AirdropsElements.WELCOME_TITLE.value
with step('Airdrops welcome subtitle is correct'):
assert airdrops_screen.airdrops_welcome_subtitle == AirdropsElements.WELCOME_SUBTITLE.value
with step('Airdrops welcome checklist is correct'):
assert AirdropsElements.WELCOME_CHECKLIST_ELEMENT_1.value == airdrops_screen.airdrops_checklist[0]
assert AirdropsElements.WELCOME_CHECKLIST_ELEMENT_2.value == airdrops_screen.airdrops_checklist[1]
assert AirdropsElements.WELCOME_CHECKLIST_ELEMENT_3.value == airdrops_screen.airdrops_checklist[2]
with step('Airdrops infobox title and text are correct and button Mint Owner Token is visible'):
assert airdrops_screen.airdrops_infobox_title == AirdropsElements.INFOBOX_TITLE.value
assert airdrops_screen.airdrops_infobox_text == AirdropsElements.INFOBOX_TEXT.value
assert airdrops_screen.is_airdrops_owner_token_button_visible is True

View File

@ -4,7 +4,7 @@ from allure_commons._allure import step
import constants
import driver
from constants.permissions import PermissionsElements
from constants.community_settings import PermissionsElements
from gui.main_window import MainWindow
from scripts.tools import image

View File

@ -0,0 +1,41 @@
import allure
import pytest
from allure_commons._allure import step
import constants
from constants.community_settings import TokensElements
from gui.main_window import MainWindow
from scripts.tools import image
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703199',
'Manage community: Manage Mint Tokens screen overview')
@pytest.mark.case(703199)
@pytest.mark.parametrize('params', [constants.community_params])
def test_tokens_screen(main_screen: MainWindow, params):
with step('Create community'):
main_screen.create_community(params)
with step('Open tokens view from community settings'):
community_screen = main_screen.left_panel.select_community(params['name'])
community_setting = community_screen.left_panel.open_community_settings()
tokens_screen = community_setting.left_panel.open_tokens()
with step('Verify all elements on tokens screen'):
with step('Mint token button is present'):
assert tokens_screen.is_tokens_owner_token_button_visible is True
with step('Tokens welcome image is correct'):
welcome_image = tokens_screen.tokens_welcome_image
image.compare(welcome_image, 'tokens_welcome_image.png')
with step('Tokens welcome title is correct'):
assert tokens_screen.tokens_welcome_title == TokensElements.WELCOME_TITLE.value
with step('Tokens welcome subtitle is correct'):
assert tokens_screen.tokens_welcome_subtitle == TokensElements.WELCOME_SUBTITLE.value
with step('Tokens welcome checklist is correct'):
assert TokensElements.WELCOME_CHECKLIST_ELEMENT_1.value == tokens_screen.tokens_checklist[0]
assert TokensElements.WELCOME_CHECKLIST_ELEMENT_2.value == tokens_screen.tokens_checklist[1]
assert TokensElements.WELCOME_CHECKLIST_ELEMENT_3.value == tokens_screen.tokens_checklist[2]
with step('Tokens infobox title and text are correct and button Mint Owner Token is visible'):
assert tokens_screen.tokens_infobox_title == TokensElements.INFOBOX_TITLE.value
assert tokens_screen.tokens_infobox_text == TokensElements.INFOBOX_TEXT.value
assert tokens_screen.is_tokens_owner_token_button_visible is True