2024-05-31 10:45:47 +00:00
|
|
|
import allure
|
|
|
|
import pytest
|
|
|
|
from allure_commons._allure import step
|
|
|
|
|
2024-10-15 15:31:37 +00:00
|
|
|
from constants import RandomCommunity
|
2024-05-31 10:45:47 +00:00
|
|
|
from gui.main_window import MainWindow
|
2024-11-12 08:43:14 +00:00
|
|
|
from helpers.SettingsHelper import enable_community_creation
|
2024-06-13 14:18:41 +00:00
|
|
|
from scripts.utils.browser import get_response, get_page_content
|
2024-05-31 10:45:47 +00:00
|
|
|
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):
|
2024-11-12 08:43:14 +00:00
|
|
|
|
|
|
|
enable_community_creation(main_screen)
|
2024-10-15 15:31:37 +00:00
|
|
|
|
2024-05-31 10:45:47 +00:00
|
|
|
with step('Create community and select it'):
|
2024-10-15 15:31:37 +00:00
|
|
|
community = RandomCommunity()
|
|
|
|
main_screen.create_community(community_data=community)
|
2024-11-12 08:43:14 +00:00
|
|
|
main_screen.left_panel.select_community(community.name)
|
2024-10-15 15:31:37 +00:00
|
|
|
|
2024-05-31 10:45:47 +00:00
|
|
|
with step('Copy community link and verify that it does not give 404 error'):
|
|
|
|
community_link = main_screen.left_panel.open_community_context_menu(
|
2024-10-15 15:31:37 +00:00
|
|
|
community.name).select_invite_people().copy_community_link()
|
2024-11-12 08:43:14 +00:00
|
|
|
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
|