chore(@e2e): merge sharing link test to community create one

This commit is contained in:
Anastasiya Semenkevich 2024-11-20 10:34:29 +03:00 committed by Anastasiya
parent 246bc897c1
commit d4e1539901
2 changed files with 20 additions and 40 deletions

View File

@ -1,40 +0,0 @@
import allure
import pytest
from allure_commons._allure import step
from constants import RandomCommunity
from gui.main_window import MainWindow
from helpers.SettingsHelper import enable_community_creation
from scripts.utils.browser import get_response, get_page_content
from . import marks
pytestmark = marks
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/736382', 'Share community link')
@pytest.mark.case(736382)
def test_share_community_link(main_screen: MainWindow):
enable_community_creation(main_screen)
with step('Create community and select it'):
community = RandomCommunity()
main_screen.create_community(community_data=community)
main_screen.left_panel.select_community(community.name)
with step('Copy community link and verify that it does not give 404 error'):
community_link = main_screen.left_panel.open_community_context_menu(
community.name).select_invite_people().copy_community_link()
assert get_response(community_link).status_code == 200
with step('Verify that community title and description are displayed on webpage and correct'):
web_content = get_page_content(community_link)
content_list = []
for item in web_content.find_all('meta'):
if 'content' in item.attrs:
content_list.append(item.attrs['content'])
assert f'Join {community.name} community in Status' in content_list
assert community.description in content_list

View File

@ -5,6 +5,7 @@ from allure_commons._allure import step
from constants import RandomCommunity
from constants.community import Channel
from helpers.SettingsHelper import enable_community_creation
from scripts.utils.browser import get_response, get_page_content
from scripts.utils.generators import random_community_name, random_community_description, random_community_introduction, \
random_community_leave_message
from . import marks
@ -53,6 +54,25 @@ def test_create_edit_community(main_screen: MainWindow):
new_introduction, new_leaving_message,
new_logo, new_banner)
with step('Copy community link and verify that it does not give 404 error'):
invite_modal = main_screen.left_panel.open_community_context_menu(
name=new_name).select_invite_people()
community_link = invite_modal.copy_community_link()
assert get_response(community_link).status_code == 200
with step('Verify that community title and description are displayed on webpage and correct'):
web_content = get_page_content(community_link)
content_list = []
for item in web_content.find_all('meta'):
if 'content' in item.attrs:
content_list.append(item.attrs['content'])
assert f'Join {new_name} community in Status' in content_list
assert new_description in content_list
invite_modal.close()
with step('Verify community parameters on settings overview'):
overview_setting = community_setting.left_panel.open_overview()
assert overview_setting.name == new_name