- Update browser option from chrome to chromium.

- Renamed the TestUtilities class to Utilities & class instance from test_utilities to utilities
- Adding create_delete_article mark to pytest.ini
This commit is contained in:
Emil Ghitta 2024-07-19 11:35:10 +03:00
Родитель c4eb68b1d5
Коммит 29d1844d52
42 изменённых файлов: 1980 добавлений и 2069 удалений

6
.github/workflows/playwright.yml поставляемый
Просмотреть файл

@ -1,7 +1,7 @@
name: Playwright Tests
on:
schedule:
# Playwright tests are running automatically in Firefox on each Monday & in Chrome on each Friday.
# Playwright tests are running automatically in Firefox on each Monday & in Chromium on each Friday.
- cron: '0 5 * * 1,5'
workflow_dispatch:
inputs:
@ -12,7 +12,7 @@ on:
type: choice
options:
- firefox
- chrome
- chromium
TestSuite:
description: Test Suite to run
required: true
@ -82,7 +82,7 @@ jobs:
if [ $current_day -eq 1 ]; then
echo "BROWSER=firefox" >> $GITHUB_ENV
elif [ $current_day -eq 5 ]; then
echo "BROWSER=chrome" >> $GITHUB_ENV
echo "BROWSER=chromium" >> $GITHUB_ENV
fi
elif [ "${{ github.event_name }}" == 'workflow_dispatch' ]; then
echo "BROWSER=${{inputs.Browsers}}" >> $GITHUB_ENV

Просмотреть файл

@ -12,7 +12,7 @@ from requests.exceptions import HTTPError
from playwright_tests.pages.top_navbar import TopNavbar
class TestUtilities:
class Utilities:
def __init__(self, page: Page):
self.page = page

Просмотреть файл

@ -1,5 +1,5 @@
from playwright.sync_api import Page
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.pages.ask_a_question.product_solutions_pages.product_solutions_page import (
ProductSolutionsPage)
from playwright_tests.pages.top_navbar import TopNavbar
@ -7,7 +7,7 @@ from playwright_tests.pages.ask_a_question.aaq_pages.aaq_form_page import AAQFor
from playwright_tests.pages.ask_a_question.posted_question_pages.questions_page import QuestionPage
class AAQFlow(AAQFormPage, ProductSolutionsPage, TopNavbar, TestUtilities, QuestionPage):
class AAQFlow(AAQFormPage, ProductSolutionsPage, TopNavbar, Utilities, QuestionPage):
def __init__(self, page: Page):
super().__init__(page)

Просмотреть файл

@ -1,9 +1,9 @@
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.pages.auth_page import AuthPage
from playwright_tests.pages.homepage import Homepage
class AuthFlowPage(TestUtilities, AuthPage, Homepage):
class AuthFlowPage(Utilities, AuthPage, Homepage):
# Providing OTP code to FxA auth.
def __provide_otp_code(self, otp_code: str):
super()._add_data_to_otp_code_input_field(otp_code)

Просмотреть файл

@ -1,6 +1,6 @@
from playwright.sync_api import Page
from typing import Any
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.flows.explore_articles_flows.article_flows.add_kb_media_flow import \
AddKbMediaFlow
from playwright_tests.messages.explore_help_articles.kb_article_page_messages import (
@ -16,7 +16,7 @@ from playwright_tests.pages.explore_help_articles.articles.submit_kb_article_pag
SubmitKBArticlePage)
class AddKbArticleFlow(TestUtilities, SubmitKBArticlePage, AddKbMediaFlow, KBArticlePage,
class AddKbArticleFlow(Utilities, SubmitKBArticlePage, AddKbMediaFlow, KBArticlePage,
KBArticleShowHistoryPage, KBArticleReviewRevisionPage, EditKBArticlePage):
def __init__(self, page: Page):

Просмотреть файл

@ -1,4 +1,4 @@
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright.sync_api import Page
from playwright_tests.pages.explore_help_articles.articles.kb_article_page import KBArticlePage
@ -7,7 +7,7 @@ from playwright_tests.pages.explore_help_articles.articles.kb_article_show_histo
from playwright_tests.pages.top_navbar import TopNavbar
class DeleteKbArticleFlow(TestUtilities, KBArticleShowHistoryPage, KBArticlePage, TopNavbar):
class DeleteKbArticleFlow(Utilities, KBArticleShowHistoryPage, KBArticlePage, TopNavbar):
def __init__(self, page: Page):
super().__init__(page)

Просмотреть файл

@ -1,4 +1,4 @@
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright.sync_api import Page
from playwright_tests.messages.explore_help_articles.kb_article_revision_page_messages import \
@ -10,7 +10,7 @@ from playwright_tests.pages.explore_help_articles.articles.submit_kb_article_pag
SubmitKBArticlePage
class EditArticleMetaFlow(TestUtilities, KBArticleEditMetadata, SubmitKBArticlePage,
class EditArticleMetaFlow(Utilities, KBArticleEditMetadata, SubmitKBArticlePage,
KBArticlePage):
def __init__(self, page: Page):

Просмотреть файл

@ -1,6 +1,6 @@
from typing import Any
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.explore_help_articles.kb_article_page_messages import \
KBArticlePageMessages
from playwright_tests.pages.explore_help_articles.articles.kb_article_discussion_page import \
@ -9,7 +9,7 @@ from playwright.sync_api import Page
from playwright_tests.pages.explore_help_articles.articles.kb_article_page import KBArticlePage
class KbThreads(TestUtilities, KBArticleDiscussionPage, KBArticlePage):
class KbThreads(Utilities, KBArticleDiscussionPage, KBArticlePage):
def __init__(self, page: Page):
super().__init__(page)

Просмотреть файл

@ -2,7 +2,7 @@ from typing import Any
from playwright.sync_api import Page
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.pages.explore_help_articles.articles.kb_article_review_revision_page import \
KBArticleReviewRevisionPage
from playwright_tests.pages.explore_help_articles.articles.kb_article_show_history_page import \
@ -13,7 +13,7 @@ from playwright_tests.pages.explore_help_articles.articles.submit_kb_article_pag
SubmitKBArticlePage
class KbArticleTranslationFlow(TranslateArticlePage, TestUtilities, SubmitKBArticlePage,
class KbArticleTranslationFlow(TranslateArticlePage, Utilities, SubmitKBArticlePage,
KBArticleShowHistoryPage, KBArticleReviewRevisionPage):
def __init__(self, page: Page):
super().__init__(page)

Просмотреть файл

@ -1,11 +1,11 @@
from playwright.sync_api import Page
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.pages.messaging_system_pages.inbox_page import InboxPage
from playwright_tests.pages.messaging_system_pages.new_message import NewMessagePage
from playwright_tests.pages.messaging_system_pages.sent_messages import SentMessagePage
class MessagingSystemFlows(TestUtilities, NewMessagePage, SentMessagePage, InboxPage):
class MessagingSystemFlows(Utilities, NewMessagePage, SentMessagePage, InboxPage):
def __init__(self, page: Page):
super().__init__(page)

Просмотреть файл

@ -1,9 +1,9 @@
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.pages.contribute.groups_page import GroupsPage
from playwright.sync_api import Page
class UserGroupFlow(TestUtilities, GroupsPage):
class UserGroupFlow(Utilities, GroupsPage):
def __init__(self, page: Page):
super().__init__(page)

Просмотреть файл

@ -1,5 +1,5 @@
from playwright.sync_api import Page
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.pages.top_navbar import TopNavbar
from playwright_tests.pages.user_pages.my_profile_edit import MyProfileEdit
from playwright_tests.pages.user_pages.my_profile_edit_contribution_areas_page import \
@ -10,7 +10,7 @@ from playwright_tests.pages.user_pages.my_profile_user_navbar import UserNavbar
class EditProfileDataFlow(MyProfileEdit,
TestUtilities,
Utilities,
MyProfileEditContributionAreasPage,
TopNavbar,
UserNavbar,

Просмотреть файл

@ -34,4 +34,5 @@ markers =
kbRemovedRestrictions: Tests belonging to the kb article restriction with all restrictions removed.
kbArticleTranslation: Tests belonging to kb article translation.
deleteAllRestrictedTestArticles: Deleting all restricted test articles.
create_delete_article: Fixture used for creating and deleting test articles.
addopts = --alluredir=./reports/allure_reports --tb=no

Просмотреть файл

@ -3,7 +3,7 @@ import pytest
from pytest_check import check
from playwright.sync_api import expect, Page
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.ask_a_question_messages.AAQ_messages.aaq_form_page_messages import (
AAQFormMessages)
from playwright_tests.messages.ask_a_question_messages.AAQ_messages.question_page_messages import \
@ -18,17 +18,17 @@ from playwright_tests.pages.sumo_pages import SumoPages
# C2188694, C2188695
@pytest.mark.aaqPage
def test_community_card_and_helpful_tip_are_displayed_for_freemium_product(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
with allure.step("Navigating to each freemium aaq form"):
for freemium_product in test_utilities.general_test_data["freemium_products"]:
test_utilities.navigate_to_link(
test_utilities.aaq_question_test_data["products_aaq_url"][freemium_product]
for freemium_product in utilities.general_test_data["freemium_products"]:
utilities.navigate_to_link(
utilities.aaq_question_test_data["products_aaq_url"][freemium_product]
)
with allure.step(f"Verifying that the helpful tip card is displayed for the "
@ -44,17 +44,17 @@ def test_community_card_and_helpful_tip_are_displayed_for_freemium_product(page:
# C2188694, C2188695
@pytest.mark.aaqPage
def test_community_card_and_helpful_tip_not_displayed_for_premium_products(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
with allure.step("Navigating to each premium aaq form"):
for premium_product in test_utilities.general_test_data["premium_products"]:
test_utilities.navigate_to_link(
test_utilities.aaq_question_test_data["products_aaq_url"][premium_product]
for premium_product in utilities.general_test_data["premium_products"]:
utilities.navigate_to_link(
utilities.aaq_question_test_data["products_aaq_url"][premium_product]
)
with allure.step(f"Verifying that the helpful tip options is displayed for the "
@ -70,18 +70,18 @@ def test_community_card_and_helpful_tip_not_displayed_for_premium_products(page:
@pytest.mark.aaqPage
@pytest.mark.parametrize("username", ['', 'TEST_ACCOUNT_12', 'TEST_ACCOUNT_MODERATOR'])
def test_scam_banner_premium_products_not_displayed(page: Page, username):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
if username != '':
with allure.step(f"Singing in with {username} user"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts[username]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts[username]
))
with allure.step("Navigating to each premium product solutions page"):
for premium_product in test_utilities.general_test_data["premium_products"]:
test_utilities.navigate_to_link(
test_utilities.general_test_data["product_solutions"][premium_product]
for premium_product in utilities.general_test_data["premium_products"]:
utilities.navigate_to_link(
utilities.general_test_data["product_solutions"][premium_product]
)
with allure.step(f"Verifying that the sam banner is not displayed for "
@ -92,8 +92,8 @@ def test_scam_banner_premium_products_not_displayed(page: Page, username):
with allure.step("Clicking on the Ask Now button and verifying that the scam "
"banner is not displayed"):
sumo_pages.product_solutions_page._click_ask_now_button()
test_utilities.wait_for_url_to_be(
test_utilities.aaq_question_test_data["products_aaq_url"][premium_product]
utilities.wait_for_url_to_be(
utilities.aaq_question_test_data["products_aaq_url"][premium_product]
)
expect(sumo_pages.product_solutions_page._get_scam_banner_locator()
).to_be_hidden()
@ -103,18 +103,18 @@ def test_scam_banner_premium_products_not_displayed(page: Page, username):
@pytest.mark.aaqPage
@pytest.mark.parametrize("username", ['', 'TEST_ACCOUNT_12', 'TEST_ACCOUNT_MODERATOR'])
def test_scam_banner_for_freemium_products_is_displayed(page: Page, username):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
if username != '':
with allure.step(f"Signing in with {username} user"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts[username]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts[username]
))
with allure.step("Navigating to each freemium product solutions page"):
for freemium_product in test_utilities.general_test_data["freemium_products"]:
test_utilities.navigate_to_link(
test_utilities.general_test_data["product_solutions"][freemium_product]
for freemium_product in utilities.general_test_data["freemium_products"]:
utilities.navigate_to_link(
utilities.general_test_data["product_solutions"][freemium_product]
)
with check, allure.step("Verifying that the 'Learn More' button contains the "
@ -126,8 +126,8 @@ def test_scam_banner_for_freemium_products_is_displayed(page: Page, username):
with check, allure.step("Clicking on the Ask Now button and verifying that "
"the 'Learn More' button contains the correct link"):
sumo_pages.product_solutions_page._click_ask_now_button()
test_utilities.wait_for_url_to_be(
test_utilities.aaq_question_test_data["products_aaq_url"][freemium_product]
utilities.wait_for_url_to_be(
utilities.aaq_question_test_data["products_aaq_url"][freemium_product]
)
assert sumo_pages.product_solutions_page._get_scam_alert_banner_link(
) == QuestionPageMessages.AVOID_SCAM_SUPPORT_LEARN_MORE_LINK
@ -136,17 +136,17 @@ def test_scam_banner_for_freemium_products_is_displayed(page: Page, username):
# C890537
@pytest.mark.aaqPage
def test_corresponding_aaq_product_name_and_image_are_displayed(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
with allure.step("Navigating to each product aaq form"):
for product in test_utilities.aaq_question_test_data["products_aaq_url"]:
test_utilities.navigate_to_link(
test_utilities.aaq_question_test_data["products_aaq_url"][product])
for product in utilities.aaq_question_test_data["products_aaq_url"]:
utilities.navigate_to_link(
utilities.aaq_question_test_data["products_aaq_url"][product])
# This needs to change when we add the Mozilla Account icon/product.
if product != "Mozilla Account":
@ -164,17 +164,17 @@ def test_corresponding_aaq_product_name_and_image_are_displayed(page: Page):
# C890535, C890536
@pytest.mark.aaqPage
def test_progress_milestone_redirect(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
with allure.step("Navigating to each product AAQ form"):
for product in test_utilities.aaq_question_test_data["products_aaq_url"]:
test_utilities.navigate_to_link(
test_utilities.aaq_question_test_data["products_aaq_url"][product])
for product in utilities.aaq_question_test_data["products_aaq_url"]:
utilities.navigate_to_link(
utilities.aaq_question_test_data["products_aaq_url"][product])
with check, allure.step("Verifying that the correct in progress milestone is "
"displayed"):
@ -187,12 +187,12 @@ def test_progress_milestone_redirect(page: Page):
sumo_pages.aaq_form_page._click_on_a_particular_completed_milestone(
AAQFormMessages.COMPLETED_MILESTONE_TWO)
expect(page).to_have_url(
test_utilities.general_test_data["product_solutions"][product])
utilities.general_test_data["product_solutions"][product])
with allure.step(f"Navigating back to the aaq form and clicking on the "
f"{AAQFormMessages.COMPLETED_MILESTONE_ONE} milestone"):
test_utilities.navigate_to_link(
test_utilities.aaq_question_test_data["products_aaq_url"][product])
utilities.navigate_to_link(
utilities.aaq_question_test_data["products_aaq_url"][product])
sumo_pages.aaq_form_page._click_on_a_particular_completed_milestone(
AAQFormMessages.COMPLETED_MILESTONE_ONE)
expect(page).to_have_url(ContactSupportMessages.PAGE_URL_CHANGE_PRODUCT_REDIRECT)
@ -201,32 +201,32 @@ def test_progress_milestone_redirect(page: Page):
# C890612
@pytest.mark.aaqPage
def test_aaq_form_cancel_button_freemium_products(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_1"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_1"]
))
with allure.step("Accessing the 'My profile' page via the top-navbar menu and extracting "
"the original number of posted questions"):
sumo_pages.top_navbar._click_on_view_profile_option()
original_number_of_questions = test_utilities.number_extraction_from_string(
original_number_of_questions = utilities.number_extraction_from_string(
sumo_pages.my_profile_page._get_my_profile_questions_text()
)
with allure.step("Navigating to each product AAQ form"):
for product in test_utilities.general_test_data["freemium_products"]:
test_utilities.navigate_to_link(
test_utilities.aaq_question_test_data["products_aaq_url"][product])
for product in utilities.general_test_data["freemium_products"]:
utilities.navigate_to_link(
utilities.aaq_question_test_data["products_aaq_url"][product])
with allure.step("Adding data inside the AAQ form fields and clicking on the "
"cancel button"):
sumo_pages.aaq_flow.add__valid_data_to_all_aaq_fields_without_submitting(
subject=test_utilities.aaq_question_test_data["valid_firefox_question"]
subject=utilities.aaq_question_test_data["valid_firefox_question"]
["subject"],
topic_value=sumo_pages.aaq_form_page._get_aaq_form_topic_options()[0],
body_text=test_utilities.aaq_question_test_data["valid_firefox_question"]
body_text=utilities.aaq_question_test_data["valid_firefox_question"]
["question_body"]
)
sumo_pages.aaq_form_page._click_aaq_form_cancel_button()
@ -234,13 +234,13 @@ def test_aaq_form_cancel_button_freemium_products(page: Page):
with allure.step("Verifying that we are redirected back to the correct product "
"solutions page"):
expect(page).to_have_url(
test_utilities.general_test_data["product_solutions"][product])
utilities.general_test_data["product_solutions"][product])
with check, allure.step("Navigating back to the My Profile page and verifying "
"that the correct number of posted questions is "
"displayed"):
sumo_pages.top_navbar._click_on_view_profile_option()
new_number = test_utilities.number_extraction_from_string(
new_number = utilities.number_extraction_from_string(
sumo_pages.my_profile_page._get_my_profile_questions_text()
)
assert new_number == original_number_of_questions
@ -249,41 +249,40 @@ def test_aaq_form_cancel_button_freemium_products(page: Page):
# C890614, C890613, C890538
@pytest.mark.aaqPage
def test_post_aaq_questions_for_all_freemium_products_topics(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Navigating to each product AAQ form"):
for product in test_utilities.general_test_data["freemium_products"]:
test_utilities.navigate_to_link(
test_utilities.aaq_question_test_data["products_aaq_url"][product])
for product in utilities.general_test_data["freemium_products"]:
utilities.navigate_to_link(
utilities.aaq_question_test_data["products_aaq_url"][product])
for topic in sumo_pages.aaq_form_page._get_aaq_form_topic_options():
with allure.step(f"Submitting question for {product} product"):
question_info = sumo_pages.aaq_flow.submit_an_aaq_question(
subject=test_utilities.aaq_question_test_data["valid_firefox_question"]
subject=utilities.aaq_question_test_data["valid_firefox_question"]
["subject"],
topic_name=topic,
body=test_utilities.aaq_question_test_data["valid_firefox_question"]
body=utilities.aaq_question_test_data["valid_firefox_question"]
["question_body"],
attach_image=False
)
with allure.step("Verifying that the correct implicit tags are added to the "
"question"):
topic_s = (test_utilities
.aaq_question_test_data['aaq_topic_tags'][product][topic])
topic_s = utilities.aaq_question_test_data['aaq_topic_tags'][product][topic]
if isinstance(topic_s, list):
slugs = topic_s
else:
slugs = [topic_s]
if (test_utilities.aaq_question_test_data['aaq_topic_tags'][product]
if (utilities.aaq_question_test_data['aaq_topic_tags'][product]
['default_slug'] != "none"):
slugs.append(
test_utilities.aaq_question_test_data['aaq_topic_tags'][product]
utilities.aaq_question_test_data['aaq_topic_tags'][product]
['default_slug']
)
assert (
@ -313,23 +312,23 @@ def test_post_aaq_questions_for_all_freemium_products_topics(page: Page):
question_info['aaq_subject'])).to_be_hidden()
with allure.step(f"Navigating back to the {product} product aa form"):
test_utilities.navigate_to_link(
test_utilities.aaq_question_test_data["products_aaq_url"][product])
utilities.navigate_to_link(
utilities.aaq_question_test_data["products_aaq_url"][product])
@pytest.mark.aaqPage
def test_share_firefox_data_functionality(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Navigating to the Firefox AAQ form page and clicking on the 'Share "
"Data' option"):
test_utilities.navigate_to_link(
test_utilities.aaq_question_test_data["products_aaq_url"]["Firefox"])
utilities.navigate_to_link(
utilities.aaq_question_test_data["products_aaq_url"]["Firefox"])
sumo_pages.aaq_form_page._click_on_share_data_button()
with check, allure.step("Verifying that the 'try these manual steps' contains the "
@ -339,16 +338,16 @@ def test_share_firefox_data_functionality(page: Page):
with allure.step("Adding data inside AAQ form fields without submitting the form"):
sumo_pages.aaq_flow.add__valid_data_to_all_aaq_fields_without_submitting(
subject=test_utilities.aaq_question_test_data["valid_firefox_question"]["subject"],
subject=utilities.aaq_question_test_data["valid_firefox_question"]["subject"],
topic_value=sumo_pages.aaq_form_page._get_aaq_form_topic_options()[0],
body_text=test_utilities.aaq_question_test_data["valid_firefox_question"]
body_text=utilities.aaq_question_test_data["valid_firefox_question"]
["question_body"]
)
with allure.step("Adding text inside the troubleshooting information field and "
"submitting the AAQ question"):
sumo_pages.aaq_form_page._add_text_to_troubleshooting_information_textarea(
test_utilities.aaq_question_test_data["troubleshooting_information"]
utilities.aaq_question_test_data["troubleshooting_information"]
)
sumo_pages.aaq_form_page._click_aaq_form_submit_button()
@ -357,7 +356,7 @@ def test_share_firefox_data_functionality(page: Page):
sumo_pages.question_page._click_on_more_system_details_option()
expect(
sumo_pages.question_page._get_more_information_with_text_locator(
test_utilities.aaq_question_test_data["troubleshooting_information"]
utilities.aaq_question_test_data["troubleshooting_information"]
)
).to_be_visible()
@ -368,24 +367,24 @@ def test_share_firefox_data_functionality(page: Page):
@pytest.mark.aaqPage
def test_additional_system_details_user_agent_information(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Navigating to each product aaq form"):
for product in test_utilities.general_test_data["freemium_products"]:
test_utilities.navigate_to_link(
test_utilities.aaq_question_test_data["products_aaq_url"][product])
for product in utilities.general_test_data["freemium_products"]:
utilities.navigate_to_link(
utilities.aaq_question_test_data["products_aaq_url"][product])
with allure.step(f"Submitting a question for the {product} product"):
sumo_pages.aaq_flow.submit_an_aaq_question(
subject=test_utilities.aaq_question_test_data["valid_firefox_question"]
subject=utilities.aaq_question_test_data["valid_firefox_question"]
["subject"],
topic_name=sumo_pages.aaq_form_page._get_aaq_form_topic_options()[0],
body=test_utilities.aaq_question_test_data["valid_firefox_question"]
body=utilities.aaq_question_test_data["valid_firefox_question"]
["question_body"],
attach_image=True
)
@ -394,7 +393,7 @@ def test_additional_system_details_user_agent_information(page: Page):
"displayed"):
sumo_pages.question_page._click_on_question_details_button()
sumo_pages.question_page._click_on_more_system_details_option()
assert "User Agent: " + test_utilities.get_user_agent(
assert "User Agent: " + utilities.get_user_agent(
) == sumo_pages.question_page._get_user_agent_information()
with allure.step("Closing the additional details panel and deleting the posted "
@ -405,33 +404,30 @@ def test_additional_system_details_user_agent_information(page: Page):
@pytest.mark.aaqPage
def test_system_details_information(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
troubleshooting_info = [
test_utilities.aaq_question_test_data["troubleshoot_product_and_os_versions"][
0],
"Firefox " + test_utilities.aaq_question_test_data["troubleshoot_product_and_os_versions"]
[1]
utilities.aaq_question_test_data["troubleshoot_product_and_os_versions"][0],
"Firefox " + utilities.aaq_question_test_data["troubleshoot_product_and_os_versions"][1]
]
with allure.step("Signing in with an admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Navigating to each product aaq form and and adding data without "
"submitting the form"):
for product in test_utilities.general_test_data["freemium_products"]:
for product in utilities.general_test_data["freemium_products"]:
if product == "Thunderbird":
continue
else:
test_utilities.navigate_to_link(
test_utilities.aaq_question_test_data["products_aaq_url"][product])
utilities.navigate_to_link(
utilities.aaq_question_test_data["products_aaq_url"][product])
sumo_pages.aaq_flow.add__valid_data_to_all_aaq_fields_without_submitting(
subject=test_utilities.aaq_question_test_data["valid_firefox_question"]
["subject"],
subject=utilities.aaq_question_test_data["valid_firefox_question"]["subject"],
topic_value=sumo_pages.aaq_form_page._get_aaq_form_topic_options()[0],
body_text=test_utilities.aaq_question_test_data["valid_firefox_question"][
body_text=utilities.aaq_question_test_data["valid_firefox_question"][
"question_body"]
)
@ -439,11 +435,11 @@ def test_system_details_information(page: Page):
"product version and OS fields"):
sumo_pages.aaq_form_page._click_on_show_details_option()
sumo_pages.aaq_form_page._add_text_to_product_version_field(
test_utilities.aaq_question_test_data[
utilities.aaq_question_test_data[
"troubleshoot_product_and_os_versions"][1]
)
sumo_pages.aaq_form_page._add_text_to_os_field(
test_utilities.aaq_question_test_data[
utilities.aaq_question_test_data[
"troubleshoot_product_and_os_versions"][0]
)
@ -462,46 +458,44 @@ def test_system_details_information(page: Page):
# C1512592
@pytest.mark.aaqPage
def test_premium_products_aaq(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
aaq_form_messages = AAQFormMessages()
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Navigating to each premium product contact form and sending a ticket"):
for premium_product in test_utilities.general_test_data['premium_products']:
test_utilities.navigate_to_link(
test_utilities.aaq_question_test_data['products_aaq_url'][premium_product]
for premium_product in utilities.general_test_data['premium_products']:
utilities.navigate_to_link(
utilities.aaq_question_test_data['products_aaq_url'][premium_product]
)
test_utilities.wait_for_dom_to_load()
utilities.wait_for_dom_to_load()
if premium_product == 'Mozilla VPN':
sumo_pages.aaq_flow.submit_an_aaq_question(
subject=test_utilities.aaq_question_test_data['premium_aaq_question']
['subject'],
body=test_utilities.aaq_question_test_data['premium_aaq_question']['body'],
subject=utilities.aaq_question_test_data['premium_aaq_question']['subject'],
body=utilities.aaq_question_test_data['premium_aaq_question']['body'],
is_premium=True
)
else:
sumo_pages.aaq_flow.submit_an_aaq_question(
subject=test_utilities.aaq_question_test_data['premium_aaq_question']
['subject'],
body=test_utilities.aaq_question_test_data['premium_aaq_question']['body'],
subject=utilities.aaq_question_test_data['premium_aaq_question']['subject'],
body=utilities.aaq_question_test_data['premium_aaq_question']['body'],
is_premium=True
)
with allure.step("Verifying that the correct success message is displayed"):
assert sumo_pages.aaq_form_page._get_premium_card_submission_message(
) == aaq_form_messages.get_premium_ticket_submission_success_message(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
)
# C2635907
@pytest.mark.aaqPage
def test_loginless_mozilla_account_aaq(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
aaq_form_messages = AAQFormMessages()
with allure.step("Sending 4 loginless tickets and verifying that the user is successfully "
@ -511,17 +505,17 @@ def test_loginless_mozilla_account_aaq(page: Page):
sumo_pages.top_navbar._click_on_signin_signup_button()
sumo_pages.auth_page._click_on_cant_sign_in_to_my_mozilla_account_link()
sumo_pages.aaq_flow.submit_an_aaq_question(
subject=test_utilities.aaq_question_test_data['premium_aaq_question']['subject'],
body=test_utilities.aaq_question_test_data['premium_aaq_question']['body'],
subject=utilities.aaq_question_test_data['premium_aaq_question']['subject'],
body=utilities.aaq_question_test_data['premium_aaq_question']['body'],
is_premium=True,
email=test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"],
email=utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"],
is_loginless=True
)
if i <= 3:
with allure.step("Verifying that the correct success message is displayed"):
assert sumo_pages.aaq_form_page._get_premium_card_submission_message(
) == aaq_form_messages.get_premium_ticket_submission_success_message(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
)
else:
with allure.step("Verifying that submission error message is displayed"):

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -3,7 +3,7 @@ import pytest
from pytest_check import check
from playwright.sync_api import TimeoutError, expect, Error, Page
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.ask_a_question_messages.AAQ_messages.aaq_widget import (
AAQWidgetMessages)
from playwright_tests.messages.contribute_messages.con_pages.con_page_messages import (
@ -15,14 +15,14 @@ from playwright_tests.pages.sumo_pages import SumoPages
# C890379
@pytest.mark.productTopicsPage
def test_popular_topics_navbar(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Navigating to product topics pages"):
for product_topic in test_utilities.general_test_data["product_topics"]:
topic_url = test_utilities.general_test_data["product_topics"][product_topic]
for product_topic in utilities.general_test_data["product_topics"]:
topic_url = utilities.general_test_data["product_topics"][product_topic]
page.wait_for_timeout(400)
test_utilities.navigate_to_link(topic_url)
test_utilities.wait_for_url_to_be(topic_url)
utilities.navigate_to_link(topic_url)
utilities.wait_for_url_to_be(topic_url)
for option in sumo_pages.product_topics_page._get_navbar_links_text():
with allure.step(f"Clicking on {option} navbar option"):
@ -30,10 +30,10 @@ def test_popular_topics_navbar(page: Page):
product_topics_page._get_navbar_option_link(option))
sumo_pages.product_topics_page._click_on_a_navbar_option(option)
try:
test_utilities.wait_for_url_to_be(option_url)
utilities.wait_for_url_to_be(option_url)
except (TimeoutError, Error):
sumo_pages.product_topics_page._click_on_a_navbar_option(option)
test_utilities.wait_for_url_to_be(option_url)
utilities.wait_for_url_to_be(option_url)
with check, allure.step("Verifying that the correct option is displayed"):
assert sumo_pages.product_topics_page._get_page_title() == option
@ -45,13 +45,13 @@ def test_popular_topics_navbar(page: Page):
# C2428991
@pytest.mark.productTopicsPage
def test_learn_more_redirect(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Navigating to product topics pages"):
for product_topic in test_utilities.general_test_data["product_topics"]:
topic_url = test_utilities.general_test_data["product_topics"][product_topic]
test_utilities.navigate_to_link(topic_url)
test_utilities.wait_for_url_to_be(topic_url)
for product_topic in utilities.general_test_data["product_topics"]:
topic_url = utilities.general_test_data["product_topics"][product_topic]
utilities.navigate_to_link(topic_url)
utilities.wait_for_url_to_be(topic_url)
with allure.step("Clicking on the 'Learn More' button"):
sumo_pages.product_topics_page._click_on_learn_more_button()
@ -64,18 +64,18 @@ def test_learn_more_redirect(page: Page):
# C2188690
@pytest.mark.productTopicsPage
def test_aaq_redirect(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Navigating to product topics pages"):
count = 0
for product_topic in test_utilities.general_test_data["product_topics"]:
topic_url = test_utilities.general_test_data["product_topics"][product_topic]
test_utilities.navigate_to_link(topic_url)
test_utilities.wait_for_url_to_be(topic_url)
for product_topic in utilities.general_test_data["product_topics"]:
topic_url = utilities.general_test_data["product_topics"][product_topic]
utilities.navigate_to_link(topic_url)
utilities.wait_for_url_to_be(topic_url)
with check, allure.step(f"Verifying that the correct subheading page for "
f"{product_topic} is displayed"):
if product_topic in test_utilities.general_test_data["premium_products"]:
if product_topic in utilities.general_test_data["premium_products"]:
assert sumo_pages.product_topics_page._get_aaq_subheading_text(
) == AAQWidgetMessages.PREMIUM_AAQ_SUBHEADING_TEXT_SIGNED_OUT
else:
@ -89,14 +89,14 @@ def test_aaq_redirect(page: Page):
"form page"):
if count == 0:
sumo_pages.auth_flow_page.sign_in_flow(
username=test_utilities.user_special_chars,
account_password=test_utilities.user_secrets_pass
username=utilities.user_special_chars,
account_password=utilities.user_secrets_pass
)
count += 1
else:
sumo_pages.auth_flow_page.login_with_existing_session()
expect(page).to_have_url(
test_utilities.aaq_question_test_data["products_aaq_url"][product_topic],
utilities.aaq_question_test_data["products_aaq_url"][product_topic],
timeout=30000)
with allure.step("Signing out from SUMO"):

Просмотреть файл

@ -3,7 +3,7 @@ import pytest
from pytest_check import check
from playwright.sync_api import expect, TimeoutError, Page
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.ask_a_question_messages.AAQ_messages.aaq_widget import (
AAQWidgetMessages)
from playwright_tests.messages.ask_a_question_messages.product_solutions_messages import (
@ -15,7 +15,7 @@ from playwright_tests.pages.sumo_pages import SumoPages
# C890370
@pytest.mark.skip
def test_featured_articles_redirect(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the contact support page via the top navbar Get Help > "
"Browse All products"):
@ -45,13 +45,13 @@ def test_featured_articles_redirect(page: Page):
feature_article_page.close()
else:
print(f"{card} has no featured articles displayed!!!")
test_utilities.navigate_back()
utilities.navigate_back()
# C890375, C890379
@pytest.mark.productSolutionsPage
def test_popular_topics_redirect(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the contact support page via the top navbar Get Help > "
"Browse All products"):
@ -89,19 +89,19 @@ def test_popular_topics_redirect(page: Page):
else:
print(f"{card} has no featured articles displayed!!!")
test_utilities.navigate_back()
utilities.navigate_back()
# C890382
@pytest.mark.productSolutionsPage
def test_ask_now_widget_redirect(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the contact support page via the top navbar Get Help > "
"Browse All products"):
sumo_pages.top_navbar._click_on_browse_all_products_option()
count = 0
for freemium_product in test_utilities.general_test_data["freemium_products"]:
for freemium_product in utilities.general_test_data["freemium_products"]:
with allure.step(f"Clicking on the {freemium_product} card "):
sumo_pages.contact_support_page._click_on_a_particular_card(freemium_product)
with check, allure.step("verifying that the correct 'Still need help' subtext is "
@ -118,8 +118,8 @@ def test_ask_now_widget_redirect(page: Page):
sumo_pages.product_solutions_page._click_ask_now_button()
if count == 0:
sumo_pages.auth_flow_page.sign_in_flow(
username=test_utilities.user_special_chars,
account_password=test_utilities.user_secrets_pass,
username=utilities.user_special_chars,
account_password=utilities.user_secrets_pass,
)
count += 1
else:
@ -127,7 +127,7 @@ def test_ask_now_widget_redirect(page: Page):
with allure.step("Verifying that we are on the correct AAQ form page"):
expect(page).to_have_url(
test_utilities.aaq_question_test_data["products_aaq_url"][freemium_product],
utilities.aaq_question_test_data["products_aaq_url"][freemium_product],
timeout=30000)
with allure.step("Signing out and accessing the contact support page via the top "
@ -139,13 +139,13 @@ def test_ask_now_widget_redirect(page: Page):
# C890382
@pytest.mark.productSolutionsPage
def test_contact_support_widget_redirect(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the contact support page via the top navbar Get Help > "
"Browse All products"):
sumo_pages.top_navbar._click_on_browse_all_products_option()
count = 0
for premium_product in test_utilities.general_test_data["premium_products"]:
for premium_product in utilities.general_test_data["premium_products"]:
with allure.step(f"Clicking on the {premium_product} card"):
sumo_pages.contact_support_page._click_on_a_particular_card(premium_product)
@ -164,8 +164,8 @@ def test_contact_support_widget_redirect(page: Page):
if count == 0:
sumo_pages.auth_flow_page.sign_in_flow(
username=test_utilities.user_special_chars,
account_password=test_utilities.user_secrets_pass,
username=utilities.user_special_chars,
account_password=utilities.user_secrets_pass,
)
count += 1
else:
@ -173,7 +173,7 @@ def test_contact_support_widget_redirect(page: Page):
with allure.step("Verifying that we are on the correct AAQ form page"):
expect(page).to_have_url(
test_utilities.aaq_question_test_data["products_aaq_url"][premium_product],
utilities.aaq_question_test_data["products_aaq_url"][premium_product],
timeout=30000)
with allure.step("Signing out and access the contact support page via the top navbar "

Просмотреть файл

@ -4,7 +4,7 @@ import requests
from playwright.sync_api import Page
from pytest_check import check
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.contribute_messages.con_pages.con_forum_messages import (
ContributeForumMessages)
from playwright_tests.messages.contribute_messages.con_pages.con_help_articles_messages import (
@ -24,10 +24,10 @@ from playwright_tests.pages.sumo_pages import SumoPages
# C2165414
@pytest.mark.contributePagesTests
def test_contribute_article_page_text(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the Contribute with help Article page"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
ContributeHelpArticlesMessages.STAGE_CONTRIBUTE_HELP_ARTICLES_PAGE_URL
)
@ -105,10 +105,10 @@ def test_contribute_article_page_text(page: Page):
# C2165414
@pytest.mark.contributePagesTests
def test_contribute_article_page_images_are_not_broken(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the Contribute with help Article page"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
ContributeHelpArticlesMessages.STAGE_CONTRIBUTE_HELP_ARTICLES_PAGE_URL
)
@ -122,10 +122,10 @@ def test_contribute_article_page_images_are_not_broken(page: Page):
# C2165415
@pytest.mark.contributePagesTests
def test_contribute_article_page_breadcrumbs(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the Contribute Forum page"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
ContributeHelpArticlesMessages.STAGE_CONTRIBUTE_HELP_ARTICLES_PAGE_URL
)
@ -148,24 +148,24 @@ def test_contribute_article_page_breadcrumbs(page: Page):
if counter == 1:
with check, allure.step("Verifying that the Contribute breadcrumb redirects to "
"the Contribute page"):
assert test_utilities.get_page_url(
assert utilities.get_page_url(
) == ContributePageMessages.STAGE_CONTRIBUTE_PAGE_URL
test_utilities.navigate_forward()
utilities.navigate_forward()
counter -= 1
elif counter == 0:
with check, allure.step("Verifying that the Home breadcrumb redirects to the "
"Homepage"):
assert test_utilities.get_page_url() == HomepageMessages.STAGE_HOMEPAGE_URL_EN_US
assert utilities.get_page_url() == HomepageMessages.STAGE_HOMEPAGE_URL_EN_US
# Need to add tests for "How you can contribute_messages" section
# C2165418
@pytest.mark.contributePagesTests
def test_contribute_article_other_ways_to_contribute_redirect_to_the_correct_page(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the Contribute Forum page"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
ContributeHelpArticlesMessages.STAGE_CONTRIBUTE_HELP_ARTICLES_PAGE_URL
)
@ -184,6 +184,6 @@ def test_contribute_article_other_ways_to_contribute_redirect_to_the_correct_pag
sumo_pages.ways_to_contribute_pages._click_on_other_way_to_contribute_card(card)
with check, allure.step(f"Verifying that the {ways_to_contribute_links[counter]} "
f"redirects to the correct page"):
assert ways_to_contribute_links[counter] == test_utilities.get_page_url()
test_utilities.navigate_back()
assert ways_to_contribute_links[counter] == utilities.get_page_url()
utilities.navigate_back()
counter += 1

Просмотреть файл

@ -4,7 +4,7 @@ from playwright.sync_api import Page
from pytest_check import check
import requests
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.contribute_messages.con_pages.con_forum_messages import (
ContributeForumMessages)
from playwright_tests.messages.contribute_messages.con_pages.con_help_articles_messages import (
@ -24,12 +24,10 @@ from playwright_tests.pages.sumo_pages import SumoPages
# C2165414
@pytest.mark.contributePagesTests
def test_contribute_forum_page_text(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the Contribute Forum page"):
test_utilities.navigate_to_link(
ContributeForumMessages.STAGE_CONTRIBUTE_FORUM_PAGE_URL
)
utilities.navigate_to_link(ContributeForumMessages.STAGE_CONTRIBUTE_FORUM_PAGE_URL)
with check, allure.step("Verifying that the Contribute Forum page contains the correct "
"strings"):
assert sumo_pages.ways_to_contribute_pages._get_hero_main_header_text(
@ -78,10 +76,10 @@ def test_contribute_forum_page_text(page: Page):
# C2165414
@pytest.mark.contributePagesTests
def test_contribute_forum_page_images_are_not_broken(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the Contribute Forum page"):
test_utilities.navigate_to_link(ContributeForumMessages.STAGE_CONTRIBUTE_FORUM_PAGE_URL)
utilities.navigate_to_link(ContributeForumMessages.STAGE_CONTRIBUTE_FORUM_PAGE_URL)
for link in sumo_pages.ways_to_contribute_pages._get_all_page_image_links():
image_link = link.get_attribute("src")
@ -93,10 +91,10 @@ def test_contribute_forum_page_images_are_not_broken(page: Page):
# C2165415
@pytest.mark.contributePagesTests
def test_contribute_forum_page_breadcrumbs(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the Contribute Forum page"):
test_utilities.navigate_to_link(ContributeForumMessages.STAGE_CONTRIBUTE_FORUM_PAGE_URL)
utilities.navigate_to_link(ContributeForumMessages.STAGE_CONTRIBUTE_FORUM_PAGE_URL)
breadcrumbs = [
ContributeForumMessages.FIRST_BREADCRUMB,
@ -117,25 +115,24 @@ def test_contribute_forum_page_breadcrumbs(page: Page):
if counter == 1:
with check, allure.step("Verifying that the Contribute breadcrumb redirects to "
"the Contribute page"):
assert test_utilities.get_page_url(
) == ContributePageMessages.STAGE_CONTRIBUTE_PAGE_URL
assert utilities.get_page_url() == ContributePageMessages.STAGE_CONTRIBUTE_PAGE_URL
test_utilities.navigate_forward()
utilities.navigate_forward()
counter -= 1
elif counter == 0:
with check, allure.step("Verifying that the Home breadcrumb redirects to the "
"Homepage"):
assert test_utilities.get_page_url() == HomepageMessages.STAGE_HOMEPAGE_URL_EN_US
assert utilities.get_page_url() == HomepageMessages.STAGE_HOMEPAGE_URL_EN_US
# Need to add tests for "How you can contribute_messages" section
# C2165418
@pytest.mark.contributePagesTests
def test_contribute_forum_other_ways_to_contribute_redirect_to_the_correct_page(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the Contribute Forum page"):
test_utilities.navigate_to_link(ContributeForumMessages.STAGE_CONTRIBUTE_FORUM_PAGE_URL)
utilities.navigate_to_link(ContributeForumMessages.STAGE_CONTRIBUTE_FORUM_PAGE_URL)
ways_to_contribute_links = [
ContributeHelpArticlesMessages.STAGE_CONTRIBUTE_HELP_ARTICLES_PAGE_URL,
@ -152,6 +149,6 @@ def test_contribute_forum_other_ways_to_contribute_redirect_to_the_correct_page(
sumo_pages.ways_to_contribute_pages._click_on_other_way_to_contribute_card(card)
with check, allure.step("Verifying that the 'other ways to contribute_messages' "
"cards are redirecting to the correct SUMO page"):
assert ways_to_contribute_links[counter] == test_utilities.get_page_url()
test_utilities.navigate_back()
assert ways_to_contribute_links[counter] == utilities.get_page_url()
utilities.navigate_back()
counter += 1

Просмотреть файл

@ -4,7 +4,7 @@ from playwright.sync_api import Page
from pytest_check import check
import requests
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.contribute_messages.con_pages.con_forum_messages import (
ContributeForumMessages)
from playwright_tests.messages.contribute_messages.con_pages.con_help_articles_messages import (
@ -24,10 +24,10 @@ from playwright_tests.pages.sumo_pages import SumoPages
# C2176356
@pytest.mark.contributePagesTests
def test_contribute_localization_page_text(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the Contribute localization page"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
ContributeLocalizationMessages.STAGE_CONTRIBUTE_LOCALIZATION_PAGE_URL
)
@ -75,10 +75,10 @@ def test_contribute_localization_page_text(page: Page):
# C2176356
@pytest.mark.contributePagesTests
def test_contribute_localization_page_images_are_not_broken(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the Contribute localization page"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
ContributeLocalizationMessages.STAGE_CONTRIBUTE_LOCALIZATION_PAGE_URL
)
@ -92,10 +92,10 @@ def test_contribute_localization_page_images_are_not_broken(page: Page):
# C2176357
@pytest.mark.contributePagesTests
def test_contribute_localization_page_breadcrumbs(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the Contribute localization page"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
ContributeLocalizationMessages.STAGE_CONTRIBUTE_LOCALIZATION_PAGE_URL
)
@ -117,15 +117,15 @@ def test_contribute_localization_page_breadcrumbs(page: Page):
if counter == 1:
with check, allure.step("Verifying that the Contribute breadcrumb redirects to "
"the Contribute page"):
assert test_utilities.get_page_url(
assert utilities.get_page_url(
) == ContributePageMessages.STAGE_CONTRIBUTE_PAGE_URL
test_utilities.navigate_forward()
utilities.navigate_forward()
counter -= 1
elif counter == 0:
with check, allure.step("Verifying that the Home breadcrumb redirects to the "
"Homepage"):
assert test_utilities.get_page_url() == HomepageMessages.STAGE_HOMEPAGE_URL_EN_US
assert utilities.get_page_url() == HomepageMessages.STAGE_HOMEPAGE_URL_EN_US
# Need to add tests for "How you can contribute_messages" section
@ -133,10 +133,10 @@ def test_contribute_localization_page_breadcrumbs(page: Page):
# C2176360
@pytest.mark.contributePagesTests
def test_contribute_localization_other_ways_to_contribute_redirect_to_the_correct_page(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the Contribute Forum page"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
ContributeLocalizationMessages.STAGE_CONTRIBUTE_LOCALIZATION_PAGE_URL
)
@ -155,6 +155,6 @@ def test_contribute_localization_other_ways_to_contribute_redirect_to_the_correc
sumo_pages.ways_to_contribute_pages._click_on_other_way_to_contribute_card(card)
with check, allure.step("Verifying that the 'other ways to contribute_messages' "
"cards are redirecting to the correct SUMO page"):
assert ways_to_contribute_links[counter] == test_utilities.get_page_url()
test_utilities.navigate_back()
assert ways_to_contribute_links[counter] == utilities.get_page_url()
utilities.navigate_back()
counter += 1

Просмотреть файл

@ -4,7 +4,7 @@ from playwright.sync_api import Page
from pytest_check import check
import requests
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.contribute_messages.con_pages.con_forum_messages import (
ContributeForumMessages)
from playwright_tests.messages.contribute_messages.con_pages.con_help_articles_messages import (
@ -24,10 +24,10 @@ from playwright_tests.pages.sumo_pages import SumoPages
# C2176366
@pytest.mark.contributePagesTests
def test_contribute_mobile_page_text(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the Contribute Mobile Store page"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
ContributeMobileSupportMessages.STAGE_CONTRIBUTE_MOBILE_SUPPORT_PAGE_URL
)
@ -75,10 +75,10 @@ def test_contribute_mobile_page_text(page: Page):
# C2176366
@pytest.mark.contributePagesTests
def test_contribute_mobile_page_images_are_not_broken(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the Contribute Mobile store page"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
ContributeMobileSupportMessages.STAGE_CONTRIBUTE_MOBILE_SUPPORT_PAGE_URL
)
@ -92,10 +92,10 @@ def test_contribute_mobile_page_images_are_not_broken(page: Page):
# C2176367
@pytest.mark.contributePagesTests
def test_contribute_mobile_page_breadcrumbs(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the Contribute Mobile Store page"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
ContributeMobileSupportMessages.STAGE_CONTRIBUTE_MOBILE_SUPPORT_PAGE_URL
)
@ -119,14 +119,14 @@ def test_contribute_mobile_page_breadcrumbs(page: Page):
if counter == 1:
with check, allure.step("Verifying that the Contribute breadcrumb redirects to "
"the Contribute page"):
assert test_utilities.get_page_url(
assert utilities.get_page_url(
) == ContributePageMessages.STAGE_CONTRIBUTE_PAGE_URL
test_utilities.navigate_forward()
utilities.navigate_forward()
counter -= 1
elif counter == 0:
with check, allure.step("Verifying that the Home breadcrumb redirects to the "
"Homepage"):
assert test_utilities.get_page_url() == HomepageMessages.STAGE_HOMEPAGE_URL_EN_US
assert utilities.get_page_url() == HomepageMessages.STAGE_HOMEPAGE_URL_EN_US
# Need to add tests for "How you can contribute_messages" section
@ -134,10 +134,10 @@ def test_contribute_mobile_page_breadcrumbs(page: Page):
# C2176370
@pytest.mark.contributePagesTests
def test_contribute_mobile_other_ways_to_contribute_redirect_to_the_correct_page(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the Contribute Mobile Store page"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
ContributeMobileSupportMessages.STAGE_CONTRIBUTE_MOBILE_SUPPORT_PAGE_URL
)
@ -156,6 +156,6 @@ def test_contribute_mobile_other_ways_to_contribute_redirect_to_the_correct_page
sumo_pages.ways_to_contribute_pages._click_on_other_way_to_contribute_card(card)
with check, allure.step("Verifying that the 'other ways to contribute_messages' "
"cards are redirecting to the correct SUMO page"):
assert ways_to_contribute_links[counter] == test_utilities.get_page_url()
test_utilities.navigate_back()
assert ways_to_contribute_links[counter] == utilities.get_page_url()
utilities.navigate_back()
counter += 1

Просмотреть файл

@ -4,7 +4,7 @@ from playwright.sync_api import Page
from pytest_check import check
import requests
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.contribute_messages.con_pages.con_forum_messages import (
ContributeForumMessages)
from playwright_tests.messages.contribute_messages.con_pages.con_help_articles_messages import (
@ -88,7 +88,7 @@ def test_contribute_page_images_are_not_broken(page: Page):
# C1949333
@pytest.mark.contributePagesTests
def test_contribute_page_breadcrumbs(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Clicking on the Contribute top-navbar option"):
sumo_pages.top_navbar._click_on_contribute_top_navbar_option()
@ -103,13 +103,13 @@ def test_contribute_page_breadcrumbs(page: Page):
with allure.step("Verifying that the home breadcrumb redirects to the homepage"):
sumo_pages.contribute_page._click_on_home_breadcrumb()
assert test_utilities.get_page_url() == HomepageMessages.STAGE_HOMEPAGE_URL_EN_US
assert utilities.get_page_url() == HomepageMessages.STAGE_HOMEPAGE_URL_EN_US
# C1949335,C1949336,C1949337,C1949338,C1949339,C1949355
@pytest.mark.contributePagesTests
def test_way_to_contribute_redirects_to_correct_page(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Clicking on the Contribute top-navbar option"):
sumo_pages.top_navbar._click_on_contribute_top_navbar_option()
@ -128,6 +128,6 @@ def test_way_to_contribute_redirects_to_correct_page(page: Page):
sumo_pages.contribute_page._click_on_way_to_contribute_card(card)
with check, allure.step("Verifying that the 'way to contribute_messages' cards are "
"redirecting to the correct SUMO page"):
assert ways_to_contribute_links[counter] == test_utilities.get_page_url()
test_utilities.navigate_back()
assert ways_to_contribute_links[counter] == utilities.get_page_url()
utilities.navigate_back()
counter += 1

Просмотреть файл

@ -4,7 +4,7 @@ from playwright.sync_api import Page
from pytest_check import check
import requests
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.contribute_messages.con_pages.con_forum_messages import (
ContributeForumMessages)
from playwright_tests.messages.contribute_messages.con_pages.con_help_articles_messages import (
@ -24,10 +24,10 @@ from playwright_tests.pages.sumo_pages import SumoPages
# C2176361
@pytest.mark.contributePagesTests
def test_contribute_social_page_text(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the Contribute Social Channels page"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
ContributeSocialSupportMessages.STAGE_CONTRIBUTE_SOCIAL_SUPPORT_PAGE_URL
)
@ -96,10 +96,10 @@ def test_contribute_social_page_text(page: Page):
# C2176361
@pytest.mark.contributePagesTests
def test_contribute_social_page_images_are_not_broken(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the Contribute Forum page"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
ContributeSocialSupportMessages.STAGE_CONTRIBUTE_SOCIAL_SUPPORT_PAGE_URL
)
@ -113,10 +113,10 @@ def test_contribute_social_page_images_are_not_broken(page: Page):
# C2176362
@pytest.mark.contributePagesTests
def test_contribute_social_page_breadcrumbs(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the Contribute Forum page"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
ContributeSocialSupportMessages.STAGE_CONTRIBUTE_SOCIAL_SUPPORT_PAGE_URL
)
@ -139,24 +139,24 @@ def test_contribute_social_page_breadcrumbs(page: Page):
if counter == 1:
with check, allure.step("Verifying that the Contribute breadcrumb redirects to "
"the Contribute page"):
assert test_utilities.get_page_url(
assert utilities.get_page_url(
) == ContributePageMessages.STAGE_CONTRIBUTE_PAGE_URL
test_utilities.navigate_forward()
utilities.navigate_forward()
counter -= 1
elif counter == 0:
with check, allure.step("Verifying that the Home breadcrumb redirects to the "
"Homepage"):
assert test_utilities.get_page_url() == HomepageMessages.STAGE_HOMEPAGE_URL_EN_US
assert utilities.get_page_url() == HomepageMessages.STAGE_HOMEPAGE_URL_EN_US
# Need to add tests for "How you can contribute_messages" section
# C2176364
@pytest.mark.contributePagesTests
def test_contribute_social_other_ways_to_contribute_redirect_to_the_correct_page(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Accessing the Contribute Forum page"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
ContributeSocialSupportMessages.STAGE_CONTRIBUTE_SOCIAL_SUPPORT_PAGE_URL
)
@ -175,6 +175,6 @@ def test_contribute_social_other_ways_to_contribute_redirect_to_the_correct_page
sumo_pages.ways_to_contribute_pages._click_on_other_way_to_contribute_card(card)
with check, allure.step("Verifying that the 'other ways to contribute_messages'n "
"cards are redirecting to the correct SUMO page"):
assert ways_to_contribute_links[counter] == test_utilities.get_page_url()
test_utilities.navigate_back()
assert ways_to_contribute_links[counter] == utilities.get_page_url()
utilities.navigate_back()
counter += 1

Просмотреть файл

@ -2,7 +2,7 @@ import allure
import pytest
from pytest_check import check
from playwright.sync_api import expect, Page
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.contribute_messages.con_tools.kb_dashboard_messages import (
KBDashboardPageMessages)
from playwright_tests.pages.sumo_pages import SumoPages
@ -11,18 +11,18 @@ from playwright_tests.pages.sumo_pages import SumoPages
# C891357
@pytest.mark.kbDashboard
def test_unreviewed_articles_visibility_in_kb_dashboard(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
kb_dashboard_page_messages = KBDashboardPageMessages()
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Create a new simple article"):
article_details = sumo_pages.submit_kb_article_flow.submit_simple_kb_article()
sumo_pages.kb_article_page._click_on_article_option()
article_url = test_utilities.get_page_url()
article_url = utilities.get_page_url()
with allure.step("Navigating to the kb dashboards and clicking on the 'Complete "
"overview' option"):
@ -30,8 +30,7 @@ def test_unreviewed_articles_visibility_in_kb_dashboard(page: Page):
sumo_pages.kb_dashboard_page._click_on_the_complete_overview_link()
with allure.step("Verifying that we are redirected to the correct page"):
expect(page).to_have_url(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
expect(page).to_have_url(utilities.general_test_data['dashboard_links']['kb_overview'])
with check, allure.step("Verifying that the correct live status is displayed"):
assert sumo_pages.kb_dashboard_page._get_a_particular_article_status(
@ -42,7 +41,7 @@ def test_unreviewed_articles_visibility_in_kb_dashboard(page: Page):
with allure.step("Signing out and verifying that the article is not displayed since it "
"is not live yet"):
test_utilities.delete_cookies()
utilities.delete_cookies()
expect(
sumo_pages.kb_dashboard_page._get_a_particular_article_title_locator(
article_details['article_title']
@ -52,14 +51,13 @@ def test_unreviewed_articles_visibility_in_kb_dashboard(page: Page):
with allure.step("Navigating to the homepage and performing the sign in step since the "
"kb overview takes quite a bit to refresh/load"):
sumo_pages.top_navbar._click_on_sumo_nav_logo()
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
))
with allure.step("Navigating to the kb overview verifying that the article is not "
"displayed since it is not live yet"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(utilities.general_test_data['dashboard_links']['kb_overview'])
expect(
sumo_pages.kb_dashboard_page._get_a_particular_article_title_locator(
article_details['article_title']
@ -68,13 +66,12 @@ def test_unreviewed_articles_visibility_in_kb_dashboard(page: Page):
with allure.step("Signing in with an admin account"):
sumo_pages.top_navbar._click_on_sumo_nav_logo()
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Navigating to the kb overview page and clicking on the article title"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(utilities.general_test_data['dashboard_links']['kb_overview'])
sumo_pages.kb_dashboard_page._click_on_article_title(article_details['article_title'])
with allure.step("Verifying that the user is redirected to the correct kb page"):
@ -85,14 +82,13 @@ def test_unreviewed_articles_visibility_in_kb_dashboard(page: Page):
with check, allure.step("Navigating back to the kb overview page and verifying that the "
"correct live status is displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(utilities.general_test_data['dashboard_links']['kb_overview'])
assert sumo_pages.kb_dashboard_page._get_a_particular_article_status(
article_details['article_title']
).strip() == kb_dashboard_page_messages.KB_LIVE_STATUS
with allure.step("Signing out and verifying that the article is visible"):
test_utilities.delete_cookies()
utilities.delete_cookies()
expect(
sumo_pages.kb_dashboard_page._get_a_particular_article_title_locator(
article_details['article_title']
@ -101,14 +97,14 @@ def test_unreviewed_articles_visibility_in_kb_dashboard(page: Page):
with allure.step("Signing in with a non-admin user"):
sumo_pages.top_navbar._click_on_sumo_nav_logo()
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
))
with allure.step("Navigating to the kb overview and verifying that the article is "
"visible"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['kb_overview'])
expect(
sumo_pages.kb_dashboard_page._get_a_particular_article_title_locator(
article_details['article_title']
@ -117,11 +113,11 @@ def test_unreviewed_articles_visibility_in_kb_dashboard(page: Page):
with allure.step("Signing back with an admin account and deleting the article"):
sumo_pages.top_navbar._click_on_sumo_nav_logo()
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['kb_overview'])
sumo_pages.kb_dashboard_page._click_on_article_title(article_details['article_title'])
sumo_pages.kb_article_deletion_flow.delete_kb_article()
@ -129,12 +125,12 @@ def test_unreviewed_articles_visibility_in_kb_dashboard(page: Page):
# C2266376
@pytest.mark.kbDashboard
def test_kb_dashboard_articles_status(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
kb_dashboard_page_messages = KBDashboardPageMessages()
with allure.step("Signing in with the admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Creating a new simple article"):
@ -142,15 +138,15 @@ def test_kb_dashboard_articles_status(page: Page):
approve_first_revision=True
)
article_url = test_utilities.get_page_url()
article_url = utilities.get_page_url()
with allure.step("Creating a anew revision for the document"):
second_revision = sumo_pages.submit_kb_article_flow.submit_new_kb_revision()
with check, allure.step("Navigating to the kb overview dashboard and verifying that the "
"correct status is displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['kb_overview'])
assert sumo_pages.kb_dashboard_page._get_a_particular_article_status(
article_details['article_title']
).strip() == kb_dashboard_page_messages.get_kb_not_live_status(
@ -158,7 +154,7 @@ def test_kb_dashboard_articles_status(page: Page):
)
with allure.step("Navigating back to the article history and deleting the revision"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.kb_article_show_history_page._click_on_delete_revision_button(
second_revision['revision_id']
)
@ -166,8 +162,7 @@ def test_kb_dashboard_articles_status(page: Page):
with check, allure.step("Navigating back to the kb dashboard and verifying that the live "
"status is displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(utilities.general_test_data['dashboard_links']['kb_overview'])
assert sumo_pages.kb_dashboard_page._get_a_particular_article_status(
article_details['article_title']
).strip() == kb_dashboard_page_messages.KB_LIVE_STATUS
@ -180,12 +175,12 @@ def test_kb_dashboard_articles_status(page: Page):
# C2496647
@pytest.mark.kbDashboard
def test_kb_dashboard_revision_deferred_status(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
kb_dashboard_page_messages = KBDashboardPageMessages()
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Creating a new simple article"):
@ -193,22 +188,21 @@ def test_kb_dashboard_revision_deferred_status(page: Page):
approve_first_revision=True
)
article_url = test_utilities.get_page_url()
article_url = utilities.get_page_url()
with allure.step("Creating a new revision for the document"):
second_revision = sumo_pages.submit_kb_article_flow.submit_new_kb_revision()
with check, allure.step("Navigating to the kb overview page and verifying that the "
"correct kb status is displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(utilities.general_test_data['dashboard_links']['kb_overview'])
assert sumo_pages.kb_dashboard_page._get_a_particular_article_status(
article_details['article_title']
) == kb_dashboard_page_messages.get_kb_not_live_status(
second_revision['changes_description'])
with allure.step("Navigating back to the article history page and deferring the revision"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.kb_article_show_history_page._click_on_review_revision(
second_revision['revision_id']
)
@ -217,25 +211,24 @@ def test_kb_dashboard_revision_deferred_status(page: Page):
with check, allure.step("Navigating back to the kb overview page and verifying that the "
"correct status is displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(utilities.general_test_data['dashboard_links']['kb_overview'])
assert sumo_pages.kb_dashboard_page._get_a_particular_article_status(
article_details['article_title']
) == kb_dashboard_page_messages.KB_LIVE_STATUS
with allure.step("Deleting the article"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.kb_article_deletion_flow.delete_kb_article()
# C2496646
@pytest.mark.kbDashboard
def test_kb_dashboard_needs_update_when_reviewing_a_revision(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Creating a new simple article"):
@ -243,7 +236,7 @@ def test_kb_dashboard_needs_update_when_reviewing_a_revision(page: Page):
approve_first_revision=True
)
article_url = test_utilities.get_page_url()
article_url = utilities.get_page_url()
with allure.step("Creating an new article revision for the document"):
second_revision = sumo_pages.submit_kb_article_flow.submit_new_kb_revision()
@ -253,26 +246,25 @@ def test_kb_dashboard_needs_update_when_reviewing_a_revision(page: Page):
with check, allure.step("Navigating to the kb dashboard overview page and verifying that "
"the correct article status is displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(utilities.general_test_data['dashboard_links']['kb_overview'])
assert sumo_pages.kb_dashboard_page._get_needs_update_status(
article_details['article_title']
).strip() == test_utilities.kb_revision_test_data['needs_change_message']
).strip() == utilities.kb_revision_test_data['needs_change_message']
with allure.step("Deleting the article"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.kb_article_deletion_flow.delete_kb_article()
# C2266377, C2243456, C2496646
@pytest.mark.kbDashboard
def test_kb_dashboard_needs_update_edit_metadata(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
kb_dashboard_page_messages = KBDashboardPageMessages()
with allure.step("Signing in with the admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Create a new simple article"):
@ -280,7 +272,7 @@ def test_kb_dashboard_needs_update_edit_metadata(page: Page):
approve_first_revision=True
)
article_url = test_utilities.get_page_url()
article_url = utilities.get_page_url()
with allure.step("Clicking on the 'Edit Article Metadata' option and enabling the 'Needs "
"change with comment' option"):
@ -290,58 +282,55 @@ def test_kb_dashboard_needs_update_edit_metadata(page: Page):
with check, allure.step("Navigating to the kb dashboard and verifying that the correct "
"needs change status is displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(utilities.general_test_data['dashboard_links']['kb_overview'])
assert sumo_pages.kb_dashboard_page._get_needs_update_status(
article_details['article_title']
).strip() == test_utilities.kb_revision_test_data['needs_change_message']
).strip() == utilities.kb_revision_test_data['needs_change_message']
with allure.step("Navigating back to the article's 'Edit Article Metadata' page and "
"removing the comment from the needs change textarea"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.edit_article_metadata_flow.edit_article_metadata(needs_change=True)
with allure.step("Navigating to the complete dashboard list and verifying that the "
"correct needs change status is displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(utilities.general_test_data['dashboard_links']['kb_overview'])
assert sumo_pages.kb_dashboard_page._get_needs_update_status(
article_details['article_title']
).strip() == kb_dashboard_page_messages.GENERAL_POSITIVE_STATUS
with allure.step("Navigating back to the article's 'Edit Article Metadata' page and "
"removing the needs change updates"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.edit_article_metadata_flow.edit_article_metadata()
with check, allure.step("Navigating to the kb overview page and verifying that the "
"correct needs change status is displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(utilities.general_test_data['dashboard_links']['kb_overview'])
assert sumo_pages.kb_dashboard_page._is_needs_change_empty(
article_details['article_title']
)
with allure.step("Deleting the article"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.kb_article_deletion_flow.delete_kb_article()
# C2266378, C2489548
@pytest.mark.kbDashboard
def test_ready_for_l10n_kb_dashboard_revision_approval(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
kb_dashboard_page_messages = KBDashboardPageMessages()
with allure.step("Signing in with the admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Create a new simple article"):
article_details = sumo_pages.submit_kb_article_flow.submit_simple_kb_article()
article_url = test_utilities.get_page_url()
article_url = utilities.get_page_url()
revision_id = sumo_pages.kb_article_show_history_page._get_last_revision_id()
@ -351,26 +340,25 @@ def test_ready_for_l10n_kb_dashboard_revision_approval(page: Page):
with check, allure.step("Navigating to the kb dashboard overview page and verifying that "
"the correct l10n status is displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(utilities.general_test_data['dashboard_links']['kb_overview'])
assert sumo_pages.kb_dashboard_page._get_ready_for_l10n_status(
article_details['article_title']
) == kb_dashboard_page_messages.GENERAL_POSITIVE_STATUS
with allure.step("Deleting the article"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.kb_article_deletion_flow.delete_kb_article()
# C2266378
@pytest.mark.kbDashboard
def test_ready_for_l10n_kb_dashboard_revision_l10n_status(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
kb_dashboard_page_messages = KBDashboardPageMessages()
with allure.step("Signing in with the admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Creating a new kb article"):
@ -378,19 +366,18 @@ def test_ready_for_l10n_kb_dashboard_revision_l10n_status(page: Page):
approve_first_revision=True
)
article_url = test_utilities.get_page_url()
article_url = utilities.get_page_url()
with check, allure.step("Navigating to the kb dashboard overview page and verifying that "
"the correct l10n status is displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(utilities.general_test_data['dashboard_links']['kb_overview'])
assert sumo_pages.kb_dashboard_page._get_ready_for_l10n_status(
article_details['article_title']
) == kb_dashboard_page_messages.GENERAL_NEGATIVE_STATUS
with allure.step("Navigating back to the article page and marking the revision as ready "
"for l10n"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.kb_article_show_history_page._click_on_ready_for_l10n_option(
article_details['first_revision_id']
)
@ -398,26 +385,25 @@ def test_ready_for_l10n_kb_dashboard_revision_l10n_status(page: Page):
with allure.step("Navigating to the kb dashboard overview page and verifying that the "
"correct l10n status is displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(utilities.general_test_data['dashboard_links']['kb_overview'])
assert sumo_pages.kb_dashboard_page._get_ready_for_l10n_status(
article_details['article_title']
) == kb_dashboard_page_messages.GENERAL_POSITIVE_STATUS
with allure.step("Navigating to the article and deleting it"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.kb_article_deletion_flow.delete_kb_article()
# C2266378
@pytest.mark.kbDashboard
def test_article_translation_not_allowed_kb_dashboard(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
kb_dashboard_page_messages = KBDashboardPageMessages()
with allure.step("Signing in with the admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Creating a new simple article & unchecking the allow translations"):
@ -426,86 +412,81 @@ def test_article_translation_not_allowed_kb_dashboard(page: Page):
approve_first_revision=True
)
article_url = test_utilities.get_page_url()
article_url = utilities.get_page_url()
with allure.step("Navigating to the kb dashboard overview page and verifying that the "
"correct l10n status is displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(utilities.general_test_data['dashboard_links']['kb_overview'])
assert sumo_pages.kb_dashboard_page._get_ready_for_l10n_status(
article_details['article_title']
) == kb_dashboard_page_messages.GENERAL_NEGATIVE_STATUS
with allure.step("Deleting the article"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.kb_article_deletion_flow.delete_kb_article()
# C2266379, C2266380
@pytest.mark.kbDashboard
def test_article_stale_kb_dashboard(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
kb_dashboard_page_messages = KBDashboardPageMessages()
with allure.step("Signing in with the admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Create a new simple article & adding an old expiry date"):
article_details = sumo_pages.submit_kb_article_flow.submit_simple_kb_article(
expiry_date=test_utilities.kb_article_test_data['old_expiry_date'],
expiry_date=utilities.kb_article_test_data['old_expiry_date'],
approve_first_revision=True
)
article_url = test_utilities.get_page_url()
article_url = utilities.get_page_url()
with check, allure.step("Navigating to the kb dashboard overview page and verifying that "
"the correct stale status and date is displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(utilities.general_test_data['dashboard_links']['kb_overview'])
assert sumo_pages.kb_dashboard_page._get_stale_status(
article_details['article_title']
) == kb_dashboard_page_messages.GENERAL_POSITIVE_STATUS
assert sumo_pages.kb_dashboard_page._get_existing_expiry_date(
article_details['article_title']
) == test_utilities.convert_string_to_datetime(
test_utilities.kb_article_test_data['old_expiry_date']
) == utilities.convert_string_to_datetime(
utilities.kb_article_test_data['old_expiry_date']
)
with allure.step("Navigating back to the article and creating a new revision with a "
"non-stale expiry date"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.submit_kb_article_flow.submit_new_kb_revision(
expiry_date=test_utilities.kb_article_test_data['expiry_date'],
expiry_date=utilities.kb_article_test_data['expiry_date'],
approve_revision=True
)
with check, allure.step("Navigating to the kb dashboard and verifying that the correct "
"stale status and date is displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(utilities.general_test_data['dashboard_links']['kb_overview'])
assert sumo_pages.kb_dashboard_page._is_stale_status_empty(
article_details['article_title']
)
assert sumo_pages.kb_dashboard_page._get_existing_expiry_date(
article_details['article_title']
) == test_utilities.convert_string_to_datetime(
test_utilities.kb_article_test_data['expiry_date']
)
) == utilities.convert_string_to_datetime(utilities.kb_article_test_data['expiry_date'])
with allure.step("Deleting the article"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.kb_article_deletion_flow.delete_kb_article()
@pytest.mark.kbDashboard
def test_article_title_update(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with the admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Creating a new kb article"):
@ -513,12 +494,11 @@ def test_article_title_update(page: Page):
approve_first_revision=True
)
article_url = test_utilities.get_page_url()
article_url = utilities.get_page_url()
with allure.step("Navigating to the kb dashboard overview page and verifying that the "
"correct title is displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(utilities.general_test_data['dashboard_links']['kb_overview'])
expect(
sumo_pages.kb_dashboard_page._get_a_particular_article_title_locator(
article_details['article_title']
@ -527,18 +507,17 @@ def test_article_title_update(page: Page):
with allure.step("Navigating to the article's 'Edit Metadata page' page and changing the "
"title"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
new_article_title = "Updated " + article_details['article_title']
sumo_pages.edit_article_metadata_flow.edit_article_metadata(title=new_article_title)
with allure.step("Navigating back to the kb dashboard page and verifying that the "
"correct title is displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['kb_overview'])
utilities.navigate_to_link(utilities.general_test_data['dashboard_links']['kb_overview'])
expect(sumo_pages.kb_dashboard_page._get_a_particular_article_title_locator(
new_article_title)
).to_be_visible()
with allure.step("Deleting the kb article"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.kb_article_deletion_flow.delete_kb_article()

Просмотреть файл

@ -2,7 +2,7 @@ import allure
import pytest
from pytest_check import check
from playwright.sync_api import expect, Page
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.explore_help_articles.kb_article_revision_page_messages import (
KBArticleRevision)
from playwright_tests.messages.my_profile_pages_messages.my_profile_page_messages import (
@ -13,11 +13,11 @@ from playwright_tests.pages.sumo_pages import SumoPages
# C2499112
@pytest.mark.recentRevisionsDashboard
def test_recent_revisions_revision_availability(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
username = sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -25,12 +25,12 @@ def test_recent_revisions_revision_availability(page: Page):
with allure.step("Creating a new kb article"):
article_details = sumo_pages.submit_kb_article_flow.submit_simple_kb_article()
article_url = test_utilities.get_page_url()
article_url = utilities.get_page_url()
with allure.step("Navigating to the recent revisions dashboard and verifying that the "
"posted article is displayed for admin accounts"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['recent_revisions']
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['recent_revisions']
)
expect(
sumo_pages.recent_revisions_page._get_recent_revision_based_on_article(
@ -40,7 +40,7 @@ def test_recent_revisions_revision_availability(page: Page):
with allure.step("Deleting the user session and verifying that the revision is not "
"displayed for signed out users"):
test_utilities.delete_cookies()
utilities.delete_cookies()
expect(
sumo_pages.recent_revisions_page._get_recent_revision_based_on_article(
article_details['article_title']
@ -50,7 +50,7 @@ def test_recent_revisions_revision_availability(page: Page):
with allure.step("Typing the article creator username inside the 'Users' field and "
"verifying that the article is not displayed"):
sumo_pages.recent_revisions_page._fill_in_users_field(username)
test_utilities.wait_for_given_timeout(2000)
utilities.wait_for_given_timeout(2000)
expect(
sumo_pages.recent_revisions_page._get_recent_revision_based_on_article(
article_details['article_title']
@ -60,8 +60,8 @@ def test_recent_revisions_revision_availability(page: Page):
with allure.step("Clearing the user search field and signing in with a different "
"non-admin account"):
sumo_pages.recent_revisions_page._clearing_the_user_field()
test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_6"]
utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_6"]
)
with allure.step("Verifying that the revision is not displayed for non-admin accounts"):
@ -74,7 +74,7 @@ def test_recent_revisions_revision_availability(page: Page):
with allure.step("Typing the article creator username inside the 'Users' field and "
"verifying that the article is not displayed"):
sumo_pages.recent_revisions_page._fill_in_users_field(username)
test_utilities.wait_for_given_timeout(2000)
utilities.wait_for_given_timeout(2000)
expect(
sumo_pages.recent_revisions_page._get_recent_revision_based_on_article(
article_details['article_title']
@ -84,18 +84,18 @@ def test_recent_revisions_revision_availability(page: Page):
with allure.step("Clearing the user search field and signing in back with the admin "
"account"):
sumo_pages.recent_revisions_page._clearing_the_user_field()
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Navigating to the article page and deleting it"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.kb_article_deletion_flow.delete_kb_article()
with allure.step("Navigating back to the recent revisions page and verifying that the "
"article is no longer displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['recent_revisions']
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['recent_revisions']
)
expect(
sumo_pages.recent_revisions_page._get_recent_revision_based_on_article(
@ -107,11 +107,11 @@ def test_recent_revisions_revision_availability(page: Page):
# C2266240
@pytest.mark.recentRevisionsDashboard
def test_second_revisions_availability(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing back in with the admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Creating a new kb article"):
@ -119,11 +119,11 @@ def test_second_revisions_availability(page: Page):
approve_first_revision=True
)
article_url = test_utilities.get_page_url()
article_url = utilities.get_page_url()
with allure.step("Signing in with a non-admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
))
username = sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -133,8 +133,8 @@ def test_second_revisions_availability(page: Page):
with allure.step("Navigating to the Recent Revisions dashboard and verifying that own "
"revision is visible"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['recent_revisions']
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['recent_revisions']
)
expect(
sumo_pages.recent_revisions_page._get_recent_revision_based_on_article_title_and_user(
@ -144,7 +144,7 @@ def test_second_revisions_availability(page: Page):
with allure.step("Deleting user session and verifying that the recent revision is "
"displayed"):
test_utilities.delete_cookies()
utilities.delete_cookies()
expect(
sumo_pages.recent_revisions_page._get_recent_revision_based_on_article_title_and_user(
article_details['article_title'], username
@ -153,8 +153,8 @@ def test_second_revisions_availability(page: Page):
with allure.step("Signing in with a different non-admin user and verifying that the "
"revision is displayed"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_6"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_6"]
))
expect(
sumo_pages.recent_revisions_page._get_recent_revision_based_on_article_title_and_user(
@ -164,9 +164,9 @@ def test_second_revisions_availability(page: Page):
with allure.step("Signing in with an admin account and verifying that the revision is "
"displayed"):
test_utilities.delete_cookies()
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.delete_cookies()
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
expect(
sumo_pages.recent_revisions_page._get_recent_revision_based_on_article_title_and_user(
@ -175,15 +175,15 @@ def test_second_revisions_availability(page: Page):
).to_be_visible()
with allure.step("Navigating to the article and approving the revision"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.submit_kb_article_flow.approve_kb_revision(second_revision['revision_id'])
test_utilities.wait_for_given_timeout(1000)
utilities.wait_for_given_timeout(1000)
with allure.step("Signing out and verifying that the revision is displayed inside the "
"Recent Revisions dashboard"):
test_utilities.delete_cookies()
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['recent_revisions'])
utilities.delete_cookies()
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['recent_revisions'])
expect(
sumo_pages.recent_revisions_page._get_recent_revision_based_on_article_title_and_user(
article_details['article_title'], username
@ -192,8 +192,8 @@ def test_second_revisions_availability(page: Page):
with allure.step("Signing in with a different non-admin user account and verifying that "
"the revision is visible"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_6"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_6"]
))
expect(
sumo_pages.recent_revisions_page._get_recent_revision_based_on_article_title_and_user(
@ -202,20 +202,20 @@ def test_second_revisions_availability(page: Page):
).to_be_visible()
with allure.step("Signing back in with an admin account an deleting the article"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.kb_article_deletion_flow.delete_kb_article()
with allure.step("Navigating back to the recent revision dashboard, signing out and "
"verifying that the revision is no longer displayed for the deleted kb "
"article"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['recent_revisions']
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['recent_revisions']
)
test_utilities.wait_for_given_timeout(1000)
test_utilities.delete_cookies()
utilities.wait_for_given_timeout(1000)
utilities.delete_cookies()
expect(
sumo_pages.recent_revisions_page._get_recent_revision_based_on_article_title_and_user(
article_details['article_title'], username
@ -224,8 +224,8 @@ def test_second_revisions_availability(page: Page):
with allure.step("Signing in with a different non-admin account and verifying that the "
"revision is no longer displayed for the deleted kb article"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_6"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_6"]
))
expect(
sumo_pages.recent_revisions_page._get_recent_revision_based_on_article_title_and_user(
@ -237,11 +237,11 @@ def test_second_revisions_availability(page: Page):
# C2266240
@pytest.mark.recentRevisionsDashboard
def test_recent_revisions_dashboard_links(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
first_username = sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -251,12 +251,12 @@ def test_recent_revisions_dashboard_links(page: Page):
)
sumo_pages.kb_article_page._click_on_article_option()
article_url = test_utilities.get_page_url()
article_url = utilities.get_page_url()
with allure.step("Navigating to the recent revisions dashboard and verifying that the "
"'Show Diff' option is not available for first revisions"):
sumo_pages.top_navbar._click_on_recent_revisions_option()
test_utilities.wait_for_given_timeout(3000)
utilities.wait_for_given_timeout(3000)
expect(
sumo_pages.recent_revisions_page._get_show_diff_article_locator(
article_title=article_details['article_title'], creator=first_username
@ -265,9 +265,9 @@ def test_recent_revisions_dashboard_links(page: Page):
with allure.step("Navigating to the article page, signing in with a non-admin user and "
"creating a new revision for the article"):
test_utilities.navigate_to_link(article_url)
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
utilities.navigate_to_link(article_url)
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
))
username = sumo_pages.top_navbar._get_text_of_logged_in_username()
second_revision = sumo_pages.submit_kb_article_flow.submit_new_kb_revision()
@ -276,25 +276,25 @@ def test_recent_revisions_dashboard_links(page: Page):
"on the revision date link and verifying that the user is redirected to"
"the correct page"):
sumo_pages.top_navbar._click_on_recent_revisions_option()
test_utilities.wait_for_given_timeout(3000)
test_utilities.delete_cookies()
utilities.wait_for_given_timeout(3000)
utilities.delete_cookies()
sumo_pages.recent_revisions_page._click_on_revision_date_for_article(
article_title=article_details['article_title'], username=username
)
expect(page).to_have_url(
article_url + KBArticleRevision.
KB_REVISION_PREVIEW + str(test_utilities.number_extraction_from_string(
KB_REVISION_PREVIEW + str(utilities.number_extraction_from_string(
second_revision['revision_id']
))
)
with check, allure.step("Verifying that the revision id is the correct one"):
assert sumo_pages.kb_article_preview_revision_page._get_preview_revision_id_text(
) == str(test_utilities.number_extraction_from_string(second_revision['revision_id']))
) == str(utilities.number_extraction_from_string(second_revision['revision_id']))
with allure.step("Navigating back, clicking on the revision title and verifying that the "
"user is redirected to the article page"):
test_utilities.navigate_back()
utilities.navigate_back()
sumo_pages.recent_revisions_page._click_on_article_title(
article_title=article_details['article_title'], creator=username
)
@ -302,10 +302,10 @@ def test_recent_revisions_dashboard_links(page: Page):
with check, allure.step("Navigating back and verifying that the correct comment is "
"displayed"):
test_utilities.navigate_back()
utilities.navigate_back()
assert sumo_pages.recent_revisions_page._get_revision_comment(
article_title=article_details['article_title'], username=username
) == test_utilities.kb_article_test_data['changes_description']
) == utilities.kb_article_test_data['changes_description']
with allure.step("Clicking on the editor and verifying that the user was redirected to "
"the correct page"):
@ -316,7 +316,7 @@ def test_recent_revisions_dashboard_links(page: Page):
with allure.step("Navigating back, clicking on the show diff option and verifying that"
"diff section is displayed"):
test_utilities.navigate_back()
utilities.navigate_back()
sumo_pages.recent_revisions_page._click_on_show_diff_for_article(
article_title=article_details['article_title'], creator=username
)
@ -329,22 +329,22 @@ def test_recent_revisions_dashboard_links(page: Page):
expect(sumo_pages.recent_revisions_page._get_diff_section_locator()).to_be_hidden()
with allure.step("Signing in with an admin account and deleting the article"):
test_utilities.delete_cookies()
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.delete_cookies()
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.kb_article_deletion_flow.delete_kb_article()
# C2266240, C2243449
@pytest.mark.recentRevisionsDashboard
def test_recent_revisions_dashboard_title_and_username_update(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing back in with the admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
first_username = sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -354,27 +354,27 @@ def test_recent_revisions_dashboard_title_and_username_update(page: Page):
)
sumo_pages.kb_article_page._click_on_article_option()
article_url = test_utilities.get_page_url()
article_url = utilities.get_page_url()
with allure.step("Changing the article title via the 'Edit Article Metadata' page"):
sumo_pages.edit_article_metadata_flow.edit_article_metadata(
title=test_utilities.kb_article_test_data['updated_kb_article_title'] + article_details
title=utilities.kb_article_test_data['updated_kb_article_title'] + article_details
['article_title']
)
with allure.step("Editing the username"):
sumo_pages.top_navbar._click_on_edit_profile_option()
new_username = test_utilities.profile_edit_test_data['valid_user_edit']['username']
new_username = utilities.profile_edit_test_data['valid_user_edit']['username']
sumo_pages.edit_my_profile_page._send_text_to_username_field(new_username)
sumo_pages.edit_my_profile_page._click_update_my_profile_button()
with allure.step("Navigating to the recent revisions dashboard and verifying that the "
"correct new username and article title arte displayed"):
sumo_pages.top_navbar._click_on_recent_revisions_option()
test_utilities.wait_for_given_timeout(3000)
utilities.wait_for_given_timeout(3000)
expect(
sumo_pages.recent_revisions_page._get_revision_and_username_locator(
article_title=(test_utilities.kb_article_test_data
article_title=(utilities.kb_article_test_data
['updated_kb_article_title'] + article_details['article_title']),
username=new_username
)
@ -386,26 +386,26 @@ def test_recent_revisions_dashboard_title_and_username_update(page: Page):
sumo_pages.edit_my_profile_page._click_update_my_profile_button()
with allure.step("Deleting the article"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.kb_article_deletion_flow.delete_kb_article()
# C2266241
@pytest.mark.recentRevisionsDashboard
def test_recent_revisions_dashboard_filters(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
start_date = "04052023"
end_date = "05012023"
with allure.step("Navigating to the 'Recent Revisions' dashboard"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['recent_revisions']
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['recent_revisions']
)
with check, allure.step("Selecting the ro locale from the locale filter and verifying "
"that all the displayed revisions are for the 'ro' locale"):
sumo_pages.recent_revisions_page._select_locale_option("ro")
test_utilities.wait_for_given_timeout(3000)
utilities.wait_for_given_timeout(3000)
for tag in sumo_pages.recent_revisions_page._get_list_of_all_locale_tage():
assert tag == "ro"
@ -413,30 +413,30 @@ def test_recent_revisions_dashboard_filters(page: Page):
"filter and verifying that all the displayed revisions are for "
"the posted user"):
sumo_pages.recent_revisions_page._select_locale_option("en-US")
test_utilities.wait_for_given_timeout(3000)
username = test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.wait_for_given_timeout(3000)
username = utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
)
sumo_pages.recent_revisions_page._fill_in_users_field(username)
test_utilities.wait_for_given_timeout(2000)
utilities.wait_for_given_timeout(2000)
for user in sumo_pages.recent_revisions_page._get_list_of_all_editors():
assert user == username
with allure.step("Clearing the user filter, adding data inside the start and end fields"):
sumo_pages.recent_revisions_page._clearing_the_user_field()
test_utilities.wait_for_given_timeout(2000)
utilities.wait_for_given_timeout(2000)
sumo_pages.recent_revisions_page._add_start_date("04052023")
sumo_pages.recent_revisions_page._add_end_date("05012023")
test_utilities.wait_for_given_timeout(2000)
utilities.wait_for_given_timeout(2000)
with check, allure.step("Verifying that the displayed revision dates are between ("
"inclusive) the set start and end date filters"):
extracted_date = []
date_filters = [int(start_date), int(end_date)]
for date in sumo_pages.recent_revisions_page._get_all_revision_dates():
extracted_date.append(test_utilities.extract_date_to_digit_format(
test_utilities.extract_month_day_year_from_string(date)
extracted_date.append(utilities.extract_date_to_digit_format(
utilities.extract_month_day_year_from_string(date)
))
for date in extracted_date:

Просмотреть файл

@ -2,7 +2,7 @@ from typing import Any
import pytest
from playwright.sync_api import Page
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.flows.explore_articles_flows.article_flows.add_kb_article_flow import \
AddKbArticleFlow
from playwright_tests.flows.explore_articles_flows.article_flows.delete_kb_article_flow import \
@ -12,7 +12,7 @@ from playwright_tests.pages.auth_page import AuthPage
@pytest.fixture
def create_delete_article(request, page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
submit_kb_article_flow = AddKbArticleFlow(page)
auth_page = AuthPage(page)
kb_article_deletion_flow = DeleteKbArticleFlow(page)
@ -24,8 +24,8 @@ def create_delete_article(request, page: Page):
def _create_delete_article(username: str, data: dict[str, Any] = {}) -> (
tuple)[dict[str, Any], str]:
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts[username]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts[username]
))
defaults = {
'article_title': None,
@ -50,18 +50,18 @@ def create_delete_article(request, page: Page):
article_data = {**defaults, **data}
article_info = submit_kb_article_flow.submit_simple_kb_article(**article_data)
created_articles_url.append(article_info['article_url'])
return article_info, test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_MODERATOR']
return article_info, utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_MODERATOR']
)
yield _create_delete_article
if auto_close:
for article_link in created_articles_url:
test_utilities.navigate_to_link(article_link)
utilities.navigate_to_link(article_link)
if auth_page._is_logged_in_sign_in_button_displayed():
test_utilities.start_existing_session(
test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_MODERATOR']
utilities.start_existing_session(
utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_MODERATOR']
))
kb_article_deletion_flow.delete_kb_article()

Просмотреть файл

@ -1,7 +1,7 @@
import allure
from pytest_check import check
import pytest
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright.sync_api import expect, Page
from playwright_tests.messages.ask_a_question_messages.AAQ_messages.question_page_messages import \
@ -24,11 +24,11 @@ from playwright_tests.pages.sumo_pages import SumoPages
@pytest.mark.kbArticleShowHistory
@pytest.mark.create_delete_article(False)
def test_kb_article_removal(page: Page, create_delete_article):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
kb_show_history_page_messages = KBArticleShowHistoryPageMessages()
article_details = create_delete_article("TEST_ACCOUNT_12")[0]
revision_id_number = test_utilities.number_extraction_from_string(
revision_id_number = utilities.number_extraction_from_string(
article_details['first_revision_id']
)
@ -43,7 +43,7 @@ def test_kb_article_removal(page: Page, create_delete_article):
with check, allure.step("Verifying that manually navigating to the delete revision "
"endpoint returns 403"):
with page.expect_navigation() as navigation_info:
test_utilities.navigate_to_link(
utilities.navigate_to_link(
kb_show_history_page_messages.get_delete_revision_endpoint(
article_details["article_slug"], revision_id_number
))
@ -52,14 +52,14 @@ def test_kb_article_removal(page: Page, create_delete_article):
with allure.step("Navigating back and verifying that the delete button for the article "
"is not displayed"):
test_utilities.navigate_to_link(article_details["article_url"])
utilities.navigate_to_link(article_details["article_url"])
expect(sumo_pages.kb_article_show_history_page._get_delete_this_document_button_locator(
)).to_be_hidden()
with check, allure.step("Verifying that manually navigating to the delete endpoint "
"returns 403"):
with page.expect_navigation() as navigation_info:
test_utilities.navigate_to_link(
utilities.navigate_to_link(
KBArticlePageMessages
.KB_ARTICLE_PAGE_URL + article_details['article_slug'] + QuestionPageMessages
.DELETE_QUESTION_URL_ENDPOINT
@ -68,29 +68,29 @@ def test_kb_article_removal(page: Page, create_delete_article):
assert response.status == 403
with allure.step("Navigating back and deleting the user session"):
test_utilities.navigate_to_link(article_details["article_url"])
test_utilities.delete_cookies()
utilities.navigate_to_link(article_details["article_url"])
utilities.delete_cookies()
with check, allure.step("Manually navigating to the delete revision endpoint and "
"verifying that the auth page is returned"):
test_utilities.navigate_to_link(kb_show_history_page_messages.get_delete_revision_endpoint(
utilities.navigate_to_link(kb_show_history_page_messages.get_delete_revision_endpoint(
article_details["article_slug"], revision_id_number
))
assert FxAPageMessages.AUTH_PAGE_URL in test_utilities.get_page_url()
assert FxAPageMessages.AUTH_PAGE_URL in utilities.get_page_url()
with check, allure.step("Navigating back and verifying that manually navigating to the "
"delete endpoint returns the auth page"):
test_utilities.navigate_to_link(article_details["article_url"])
test_utilities.navigate_to_link(
utilities.navigate_to_link(article_details["article_url"])
utilities.navigate_to_link(
KBArticlePageMessages
.KB_ARTICLE_PAGE_URL + article_details['article_slug'] + QuestionPageMessages
.DELETE_QUESTION_URL_ENDPOINT
)
assert FxAPageMessages.AUTH_PAGE_URL in test_utilities.get_page_url()
assert FxAPageMessages.AUTH_PAGE_URL in utilities.get_page_url()
with allure.step("Navigating back and verifying that the delete button is not available "
"for the only revision"):
test_utilities.navigate_to_link(article_details["article_url"])
utilities.navigate_to_link(article_details["article_url"])
expect(sumo_pages.kb_article_show_history_page._get_delete_revision_button_locator(
article_details['first_revision_id'])).to_be_hidden()
@ -99,8 +99,8 @@ def test_kb_article_removal(page: Page, create_delete_article):
)).to_be_hidden()
with allure.step("Signing in with an admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with check, allure.step("Clicking on the delete revision button for the only available "
@ -155,7 +155,7 @@ def test_kb_article_removal(page: Page, create_delete_article):
"that the article was successfully deleted"):
sumo_pages.kb_article_deletion_flow.delete_kb_article()
with page.expect_navigation() as navigation_info:
test_utilities.navigate_to_link(
utilities.navigate_to_link(
KBArticlePageMessages.
KB_ARTICLE_PAGE_URL + article_details['article_slug'] + "/"
)
@ -166,9 +166,9 @@ def test_kb_article_removal(page: Page, create_delete_article):
# C2490047, C2490048
@pytest.mark.kbArticleShowHistory
def test_kb_article_category_link_and_header(page: Page, create_delete_article):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
for category in test_utilities.general_test_data["kb_article_categories"]:
for category in utilities.general_test_data["kb_article_categories"]:
if category != "Templates":
with allure.step("Creating a new article"):
article_info = create_delete_article("TEST_ACCOUNT_MODERATOR",
@ -199,16 +199,16 @@ def test_kb_article_category_link_and_header(page: Page, create_delete_article):
sumo_pages.kb_article_show_history_page._click_on_show_history_category()
expect(
page
).to_have_url(test_utilities.different_endpoints['kb_categories_links'][category])
).to_have_url(utilities.different_endpoints['kb_categories_links'][category])
with allure.step("Navigating back and deleting the article"):
test_utilities.navigate_back()
utilities.navigate_back()
# C2101637, C2489543, C2102169, C2489542
@pytest.mark.kbArticleShowHistory
def test_kb_article_contributor_removal(page: Page, create_delete_article):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
kb_show_history_page_messages = KBArticleShowHistoryPageMessages()
article_details, username_one = create_delete_article("TEST_ACCOUNT_MODERATOR")
@ -233,7 +233,7 @@ def test_kb_article_contributor_removal(page: Page, create_delete_article):
sumo_pages.kb_article_show_history_page._click_on_edit_contributors_option()
sumo_pages.kb_article_show_history_page._click_on_delete_button_for_a_particular_contributor(
username_one)
deletion_link = test_utilities.get_page_url()
deletion_link = utilities.get_page_url()
with check, allure.step("Navigating back by hitting the cancel button. clicking on the "
"Article menu option and verifying that the user is displayed "
@ -246,8 +246,8 @@ def test_kb_article_contributor_removal(page: Page, create_delete_article):
with allure.step("Navigating back to the 'Show History page' and signing in with a "
"non-admin account"):
sumo_pages.kb_article_page._click_on_show_history_option()
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
username_two = sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -262,16 +262,14 @@ def test_kb_article_contributor_removal(page: Page, create_delete_article):
with check, allure.step("Manually navigating to the deletion link and verifying that 403 "
"is returned"):
with page.expect_navigation() as navigation_info:
test_utilities.navigate_to_link(
deletion_link
)
utilities.navigate_to_link(deletion_link)
response = navigation_info.value
assert response.status == 403
with check, allure.step("Navigating back, clicking on the Article menu and verifying "
"that the user is not displayed inside the article contributors "
"section"):
test_utilities.navigate_to_link(article_details['article_url'])
utilities.navigate_to_link(article_details['article_url'])
sumo_pages.kb_article_page._click_on_article_option()
assert (username_two not in sumo_pages.kb_article_page
._get_list_of_kb_article_contributors())
@ -279,21 +277,21 @@ def test_kb_article_contributor_removal(page: Page, create_delete_article):
with allure.step("Navigating back to the 'Show History page', deleting the user session "
"and verifying that the 'Edit Contributors' options is not displayed"):
sumo_pages.kb_article_page._click_on_show_history_option()
test_utilities.delete_cookies()
utilities.delete_cookies()
expect(sumo_pages.kb_article_show_history_page._get_edit_contributors_option_locator()
).to_be_hidden()
with check, allure.step("Manually navigating to the deletion link and the user is "
"redirected to the auth page"):
test_utilities.navigate_to_link(deletion_link)
assert FxAPageMessages.AUTH_PAGE_URL in test_utilities.get_page_url()
utilities.navigate_to_link(deletion_link)
assert FxAPageMessages.AUTH_PAGE_URL in utilities.get_page_url()
with check, allure.step("Navigating back, signing in with a non-admin account and "
"verifying that the username two is not displayed inside the "
"Contributors list"):
test_utilities.navigate_to_link(article_details['article_url'])
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.navigate_to_link(article_details['article_url'])
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
assert (username_two not in sumo_pages.kb_article_show_history_page
._get_list_of_all_contributors())
@ -359,15 +357,15 @@ def test_kb_article_contributor_removal(page: Page, create_delete_article):
._get_list_of_kb_article_contributors())
with allure.step("Signing in with the removed username and creating a new revision"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
third_revision = sumo_pages.submit_kb_article_flow.submit_new_kb_revision()
with allure.step("Approving the revision and verifying that the user is added again "
"inside the contributors list"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
sumo_pages.submit_kb_article_flow.approve_kb_revision(third_revision['revision_id'])
@ -385,15 +383,15 @@ def test_kb_article_contributor_removal(page: Page, create_delete_article):
# C2101638
@pytest.mark.kbArticleShowHistory
def test_contributors_can_be_manually_added(page: Page, create_delete_article):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
kb_show_history_page_messages = KBArticleShowHistoryPageMessages()
with allure.step("Clicking on the 'Edit Contributors' option, adding and selecting the "
"username from the search field"):
create_delete_article("TEST_ACCOUNT_MODERATOR")
sumo_pages.kb_article_show_history_page._click_on_edit_contributors_option()
new_contributor = test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
new_contributor = utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
)
(sumo_pages.kb_article_show_history_page
._add_a_new_contributor_inside_the_contributor_field(new_contributor))
@ -420,16 +418,16 @@ def test_contributors_can_be_manually_added(page: Page, create_delete_article):
# C2101634, C2489553, C2102186
@pytest.mark.kbArticleShowHistory
def test_kb_article_contributor_profile_access(page: Page, create_delete_article):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
kb_article_show_history_page = KBArticleShowHistoryPage(page)
create_delete_article("TEST_ACCOUNT_MODERATOR", {"approve_first_revision": True})
sumo_pages.kb_article_page._click_on_article_option()
article_url = test_utilities.get_page_url()
article_url = utilities.get_page_url()
with allure.step("Signing in with a non-Admin account and creating a new revision"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
username_two = sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -437,13 +435,13 @@ def test_kb_article_contributor_profile_access(page: Page, create_delete_article
second_revision_info = sumo_pages.submit_kb_article_flow.submit_new_kb_revision()
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Approving the revision and deleting the user session"):
sumo_pages.submit_kb_article_flow.approve_kb_revision(second_revision_info['revision_id'])
test_utilities.delete_cookies()
utilities.delete_cookies()
with allure.step("Clicking on the second contributor and verifying that we are "
"redirected to it's profile page"):
@ -452,14 +450,14 @@ def test_kb_article_contributor_profile_access(page: Page, create_delete_article
with allure.step("Navigating back, clicking on the revision editor and verifying that we "
"are redirected to the editor homepage"):
test_utilities.navigate_back()
utilities.navigate_back()
kb_article_show_history_page._click_on_a_particular_revision_editor(
second_revision_info['revision_id'], username_two
)
expect(page).to_have_url(MyProfileMessages.get_my_profile_stage_url(username_two))
with allure.step("Navigating back to the article main menu"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
with allure.step("Clicking on the contributor listed inside the article page and "
"verifying that we are redirected to the editor homepage"):
@ -467,9 +465,9 @@ def test_kb_article_contributor_profile_access(page: Page, create_delete_article
expect(page).to_have_url(MyProfileMessages.get_my_profile_stage_url(username_two))
with allure.step("Navigating back and signin in with an admin account"):
test_utilities.navigate_back()
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.navigate_back()
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Clicking on the Article menu option, clicking on the contributor "
@ -481,13 +479,13 @@ def test_kb_article_contributor_profile_access(page: Page, create_delete_article
with allure.step("Navigating back to the article history, clicking on the second "
"contributor and verifying that we are redirected to it's profile page"):
test_utilities.navigate_back()
utilities.navigate_back()
sumo_pages.kb_article_page._click_on_show_history_option()
kb_article_show_history_page._click_on_a_particular_contributor(username_two)
expect(page).to_have_url(MyProfileMessages.get_my_profile_stage_url(username_two))
with allure.step("Navigating back and clicking on the revision editor"):
test_utilities.navigate_back()
utilities.navigate_back()
kb_article_show_history_page._click_on_a_particular_revision_editor(
second_revision_info['revision_id'], username_two
)
@ -496,31 +494,31 @@ def test_kb_article_contributor_profile_access(page: Page, create_delete_article
expect(page).to_have_url(MyProfileMessages.get_my_profile_stage_url(username_two))
with allure.step("Navigating back and deleting the created article"):
test_utilities.navigate_back()
utilities.navigate_back()
# C2499415, C2271120, C2101633
@pytest.mark.kbArticleShowHistory
def test_kb_article_revision_date_functionality(page: Page, create_delete_article):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin account and creating a new article and "
"approving it's first revision"):
article_details, main_user = create_delete_article("TEST_ACCOUNT_MODERATOR",
{"approve_first_revision": True})
sumo_pages.kb_article_page._click_on_article_option()
article_url = test_utilities.get_page_url()
article_url = utilities.get_page_url()
with allure.step("Signing in with a non-admin account"):
creator_username = test_utilities.start_existing_session(
test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']))
creator_username = utilities.start_existing_session(
utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']))
with allure.step("Submitting a new revision"):
second_revision_info = sumo_pages.submit_kb_article_flow.submit_new_kb_revision()
with allure.step("Deleting the user session and clicking on the first revision"):
test_utilities.delete_cookies()
utilities.delete_cookies()
revision_time = sumo_pages.kb_article_show_history_page._get_revision_time(
second_revision_info['revision_id']
)
@ -534,7 +532,7 @@ def test_kb_article_revision_date_functionality(page: Page, create_delete_articl
) == KBArticleRevision.KB_ARTICLE_REVISION_YES_STATUS
with allure.step("Navigating back and clicking on the revision time"):
test_utilities.navigate_back()
utilities.navigate_back()
sumo_pages.kb_article_show_history_page._click_on_a_revision_date(
second_revision_info['revision_id'])
@ -562,7 +560,7 @@ def test_kb_article_revision_date_functionality(page: Page, create_delete_articl
with check, allure.step("Verifying that the revision id is the correct one"):
assert sumo_pages.kb_article_preview_revision_page._get_preview_revision_id_text(
) == str(test_utilities.number_extraction_from_string(second_revision_info['revision_id']))
) == str(utilities.number_extraction_from_string(second_revision_info['revision_id']))
with check, allure.step("Verifying that the correct revision time is displayed"):
assert (
@ -580,9 +578,9 @@ def test_kb_article_revision_date_functionality(page: Page, create_delete_articl
with check, allure.step("Navigating back to the revision preview page and verifying that "
"the correct review comment is displayed"):
test_utilities.navigate_back()
utilities.navigate_back()
assert (sumo_pages.kb_article_preview_revision_page._get_preview_revision_comment_text(
) == test_utilities.kb_article_test_data['changes_description'])
) == utilities.kb_article_test_data['changes_description'])
with check, allure.step("Verifying that the correct reviewed status is displayed"):
assert (sumo_pages.kb_article_preview_revision_page._get_preview_revision_reviewed_text(
@ -628,7 +626,7 @@ def test_kb_article_revision_date_functionality(page: Page, create_delete_articl
sumo_pages.kb_article_preview_revision_page._click_on_revision_source_foldout_section()
assert (sumo_pages.kb_article_preview_revision_page
._get_preview_revision_source_textarea_content(
) == test_utilities.kb_article_test_data['updated_article_content'])
) == utilities.kb_article_test_data['updated_article_content'])
with allure.step("Verifying that the 'Revision Content' section is hidden by default"):
expect(sumo_pages.kb_article_preview_revision_page._get_revision_content_html_locator(
@ -641,8 +639,8 @@ def test_kb_article_revision_date_functionality(page: Page, create_delete_articl
)).to_be_visible()
with allure.step("Signing in with an admin account and approving the revision"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Approving the second revision"):
@ -651,7 +649,7 @@ def test_kb_article_revision_date_functionality(page: Page, create_delete_articl
with check, allure.step("Deleting the user session, clicking on the revision time and "
"verifying that the correct reviewed status is displayed"):
test_utilities.delete_cookies()
utilities.delete_cookies()
sumo_pages.kb_article_show_history_page._click_on_a_revision_date(
second_revision_info['revision_id']
)
@ -689,8 +687,8 @@ def test_kb_article_revision_date_functionality(page: Page, create_delete_articl
) == main_user
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Clicking on the 'Edit article based on this revision option' and "
@ -699,5 +697,5 @@ def test_kb_article_revision_date_functionality(page: Page, create_delete_articl
._click_on_edit_article_based_on_this_revision_link())
expect(page).to_have_url(
article_url + QuestionPageMessages.EDIT_QUESTION_URL_ENDPOINT + "/" + str(
test_utilities.number_extraction_from_string(second_revision_info['revision_id']))
utilities.number_extraction_from_string(second_revision_info['revision_id']))
)

Просмотреть файл

@ -2,7 +2,7 @@ import allure
import pytest
from playwright.sync_api import expect, Page
from pytest_check import check
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.explore_help_articles.kb_article_page_messages import (
KBArticlePageMessages)
from playwright_tests.pages.sumo_pages import SumoPages
@ -14,13 +14,13 @@ with open('test_data/test_article', 'r') as file:
# C2188031
@pytest.mark.articleThreads
def test_article_thread_field_validation(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.kb_article_page._click_on_editing_tools_discussion_option()
with allure.step("Clicking on the 'Post a new thread button' and clicking on the 'Post "
@ -44,7 +44,7 @@ def test_article_thread_field_validation(page: Page):
"input field"):
sumo_pages.kb_article_discussion_page._clear_new_thread_title_field()
sumo_pages.kb_article_discussion_page._add_text_to_new_thread_title_field(
test_utilities.kb_new_thread_test_data['new_thread_reduced_title']
utilities.kb_new_thread_test_data['new_thread_reduced_title']
)
with allure.step("Clicking on the 'Post Thread' button and verifying that we are on the "
@ -66,7 +66,7 @@ def test_article_thread_field_validation(page: Page):
sumo_pages.kb_article_discussion_page._clear_new_thread_title_field()
sumo_pages.kb_article_discussion_page._clear_new_thread_body_field()
sumo_pages.kb_article_discussion_page._add_text_to_new_thread_body_input_field(
test_utilities.kb_new_thread_test_data['new_thread_reduced_body']
utilities.kb_new_thread_test_data['new_thread_reduced_body']
)
with allure.step("Clicking on the 'Post Thread' button and verifying that we are on the "
@ -79,11 +79,11 @@ def test_article_thread_field_validation(page: Page):
"'Cancel' button and verifying that the article is not displayed inside "
"the discussion thread list"):
sumo_pages.kb_article_discussion_page._add_text_to_new_thread_title_field(
test_utilities.kb_new_thread_test_data['new_thread_reduced_title']
utilities.kb_new_thread_test_data['new_thread_reduced_title']
)
sumo_pages.kb_article_discussion_page._click_on_cancel_new_thread_button()
expect(sumo_pages.kb_article_discussion_page._get_thread_by_title_locator(
test_utilities.kb_new_thread_test_data['new_thread_reduced_title']
utilities.kb_new_thread_test_data['new_thread_reduced_title']
)
).to_be_hidden()
@ -91,21 +91,21 @@ def test_article_thread_field_validation(page: Page):
"required characters inside both title and content fields"):
sumo_pages.kb_article_discussion_page._click_on_post_a_new_thread_option()
sumo_pages.kb_article_discussion_page._add_text_to_new_thread_title_field(
test_utilities.kb_new_thread_test_data['new_thread_reduced_title']
utilities.kb_new_thread_test_data['new_thread_reduced_title']
)
sumo_pages.kb_article_discussion_page._add_text_to_new_thread_body_input_field(
test_utilities.kb_new_thread_test_data['new_thread_reduced_body']
utilities.kb_new_thread_test_data['new_thread_reduced_body']
)
with allure.step("Clicking on the 'Post Thread' button, manually navigating to the "
"discuss endpoint and verifying that the posted thread is successfully "
"displayed"):
sumo_pages.kb_article_discussion_page._click_on_submit_new_thread_button()
thread_url = test_utilities.get_page_url()
thread_id = str(test_utilities.number_extraction_from_string_endpoint(
thread_url = utilities.get_page_url()
thread_id = str(utilities.number_extraction_from_string_endpoint(
KBArticlePageMessages.KB_ARTICLE_DISCUSSIONS_ENDPOINT, thread_url)
)
test_utilities.navigate_to_link(
utilities.navigate_to_link(
article_url + KBArticlePageMessages.KB_ARTICLE_DISCUSSIONS_ENDPOINT)
expect(sumo_pages.kb_article_discussion_page._get_posted_thread_locator(thread_id)
).to_be_visible()
@ -117,29 +117,29 @@ def test_article_thread_field_validation(page: Page):
# C2260840
@pytest.mark.articleThreads
def test_thread_replies_counter_increment(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Manually navigating to the article endpoint and clicking on the "
"article option"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
with check, allure.step("Clicking on the 'Post a new thread button', posting a new kb "
"article discussion thread and verifying that the thread counter"
" is not 0"):
thread_info = sumo_pages.kb_article_thread_flow.add_new_kb_discussion_thread()
assert (test_utilities.number_extraction_from_string(
assert (utilities.number_extraction_from_string(
sumo_pages.kb_article_discussion_page._get_thread_page_counter_replies_text())) == 0
with check, allure.step("Manually navigating to the discuss endpoint "
"and verifying that the reply counter for the posted thread has "
"incremented successfully"):
test_utilities.navigate_to_link(thread_info["article_discussion_url"])
assert (test_utilities.number_extraction_from_string(
utilities.navigate_to_link(thread_info["article_discussion_url"])
assert (utilities.number_extraction_from_string(
sumo_pages.kb_article_discussion_page._get_article_discussions_thread_counter(
thread_info['thread_id']))) == 0
@ -148,17 +148,17 @@ def test_thread_replies_counter_increment(page: Page):
sumo_pages.kb_article_discussion_page._click_on_a_particular_thread(
thread_info['thread_id'])
sumo_pages.kb_article_thread_flow.post_reply_to_thread(
test_utilities.kb_new_thread_test_data['thread_reply_body'])
utilities.kb_new_thread_test_data['thread_reply_body'])
with check, allure.step("Verifying that the thread counter is 1"):
assert (test_utilities.number_extraction_from_string(
assert (utilities.number_extraction_from_string(
sumo_pages.kb_article_discussion_page._get_thread_page_counter_replies_text())) == 1
with check, allure.step("Manually navigating to the discuss endpoint and verifying that "
"the reply counter for the posted thread has incremented "
"successfully"):
test_utilities.navigate_to_link(thread_info["article_discussion_url"])
assert (test_utilities.number_extraction_from_string(
utilities.navigate_to_link(thread_info["article_discussion_url"])
assert (utilities.number_extraction_from_string(
sumo_pages.kb_article_discussion_page._get_article_discussions_thread_counter(
thread_info['thread_id']))) == 1
@ -169,13 +169,13 @@ def test_thread_replies_counter_increment(page: Page):
# C2260840, C2260809
@pytest.mark.articleThreads
def test_thread_replies_counter_decrement(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a normal account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
with allure.step("Clicking on the 'Post a new thread button' and posting a new kb "
"article discussion thread"):
@ -183,26 +183,26 @@ def test_thread_replies_counter_decrement(page: Page):
with allure.step("Posting a new reply with the same user"):
thread_reply_info = sumo_pages.kb_article_thread_flow.post_reply_to_thread(
test_utilities.kb_new_thread_test_data['thread_reply_body'])
utilities.kb_new_thread_test_data['thread_reply_body'])
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_MODERATOR']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_MODERATOR']
))
with check, allure.step("Posting a new reply with the same user and verifying that the "
"reply counter for the posted thread has incremented "
"successfully"):
sumo_pages.kb_article_thread_flow.post_reply_to_thread(
test_utilities.kb_new_thread_test_data['thread_reply_body']
utilities.kb_new_thread_test_data['thread_reply_body']
)
assert (test_utilities.number_extraction_from_string(
assert (utilities.number_extraction_from_string(
sumo_pages.kb_article_discussion_page._get_thread_page_counter_replies_text()) == 2)
with allure.step("Manually navigating to the discuss endpoint and verifying that the "
"reply counter for the posted thread has incremented successfully"):
test_utilities.navigate_to_link(thread_info['article_discussion_url'])
assert (test_utilities.number_extraction_from_string(
utilities.navigate_to_link(thread_info['article_discussion_url'])
assert (utilities.number_extraction_from_string(
sumo_pages.kb_article_discussion_page._get_article_discussions_thread_counter(
thread_info['thread_id'])) == 2)
@ -214,14 +214,14 @@ def test_thread_replies_counter_decrement(page: Page):
"the reply counter for the posted thread has incremented "
"successfully"):
sumo_pages.kb_article_thread_flow.delete_reply_to_thread(thread_reply_info['reply_id'])
assert (test_utilities.number_extraction_from_string(
assert (utilities.number_extraction_from_string(
sumo_pages.kb_article_discussion_page._get_thread_page_counter_replies_text()) == 1)
with check, allure.step("Manually navigating to the discuss endpoint and verifying that "
"the reply counter for the posted thread has decremented "
"successfully"):
test_utilities.navigate_to_link(thread_info['article_discussion_url'])
assert (test_utilities.number_extraction_from_string(
utilities.navigate_to_link(thread_info['article_discussion_url'])
assert (utilities.number_extraction_from_string(
sumo_pages.kb_article_discussion_page._get_article_discussions_thread_counter(
thread_info['thread_id'])) == 1)
@ -232,38 +232,38 @@ def test_thread_replies_counter_decrement(page: Page):
@pytest.mark.articleThreads
@pytest.mark.parametrize("username", ['TEST_ACCOUNT_12', 'TEST_ACCOUNT_MODERATOR', ''])
def test_article_thread_author_filter(page: Page, username):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
with allure.step("Posting a new kb article discussion thread"):
thread_info = sumo_pages.kb_article_thread_flow.add_new_kb_discussion_thread()
with allure.step("Navigating back to the article discussion page and signing in with a "
"non-admin account"):
test_utilities.navigate_to_link(thread_info['article_discussion_url'])
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.navigate_to_link(thread_info['article_discussion_url'])
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
with allure.step("Posting a new kb article discussion thread"):
thread_info_two = sumo_pages.kb_article_thread_flow.add_new_kb_discussion_thread()
with allure.step("Navigating back to the article discussion page"):
test_utilities.navigate_to_link(thread_info['article_discussion_url'])
utilities.navigate_to_link(thread_info['article_discussion_url'])
if username == 'TEST_ACCOUNT_MODERATOR':
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
elif username != 'TEST_ACCOUNT_12':
with allure.step("Signing out from SUMO"):
test_utilities.delete_cookies()
utilities.delete_cookies()
with check, allure.step("Clicking on the 'Author' filter and verifying that the authors "
"are in reverse alphabetical order"):
@ -285,13 +285,13 @@ def test_article_thread_author_filter(page: Page, username):
@pytest.mark.articleThreads
@pytest.mark.parametrize("username", ['TEST_ACCOUNT_12', 'TEST_ACCOUNT_MODERATOR', ''])
def test_article_thread_replies_filter(page: Page, username):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
with allure.step("Clicking on the 'Post a new thread button' and posting a new kb "
"article discussion thread"):
@ -299,7 +299,7 @@ def test_article_thread_replies_filter(page: Page, username):
with allure.step("Posting a new reply with the same user"):
sumo_pages.kb_article_thread_flow.post_reply_to_thread(
test_utilities.kb_new_thread_test_data['thread_reply_body']
utilities.kb_new_thread_test_data['thread_reply_body']
)
with allure.step("Navigating back to the article discussion page and posting a new kb "
@ -307,27 +307,27 @@ def test_article_thread_replies_filter(page: Page, username):
thread_info_two = sumo_pages.kb_article_thread_flow.add_new_kb_discussion_thread()
with allure.step("Navigating back to the article discussion page"):
test_utilities.navigate_to_link(thread_info['article_discussion_url'])
utilities.navigate_to_link(thread_info['article_discussion_url'])
if username == "TEST_ACCOUNT_12":
with allure.step("Signing in with a non admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
elif username == '':
with allure.step("Deleting user session"):
test_utilities.delete_cookies()
utilities.delete_cookies()
with allure.step("Clicking on the 'Replies' filter and verifying that the replies is in "
"descending order"):
sumo_pages.kb_article_discussion_page._click_on_article_thread_replies_filter()
assert test_utilities.is_descending(
assert utilities.is_descending(
sumo_pages.kb_article_discussion_page._get_all_article_threads_replies())
with check, allure.step("Clicking on the 'Replies' filter again and verifying that the "
"replies is in ascending order"):
sumo_pages.kb_article_discussion_page._click_on_article_thread_replies_filter()
assert not test_utilities.is_descending(
assert not utilities.is_descending(
sumo_pages.kb_article_discussion_page._get_all_article_threads_replies())
with allure.step("Clearing both created threads"):
@ -337,17 +337,17 @@ def test_article_thread_replies_filter(page: Page, username):
@pytest.mark.articleThreads
def test_article_lock_thread_non_admin_users(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin account and creating an article"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
article_details = sumo_pages.submit_kb_article_flow.submit_simple_kb_article()
with allure.step("Signing in with an admin account and approving the article"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
sumo_pages.submit_kb_article_flow.approve_kb_revision(
revision_id=article_details['first_revision_id']
@ -358,19 +358,19 @@ def test_article_lock_thread_non_admin_users(page: Page):
thread_info_one = sumo_pages.kb_article_thread_flow.add_new_kb_discussion_thread()
with allure.step("Signing in with a non-admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
with allure.step("Navigating back to the discussions page and posting a new kb article "
"discussion thread"):
test_utilities.navigate_to_link(thread_info_one["article_discussion_url"])
utilities.navigate_to_link(thread_info_one["article_discussion_url"])
thread_info_two = sumo_pages.kb_article_thread_flow.add_new_kb_discussion_thread()
with allure.step("Navigating back to the discussions page, clicking on the thread posted "
"by another user and verifying that the 'Lock thread' option is not "
"available"):
test_utilities.navigate_to_link(thread_info_one["article_discussion_url"])
utilities.navigate_to_link(thread_info_one["article_discussion_url"])
sumo_pages.kb_article_discussion_page._click_on_a_particular_thread(
thread_info_one['thread_id'])
expect(sumo_pages.kb_article_discussion_page._get_lock_this_article_thread_locator()
@ -379,7 +379,7 @@ def test_article_lock_thread_non_admin_users(page: Page):
with allure.step("Navigating back to the article discussions page, clicking on the "
"thread posted by self and verifying that the 'Lock thread' option is "
"not available"):
test_utilities.navigate_to_link(thread_info_one["article_discussion_url"])
utilities.navigate_to_link(thread_info_one["article_discussion_url"])
sumo_pages.kb_article_discussion_page._click_on_a_particular_thread(
thread_info_two['thread_id'])
expect(sumo_pages.kb_article_discussion_page._get_lock_this_article_thread_locator()
@ -387,15 +387,15 @@ def test_article_lock_thread_non_admin_users(page: Page):
with allure.step("Deleting user sessions and verifying that the 'Lock thread' options is "
"not available"):
test_utilities.delete_cookies()
utilities.delete_cookies()
expect(sumo_pages.kb_article_discussion_page._get_lock_this_article_thread_locator()
).to_be_hidden()
with allure.step("Signing in with an admin account and deleting the kb article"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
test_utilities.navigate_to_link(article_details["article_url"])
utilities.navigate_to_link(article_details["article_url"])
sumo_pages.kb_article_deletion_flow.delete_kb_article()
@ -403,33 +403,33 @@ def test_article_lock_thread_non_admin_users(page: Page):
@pytest.mark.articleThreads
@pytest.mark.parametrize("username", ['TEST_ACCOUNT_MODERATOR', 'TEST_ACCOUNT_12', ''])
def test_article_lock_thread_functionality(page: Page, username):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
with allure.step("Posting a new kb article discussion thread"):
thread_info_one = sumo_pages.kb_article_thread_flow.add_new_kb_discussion_thread()
with allure.step("Signing in with a non-admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
with allure.step("Navigating back to the discussions page and posting a new discussion "
"thread"):
test_utilities.navigate_to_link(thread_info_one["article_discussion_url"])
utilities.navigate_to_link(thread_info_one["article_discussion_url"])
thread_info_two = sumo_pages.kb_article_thread_flow.add_new_kb_discussion_thread()
with allure.step("Navigating back to the discussions page"):
test_utilities.navigate_to_link(thread_info_one["article_discussion_url"])
utilities.navigate_to_link(thread_info_one["article_discussion_url"])
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Clicking on the thread posted by self user and locking the thread"):
@ -440,15 +440,15 @@ def test_article_lock_thread_functionality(page: Page, username):
if username == 'TEST_ACCOUNT_12':
with check, allure.step("Signing in with a non-admin account and verifying that the "
"correct thread locked message is displayed"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
assert (sumo_pages.kb_article_discussion_page._get_text_of_locked_article_thread_text(
) == KBArticlePageMessages.KB_ARTICLE_LOCKED_THREAD_MESSAGE)
elif username == '':
with allure.step("Deleting user session"):
test_utilities.delete_cookies()
utilities.delete_cookies()
with allure.step("Verifying that the 'Post a reply' textarea field is not displayed"):
expect(sumo_pages.kb_article_discussion_page._get_thread_post_a_reply_textarea_field()
@ -458,12 +458,12 @@ def test_article_lock_thread_functionality(page: Page, username):
expect(sumo_pages.kb_article_discussion_page._get_locked_article_status()).to_be_visible()
with allure.step("Navigating back to the discussions page"):
test_utilities.navigate_to_link(thread_info_one["article_discussion_url"])
utilities.navigate_to_link(thread_info_one["article_discussion_url"])
if username != 'TEST_ACCOUNT_MODERATOR':
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Clicking on the thread posted by the other user and clicking on the "
@ -475,14 +475,14 @@ def test_article_lock_thread_functionality(page: Page, username):
if username == 'TEST_ACCOUNT_12':
with check, allure.step("Signing in with a non-admin account and verifying that the "
"correct thread locked message is displayed"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
assert (sumo_pages.kb_article_discussion_page._get_text_of_locked_article_thread_text(
) == KBArticlePageMessages.KB_ARTICLE_LOCKED_THREAD_MESSAGE)
elif username == '':
with allure.step("Deleting user session"):
test_utilities.delete_cookies()
utilities.delete_cookies()
with allure.step("Verifying that the 'Locked' status is displayed under article header"):
expect(sumo_pages.kb_article_discussion_page._get_locked_article_status()).to_be_visible()
@ -500,36 +500,36 @@ def test_article_lock_thread_functionality(page: Page, username):
@pytest.mark.articleThreads
@pytest.mark.parametrize("username", ['TEST_ACCOUNT_MODERATOR', 'TEST_ACCOUNT_12', ''])
def test_article_unlock_thread_functionality(page: Page, username):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Navigating to the article endpoint"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
with allure.step("Posting a new kb article discussion thread"):
thread_info_one = sumo_pages.kb_article_thread_flow.add_new_kb_discussion_thread()
with allure.step("Signing in with a normal user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
with allure.step("Navigating back to the discussions page"):
test_utilities.navigate_to_link(thread_info_one["article_discussion_url"])
utilities.navigate_to_link(thread_info_one["article_discussion_url"])
with allure.step("Posting a new kb article discussion thread"):
thread_info_two = sumo_pages.kb_article_thread_flow.add_new_kb_discussion_thread()
with allure.step("Navigating back to the discussions page"):
test_utilities.navigate_to_link(thread_info_one["article_discussion_url"])
utilities.navigate_to_link(thread_info_one["article_discussion_url"])
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with check, allure.step("Clicking on the thread posted by self user and verifying that "
@ -548,22 +548,22 @@ def test_article_unlock_thread_functionality(page: Page, username):
if username == 'TEST_ACCOUNT_12':
with allure.step("Signing in with a non-admin account and verifying that the 'Unlock "
"this thread' option is not displayed"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
expect(sumo_pages.kb_article_discussion_page._get_lock_this_article_thread_locator(
)).to_be_hidden()
if username == '':
with allure.step("Deleting user session and verifying that the 'Unlock this thread' "
"option is no displayed"):
test_utilities.delete_cookies()
utilities.delete_cookies()
expect(sumo_pages.kb_article_discussion_page._get_lock_this_article_thread_locator(
)).to_be_hidden()
if username != 'TEST_ACCOUNT_MODERATOR':
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Clicking on the 'Unlock this thread'"):
@ -572,15 +572,15 @@ def test_article_unlock_thread_functionality(page: Page, username):
if username == 'TEST_ACCOUNT_12':
with allure.step("Signing in with a non-admin account and verifying that the "
"textarea field is available"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
expect(sumo_pages.kb_article_discussion_page._get_thread_post_a_reply_textarea_field(
)).to_be_visible()
if username == '':
with allure.step("Deleting user session and verifying that the textarea field is not "
"available"):
test_utilities.delete_cookies()
utilities.delete_cookies()
expect(sumo_pages.kb_article_discussion_page._get_thread_post_a_reply_textarea_field(
)).to_be_hidden()
@ -593,13 +593,13 @@ def test_article_unlock_thread_functionality(page: Page, username):
if username != "TEST_ACCOUNT_MODERATOR":
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Navigating back the article page and clicking on the thread posted by "
"another user"):
test_utilities.navigate_to_link(thread_info_one["article_discussion_url"])
utilities.navigate_to_link(thread_info_one["article_discussion_url"])
sumo_pages.kb_article_discussion_page._click_on_a_particular_thread(
thread_info_two['thread_id'])
@ -617,38 +617,38 @@ def test_article_unlock_thread_functionality(page: Page, username):
if username == 'TEST_ACCOUNT_12':
with allure.step("Signing in with a non-admin account and verifying that the 'Unlock "
"this thread' option is displayed"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
expect(sumo_pages.kb_article_discussion_page._get_lock_this_article_thread_locator(
)).to_be_hidden()
if username == '':
with allure.step("Deleting the user session and verifying that the 'Unlock this "
"thread' option is not displayed"):
test_utilities.delete_cookies()
utilities.delete_cookies()
expect(sumo_pages.kb_article_discussion_page._get_lock_this_article_thread_locator(
)).to_be_hidden()
if username != 'TEST_ACCOUNT_MODERATOR':
with allure.step("Signing in with an admin account and clicking on the 'Unlock this "
"thread' option"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
sumo_pages.kb_article_discussion_page._click_on_lock_this_article_thread_option()
if username == 'TEST_ACCOUNT_12':
with allure.step("Signing in with a non-admin account and verifying that the "
"textarea field is available"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
expect(sumo_pages.kb_article_discussion_page._get_thread_post_a_reply_textarea_field(
)).to_be_visible()
if username == '':
with allure.step("Deleting user session and verifying that the textarea field is not "
"available"):
test_utilities.delete_cookies()
utilities.delete_cookies()
expect(sumo_pages.kb_article_discussion_page._get_thread_post_a_reply_textarea_field(
)).to_be_hidden()
@ -668,11 +668,11 @@ def test_article_unlock_thread_functionality(page: Page, username):
@pytest.mark.articleThreads
@pytest.mark.parametrize("username", ['TEST_ACCOUNT_MODERATOR', 'TEST_ACCOUNT_12', ''])
def test_article_thread_sticky(page: Page, username):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Posting a new kb article"):
@ -684,12 +684,12 @@ def test_article_thread_sticky(page: Page, username):
thread_info_one = sumo_pages.kb_article_thread_flow.add_new_kb_discussion_thread()
with allure.step("Signing in with a normal user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
with allure.step("Navigating back to the discussions page"):
test_utilities.navigate_to_link(thread_info_one['article_discussion_url'])
utilities.navigate_to_link(thread_info_one['article_discussion_url'])
with allure.step("Posting a new kb article discussion thread"):
thread_info_two = sumo_pages.kb_article_thread_flow.add_new_kb_discussion_thread(
@ -701,11 +701,11 @@ def test_article_thread_sticky(page: Page, username):
).to_be_hidden()
with allure.step("Navigating back to the discussions page"):
test_utilities.navigate_to_link(thread_info_one['article_discussion_url'])
utilities.navigate_to_link(thread_info_one['article_discussion_url'])
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Clicking on the thread posted by self and clicking on the 'sticky this "
@ -721,15 +721,15 @@ def test_article_thread_sticky(page: Page, username):
if username == 'TEST_ACCOUNT_12':
with allure.step("Signing in with a non-admin account and verifying that the "
"unsticky this thread option is not available"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
expect(sumo_pages.kb_article_discussion_page._get_sticky_this_thread_locator()
).to_be_hidden()
if username == '':
with allure.step("Deleting user session and verifying that the unsticky this thread "
"option is not available"):
test_utilities.delete_cookies()
utilities.delete_cookies()
expect(sumo_pages.kb_article_discussion_page._get_sticky_this_thread_locator()
).to_be_hidden()
@ -739,14 +739,14 @@ def test_article_thread_sticky(page: Page, username):
with check, allure.step("Navigating back to the discussions page and verifying that the "
"sticky article is displayed in top of the list"):
test_utilities.navigate_to_link(thread_info_one['article_discussion_url'])
utilities.navigate_to_link(thread_info_one['article_discussion_url'])
assert sumo_pages.kb_article_discussion_page._get_all_article_threads_titles(
)[0] == thread_info_one['thread_title']
if username != 'TEST_ACCOUNT_MODERATOR':
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with check, allure.step("Clicking on the unsitcky this thread and verifying that the "
@ -759,12 +759,12 @@ def test_article_thread_sticky(page: Page, username):
if username == 'TEST_ACCOUNT_12':
with allure.step("Signing in with a non-admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
if username == '':
with allure.step("Deleting user session"):
test_utilities.delete_cookies()
utilities.delete_cookies()
with allure.step("Verifying that the 'Sticky' status is not displayed"):
expect(sumo_pages.kb_article_discussion_page._get_sticky_this_thread_status_locator()
@ -772,15 +772,15 @@ def test_article_thread_sticky(page: Page, username):
with check, allure.step("Navigating back to the discussions page and verifying that the "
"sticky article is not displayed in top of the list"):
test_utilities.navigate_to_link(thread_info_one['article_discussion_url'])
utilities.navigate_to_link(thread_info_one['article_discussion_url'])
assert sumo_pages.kb_article_discussion_page._get_all_article_threads_titles(
)[0] == thread_info_two['thread_title']
with allure.step("Signing in with an admin account and deleting the kb article"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
test_utilities.navigate_to_link(article_details["article_url"])
utilities.navigate_to_link(article_details["article_url"])
sumo_pages.kb_article_deletion_flow.delete_kb_article()
@ -788,32 +788,32 @@ def test_article_thread_sticky(page: Page, username):
@pytest.mark.articleThreads
@pytest.mark.parametrize("thread_author", ['self', 'other'])
def test_article_thread_content_edit(page: Page, thread_author):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Manually navigating to the article endpoint and posting a new kb "
"article discussion thread"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
thread_info_one = sumo_pages.kb_article_thread_flow.add_new_kb_discussion_thread()
with allure.step("Signing in with a non-admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
with allure.step("Navigating back to the discussions page and posting a new kb article "
"discussion thread"):
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
thread_info_two = sumo_pages.kb_article_thread_flow.add_new_kb_discussion_thread()
with allure.step("Adding data inside the edit this thread title field and clicking on "
"the cancel button"):
sumo_pages.kb_article_thread_flow._edit_article_thread(
thread_title=test_utilities.kb_new_thread_test_data['updated_thread_title'],
thread_title=utilities.kb_new_thread_test_data['updated_thread_title'],
submit_edit=False
)
@ -824,26 +824,26 @@ def test_article_thread_content_edit(page: Page, thread_author):
with allure.step("Adding data inside the edit this thread title field and clicking on "
"the update button"):
sumo_pages.kb_article_thread_flow._edit_article_thread(
thread_title=test_utilities.kb_new_thread_test_data['updated_thread_title']
thread_title=utilities.kb_new_thread_test_data['updated_thread_title']
)
with check, allure.step("Verifying that the thread title was changed"):
assert sumo_pages.kb_article_discussion_page._get_thread_title_text(
) == test_utilities.kb_new_thread_test_data['updated_thread_title']
) == utilities.kb_new_thread_test_data['updated_thread_title']
with allure.step("Deleting user session and verifying that the edit this thread option "
"is not displayed"):
test_utilities.delete_cookies()
utilities.delete_cookies()
expect(sumo_pages.kb_article_discussion_page._get_edit_this_thread_locator()
).to_be_hidden()
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Navigating back to the discussions page"):
test_utilities.navigate_to_link(thread_info_one["article_discussion_url"])
utilities.navigate_to_link(thread_info_one["article_discussion_url"])
if thread_author == 'self':
with allure.step("Clicking on the self posted thread"):
@ -857,7 +857,7 @@ def test_article_thread_content_edit(page: Page, thread_author):
with allure.step("Clicking on the 'Edit this thread', adding data inside the title field "
"and clicking on the cancel button"):
sumo_pages.kb_article_thread_flow._edit_article_thread(
test_utilities.kb_new_thread_test_data['second_thread_updated_title'], False
utilities.kb_new_thread_test_data['second_thread_updated_title'], False
)
if thread_author == 'self':
@ -867,24 +867,24 @@ def test_article_thread_content_edit(page: Page, thread_author):
else:
with check, allure.step("Verifying that the thread title was not changed"):
assert sumo_pages.kb_article_discussion_page._get_thread_title_text(
) == test_utilities.kb_new_thread_test_data['updated_thread_title']
) == utilities.kb_new_thread_test_data['updated_thread_title']
with allure.step("Adding data inside the edit this thread title field and clicking on "
"the update button"):
sumo_pages.kb_article_thread_flow._edit_article_thread(
thread_title=test_utilities.kb_new_thread_test_data['second_thread_updated_title']
thread_title=utilities.kb_new_thread_test_data['second_thread_updated_title']
)
with check, allure.step("Verifying that the thread title was changed"):
assert sumo_pages.kb_article_discussion_page._get_thread_title_text(
) == test_utilities.kb_new_thread_test_data['second_thread_updated_title']
) == utilities.kb_new_thread_test_data['second_thread_updated_title']
with allure.step("Navigating back to the discussions page"):
test_utilities.navigate_to_link(thread_info_one["article_discussion_url"])
utilities.navigate_to_link(thread_info_one["article_discussion_url"])
with check, allure.step("Verifying that the updated thread title is displayed inside the "
"threads list"):
assert (test_utilities.kb_new_thread_test_data
assert (utilities.kb_new_thread_test_data
['second_thread_updated_title'] in sumo_pages.kb_article_discussion_page
._get_all_article_threads_titles())
@ -900,16 +900,16 @@ def test_posting_a_new_kb_test_article(page: Page):
article upon which the majority of the test are performed.
This needs to be placed before the articleThreads inside the yml file.
"""
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
sumo_pages.submit_kb_article_flow.submit_simple_kb_article(approve_first_revision=True)
sumo_pages.kb_article_page._click_on_article_option()
with open("test_data/test_article", 'w') as file:
file.write(test_utilities.get_page_url())
file.write(utilities.get_page_url())
@pytest.mark.afterThreadTests
@ -919,12 +919,12 @@ def test_delete_kb_test_article(page: Page):
threads tests.
This needs to be executed after the articleThreads tests in the yml.
"""
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.kb_article_deletion_flow.delete_kb_article()
with open("test_data/test_article", 'w'):
@ -935,16 +935,14 @@ def __clearing_newly_created_thread(page: Page, thread_id: str):
"""
Test article threads helper function which deletes a thread which has the given thread_id.
"""
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
test_utilities.navigate_to_link(
article_url + KBArticlePageMessages.KB_ARTICLE_DISCUSSIONS_ENDPOINT
)
utilities.navigate_to_link(article_url + KBArticlePageMessages.KB_ARTICLE_DISCUSSIONS_ENDPOINT)
sumo_pages.kb_article_thread_flow.delete_article_thread(thread_id)
test_utilities.navigate_to_link(
utilities.navigate_to_link(
article_url + KBArticlePageMessages.KB_ARTICLE_DISCUSSIONS_ENDPOINT)

Просмотреть файл

@ -1,4 +1,4 @@
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
import pytest
import allure
from pytest_check import check
@ -15,13 +15,13 @@ from playwright_tests.pages.sumo_pages import SumoPages
# C2489548, C2490043, C946153
@pytest.mark.kbArticleTranslation
def test_not_ready_for_localization_articles_dashboard_status(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
kb_translation_messages = KbTranslationMessages()
with allure.step("Signing in with an Admin account"):
username = test_utilities.start_existing_session(
test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
username = utilities.start_existing_session(
utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Create a new simple article and approving it without marking it as "
@ -29,13 +29,13 @@ def test_not_ready_for_localization_articles_dashboard_status(page: Page):
article_details = sumo_pages.submit_kb_article_flow.submit_simple_kb_article(
approve_first_revision=True
)
parent_article_url = test_utilities.get_page_url()
parent_article_url = utilities.get_page_url()
with allure.step("Clicking on the Translate Article Editing Tools option and selecting "
"the ro locale"):
sumo_pages.kb_article_page._click_on_translate_article_option()
sumo_pages.translate_article_page._click_on_romanian_locale_from_list()
translation_url = test_utilities.get_page_url()
translation_url = utilities.get_page_url()
with check, allure.step("Verifying that the correct banner is displayed"):
check.equal(
@ -45,38 +45,38 @@ def test_not_ready_for_localization_articles_dashboard_status(page: Page):
with allure.step("Navigating to the localization dashboard and verifying that the "
"article is not listed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['l10n_most_visited_translations']
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['l10n_most_visited_translations']
)
expect(sumo_pages.most_visited_translations_page._get_a_particular_article_title_locator(
article_details['article_title'])).to_be_hidden()
with allure.step("Navigating to the localization unreviewed page and verifying that the "
"article is not listed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['localization_unreviewed']
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['localization_unreviewed']
)
expect(sumo_pages.localization_unreviewed_page._get_listed_article(
article_details['article_title'])).to_be_hidden()
with allure.step("Navigating back to the translation page and performing a translation"):
test_utilities.navigate_to_link(translation_url)
utilities.navigate_to_link(translation_url)
translation = sumo_pages.submit_kb_translation_flow._add_article_translation(
approve_translation_revision=False
)
with allure.step("Navigating to the localization dashboard and verifying that the "
"article is not listed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['l10n_most_visited_translations']
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['l10n_most_visited_translations']
)
expect(sumo_pages.most_visited_translations_page._get_a_particular_article_title_locator(
translation['translation_title'])).to_be_hidden()
with allure.step("Navigating to the localization unreviewed page and verifying that the "
"article is displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['localization_unreviewed']
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['localization_unreviewed']
)
expect(sumo_pages.localization_unreviewed_page._get_listed_article(
translation['translation_title'])).to_be_visible()
@ -94,22 +94,22 @@ def test_not_ready_for_localization_articles_dashboard_status(page: Page):
with allure.step("Navigating to the localization unreviewed page and verifying that the "
"article is not displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['l10n_most_visited_translations']
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['l10n_most_visited_translations']
)
expect(sumo_pages.localization_unreviewed_page._get_listed_article(
translation['translation_title'])).to_be_hidden()
with check, allure.step("Navigating to the localization dashboard and verifying that the "
"article is not displayed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['l10n_most_visited_translations']
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['l10n_most_visited_translations']
)
expect(sumo_pages.localization_unreviewed_page._get_listed_article(
translation['translation_title'])).to_be_hidden()
with allure.step("Navigating to the parent article and marking it as ready for l10n"):
test_utilities.navigate_to_link(parent_article_url)
utilities.navigate_to_link(parent_article_url)
sumo_pages.kb_article_show_history_page._click_on_ready_for_l10n_option(
article_details['first_revision_id']
)
@ -117,9 +117,9 @@ def test_not_ready_for_localization_articles_dashboard_status(page: Page):
with check, allure.step("Navigating to the localization dashboard and verifying that the "
"article is displayed with the correct status"):
test_utilities.wait_for_given_timeout(2000)
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['l10n_most_visited_translations']
utilities.wait_for_given_timeout(2000)
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['l10n_most_visited_translations']
)
check.equal(sumo_pages.most_visited_translations_page._get_updated_localization_status(
translation['translation_title']),
@ -127,15 +127,13 @@ def test_not_ready_for_localization_articles_dashboard_status(page: Page):
)
with allure.step("Deleting the parent article"):
test_utilities.navigate_to_link(parent_article_url)
utilities.navigate_to_link(parent_article_url)
sumo_pages.kb_article_deletion_flow.delete_kb_article()
with check, allure.step("Manually navigating to the 'Discuss' endpoint and verifying "
"that the 404 page is returned"):
with page.expect_navigation() as navigation_info:
test_utilities.navigate_to_link(
translation_url
)
utilities.navigate_to_link(translation_url)
response = navigation_info.value
assert response.status == 404
@ -143,25 +141,25 @@ def test_not_ready_for_localization_articles_dashboard_status(page: Page):
# C2489548
@pytest.mark.kbArticleTranslation
def test_ready_for_localization_articles_dashboard_status(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
kb_translation_messages = KbTranslationMessages()
with allure.step("Signing in with an Admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Create a new simple article and marking it as ready for localization"):
article_details = sumo_pages.submit_kb_article_flow.submit_simple_kb_article(
approve_first_revision=True, ready_for_localization=True
)
parent_article_url = test_utilities.get_page_url()
parent_article_url = utilities.get_page_url()
with check, allure.step("Navigating to the localization dashboard and verifying that the "
"correct status is displayed"):
test_utilities.wait_for_given_timeout(2000)
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['l10n_most_visited_translations']
utilities.wait_for_given_timeout(2000)
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['l10n_most_visited_translations']
)
check.equal(sumo_pages.most_visited_translations_page._get_a_particular_translation_status(
article_details['article_title']),
@ -172,7 +170,7 @@ def test_ready_for_localization_articles_dashboard_status(page: Page):
"banner is displayed"):
sumo_pages.most_visited_translations_page._click_on_a_particular_article_status(
article_details['article_title'])
translation_url = test_utilities.get_page_url()
translation_url = utilities.get_page_url()
expect(sumo_pages.translate_article_page._get_unready_for_translation_banner()
).to_be_hidden()
@ -183,9 +181,9 @@ def test_ready_for_localization_articles_dashboard_status(page: Page):
with check, allure.step("Navigating to the localization dashboard and verifying that the "
"correct status is displayed"):
test_utilities.wait_for_given_timeout(2000)
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['l10n_most_visited_translations']
utilities.wait_for_given_timeout(2000)
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['l10n_most_visited_translations']
)
check.equal(sumo_pages.most_visited_translations_page._get_a_particular_translation_status(
translation['translation_title']),
@ -201,9 +199,9 @@ def test_ready_for_localization_articles_dashboard_status(page: Page):
with check, allure.step("Navigating to the localization dashboard an verifying that the "
"correct status is displayed"):
test_utilities.wait_for_given_timeout(2000)
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['l10n_most_visited_translations']
utilities.wait_for_given_timeout(2000)
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['l10n_most_visited_translations']
)
check.equal(
sumo_pages.most_visited_translations_page._get_updated_localization_status(
@ -212,13 +210,13 @@ def test_ready_for_localization_articles_dashboard_status(page: Page):
)
with allure.step("Deleting the parent article"):
test_utilities.navigate_to_link(parent_article_url)
utilities.navigate_to_link(parent_article_url)
sumo_pages.kb_article_deletion_flow.delete_kb_article()
with check, allure.step("Manually navigating to the 'Discuss' endpoint and verifying "
"that the 404 page is returned"):
with page.expect_navigation() as navigation_info:
test_utilities.navigate_to_link(translation_url)
utilities.navigate_to_link(translation_url)
response = navigation_info.value
assert response.status == 404
@ -226,23 +224,23 @@ def test_ready_for_localization_articles_dashboard_status(page: Page):
# C2490043
@pytest.mark.kbArticleTranslation
def test_revisions_cannot_be_marked_as_ready_for_l10n_if_lacking_permissions(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an Admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Create a new simple article and marking it as ready for localization"):
article_details = sumo_pages.submit_kb_article_flow.submit_simple_kb_article(
approve_first_revision=True
)
article_url = test_utilities.get_page_url()
article_url = utilities.get_page_url()
with allure.step("Signing in with a different account that has no permissions to mark a "
"revision as ready for l10n"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_2"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_2"]
))
with allure.step("Clicking on the ready for l10n button and verifying that it has no "
@ -250,7 +248,7 @@ def test_revisions_cannot_be_marked_as_ready_for_l10n_if_lacking_permissions(pag
sumo_pages.kb_article_show_history_page._click_on_ready_for_l10n_option(
article_details['first_revision_id']
)
test_utilities.wait_for_given_timeout(2000)
utilities.wait_for_given_timeout(2000)
expect(sumo_pages.kb_article_show_history_page._get_l10n_modal_locator()).to_be_hidden()
expect(
@ -261,36 +259,36 @@ def test_revisions_cannot_be_marked_as_ready_for_l10n_if_lacking_permissions(pag
with allure.step("Navigating to the localization dashboard and verifying that the "
"article is not listed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['l10n_most_visited_translations']
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['l10n_most_visited_translations']
)
expect(sumo_pages.most_visited_translations_page._get_a_particular_article_title_locator(
article_details['article_title'])).to_be_hidden()
with allure.step("Navigating to the localization unreviewed page and verifying that the "
"article is not listed"):
test_utilities.navigate_to_link(
test_utilities.general_test_data['dashboard_links']['localization_unreviewed']
utilities.navigate_to_link(
utilities.general_test_data['dashboard_links']['localization_unreviewed']
)
expect(sumo_pages.localization_unreviewed_page._get_listed_article(
article_details['article_title'])).to_be_hidden()
with allure.step("Navigating back to the article and deleting it"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
test_utilities.navigate_to_link(article_url)
utilities.navigate_to_link(article_url)
sumo_pages.kb_article_deletion_flow.delete_kb_article()
# C2316346, C2316347
@pytest.mark.kbArticleTranslation
def test_unsupported_locales_fallback(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
with allure.step("Verifying the unsupported locales fallback"):
for key, value in NON_SUPPORTED_LOCALES.items():
test_utilities.navigate_to_link(HomepageMessages.STAGE_HOMEPAGE_URL + f"/{key}/")
utilities.navigate_to_link(HomepageMessages.STAGE_HOMEPAGE_URL + f"/{key}/")
if value is None:
expect(
page
@ -314,7 +312,7 @@ def test_unsupported_locales_fallback(page: Page):
# C2316347
@pytest.mark.kbArticleTranslation
def test_supported_languages(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
with allure.step("Verifying that the users are redirected to the supported locales "
"successfully"):
for locale in SUMO_LANGUAGES:
@ -322,22 +320,22 @@ def test_supported_languages(page: Page):
continue
else:
with page.expect_navigation() as navigation_info:
test_utilities.navigate_to_link(
utilities.navigate_to_link(
HomepageMessages.STAGE_HOMEPAGE_URL + f"/{locale}/")
response = navigation_info.value
assert response.status == 200
assert locale in test_utilities.get_page_url()
assert locale in utilities.get_page_url()
# C2316350, C2316349
@pytest.mark.kbArticleTranslation
def test_sumo_locale_priority(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin account and changing the preferred profile "
"language"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_5"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_5"]
))
with allure.step("Accessing the edit profile page and changing the language to ro"):
@ -347,38 +345,38 @@ def test_sumo_locale_priority(page: Page):
with allure.step("Navigating to the SUMO homepage without specifying the path in the "
"locale and verifying that the preferred locale is set"):
test_utilities.navigate_to_link(HomepageMessages.STAGE_HOMEPAGE_URL)
utilities.navigate_to_link(HomepageMessages.STAGE_HOMEPAGE_URL)
expect(page).to_have_url(HomepageMessages.STAGE_HOMEPAGE_URL + "/ro/")
with allure.step("Navigating to the SUMO homepage while using a lang query parameter and "
"verifying that the user is redirected to the specified locale inside "
"the param"):
test_utilities.navigate_to_link(HomepageMessages.STAGE_HOMEPAGE_URL + "/?lang=de")
utilities.navigate_to_link(HomepageMessages.STAGE_HOMEPAGE_URL + "/?lang=de")
expect(page).to_have_url(HomepageMessages.STAGE_HOMEPAGE_URL + "/de/")
with allure.step("Navigating back to the ro locale"):
test_utilities.navigate_to_link(HomepageMessages.STAGE_HOMEPAGE_URL)
utilities.navigate_to_link(HomepageMessages.STAGE_HOMEPAGE_URL)
with allure.step("Sending a request by modifying the 'Accept-Language' header to a "
"different locale"):
headers = {
'Accept-Language': 'it'
}
test_utilities.set_extra_http_headers(headers)
test_utilities.navigate_to_link(HomepageMessages.STAGE_HOMEPAGE_URL)
utilities.set_extra_http_headers(headers)
utilities.navigate_to_link(HomepageMessages.STAGE_HOMEPAGE_URL)
expect(page).to_have_url(HomepageMessages.STAGE_HOMEPAGE_URL + "/ro/")
with allure.step("Changing the preferred language back to english and signing out"):
test_utilities.navigate_to_link(HomepageMessages.STAGE_HOMEPAGE_URL + '/en-US/')
utilities.navigate_to_link(HomepageMessages.STAGE_HOMEPAGE_URL + '/en-US/')
sumo_pages.top_navbar._click_on_edit_profile_option()
sumo_pages.edit_my_profile_page._select_preferred_language_dropdown_option_by_value(
"en-US")
sumo_pages.edit_my_profile_page._click_update_my_profile_button()
test_utilities.delete_cookies()
utilities.delete_cookies()
with allure.step("Sending the request with the modified 'Accept-Language' header set to "
"a different locale and verifying that the correct locale is displayed"):
test_utilities.navigate_to_link(HomepageMessages.STAGE_HOMEPAGE_URL)
utilities.navigate_to_link(HomepageMessages.STAGE_HOMEPAGE_URL)
expect(page).to_have_url(HomepageMessages.STAGE_HOMEPAGE_URL + "/it/")
with allure.step("Sending the request with the modified 'Accept-Language' to point out "
@ -387,6 +385,6 @@ def test_sumo_locale_priority(page: Page):
headers = {
'Accept-Language': 'test, de, it'
}
test_utilities.set_extra_http_headers(headers)
test_utilities.navigate_to_link(HomepageMessages.STAGE_HOMEPAGE_URL)
utilities.set_extra_http_headers(headers)
utilities.navigate_to_link(HomepageMessages.STAGE_HOMEPAGE_URL)
expect(page).to_have_url(HomepageMessages.STAGE_HOMEPAGE_URL + "/de/")

Просмотреть файл

@ -4,7 +4,7 @@ from playwright.sync_api import expect, Page
from pytest_check import check
import pytest
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.homepage_messages import HomepageMessages
from playwright_tests.messages.explore_help_articles.products_page_messages import (
ProductsPageMessages)
@ -17,7 +17,7 @@ def test_products_page_content(page: Page):
with check, allure.step("Navigating to products page via top-navbar and verifying that "
"the correct page header is displayed"):
sumo_pages = SumoPages(page)
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages.top_navbar._click_on_explore_our_help_articles_view_all_option()
assert sumo_pages.products_page._get_page_header(
) == ProductsPageMessages.PRODUCTS_PAGE_HEADER
@ -27,7 +27,7 @@ def test_products_page_content(page: Page):
expect(page).to_have_url(HomepageMessages.STAGE_HOMEPAGE_URL_EN_US)
with allure.step("Navigating back to the 'Products' page"):
test_utilities.navigate_back()
utilities.navigate_back()
for card in sumo_pages.products_page._get_all_product_support_titles():
with check, allure.step(f"Verifying that the {card} card contains the correct "
@ -41,16 +41,16 @@ def test_products_page_content(page: Page):
@pytest.mark.kbProductsPage
def test_products_page_card_redirect(page: Page):
sumo_pages = SumoPages(page)
test_utilities = TestUtilities(page)
utilities = Utilities(page)
with allure.step("Navigating to products page via top-navbar"):
sumo_pages.top_navbar._click_on_explore_our_help_articles_view_all_option()
for card in sumo_pages.products_page._get_all_product_support_titles():
if card in test_utilities.general_test_data['product_support']:
if card in utilities.general_test_data['product_support']:
with allure.step(f"Clicking on {card} card and verifying that we are redirected "
f"to the correct product url"):
sumo_pages.products_page._click_on_a_particular_product_support_card(card)
expect(page).to_have_url(test_utilities.general_test_data['product_support'][card])
expect(page).to_have_url(utilities.general_test_data['product_support'][card])
with allure.step("Navigating back to the products page"):
test_utilities.navigate_back()
utilities.navigate_back()

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -2,7 +2,7 @@ import allure
from pytest_check import check
import pytest
from playwright.sync_api import expect, Page
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.contribute_messages.con_pages.con_page_messages import (
ContributePageMessages)
from playwright_tests.messages.homepage_messages import HomepageMessages
@ -17,14 +17,14 @@ from playwright_tests.pages.sumo_pages import SumoPages
# C890926, C890931, C2091563
@pytest.mark.skip
def test_product_support_page(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Navigating to products page via top-navbar"):
sumo_pages.top_navbar._click_on_explore_our_help_articles_view_all_option()
with allure.step("Clicking on all product cards"):
for card in sumo_pages.products_page._get_all_product_support_titles():
if card in test_utilities.general_test_data['product_support']:
if card in utilities.general_test_data['product_support']:
sumo_pages.products_page._click_on_a_particular_product_support_card(card)
with check, allure.step("Verifying that the correct page header is displayed"):
@ -47,7 +47,7 @@ def test_product_support_page(page: Page):
assert (sumo_pages.product_support_page._get_still_need_help_widget_title()
) == ProductSupportPageMessages.STILL_NEED_HELP_WIDGET_TITLE
if card in test_utilities.general_test_data['premium_products']:
if card in utilities.general_test_data['premium_products']:
with check, allure.step("Verifying that the correct still need help "
"content is displayed"):
assert (sumo_pages.product_support_page
@ -104,7 +104,7 @@ def test_product_support_page(page: Page):
with allure.step("Navigate back, clicking on the 'Home' breadcrumb and "
"verifying that we are redirected to the homepage"):
test_utilities.navigate_back()
utilities.navigate_back()
sumo_pages.product_support_page._click_on_product_support_home_breadcrumb()
expect(page).to_have_url(HomepageMessages.STAGE_HOMEPAGE_URL_EN_US)
@ -115,7 +115,7 @@ def test_product_support_page(page: Page):
# C890929
@pytest.mark.skip
def test_product_support_page_frequent_topics_redirect(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Navigating to products page via top-navbar"):
sumo_pages.top_navbar._click_on_explore_our_help_articles_view_all_option()
@ -123,7 +123,7 @@ def test_product_support_page_frequent_topics_redirect(page: Page):
with allure.step("Clicking on all product cards"):
for card in sumo_pages.products_page._get_all_product_support_titles():
if card in test_utilities.general_test_data['product_support']:
if card in utilities.general_test_data['product_support']:
sumo_pages.products_page._click_on_a_particular_product_support_card(card)
with check, allure.step("Verifying that the correct page header is displayed"):
@ -138,23 +138,23 @@ def test_product_support_page_frequent_topics_redirect(page: Page):
"card and verifying that the correct topic "
"page title is displayed"):
assert sumo_pages.product_topics_page._get_page_title() == topic
test_utilities.navigate_back()
utilities.navigate_back()
else:
print(f"{card} has no frequent topics displayed!!!")
with allure.step("Navigating back"):
test_utilities.navigate_back()
utilities.navigate_back()
@pytest.mark.skip
def test_product_support_page_featured_articles_redirect(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Navigating to products page via top-navbar"):
sumo_pages.top_navbar._click_on_explore_our_help_articles_view_all_option()
with allure.step("Clicking on all product cards"):
for card in sumo_pages.products_page._get_all_product_support_titles():
if card in test_utilities.general_test_data['product_support']:
if card in utilities.general_test_data['product_support']:
sumo_pages.products_page._click_on_a_particular_product_support_card(card)
with check, allure.step("Verifying that the correct page header is displayed"):
@ -181,25 +181,25 @@ def test_product_support_page_featured_articles_redirect(page: Page):
assert featured_article_names[count - 1] == (
sumo_pages.kb_article_page._get_text_of_article_title())
count += 1
test_utilities.navigate_back()
utilities.navigate_back()
else:
print(f"{card} has no featured articles displayed!!!")
with allure.step("Navigating back"):
test_utilities.navigate_back()
utilities.navigate_back()
# C890932
@pytest.mark.skip
def test_still_need_help_button_redirect(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Navigating to products page via top-navbar"):
sumo_pages.top_navbar._click_on_explore_our_help_articles_view_all_option()
with allure.step("Clicking on all product cards"):
for card in sumo_pages.products_page._get_all_product_support_titles():
if card in test_utilities.general_test_data['product_support']:
if card in utilities.general_test_data['product_support']:
sumo_pages.products_page._click_on_a_particular_product_support_card(card)
with check, allure.step("Verifying that the correct page header is displayed"):
@ -210,7 +210,7 @@ def test_still_need_help_button_redirect(page: Page):
with allure.step("Verifying that we are redirected to the correct product "
"solutions page"):
expect(page).to_have_url(
test_utilities.general_test_data['product_solutions'][card]
utilities.general_test_data['product_solutions'][card]
)
with check, allure.step("Verifying that we are on the correct milestone"):

Просмотреть файл

@ -2,7 +2,7 @@ import allure
import pytest
from playwright.sync_api import Page
from pytest_check import check
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.contribute_messages.con_pages.con_page_messages import (
ContributePageMessages)
from playwright_tests.messages.homepage_messages import HomepageMessages
@ -15,13 +15,13 @@ from playwright_tests.pages.sumo_pages import SumoPages
@pytest.mark.homePageTests
def test_join_our_community_card_learn_more_redirects_to_contribute_page(page: Page):
sumo_pages = SumoPages(page)
test_utilities = TestUtilities(page)
utilities = Utilities(page)
with allure.step("Clicking on the 'Learn More' option"):
sumo_pages.homepage._click_learn_more_option()
with allure.step("Verifying that we are redirected to the 'Contribute' page successfully"):
assert (
test_utilities.get_page_url()
utilities.get_page_url()
== ContributePageMessages.STAGE_CONTRIBUTE_PAGE_URL
), "We are not on the Contribute page!"
@ -45,7 +45,7 @@ def test_join_our_community_card_has_the_correct_content(page: Page):
@pytest.mark.homePageTests
def test_homepage_feature_articles_are_available_and_interactable(page: Page):
sumo_pages = SumoPages(page)
test_utilities = TestUtilities(page)
utilities = Utilities(page)
with check, allure.step(
"Verifying if the correct number of featured articles are present on the homepage"
):
@ -65,7 +65,7 @@ def test_homepage_feature_articles_are_available_and_interactable(page: Page):
f"Received: {sumo_pages.kb_article_page._get_text_of_article_title()}")
with allure.step("Navigating back to the previous page"):
test_utilities.navigate_back()
utilities.navigate_back()
counter += 1
@ -73,7 +73,7 @@ def test_homepage_feature_articles_are_available_and_interactable(page: Page):
@pytest.mark.homePageTests
def test_product_cards_are_functional_and_redirect_to_the_proper_support_page(page: Page):
sumo_pages = SumoPages(page)
test_utilities = TestUtilities(page)
utilities = Utilities(page)
with allure.step("Verifying that the product cards redirect to the correct support page"):
card_titles = sumo_pages.homepage._get_text_of_product_card_titles()
counter = 0
@ -89,5 +89,5 @@ def test_product_cards_are_functional_and_redirect_to_the_proper_support_page(pa
f"{sumo_pages.product_support_page._get_product_support_title_text()}")
with allure.step("Navigating back to the previous page"):
test_utilities.navigate_back()
utilities.navigate_back()
counter += 1

Просмотреть файл

@ -3,7 +3,7 @@ import pytest
from pytest_check import check
from playwright.sync_api import expect, Page
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.mess_system_pages_messages.inbox_page_messages import (
InboxPageMessages)
from playwright_tests.messages.mess_system_pages_messages.new_message_page_messages import (
@ -18,11 +18,11 @@ from playwright_tests.pages.sumo_pages import SumoPages
# C891415
@pytest.mark.messagingSystem
def test_there_are_no_messages_here_text_is_displayed_when_no_messages_are_available(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
with allure.step("Navigating to the inbox page"):
@ -52,24 +52,22 @@ def test_there_are_no_messages_here_text_is_displayed_when_no_messages_are_avail
# This test needs to be updated to fetch the username from a different place
@pytest.mark.messagingSystem
def test_private_messages_can_be_sent_via_user_profiles(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
message_body = "Test1"
user_two = test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_2"]
user_two = utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_2"]
)
with allure.step("Signing in with a non-admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_1"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_1"]
))
sumo_pages.top_navbar._get_text_of_logged_in_username()
with allure.step("Navigating to the profile page for user two"):
test_utilities.navigate_to_link(
MyProfileMessages.get_my_profile_stage_url(username=user_two)
)
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username=user_two))
with allure.step("Clicking on the 'Private Message button'"):
sumo_pages.my_profile_page._click_on_private_message_button()
@ -112,8 +110,8 @@ def test_private_messages_can_be_sent_via_user_profiles(page: Page):
).to_be_hidden()
with allure.step("Signing in with the user which received the message"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_2"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_2"]
))
with allure.step("Accessing the Inbox section"):
@ -138,16 +136,16 @@ def test_private_messages_can_be_sent_via_user_profiles(page: Page):
# C891419
@pytest.mark.messagingSystem
def test_private_message_can_be_sent_via_new_message_page(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
message_body = "Test2"
test_user = test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_4"]
test_user = utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_4"]
)
with allure.step("Signing in with a non-admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_3"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_3"]
))
sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -176,8 +174,8 @@ def test_private_message_can_be_sent_via_new_message_page(page: Page):
with allure.step("Signing in with the receiver account and verifying that the message is "
"displayed inside the inbox section"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_4"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_4"]
))
sumo_pages.top_navbar._click_on_inbox_option()
expect(sumo_pages.inbox_page._inbox_message_based_on_excerpt(message_body)
@ -193,11 +191,11 @@ def test_private_message_can_be_sent_via_new_message_page(page: Page):
def test_navbar_options_redirect_to_the_correct_page_and_options_are_correctly_highlighted(
page: Page
):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
with allure.step("Accessing the inbox section via the top-navbar"):
@ -248,15 +246,15 @@ def test_navbar_options_redirect_to_the_correct_page_and_options_are_correctly_h
# C891416
@pytest.mark.messagingSystem
def test_new_message_field_validation(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
user_two = test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_1"]
user_two = utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_1"]
)
with allure.step("Signing in with a non-admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
with allure.step("Accessing the New Message page"):
@ -298,7 +296,7 @@ def test_new_message_field_validation(page: Page):
with allure.step("Adding 9990 characters inside the input field"):
sumo_pages.new_message_page._fill_into_new_message_body_textarea(
text=test_utilities.user_message_test_data["valid_user_message"][
text=utilities.user_message_test_data["valid_user_message"][
"9990_characters_long_message"
])
@ -322,7 +320,7 @@ def test_new_message_field_validation(page: Page):
with allure.step("Adding one character inside the textarea field"):
sumo_pages.new_message_page._type_into_new_message_body_textarea(
text=test_utilities.user_message_test_data["valid_user_message"]
text=utilities.user_message_test_data["valid_user_message"]
["one_character_message"]
)
@ -345,7 +343,7 @@ def test_new_message_field_validation(page: Page):
with allure.step("Adding 9 characters inside the textarea field"):
sumo_pages.new_message_page._type_into_new_message_body_textarea(
text=test_utilities.user_message_test_data["valid_user_message"]
text=utilities.user_message_test_data["valid_user_message"]
["9_characters_message"]
)
@ -380,16 +378,16 @@ def test_new_message_field_validation(page: Page):
# C891417
@pytest.mark.messagingSystem
def test_new_message_cancel_button(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
message_body = "Test3"
user_two = test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
user_two = utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
)
with allure.step("Signing in with a non-admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -420,8 +418,8 @@ def test_new_message_cancel_button(page: Page):
).to_be_hidden()
with allure.step("Signing out and signing in with the receiver account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
))
with allure.step("Navigating to the receiver inbox and verifying that no message was "
@ -433,15 +431,15 @@ def test_new_message_cancel_button(page: Page):
# C891418
@pytest.mark.messagingSystem
def test_new_message_preview(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
test_user = test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
test_user = utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
)
with allure.step("Signing in with a non-admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
username = sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -453,7 +451,7 @@ def test_new_message_preview(page: Page):
with allure.step("Adding text inside the message content section"):
sumo_pages.messaging_system_flow.complete_send_message_form_with_data(
recipient_username=test_user,
message_body=test_utilities.user_message_test_data["valid_user_message"]["message"],
message_body=utilities.user_message_test_data["valid_user_message"]["message"],
submit_message=False
)
@ -516,8 +514,8 @@ def test_new_message_preview(page: Page):
with allure.step("Signing in with the potential message receiver and verifying that no "
"message were received"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
))
sumo_pages.top_navbar._click_on_inbox_option()
expect(sumo_pages.inbox_page._inbox_message(username=username)).to_be_hidden()
@ -526,16 +524,16 @@ def test_new_message_preview(page: Page):
# C891421, C891424
@pytest.mark.messagingSystem
def test_messages_can_be_selected_and_deleted(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
message_body = "Test4"
test_user = test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_6"]
test_user = utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_6"]
)
with allure.step("Signing in with a non-admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_5"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_5"]
))
username_one = sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -605,8 +603,8 @@ def test_messages_can_be_selected_and_deleted(page: Page):
) in SentMessagesPageMessages.MULTIPLE_MESSAGES_DELETION_BANNER_TEXT
with allure.step("Signing in with the receiver account and navigating to the inbox"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_6"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_6"]
))
sumo_pages.top_navbar._click_on_inbox_option()
@ -627,11 +625,11 @@ def test_messages_can_be_selected_and_deleted(page: Page):
# C2566115, C2602253, C2602252
@pytest.mark.messagingSystem
def test_group_messages_cannot_be_sent_by_non_staff_users(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-staff account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
with allure.step("Navigating to the new message page"):
@ -640,30 +638,30 @@ def test_group_messages_cannot_be_sent_by_non_staff_users(page: Page):
with allure.step("Typing in a group name inside the To field"):
sumo_pages.new_message_page._type_into_new_message_to_input_field(
test_utilities.user_message_test_data['test_groups'][0]
utilities.user_message_test_data['test_groups'][0]
)
with allure.step("Verifying that no users are returned"):
expect(sumo_pages.new_message_page._get_no_user_to_locator()).to_be_visible(timeout=10000)
with allure.step("Navigating to the groups page"):
test_utilities.navigate_to_link(test_utilities.general_test_data['groups'])
utilities.navigate_to_link(utilities.general_test_data['groups'])
sumo_pages.user_groups._click_on_a_particular_group(
test_utilities.user_message_test_data['test_groups'][0])
utilities.user_message_test_data['test_groups'][0])
with allure.step("Verifying that the pm group members button is not displayed"):
expect(sumo_pages.user_groups._get_pm_group_members_button()).to_be_hidden()
with allure.step("Deleting the user session and verifying that the pm group members "
"button is not displayed"):
test_utilities.delete_cookies()
utilities.delete_cookies()
expect(sumo_pages.user_groups._get_pm_group_members_button()).to_be_hidden()
# The PM group members button was removed for staff members as well.
with allure.step("Signing in with a staff account and verifying that the pm group "
"members button is not displayed"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_MODERATOR']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_MODERATOR']
))
expect(sumo_pages.user_groups._get_pm_group_members_button()).to_be_hidden()
@ -671,14 +669,14 @@ def test_group_messages_cannot_be_sent_by_non_staff_users(page: Page):
# C2566115, C2566116, C2566119
@pytest.mark.messagingSystem
def test_staff_users_can_send_group_messages(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
message_body = 'Test5'
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_MODERATOR']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_MODERATOR']
))
targeted_test_group = test_utilities.user_message_test_data['test_groups'][0]
targeted_test_group = utilities.user_message_test_data['test_groups'][0]
with allure.step("Navigating to the new messages page"):
sumo_pages.top_navbar._click_on_inbox_option()
@ -703,9 +701,9 @@ def test_staff_users_can_send_group_messages(page: Page):
with allure.step("Signing in with all targeted group members, verifying that the message "
"was received and clearing the inbox"):
for user in test_utilities.general_test_data['testGroup1users']:
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts[user]
for user in utilities.general_test_data['testGroup1users']:
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts[user]
))
sumo_pages.top_navbar._click_on_inbox_option()
@ -716,9 +714,9 @@ def test_staff_users_can_send_group_messages(page: Page):
with allure.step("Signing in with users from second test group and verifying that the "
"message was not received"):
for user in test_utilities.general_test_data["testGroup2users"]:
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts[user]
for user in utilities.general_test_data["testGroup2users"]:
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts[user]
))
sumo_pages.top_navbar._click_on_inbox_option()
@ -729,14 +727,14 @@ def test_staff_users_can_send_group_messages(page: Page):
# C2566117, C2566119
@pytest.mark.messagingSystem
def test_staff_users_can_send_messages_to_multiple_groups(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
message_body = "Test6"
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_MODERATOR']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_MODERATOR']
))
targeted_test_group = test_utilities.user_message_test_data['test_groups']
targeted_test_group = utilities.user_message_test_data['test_groups']
with allure.step("Navigating to the new messages page"):
sumo_pages.top_navbar._click_on_inbox_option()
@ -756,16 +754,16 @@ def test_staff_users_can_send_messages_to_multiple_groups(page: Page):
targeted_test_group)
with allure.step("Deleting the outbox"):
test_utilities.navigate_back()
utilities.navigate_back()
sumo_pages.sent_message_page._delete_all_sent_messages_via_delete_selected_button(
message_body)
with allure.step("Signing in with all targeted group members, verifying that the message "
"was received and clearing the inbox"):
for user in test_utilities.general_test_data['testGroup1users'] + (
test_utilities.general_test_data['testGroup2users'][1:]):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts[user]
for user in utilities.general_test_data['testGroup1users'] + (
utilities.general_test_data['testGroup2users'][1:]):
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts[user]
))
sumo_pages.top_navbar._click_on_inbox_option()
@ -778,18 +776,18 @@ def test_staff_users_can_send_messages_to_multiple_groups(page: Page):
# C2566118, C2566119, C2566120
@pytest.mark.messagingSystem
def test_staff_users_can_send_messages_to_both_groups_and_user(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin account"):
message_body = "Test7"
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_MODERATOR']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_MODERATOR']
))
targeted_test_group = test_utilities.user_message_test_data['test_groups'][0]
targeted_user = [test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_MESSAGE_4']),
test_utilities.username_extraction_from_email(test_utilities.
user_secrets_accounts['TEST_ACCOUNT_12'])]
targeted_test_group = utilities.user_message_test_data['test_groups'][0]
targeted_user = [utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_MESSAGE_4']),
utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12'])]
with allure.step("Navigating to the new messages page"):
sumo_pages.top_navbar._click_on_inbox_option()
@ -810,15 +808,15 @@ def test_staff_users_can_send_messages_to_both_groups_and_user(page: Page):
check.equal(targeted_user, sumo_pages.sent_message_page._get_text_of_all_recipients())
with allure.step("Deleting the outbox"):
test_utilities.navigate_back()
utilities.navigate_back()
sumo_pages.sent_message_page._delete_all_sent_messages_via_delete_selected_button(
message_body)
with allure.step("Signing in with all targeted group members, verifying that the message "
"was received and clearing the inbox"):
for user in test_utilities.general_test_data['testGroup1users'] + ['TEST_ACCOUNT_12']:
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts[user]
for user in utilities.general_test_data['testGroup1users'] + ['TEST_ACCOUNT_12']:
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts[user]
))
sumo_pages.top_navbar._click_on_inbox_option()
@ -831,23 +829,23 @@ def test_staff_users_can_send_messages_to_both_groups_and_user(page: Page):
# C2566116
@pytest.mark.messagingSystem
def test_removed_group_users_do_not_receive_group_messages(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
message_body = "Test8"
with allure.step("Signing in with a staff account and removing a user from the targeted "
"group"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_MODERATOR']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_MODERATOR']
))
targeted_test_group = test_utilities.user_message_test_data['test_groups'][0]
targeted_user = test_utilities.remove_character_from_string(
test_utilities.username_extraction_from_email(
test_utilities.user_special_chars
targeted_test_group = utilities.user_message_test_data['test_groups'][0]
targeted_user = utilities.remove_character_from_string(
utilities.username_extraction_from_email(
utilities.user_special_chars
),
'*'
)
test_utilities.navigate_to_link(test_utilities.general_test_data['groups'])
utilities.navigate_to_link(utilities.general_test_data['groups'])
sumo_pages.user_groups._click_on_a_particular_group(targeted_test_group)
sumo_pages.user_group_flow.remove_a_user_from_group(targeted_user)
@ -865,10 +863,10 @@ def test_removed_group_users_do_not_receive_group_messages(page: Page):
with allure.step("Signing in with all targeted group members, verifying that the message "
"was received and clearing the inbox"):
for user in test_utilities.general_test_data['testGroup1users']:
logged_user = test_utilities.start_existing_session(
test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts[user]
for user in utilities.general_test_data['testGroup1users']:
logged_user = utilities.start_existing_session(
utilities.username_extraction_from_email(
utilities.user_secrets_accounts[user]
))
sumo_pages.top_navbar._click_on_inbox_option()
@ -884,10 +882,10 @@ def test_removed_group_users_do_not_receive_group_messages(page: Page):
message_body)
with allure.step("Signing in with an staff account and adding the user back to the group"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_MODERATOR']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_MODERATOR']
))
test_utilities.navigate_to_link(test_utilities.general_test_data['groups'])
utilities.navigate_to_link(utilities.general_test_data['groups'])
sumo_pages.user_groups._click_on_a_particular_group(targeted_test_group)
sumo_pages.user_group_flow.add_a_user_to_group(targeted_user)
@ -895,11 +893,11 @@ def test_removed_group_users_do_not_receive_group_messages(page: Page):
# C2584835
@pytest.mark.messagingSystem
def test_unable_to_send_group_messages_to_profiless_groups(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_MODERATOR']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_MODERATOR']
))
with allure.step("Navigating to the new message page"):
@ -915,20 +913,20 @@ def test_unable_to_send_group_messages_to_profiless_groups(page: Page):
@pytest.mark.messagingSystemCleanup
def test_clear_inbox_and_outbox(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
for user in test_utilities.user_secrets_accounts:
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts[user]
for user in utilities.user_secrets_accounts:
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts[user]
))
inbox_and_outbox_deletion(page)
test_utilities.delete_cookies()
utilities.delete_cookies()
sumo_pages.auth_flow_page.sign_in_flow(
username=test_utilities.user_special_chars,
account_password=test_utilities.user_secrets_pass,
username=utilities.user_special_chars,
account_password=utilities.user_secrets_pass,
)
inbox_and_outbox_deletion(page)

Просмотреть файл

@ -1,5 +1,5 @@
import pytest
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright.sync_api import expect, Page
from playwright_tests.flows.auth_flows.auth_flow import AuthFlowPage
from playwright_tests.pages.sumo_pages import SumoPages
@ -7,12 +7,12 @@ from playwright_tests.pages.sumo_pages import SumoPages
@pytest.mark.loginSessions
def test_create_user_sessions_for_test_accounts(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
auth_flow = AuthFlowPage(page)
i = 0
keys = list(test_utilities.user_secrets_accounts.keys())
keys = list(utilities.user_secrets_accounts.keys())
tried_once = False
while i < len(keys):
sumo_pages.top_navbar._click_on_signin_signup_button()
@ -22,19 +22,19 @@ def test_create_user_sessions_for_test_accounts(page: Page):
expect(sumo_pages.auth_page._get_continue_with_firefox_button_locator()).to_be_visible()
auth_flow.sign_in_flow(
username=test_utilities.user_secrets_accounts[keys[i]],
account_password=test_utilities.user_secrets_pass
username=utilities.user_secrets_accounts[keys[i]],
account_password=utilities.user_secrets_pass
)
test_utilities.wait_for_given_timeout(3500)
username = test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts[keys[i]]
utilities.wait_for_given_timeout(3500)
username = utilities.username_extraction_from_email(
utilities.user_secrets_accounts[keys[i]]
)
test_utilities.store_session_cookies(username)
utilities.store_session_cookies(username)
# Trying to log in. If the login fails, we retry creating the failed session. If we
# retried once, fail the test.
test_utilities.start_existing_session(
utilities.start_existing_session(
username
)
@ -44,4 +44,4 @@ def test_create_user_sessions_for_test_accounts(page: Page):
pytest.fail(f"Unable to sign in with {username}")
else:
i += 1
test_utilities.delete_cookies()
utilities.delete_cookies()

Просмотреть файл

@ -4,7 +4,7 @@ from playwright.sync_api import Page
from pytest_check import check
import requests
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.top_navbar_messages import TopNavbarMessages
from playwright_tests.pages.sumo_pages import SumoPages
@ -30,11 +30,11 @@ def test_number_of_options_not_signed_in(page: Page):
# C876539
@pytest.mark.topNavbarTests
def test_number_of_options_signed_in(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in using a non-admin user"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
with check, allure.step("Verifying that the SUMO logo is successfully displayed"):

Просмотреть файл

@ -3,7 +3,7 @@ import pytest
from pytest_check import check
from playwright.sync_api import expect, Page
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.mess_system_pages_messages.edit_cont_areas_page_messages import (
EditContributionAreasPageMessages)
from playwright_tests.messages.my_profile_pages_messages.my_profile_page_messages import (
@ -14,11 +14,11 @@ from playwright_tests.pages.sumo_pages import SumoPages
# C2206070
@pytest.mark.userContributionTests
def test_all_checkboxes_can_be_selected_and_saved(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
original_user = sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -45,19 +45,19 @@ def test_all_checkboxes_can_be_selected_and_saved(page: Page):
with allure.step("Signing in with a different account and verifying that the original user "
"groups are displayed"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_13']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_13']
))
with allure.step("Navigating to the user page and verifying that the user groups is "
"successfully displayed"):
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(original_user))
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(original_user))
assert sumo_pages.my_profile_page._get_my_profile_groups_items_text(
) == contribution_options
with allure.step("Signing in back with the original user"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
with allure.step("Accessing the edit contribution areas page and unchecking all checkboxes"):
@ -74,13 +74,13 @@ def test_all_checkboxes_can_be_selected_and_saved(page: Page):
expect(sumo_pages.my_profile_page._groups_section_element()).to_be_hidden()
with allure.step("Logging in with a different user and accessing the original user profile"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_13']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_13']
))
with allure.step("Navigating to the my profile page and verifying that the groups section is "
"no longer displayed for the original user"):
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(original_user))
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(original_user))
expect(
sumo_pages.my_profile_page._groups_section_element()
).to_be_hidden()

Просмотреть файл

@ -3,7 +3,7 @@ import pytest
from pytest_check import check
from playwright.sync_api import expect, Page
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.auth_pages_messages.fxa_page_messages import FxAPageMessages
from playwright_tests.messages.my_profile_pages_messages.edit_my_profile_page_messages import (
EditMyProfilePageMessages)
@ -15,11 +15,11 @@ from playwright_tests.pages.sumo_pages import SumoPages
# C891529
@pytest.mark.editUserProfileTests
def test_username_field_is_automatically_populated(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin user and navigating to the 'Edit Profile' page"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
sumo_pages.top_navbar._click_on_edit_profile_option()
@ -35,11 +35,11 @@ def test_username_field_is_automatically_populated(page: Page):
# Might want to extend the coverage
@pytest.mark.editUserProfileTests
def test_edit_profile_field_validation_with_symbols(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
with allure.step("Navigating to the profile edit page"):
@ -50,7 +50,7 @@ def test_edit_profile_field_validation_with_symbols(page: Page):
with allure.step("Clearing the username, display name fields and inserting the new one"):
sumo_pages.edit_my_profile_page._clear_username_field()
sumo_pages.edit_my_profile_page._clear_display_name_field()
profile_edit_data = test_utilities.profile_edit_test_data
profile_edit_data = utilities.profile_edit_test_data
if page.context.browser.browser_type.name == "chromium":
new_username = profile_edit_data["valid_user_edit_with_symbols"][
@ -105,11 +105,11 @@ def test_edit_profile_field_validation_with_symbols(page: Page):
# C1491017
@pytest.mark.editUserProfileTests
def test_username_with_invalid_symbols(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
with allure.step("Accessing the edit profile page"):
@ -119,7 +119,7 @@ def test_username_with_invalid_symbols(page: Page):
with allure.step("Clearing the username input field and adding an invalid user"):
sumo_pages.edit_my_profile_page._clear_username_field()
profile_edit_data = test_utilities.profile_edit_test_data
profile_edit_data = utilities.profile_edit_test_data
new_username = profile_edit_data["invalid_username_with_symbols"][
"username_with_invalid_symbols"
]
@ -141,11 +141,11 @@ def test_username_with_invalid_symbols(page: Page):
# C891530, C2107866
@pytest.mark.editUserProfileTests
def test_cancel_profile_edit(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a normal user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
with allure.step("Accessing the Edit My Profile page"):
@ -165,11 +165,11 @@ def test_cancel_profile_edit(page: Page):
# C946232
@pytest.mark.editUserProfileTests
def test_manage_firefox_account_redirects_to_firefox_account_settings_page(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin user"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
with allure.step("Accessing the 'Edit my profile' page and clicking on the 'Manage "
@ -187,11 +187,11 @@ def test_manage_firefox_account_redirects_to_firefox_account_settings_page(page:
# C1491461
@pytest.mark.editUserProfileTests
def test_duplicate_usernames_are_not_allowed(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
original_username = sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -203,8 +203,8 @@ def test_duplicate_usernames_are_not_allowed(page: Page):
"to it"):
sumo_pages.edit_my_profile_page._clear_username_field()
sumo_pages.edit_my_profile_page._send_text_to_username_field(
test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_6"]
utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MESSAGE_6"]
)
)
sumo_pages.edit_my_profile_page._click_update_my_profile_button()
@ -228,11 +228,11 @@ def test_duplicate_usernames_are_not_allowed(page: Page):
# C1491462
@pytest.mark.editUserProfileTests
def test_profile_username_field_cannot_be_left_empty(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
original_username = sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -244,7 +244,7 @@ def test_profile_username_field_cannot_be_left_empty(page: Page):
sumo_pages.edit_my_profile_page._click_update_my_profile_button()
with check, allure.step("Verifying that we are still on the edit profile page"):
assert test_utilities.get_page_url() == EditMyProfilePageMessages.STAGE_EDIT_MY_PROFILE_URL
assert utilities.get_page_url() == EditMyProfilePageMessages.STAGE_EDIT_MY_PROFILE_URL
with allure.step("Verifying that the displayed username inside the top navbar is the "
"original one"):
@ -260,16 +260,16 @@ def test_profile_username_field_cannot_be_left_empty(page: Page):
# C1491018, C891531,C1491021
@pytest.mark.editUserProfileTests
def test_username_can_contain_uppercase_and_lowercase_letters(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_MESSAGE_4']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_MESSAGE_4']
))
original_username = sumo_pages.top_navbar._get_text_of_logged_in_username()
new_username = test_utilities.profile_edit_test_data["uppercase_lowercase_valid_username"][
new_username = utilities.profile_edit_test_data["uppercase_lowercase_valid_username"][
"uppercase_lowercase_username"
]
@ -299,21 +299,21 @@ def test_username_can_contain_uppercase_and_lowercase_letters(page: Page):
# C1491463, C1491464
@pytest.mark.editUserProfileTests
def test_display_name_replaces_the_username_text(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_MESSAGE_1']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_MESSAGE_1']
))
original_username = sumo_pages.top_navbar._get_text_of_logged_in_username()
if page.context.browser.browser_type.name == "chromium":
new_display_name = test_utilities.profile_edit_test_data["valid_user_edit"][
new_display_name = utilities.profile_edit_test_data["valid_user_edit"][
"display_name_chrome"
]
elif page.context.browser.browser_type.name == "firefox":
new_display_name = test_utilities.profile_edit_test_data["valid_user_edit"][
new_display_name = utilities.profile_edit_test_data["valid_user_edit"][
"display_name_firefox"
]
@ -350,18 +350,18 @@ def test_display_name_replaces_the_username_text(page: Page):
# https://github.com/mozilla/sumo/issues/1345
@pytest.mark.skip
def test_biography_field_accepts_html_tags(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
with allure.step("Accessing the edit profile page via top-navbar and adding data inside "
"the biography field"):
sumo_pages.top_navbar._click_on_edit_profile_option()
sumo_pages.edit_my_profile_page._clear_biography_textarea_field()
html_test_data = test_utilities.profile_edit_test_data
html_test_data = utilities.profile_edit_test_data
sumo_pages.edit_my_profile_page._send_text_to_biography_field(
html_test_data["biography_field_with_html_data"]["biography_html_data"]
)
@ -371,13 +371,13 @@ def test_biography_field_accepts_html_tags(page: Page):
# C2107899, C2107899
@pytest.mark.editUserProfileTests
def test_make_my_email_address_visible_checkbox_checked(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
logged_in_email = test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
logged_in_email = utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
with allure.step("Signing in with a non-admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
username_one = sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -395,34 +395,34 @@ def test_make_my_email_address_visible_checkbox_checked(page: Page):
) == logged_in_email
with allure.step("Signing in with a different user"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
))
with check, allure.step("Accessing the previous user profile and verifying that the email"
" address is displayed"):
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
assert sumo_pages.my_profile_page._get_text_of_publicly_displayed_username(
) == logged_in_email
with allure.step("Signing out"):
test_utilities.delete_cookies()
utilities.delete_cookies()
with allure.step("Accessing the previous user profile and verifying that the email "
"address is not displayed to signed out users"):
# This also needs an update
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
expect(sumo_pages.my_profile_page._publicly_displayed_email_element()).to_be_hidden()
# C2107899
@pytest.mark.editUserProfileTests
def test_make_my_email_address_visible_checkbox_unchecked(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
username_one = sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -439,70 +439,68 @@ def test_make_my_email_address_visible_checkbox_unchecked(page: Page):
expect(sumo_pages.my_profile_page._publicly_displayed_email_element()).to_be_hidden()
with allure.step("Signing in with a different non-admin user"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
))
with allure.step("Accessing the previous user profile and verifying that the email "
"address is not displayed"):
# This also needs an update
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
expect(sumo_pages.my_profile_page._publicly_displayed_email_element()).to_be_hidden()
# C2107900, C2107900
@pytest.mark.editUserProfileTests
def test_website_information_is_displayed(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin user"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
username_one = sumo_pages.top_navbar._get_text_of_logged_in_username()
with allure.step("Accessing the 'Edit My Profile' page and updating the website field"):
sumo_pages.top_navbar._click_on_edit_profile_option()
website_field_test_data = (test_utilities.
profile_edit_test_data["valid_user_edit"]["website"])
website_field_test_data = utilities.profile_edit_test_data["valid_user_edit"]["website"]
sumo_pages.edit_my_profile_page._clear_website_field()
sumo_pages.edit_my_profile_page._send_text_to_website_field(
website_field_test_data)
sumo_pages.edit_my_profile_page._send_text_to_website_field(website_field_test_data)
sumo_pages.edit_my_profile_page._click_update_my_profile_button()
with check, allure.step("Verify that the correct website is displayed"):
assert sumo_pages.my_profile_page._get_my_profile_website_text() == website_field_test_data
with allure.step("Signing in with a different non-admin user"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
))
with check, allure.step("Verifying that the correct website information is displayed for the "
"first user"):
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
assert sumo_pages.my_profile_page._get_my_profile_website_text() == website_field_test_data
with check, allure.step("Clicking on the website and verifying that the user is redirected to "
"the correct page"):
sumo_pages.my_profile_page._click_on_my_website_link()
assert website_field_test_data in test_utilities.get_page_url()
assert website_field_test_data in utilities.get_page_url()
with check, allure.step("Navigating back to the SUMO page, signing out and verifying that the "
"correct website is displayed for the first user"):
test_utilities.navigate_back()
test_utilities.delete_cookies()
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.navigate_back()
utilities.delete_cookies()
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
assert sumo_pages.my_profile_page._get_my_profile_website_text() == website_field_test_data
with check, allure.step("Clicking on the website and verifying that the user is "
"redirected to the correct page"):
sumo_pages.my_profile_page._click_on_my_website_link()
assert website_field_test_data in test_utilities.get_page_url()
assert website_field_test_data in utilities.get_page_url()
with allure.step("Navigating back to the SUMO page and clearing the website field"):
test_utilities.navigate_back()
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.navigate_back()
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
sumo_pages.top_navbar._click_on_edit_profile_option()
sumo_pages.edit_my_profile_page._clear_website_field()
@ -512,18 +510,18 @@ def test_website_information_is_displayed(page: Page):
# C2107901, C2107901
@pytest.mark.editUserProfileTests
def test_twitter_information_is_displayed(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
username_one = sumo_pages.top_navbar._get_text_of_logged_in_username()
with allure.step("Accessing the Edit My Profile' page, clearing and adding data inside the "
"twitter input field"):
sumo_pages.top_navbar._click_on_edit_profile_option()
twitter_field_test_data = test_utilities.profile_edit_test_data["valid_user_edit"][
twitter_field_test_data = utilities.profile_edit_test_data["valid_user_edit"][
"twitter_username"
]
sumo_pages.edit_my_profile_page._clear_twitter_field()
@ -538,38 +536,38 @@ def test_twitter_information_is_displayed(page: Page):
with check, allure.step("Signing in with a different user and verifying that the correct "
"website information is displayed for the first user"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
))
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
assert sumo_pages.my_profile_page._get_my_profile_twitter_text() == twitter_field_test_data
with allure.step("Clicking on the twitter link and verifying that the user is redirected "
"correctly"):
sumo_pages.my_profile_page._click_on_twitter_link()
test_utilities.wait_for_given_timeout(2000)
assert (MyProfileMessages.TWITTER_REDIRECT_LINK + twitter_field_test_data in test_utilities
utilities.wait_for_given_timeout(2000)
assert (MyProfileMessages.TWITTER_REDIRECT_LINK + twitter_field_test_data in utilities
.get_page_url())
with check, allure.step("Navigating back to the SUMO page, signing out, accessing the profile "
"and verifying that the twitter information is displayed"):
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
test_utilities.delete_cookies()
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.delete_cookies()
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
assert sumo_pages.my_profile_page._get_my_profile_twitter_text() == twitter_field_test_data
with check, allure.step("Clicking on the twitter link and verifying that the user is "
"redirected correctly"):
sumo_pages.my_profile_page._click_on_twitter_link()
test_utilities.wait_for_given_timeout(2000)
assert (MyProfileMessages.TWITTER_REDIRECT_LINK + twitter_field_test_data in test_utilities
utilities.wait_for_given_timeout(2000)
assert (MyProfileMessages.TWITTER_REDIRECT_LINK + twitter_field_test_data in utilities
.get_page_url())
with allure.step("Navigating back to the SUMO page and clearing the twitter input field "
"changes"):
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
sumo_pages.top_navbar._click_on_edit_profile_option()
sumo_pages.edit_my_profile_page._clear_twitter_field()
@ -579,11 +577,11 @@ def test_twitter_information_is_displayed(page: Page):
# C2107903, C2107903
@pytest.mark.editUserProfileTests
def test_community_portal_username_is_displayed(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
username_one = sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -591,7 +589,7 @@ def test_community_portal_username_is_displayed(page: Page):
"'Community Portal' input field"):
sumo_pages.top_navbar._click_on_edit_profile_option()
community_portal_field_test_data = (
test_utilities.profile_edit_test_data["valid_user_edit"]["community_portal_username"])
utilities.profile_edit_test_data["valid_user_edit"]["community_portal_username"])
sumo_pages.edit_my_profile_page._clear_community_portal_field()
sumo_pages.edit_my_profile_page._send_text_to_community_portal_field(
community_portal_field_test_data)
@ -605,37 +603,37 @@ def test_community_portal_username_is_displayed(page: Page):
with check, allure.step("Signing in with a different user and verifying that the correct "
"community portal information is displayed for the first user"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
))
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
assert sumo_pages.my_profile_page._get_my_profile_community_portal_text(
) == community_portal_field_test_data
with check, allure.step("Clicking on the community portal link and verifying that the user is "
"redirected correctly"):
sumo_pages.my_profile_page._click_on_community_portal_link()
assert MyProfileMessages.COMMUNITY_PORTAL_LINK in test_utilities.get_page_url()
assert MyProfileMessages.COMMUNITY_PORTAL_LINK in utilities.get_page_url()
with check, allure.step("Navigating back to the SUMO page, signing out, accessing the "
"profile and verifying that the community portal information is "
"displayed"):
test_utilities.navigate_back()
test_utilities.delete_cookies()
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.navigate_back()
utilities.delete_cookies()
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
assert sumo_pages.my_profile_page._get_my_profile_community_portal_text(
) == community_portal_field_test_data
with check, allure.step("Clicking on the community portal link and verifying that the user is "
"redirected correctly"):
sumo_pages.my_profile_page._click_on_community_portal_link()
assert MyProfileMessages.COMMUNITY_PORTAL_LINK in test_utilities.get_page_url()
assert MyProfileMessages.COMMUNITY_PORTAL_LINK in utilities.get_page_url()
with allure.step("Navigating back to the SUMO page, and clearing the community portal "
"field changes"):
test_utilities.navigate_back()
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.navigate_back()
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
sumo_pages.top_navbar._click_on_edit_profile_option()
sumo_pages.edit_my_profile_page._clear_community_portal_field()
@ -645,11 +643,11 @@ def test_community_portal_username_is_displayed(page: Page):
# C2107902,C2107902
@pytest.mark.editUserProfileTests
def test_people_directory_information_is_displayed(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin user"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
username_one = sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -657,7 +655,7 @@ def test_people_directory_information_is_displayed(page: Page):
"'People Directory' input field"):
sumo_pages.top_navbar._click_on_edit_profile_option()
people_directory_field_test_data = (
test_utilities.profile_edit_test_data["valid_user_edit"]["people_directory_username"])
utilities.profile_edit_test_data["valid_user_edit"]["people_directory_username"])
sumo_pages.edit_my_profile_page._clear_people_directory_field()
sumo_pages.edit_my_profile_page._send_text_to_people_directory_username(
people_directory_field_test_data
@ -672,23 +670,23 @@ def test_people_directory_information_is_displayed(page: Page):
with check, allure.step("Signing in with a different user and verifying that the correct "
"people directory information is displayed for the first user"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
))
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
assert sumo_pages.my_profile_page._get_my_profile_people_directory_text(
) == people_directory_field_test_data
with check, allure.step("Signing out, accessing the profile and verifying that the people "
"directory information is displayed"):
test_utilities.delete_cookies()
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.delete_cookies()
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
assert sumo_pages.my_profile_page._get_my_profile_people_directory_text(
) == people_directory_field_test_data
with allure.step("Clearing the people directory field changes"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
sumo_pages.top_navbar._click_on_edit_profile_option()
sumo_pages.edit_my_profile_page._clear_people_directory_field()
@ -698,18 +696,18 @@ def test_people_directory_information_is_displayed(page: Page):
# C2107933, C2107933
@pytest.mark.editUserProfileTests
def test_matrix_information_is_displayed(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
username_one = sumo_pages.top_navbar._get_text_of_logged_in_username()
with allure.step("Accessing the 'Edit My Profile' page, clearing and adding data inside the "
"Matrix input field"):
sumo_pages.top_navbar._click_on_edit_profile_option()
matrix_field_test_data = test_utilities.profile_edit_test_data["valid_user_edit"][
matrix_field_test_data = utilities.profile_edit_test_data["valid_user_edit"][
"matrix_nickname"
]
sumo_pages.edit_my_profile_page._clear_matrix_field()
@ -723,21 +721,21 @@ def test_matrix_information_is_displayed(page: Page):
with check, allure.step("Signing in with a different user and verifying that the correct "
"Matrix information is displayed for the first user"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
))
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
assert matrix_field_test_data in sumo_pages.my_profile_page._get_my_profile_matrix_text()
with check, allure.step("Signing out, accessing the profile and verifying that the "
"Matrix information is displayed"):
test_utilities.delete_cookies()
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.delete_cookies()
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
assert matrix_field_test_data in sumo_pages.my_profile_page._get_my_profile_matrix_text()
with allure.step("Clearing the Matrix field changes"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
sumo_pages.top_navbar._click_on_edit_profile_option()
@ -748,21 +746,21 @@ def test_matrix_information_is_displayed(page: Page):
# C2107934, C2107934
@pytest.mark.editUserProfileTests
def test_country_location_information_is_displayed(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
username_one = sumo_pages.top_navbar._get_text_of_logged_in_username()
with allure.step("Accessing the 'Edit My Profile' page, clearing and adding data inside the "
"country input field"):
sumo_pages.top_navbar._click_on_edit_profile_option()
country_field_test_data_code = test_utilities.profile_edit_test_data["valid_user_edit"][
country_field_test_data_code = utilities.profile_edit_test_data["valid_user_edit"][
"country_code"
]
country_field_test_data_value = test_utilities.profile_edit_test_data["valid_user_edit"][
country_field_test_data_value = utilities.profile_edit_test_data["valid_user_edit"][
"country_value"
]
sumo_pages.edit_my_profile_page._clear_country_dropdown_field()
@ -776,23 +774,23 @@ def test_country_location_information_is_displayed(page: Page):
with check, allure.step("Signing in with a different user and verifying that the correct "
"Country information is displayed for the first user"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
))
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
assert (country_field_test_data_value in sumo_pages.my_profile_page.
_get_text_of_profile_subheading_location())
with check, allure.step("Signing out, accessing the profile and verifying that the Country "
"information is displayed"):
test_utilities.delete_cookies()
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.delete_cookies()
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
assert (country_field_test_data_value in sumo_pages.my_profile_page.
_get_text_of_profile_subheading_location())
with allure.step("Clearing the Country field changes"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
sumo_pages.top_navbar._click_on_edit_profile_option()
@ -803,11 +801,11 @@ def test_country_location_information_is_displayed(page: Page):
# C2107935, C2107935
@pytest.mark.editUserProfileTests
def test_city_location_information_is_displayed(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
username_one = sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -815,7 +813,7 @@ def test_city_location_information_is_displayed(page: Page):
"the City input field"):
sumo_pages.top_navbar._click_on_edit_profile_option()
city_field_test_data_value = (
test_utilities.profile_edit_test_data["valid_user_edit"]["city"])
utilities.profile_edit_test_data["valid_user_edit"]["city"])
sumo_pages.edit_my_profile_page._clear_city_field()
sumo_pages.edit_my_profile_page._sent_text_to_city_field(
city_field_test_data_value)
@ -827,23 +825,23 @@ def test_city_location_information_is_displayed(page: Page):
with check, allure.step("Signing in with a different user and verifying that the correct "
"City information is displayed for the first user"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
))
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
assert (city_field_test_data_value in sumo_pages.my_profile_page
._get_text_of_profile_subheading_location())
with check, allure.step("Signing out, accessing the profile and verifying that the City "
"information is displayed"):
test_utilities.delete_cookies()
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.delete_cookies()
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
assert (city_field_test_data_value in sumo_pages.my_profile_page.
_get_text_of_profile_subheading_location())
with allure.step("Clearing the City field changes"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
sumo_pages.top_navbar._click_on_edit_profile_option()
sumo_pages.edit_my_profile_page._clear_city_field()
@ -853,11 +851,11 @@ def test_city_location_information_is_displayed(page: Page):
# C2107938, C2107938
@pytest.mark.editUserProfileTests
def test_involved_since_information_is_displayed(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
username_one = sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -865,11 +863,11 @@ def test_involved_since_information_is_displayed(page: Page):
"the involved since input fields"):
sumo_pages.top_navbar._click_on_edit_profile_option()
involved_since_month_number_test_data = (
test_utilities.profile_edit_test_data["valid_user_edit"]["involved_from_month_number"])
utilities.profile_edit_test_data["valid_user_edit"]["involved_from_month_number"])
involved_since_month_test_data_value = (
test_utilities.profile_edit_test_data["valid_user_edit"]["involved_from_month_value"])
utilities.profile_edit_test_data["valid_user_edit"]["involved_from_month_value"])
involved_since_year_test_data_value = (
test_utilities.profile_edit_test_data["valid_user_edit"]["involved_from_year"])
utilities.profile_edit_test_data["valid_user_edit"]["involved_from_year"])
sumo_pages.edit_my_profile_page._clear_involved_from_month_select_field()
sumo_pages.edit_my_profile_page._clear_involved_from_year_select_field()
sumo_pages.edit_my_profile_page._select_involved_from_month_option_by_value(
@ -886,23 +884,23 @@ def test_involved_since_information_is_displayed(page: Page):
with check, allure.step("Signing in with a different user and verifying that the correct "
"involved from information is displayed for the first user"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_13"]
))
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
assert (involved_since_month_test_data_value and involved_since_year_test_data_value in
sumo_pages.my_profile_page._get_my_contributed_from_text())
with check, allure.step("Signing out, accessing the profile and verifying that the "
"involved from information is displayed"):
test_utilities.delete_cookies()
test_utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
utilities.delete_cookies()
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(username_one))
assert (involved_since_month_test_data_value and involved_since_year_test_data_value in
sumo_pages.my_profile_page._get_my_contributed_from_text())
with allure.step("Clearing the involved from field changes"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
sumo_pages.top_navbar._click_on_edit_profile_option()
sumo_pages.edit_my_profile_page._clear_involved_from_month_select_field()
@ -913,26 +911,24 @@ def test_involved_since_information_is_displayed(page: Page):
# C2087552, C2108840
@pytest.mark.editUserProfileTests
def test_edit_user_profile_button_is_not_displayed_for_non_admin_users(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
target_username = test_utilities.remove_character_from_string(
test_utilities.username_extraction_from_email(
test_utilities.user_special_chars
target_username = utilities.remove_character_from_string(
utilities.username_extraction_from_email(
utilities.user_special_chars
),
"*",
)
with allure.step("Accessing a user profile while not being signed in to SUMO"):
test_utilities.navigate_to_link(
MyProfileMessages.get_my_profile_stage_url(target_username)
)
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(target_username))
with allure.step("Verifying that the 'Edit user profile' option is not displayed"):
expect(sumo_pages.my_profile_page._edit_user_profile_option_element()).to_be_hidden()
with allure.step("Navigating to the profile edit link directly and verifying that the "
"user is redirected to the auth page"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
EditMyProfilePageMessages.get_url_of_other_profile_edit_page(target_username)
)
assert (
@ -943,12 +939,10 @@ def test_edit_user_profile_button_is_not_displayed_for_non_admin_users(page: Pag
with allure.step("Signing in with another non-admin account and accessing another user "
"account"):
sumo_pages.top_navbar._click_on_sumo_nav_logo()
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
test_utilities.navigate_to_link(
MyProfileMessages.get_my_profile_stage_url(target_username)
)
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(target_username))
with allure.step("Verifying that the 'Edit user profile' option is not displayed"):
expect(sumo_pages.my_profile_page._edit_user_profile_option_element()).to_be_hidden()
@ -956,7 +950,7 @@ def test_edit_user_profile_button_is_not_displayed_for_non_admin_users(page: Pag
with check, allure.step("Navigating to the profile edit link directly, verifying that "
"the correct message is displayed and that the edit form is not "
"displayed"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
EditMyProfilePageMessages.get_url_of_other_profile_edit_page(target_username)
)
assert sumo_pages.edit_my_profile_page._get_access_denied_header_text(
@ -969,22 +963,22 @@ def test_edit_user_profile_button_is_not_displayed_for_non_admin_users(page: Pag
# C2108839
@pytest.mark.editUserProfileTests
def test_report_user_is_displayed_and_accessible_for_signed_in_users_only(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
target_username = test_utilities.remove_character_from_string(
test_utilities.username_extraction_from_email(
test_utilities.user_special_chars
target_username = utilities.remove_character_from_string(
utilities.username_extraction_from_email(
utilities.user_special_chars
),
"*",
)
with allure.step("Accessing another user profile and verifying that the 'Report Abuse' "
"option is displayed"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
MyProfileMessages.get_my_profile_stage_url(target_username)
)
expect(sumo_pages.my_profile_page._is_report_user_option_displayed()).to_be_visible()
@ -1001,8 +995,8 @@ def test_report_user_is_displayed_and_accessible_for_signed_in_users_only(page:
with allure.step("Signing out and verifying that the 'Report Abuse' option is not "
"displayed on user profiles"):
test_utilities.delete_cookies()
test_utilities.navigate_to_link(
utilities.delete_cookies()
utilities.navigate_to_link(
MyProfileMessages.get_my_profile_stage_url(target_username)
)
expect(sumo_pages.my_profile_page._is_report_user_option_displayed()).to_be_hidden()
@ -1011,19 +1005,17 @@ def test_report_user_is_displayed_and_accessible_for_signed_in_users_only(page:
# C2108841
@pytest.mark.editUserProfileTests
def test_private_message_button_redirects_non_signed_in_users_to_the_fxa_login_flow(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
target_username = test_utilities.remove_character_from_string(
test_utilities.username_extraction_from_email(
test_utilities.user_special_chars
target_username = utilities.remove_character_from_string(
utilities.username_extraction_from_email(
utilities.user_special_chars
),
"*",
)
with allure.step("Accessing a user profile"):
test_utilities.navigate_to_link(
MyProfileMessages.get_my_profile_stage_url(target_username)
)
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(target_username))
with allure.step("Clicking on the 'Private Message' button and verifying that the non-signed "
"in user is redirected to the fxa page"):
@ -1036,18 +1028,16 @@ def test_private_message_button_redirects_non_signed_in_users_to_the_fxa_login_f
# C916055, C916054
@pytest.mark.editUserProfileTests
def test_deactivate_this_user_buttons_are_displayed_only_for_admin_users(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
target_username = test_utilities.remove_character_from_string(
test_utilities.username_extraction_from_email(
test_utilities.user_special_chars
target_username = utilities.remove_character_from_string(
utilities.username_extraction_from_email(
utilities.user_special_chars
),
"*",
)
with allure.step("Navigating ot a user profile while not signed in with a user"):
test_utilities.navigate_to_link(
MyProfileMessages.get_my_profile_stage_url(target_username)
)
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(target_username))
with allure.step("Verifying that the deactivate user buttons are not displayed"):
expect(sumo_pages.my_profile_page._is_deactivate_this_user_button_displayed()
@ -1058,13 +1048,13 @@ def test_deactivate_this_user_buttons_are_displayed_only_for_admin_users(page: P
with allure.step("Signing in with a non-admin account"):
sumo_pages.top_navbar._click_on_sumo_nav_logo()
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
with allure.step("Accessing another user profile and verifying that the deactivate "
"buttons are not displayed"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
MyProfileMessages.get_my_profile_stage_url(target_username)
)
expect(sumo_pages.my_profile_page._is_deactivate_this_user_button_displayed()
@ -1074,16 +1064,14 @@ def test_deactivate_this_user_buttons_are_displayed_only_for_admin_users(page: P
with allure.step("Signing in with an admin account"):
sumo_pages.top_navbar._click_on_sumo_nav_logo()
test_utilities.delete_cookies()
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.delete_cookies()
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Accessing another user profile and verifying that the deactivate user "
"buttons are displayed"):
test_utilities.navigate_to_link(
MyProfileMessages.get_my_profile_stage_url(target_username)
)
utilities.navigate_to_link(MyProfileMessages.get_my_profile_stage_url(target_username))
expect(sumo_pages.my_profile_page._is_deactivate_this_user_button_displayed()
).to_be_visible()
expect(sumo_pages.my_profile_page._deactivate_user_and_mark_content_as_spam_button()

Просмотреть файл

@ -3,7 +3,7 @@ import pytest
from playwright.sync_api import Page
from pytest_check import check
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.my_profile_pages_messages.edit_settings_page_messages import (
EditSettingsPageMessages)
from playwright_tests.pages.sumo_pages import SumoPages
@ -12,11 +12,11 @@ from playwright_tests.pages.sumo_pages import SumoPages
# C891396, C2108836
@pytest.mark.userSettings
def test_all_checkboxes_can_be_selected_and_saved(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
with check, allure.step("Checking all user settings and verifying that the correct "

Просмотреть файл

@ -3,7 +3,7 @@ import pytest
from pytest_check import check
from playwright.sync_api import expect, Page
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.homepage_messages import HomepageMessages
from playwright_tests.messages.my_profile_pages_messages.my_profile_page_messages import (
MyProfileMessages)
@ -15,11 +15,11 @@ from playwright_tests.pages.sumo_pages import SumoPages
# C891409
@pytest.mark.userProfile
def test_my_profile_page_can_be_accessed_via_top_navbar(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts['TEST_ACCOUNT_12']
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts['TEST_ACCOUNT_12']
))
original_username = sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -41,14 +41,14 @@ def test_my_profile_page_can_be_accessed_via_top_navbar(page: Page):
# C891411
@pytest.mark.userProfile
def test_my_profile_sign_out_button_functionality(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin account"):
sumo_pages.top_navbar._click_on_signin_signup_button()
sumo_pages.auth_flow_page.sign_in_flow(
username=test_utilities.user_special_chars,
account_password=test_utilities.user_secrets_pass
username=utilities.user_special_chars,
account_password=utilities.user_secrets_pass
)
with allure.step("Accessing the my profile page, clicking on the sign out button and "
@ -64,25 +64,23 @@ def test_my_profile_sign_out_button_functionality(page: Page):
# C2108828
@pytest.mark.userProfile
def test_provided_solutions_number_is_successfully_displayed(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin user account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
repliant_username = sumo_pages.top_navbar._get_text_of_logged_in_username()
with allure.step("Navigating to the Firefox AAQ form and posting a new AAQ question for "
"the Firefox product"):
test_utilities.navigate_to_link(
test_utilities.aaq_question_test_data["products_aaq_url"]["Firefox"]
)
utilities.navigate_to_link(utilities.aaq_question_test_data["products_aaq_url"]["Firefox"])
question_info = (
sumo_pages.aaq_flow.submit_an_aaq_question(
subject=test_utilities.aaq_question_test_data["valid_firefox_question"]["subject"],
topic_name=test_utilities.
subject=utilities.aaq_question_test_data["valid_firefox_question"]["subject"],
topic_name=utilities.
aaq_question_test_data["valid_firefox_question"]["topic_value"],
body=test_utilities.
body=utilities.
aaq_question_test_data["valid_firefox_question"]["question_body"]
)
)
@ -90,13 +88,13 @@ def test_provided_solutions_number_is_successfully_displayed(page: Page):
with allure.step("Navigating to the user profile page and extracting the original number "
"of posted question solutions"):
sumo_pages.top_navbar._click_on_view_profile_option()
original_number_of_solutions = test_utilities.number_extraction_from_string(
original_number_of_solutions = utilities.number_extraction_from_string(
sumo_pages.my_profile_page._get_my_profile_solutions_text()
)
with allure.step("Navigating to the previously posted question and posting a reply to it"):
test_utilities.navigate_to_link(question_info["question_page_url"])
question_test_data = test_utilities.question_test_data
utilities.navigate_to_link(question_info["question_page_url"])
question_test_data = utilities.question_test_data
sumo_pages.question_page._add_text_to_post_a_reply_textarea(
question_test_data["question_reply_solution"]
)
@ -111,16 +109,16 @@ def test_provided_solutions_number_is_successfully_displayed(page: Page):
"solution and verifying that the original number of solutions has "
"incremented"):
sumo_pages.top_navbar._click_on_view_profile_option()
test_utilities.number_extraction_from_string(
utilities.number_extraction_from_string(
sumo_pages.my_profile_page._get_my_profile_solutions_text()
)
assert (test_utilities.number_extraction_from_string(
assert (utilities.number_extraction_from_string(
sumo_pages.my_profile_page._get_my_profile_solutions_text(
)) == original_number_of_solutions + 1)
with allure.step("Deleting the posted question and verifying that we are redirected to "
"the product support forum page after deletion"):
test_utilities.navigate_to_link(question_info["question_page_url"])
utilities.navigate_to_link(question_info["question_page_url"])
sumo_pages.question_page._click_delete_this_question_question_tools_option()
sumo_pages.question_page._click_delete_this_question_button()
expect(sumo_pages.product_support_page._product_product_title_element()).to_be_visible()
@ -129,37 +127,37 @@ def test_provided_solutions_number_is_successfully_displayed(page: Page):
# C890832, C2094281
@pytest.mark.userProfile
def test_number_of_my_profile_answers_is_successfully_displayed(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin user"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
repliant_user = sumo_pages.top_navbar._get_text_of_logged_in_username()
with allure.step("Accessing the 'My profile' page and extracting the number of posted "
"answers"):
sumo_pages.top_navbar._click_on_view_profile_option()
original_number_of_answers = test_utilities.number_extraction_from_string(
original_number_of_answers = utilities.number_extraction_from_string(
sumo_pages.my_profile_page._get_my_profile_answers_text()
)
with allure.step("Navigating to the Firefox AAQ form and posting a new AAQ question"):
test_utilities.navigate_to_link(
test_utilities.aaq_question_test_data["products_aaq_url"]["Firefox"]
utilities.navigate_to_link(
utilities.aaq_question_test_data["products_aaq_url"]["Firefox"]
)
question_info = (
sumo_pages.aaq_flow.submit_an_aaq_question(
subject=test_utilities.aaq_question_test_data["valid_firefox_question"]["subject"],
topic_name=test_utilities.
subject=utilities.aaq_question_test_data["valid_firefox_question"]["subject"],
topic_name=utilities.
aaq_question_test_data["valid_firefox_question"]["topic_value"],
body=test_utilities.
body=utilities.
aaq_question_test_data["valid_firefox_question"]["question_body"]
)
)
with allure.step("Posting a reply for the question"):
question_test_data = test_utilities.question_test_data
question_test_data = utilities.question_test_data
reply_text = question_test_data["non_solution_reply"]
sumo_pages.question_page._add_text_to_post_a_reply_textarea(reply_text)
answer_id = sumo_pages.question_page._click_on_post_reply_button(
@ -169,11 +167,11 @@ def test_number_of_my_profile_answers_is_successfully_displayed(page: Page):
with allure.step("Accessing the 'My profile' page and verifying that the number of "
"answers has incremented successfully"):
sumo_pages.question_page._click_on_the_reply_author(answer_id)
test_utilities.number_extraction_from_string(
utilities.number_extraction_from_string(
sumo_pages.my_profile_page._get_my_profile_answers_text()
)
assert (
test_utilities.number_extraction_from_string(
utilities.number_extraction_from_string(
sumo_pages.my_profile_page._get_my_profile_answers_text()
) == original_number_of_answers + 1
)
@ -187,27 +185,25 @@ def test_number_of_my_profile_answers_is_successfully_displayed(page: Page):
with allure.step("Deleting the posted question and verifying that the user is redirected "
"to the product support forum page"):
test_utilities.navigate_to_link(question_info["question_page_url"])
utilities.navigate_to_link(question_info["question_page_url"])
sumo_pages.question_page._click_delete_this_question_question_tools_option()
sumo_pages.question_page._click_delete_this_question_button()
expect(
sumo_pages.product_support_page._product_product_title_element()
).to_be_visible()
expect(sumo_pages.product_support_page._product_product_title_element()).to_be_visible()
# C2094285, C2094284, C891309
@pytest.mark.userProfile
def test_number_of_posted_articles_is_successfully_displayed(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Accessing the profile page and extracting the number of documents"):
sumo_pages.top_navbar._click_on_view_profile_option()
original_number_of_documents = test_utilities.number_extraction_from_string(
original_number_of_documents = utilities.number_extraction_from_string(
sumo_pages.my_profile_page._get_my_profile_documents_text()
)
@ -218,7 +214,7 @@ def test_number_of_posted_articles_is_successfully_displayed(page: Page):
"documents has incremented"):
sumo_pages.top_navbar._click_on_view_profile_option()
assert (
test_utilities.number_extraction_from_string(
utilities.number_extraction_from_string(
sumo_pages.my_profile_page._get_my_profile_documents_text()
) == original_number_of_documents + 1
)
@ -241,17 +237,17 @@ def test_number_of_posted_articles_is_successfully_displayed(page: Page):
# C1491023
@pytest.mark.userProfile
def test_accounts_with_symbols_are_getting_a_corresponding_valid_username(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an account that contains SUMO-supported and "
"unsupported characters"):
sumo_pages.top_navbar._click_on_signin_signup_button()
username = test_utilities.username_extraction_from_email(
test_utilities.remove_character_from_string(
username = utilities.username_extraction_from_email(
utilities.remove_character_from_string(
sumo_pages.auth_flow_page.sign_in_flow(
username=test_utilities.user_special_chars,
account_password=test_utilities.user_secrets_pass
username=utilities.user_special_chars,
account_password=utilities.user_secrets_pass
),
"*",
))

Просмотреть файл

@ -2,7 +2,7 @@ import allure
import pytest
from playwright.sync_api import expect, Page
from playwright_tests.core.testutilities import TestUtilities
from playwright_tests.core.utilities import Utilities
from playwright_tests.messages.my_profile_pages_messages.my_questions_page_messages import (
MyQuestionsPageMessages)
from playwright_tests.pages.sumo_pages import SumoPages
@ -11,30 +11,30 @@ from playwright_tests.pages.sumo_pages import SumoPages
# C2094280, C890790
@pytest.mark.userQuestions
def test_number_of_questions_is_incremented_when_posting_a_question(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Accessing the 'My profile' page and extracting the original number of "
"posted questions"):
sumo_pages.top_navbar._click_on_view_profile_option()
original_number_of_questions = test_utilities.number_extraction_from_string(
original_number_of_questions = utilities.number_extraction_from_string(
sumo_pages.my_profile_page._get_my_profile_questions_text()
)
with allure.step("Navigating to the AAQ form and posting a new AAQ question"):
test_utilities.navigate_to_link(
test_utilities.aaq_question_test_data["products_aaq_url"]["Firefox"]
utilities.navigate_to_link(
utilities.aaq_question_test_data["products_aaq_url"]["Firefox"]
)
question_info = (
sumo_pages.aaq_flow.submit_an_aaq_question(
subject=test_utilities.aaq_question_test_data["valid_firefox_question"]["subject"],
topic_name=test_utilities
subject=utilities.aaq_question_test_data["valid_firefox_question"]["subject"],
topic_name=utilities
.aaq_question_test_data["valid_firefox_question"]["topic_value"],
body=test_utilities.
body=utilities.
aaq_question_test_data["valid_firefox_question"]["question_body"]
)
)
@ -42,13 +42,13 @@ def test_number_of_questions_is_incremented_when_posting_a_question(page: Page):
with allure.step("Navigating back to the profile page and verifying that the number of "
"questions has incremented"):
sumo_pages.top_navbar._click_on_view_profile_option()
new_number = test_utilities.number_extraction_from_string(
new_number = utilities.number_extraction_from_string(
sumo_pages.my_profile_page._get_my_profile_questions_text()
)
assert new_number == original_number_of_questions + 1
with allure.step("Deleting the posted question"):
test_utilities.navigate_to_link(question_info["question_page_url"])
utilities.navigate_to_link(question_info["question_page_url"])
sumo_pages.question_page._click_delete_this_question_question_tools_option()
sumo_pages.question_page._click_delete_this_question_button()
@ -61,17 +61,17 @@ def test_number_of_questions_is_incremented_when_posting_a_question(page: Page):
# C1296000, # C890790
@pytest.mark.userQuestions
def test_my_contributions_questions_reflects_my_questions_page_numbers(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a non-admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_12"]
))
with allure.step("Accessing the 'My profile' and extracting the number of questions "
"listed inside the my profile page"):
sumo_pages.top_navbar._click_on_view_profile_option()
number_of_questions = test_utilities.number_extraction_from_string(
number_of_questions = utilities.number_extraction_from_string(
sumo_pages.my_profile_page._get_my_profile_questions_text()
)
@ -85,13 +85,13 @@ def test_my_contributions_questions_reflects_my_questions_page_numbers(page: Pag
# C890821
@pytest.mark.userQuestions
def test_correct_messages_is_displayed_if_user_has_no_posted_questions(page: Page):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with a user which has no posted questions"):
sumo_pages.top_navbar._click_on_signin_signup_button()
sumo_pages.auth_flow_page.sign_in_flow(
username=test_utilities.user_special_chars,
account_password=test_utilities.user_secrets_pass
username=utilities.user_special_chars,
account_password=utilities.user_secrets_pass
)
original_user = sumo_pages.top_navbar._get_text_of_logged_in_username()
@ -110,15 +110,13 @@ def test_correct_messages_is_displayed_if_user_has_no_posted_questions(page: Pag
with allure.step("Navigating to the Firefox AAQ form and posting a new AAQ question for "
"the Firefox product"):
test_utilities.navigate_to_link(
test_utilities.aaq_question_test_data["products_aaq_url"]["Firefox"]
)
utilities.navigate_to_link(utilities.aaq_question_test_data["products_aaq_url"]["Firefox"])
question_info = (
sumo_pages.aaq_flow.submit_an_aaq_question(
subject=test_utilities.aaq_question_test_data["valid_firefox_question"]["subject"],
topic_name=test_utilities
subject=utilities.aaq_question_test_data["valid_firefox_question"]["subject"],
topic_name=utilities
.aaq_question_test_data["valid_firefox_question"]["topic_value"],
body=test_utilities.
body=utilities.
aaq_question_test_data["valid_firefox_question"]["question_body"]
)
)
@ -131,16 +129,16 @@ def test_correct_messages_is_displayed_if_user_has_no_posted_questions(page: Pag
with allure.step("Signing in with an admin account and deleting the posted question"):
sumo_pages.top_navbar._click_on_sign_out_button()
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
test_utilities.navigate_to_link(question_info["question_page_url"])
utilities.navigate_to_link(question_info["question_page_url"])
sumo_pages.question_page._click_delete_this_question_question_tools_option()
sumo_pages.question_page._click_delete_this_question_button()
with allure.step("Accessing the original user and verifying that the correct message is "
"displayed"):
test_utilities.navigate_to_link(
utilities.navigate_to_link(
MyQuestionsPageMessages.get_stage_my_questions_url(original_user)
)
assert (
@ -150,7 +148,7 @@ def test_correct_messages_is_displayed_if_user_has_no_posted_questions(page: Pag
with allure.step("Signing in with the original user and verifying that the correct "
"message and the question list is no longer displayed"):
test_utilities.delete_cookies()
utilities.delete_cookies()
sumo_pages.top_navbar._click_on_signin_signup_button()
sumo_pages.auth_flow_page.login_with_existing_session()
sumo_pages.top_navbar._click_on_view_profile_option()
@ -166,23 +164,21 @@ def test_correct_messages_is_displayed_if_user_has_no_posted_questions(page: Pag
def test_my_question_page_reflects_posted_questions_and_redirects_to_the_correct_question(
page: Page
):
test_utilities = TestUtilities(page)
utilities = Utilities(page)
sumo_pages = SumoPages(page)
with allure.step("Signing in with an admin account"):
test_utilities.start_existing_session(test_utilities.username_extraction_from_email(
test_utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
utilities.start_existing_session(utilities.username_extraction_from_email(
utilities.user_secrets_accounts["TEST_ACCOUNT_MODERATOR"]
))
with allure.step("Navigating to the Firefox AAQ form and posting a new AAQ question"):
test_utilities.navigate_to_link(
test_utilities.aaq_question_test_data["products_aaq_url"]["Firefox"]
)
utilities.navigate_to_link(utilities.aaq_question_test_data["products_aaq_url"]["Firefox"])
question_info = (
sumo_pages.aaq_flow.submit_an_aaq_question(
subject=test_utilities.aaq_question_test_data["valid_firefox_question"]["subject"],
topic_name=test_utilities.
subject=utilities.aaq_question_test_data["valid_firefox_question"]["subject"],
topic_name=utilities.
aaq_question_test_data["valid_firefox_question"]["topic_value"],
body=test_utilities.
body=utilities.
aaq_question_test_data["valid_firefox_question"]["question_body"]
)
)
@ -191,8 +187,7 @@ def test_my_question_page_reflects_posted_questions_and_redirects_to_the_correct
"element from the My Questions page is the recently posted question"):
sumo_pages.top_navbar._click_on_my_questions_profile_option()
assert sumo_pages.my_questions_page._get_text_of_first_listed_question().replace(
" ", ""
) == question_info["aaq_subject"].replace(" ", "")
" ", "") == question_info["aaq_subject"].replace(" ", "")
with allure.step("Clicking on the first list item and verifying that the user is "
"redirected to the correct question"):