2023-12-29 14:35:38 +00:00
|
|
|
import allure
|
|
|
|
import pytest
|
|
|
|
from allure_commons._allure import step
|
2024-10-15 15:31:37 +00:00
|
|
|
|
|
|
|
from constants import RandomCommunity
|
2023-12-29 14:35:38 +00:00
|
|
|
from . import marks
|
|
|
|
|
2024-10-21 09:16:06 +00:00
|
|
|
from constants.community import AirdropsElements, TokensElements, PermissionsElements
|
2023-12-29 14:35:38 +00:00
|
|
|
from constants.images_paths import AIRDROPS_WELCOME_IMAGE_PATH, TOKENS_WELCOME_IMAGE_PATH, PERMISSION_WELCOME_IMAGE_PATH
|
|
|
|
from gui.main_window import MainWindow
|
|
|
|
|
|
|
|
pytestmark = marks
|
|
|
|
|
|
|
|
|
2024-02-19 13:27:54 +00:00
|
|
|
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703198',
|
|
|
|
'Manage community: Manage Permissions screen overview')
|
|
|
|
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703199',
|
|
|
|
'Manage community: Manage Mint Tokens screen overview')
|
2023-12-29 14:35:38 +00:00
|
|
|
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703200',
|
|
|
|
'Manage community: Manage Airdrops screen overview')
|
2024-02-19 13:27:54 +00:00
|
|
|
@pytest.mark.case(703198, 703199, 703200)
|
2024-10-15 15:31:37 +00:00
|
|
|
def test_manage_community_screens_overview(main_screen: MainWindow):
|
2024-05-03 09:36:51 +00:00
|
|
|
with step('Enable creation of community option'):
|
|
|
|
settings = main_screen.left_panel.open_settings()
|
|
|
|
settings.left_panel.open_advanced_settings().enable_creation_of_communities()
|
2024-10-15 15:31:37 +00:00
|
|
|
|
|
|
|
with step('Create community and select it'):
|
|
|
|
community = RandomCommunity()
|
|
|
|
main_screen.create_community(community_data=community)
|
|
|
|
community_screen = main_screen.left_panel.select_community(community.name)
|
2023-12-29 14:35:38 +00:00
|
|
|
|
|
|
|
with step('Open airdrops view from community settings'):
|
|
|
|
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('Verify New Airdrop button is disabled'):
|
|
|
|
assert airdrops_screen.is_new_airdrop_button_present is True, \
|
|
|
|
f'New airdrop button should be disabled by default'
|
|
|
|
with step('Airdrops welcome image source path is correct'):
|
2024-10-21 12:53:55 +00:00
|
|
|
assert AIRDROPS_WELCOME_IMAGE_PATH == str(airdrops_screen.airdrops_welcome_image_path)
|
2023-12-29 14:35:38 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
with step('Open tokens view from community settings'):
|
|
|
|
tokens_screen = community_setting.left_panel.open_tokens()
|
|
|
|
|
|
|
|
with step('Verify all elements on tokens screen'):
|
|
|
|
with step('Verify Mint token button is disabled'):
|
|
|
|
assert tokens_screen.is_mint_token_button_present is True, \
|
|
|
|
f'Mint token button should be present'
|
|
|
|
with step('Tokens welcome image path is correct'):
|
2024-10-21 12:53:55 +00:00
|
|
|
assert TOKENS_WELCOME_IMAGE_PATH == str(tokens_screen.tokens_welcome_image_path)
|
2023-12-29 14:35:38 +00:00
|
|
|
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, \
|
|
|
|
f'Mint token owner token button should be enabled'
|
|
|
|
|
|
|
|
with step('Open permissions in community settings'):
|
|
|
|
permissions_settings = community_setting.left_panel.open_permissions()
|
|
|
|
|
|
|
|
with step('Verify all elements on permissions screen'):
|
|
|
|
with step('Verify Add permission button is visible'):
|
|
|
|
assert permissions_settings.is_add_new_permission_button_present is True, \
|
|
|
|
f'Add new permission button should be visible'
|
|
|
|
with step('Permission welcome image source path is correct'):
|
2024-10-21 12:53:55 +00:00
|
|
|
assert PERMISSION_WELCOME_IMAGE_PATH == str(permissions_settings.permission_welcome_image_source)
|
2023-12-29 14:35:38 +00:00
|
|
|
with step('Permission welcome title is correct'):
|
|
|
|
assert permissions_settings.permission_welcome_title == PermissionsElements.WELCOME_TITLE.value
|
|
|
|
with step('Permission welcome subtitle is correct'):
|
|
|
|
assert permissions_settings.permission_welcome_subtitle == PermissionsElements.WELCOME_SUBTITLE.value
|
|
|
|
with step('Permission welcome checklist is correct'):
|
|
|
|
assert PermissionsElements.WELCOME_CHECKLIST_ELEMENT_1.value == permissions_settings.permission_checklist[0]
|
|
|
|
assert PermissionsElements.WELCOME_CHECKLIST_ELEMENT_2.value == permissions_settings.permission_checklist[1]
|
|
|
|
assert PermissionsElements.WELCOME_CHECKLIST_ELEMENT_3.value == permissions_settings.permission_checklist[2]
|