Skip to content

Commit

Permalink
Revert "- Adding tests for: popular topics page, product solutions pa…
Browse files Browse the repository at this point in the history
…ge, contact support page, submitted aaq questions for freemium products, freemium aaq form (#5812)" (#5817)

This reverts commit db58b90.
  • Loading branch information
escattone authored Dec 14, 2023
1 parent db58b90 commit fff9d33
Show file tree
Hide file tree
Showing 38 changed files with 155 additions and 1,619 deletions.
40 changes: 0 additions & 40 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,46 +141,6 @@ jobs:
if: success() || failure() && steps.create-sessions.outcome == 'success'
run: |
poetry run pytest -m userQuestions --numprocesses 2 --browser chrome --reruns 1 --html=reports/chrome_user_questions_page_tests.html --capture=tee-sys
- name: Run Contact Support Page Tests (Firefox)
working-directory: playwright_tests
if: success() || failure() && steps.create-sessions.outcome == 'success'
run: |
poetry run pytest -m contactSupportPage --numprocesses 2 --browser firefox --reruns 1 --html=reports/firefox_contact_support_page_tests.html --capture=tee-sys
- name: Run Contact Support Page Tests (Chrome)
working-directory: playwright_tests
if: success() || failure() && steps.create-sessions.outcome == 'success'
run: |
poetry run pytest -m contactSupportPage --numprocesses 2 --browser chrome --reruns 1 --html=reports/chrome_contact_support_page_tests.html --capture=tee-sys
- name: Run Product Solutions Page Tests (Firefox)
working-directory: playwright_tests
if: success() || failure() && steps.create-sessions.outcome == 'success'
run: |
poetry run pytest -m productSolutionsPage --numprocesses 2 --browser firefox --reruns 1 --html=reports/firefox_product_solutions_page_tests.html --capture=tee-sys
- name: Run Product Solutions Page Tests (Chrome)
working-directory: playwright_tests
if: success() || failure() && steps.create-sessions.outcome == 'success'
run: |
poetry run pytest -m productSolutionsPage --numprocesses 2 --browser chrome --reruns 1 --html=reports/chrome_product_solutions_page_tests.html --capture=tee-sys
- name: Run Product Topics Page Tests (Firefox)
working-directory: playwright_tests
if: success() || failure() && steps.create-sessions.outcome == 'success'
run: |
poetry run pytest -m productTopicsPage --numprocesses 2 --browser firefox --reruns 1 --html=reports/firefox_product_topics_page_tests.html --capture=tee-sys
- name: Run Product Topics Page Tests (Chrome)
working-directory: playwright_tests
if: success() || failure() && steps.create-sessions.outcome == 'success'
run: |
poetry run pytest -m productTopicsPage --numprocesses 2 --browser chrome --reruns 1 --html=reports/chrome_product_topics_page_tests.html --capture=tee-sys
- name: Run AAQ Tests (Firefox)
working-directory: playwright_tests
if: success() || failure() && steps.create-sessions.outcome == 'success'
run: |
poetry run pytest -m aaqPage --numprocesses 2 --browser firefox --reruns 1 --html=reports/firefox_aaq_tests.html --capture=tee-sys
- name: Run AAQ Tests (Chrome)
working-directory: playwright_tests
if: success() || failure() && steps.create-sessions.outcome == 'success'
run: |
poetry run pytest -m aaqPage --numprocesses 2 --browser chrome --reruns 1 --html=reports/chrome_aaq_tests.html --capture=tee-sys
- name: Combine Reports
working-directory: playwright_tests
if: success() || failure()
Expand Down
10 changes: 0 additions & 10 deletions playwright_tests/core/testutilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ class TestUtilities:
user_message_test_data = json.load(user_message_test_data_file)
user_message_test_data_file.close()

with open("test_data/general_data.json", "r") as general_test_data_file:
general_test_data = json.load(general_test_data_file)
general_test_data_file.close()

user_secrets_accounts = {
"TEST_ACCOUNT_12": os.environ.get("TEST_ACCOUNT_12"),
"TEST_ACCOUNT_13": os.environ.get("TEST_ACCOUNT_13"),
Expand Down Expand Up @@ -131,9 +127,6 @@ def navigate_to_link(self, link: str):
def wait_for_given_timeout(self, milliseconds: int):
self.page.wait_for_timeout(milliseconds)

def wait_for_url_to_be(self, expected_url: str):
self.page.wait_for_url(expected_url, timeout=4000)

# Store authentication states
def store_session_cookies(self, session_file_name: str):
self.context.storage_state(path=f"core/sessions/.auth/{session_file_name}.json")
Expand All @@ -151,9 +144,6 @@ def start_existing_session(self, session_file_name: str):
# session
self.page.reload()

def get_user_agent(self) -> str:
return self.page.evaluate('window.navigator.userAgent ')

def replace_special_chars_account(self, account: str) -> str:
return account.replace(account, "testMozillaSpecialChars")

Expand Down
67 changes: 13 additions & 54 deletions playwright_tests/flows/aaq_flows/aaq_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,73 +3,32 @@
from playwright_tests.pages.product_solutions_pages.product_solutions_page import (
ProductSolutionsPage)
from playwright_tests.pages.top_navbar import TopNavbar
from playwright_tests.pages.aaq_pages.aaq_form_page import AAQFormPage
from playwright_tests.pages.user_questions_pages.aaq_form_page import AAQFormPage
from playwright_tests.pages.user_questions_pages.questions_page import QuestionPage


class AAQFlow(AAQFormPage, ProductSolutionsPage, TopNavbar, TestUtilities, QuestionPage):
def __init__(self, page: Page):
super().__init__(page)

# Mozilla VPN has an extra optional dropdown menu for choosing an operating system
def submit_an_aaq_question_for_a_product(self,
subject: str,
topic_name: str,
body: str,
os="",
attach_image=False):
question_subject = self.add__valid_data_to_all_input_fields_without_submitting(
subject,
topic_name,
body,
os,
attach_image
)
# Submitting the question.
super().click_aaq_form_submit_button()
# Waiting for submitted question reply button visibility.
super().is_post_reply_button_visible()
current_page_url = self._page.url

# Returning the posted question subject and url for further usage.
return {"aaq_subject": question_subject, "question_page_url": current_page_url}

# Mozilla VPN has an extra optional dropdown menu for choosing an operating system
def add__valid_data_to_all_input_fields_without_submitting(self,
subject: str,
topic_value: str,
body_text: str,
os='',
attach_image=False):
def submit_valid_firefox_prod_question_via_ask_now_fx_solutions(self) -> dict:
random_number = str(super().generate_random_number(min_value=0, max_value=1000))
aaq_subject = subject + random_number
# Adding text to subject field.
super().click_on_ask_a_question_firefox_browser_option()
super().click_ask_now_button()
aaq_question_data = super().aaq_question_test_data
aaq_subject = aaq_question_data["valid_firefox_question"]["subject"] + " " + random_number
super().add_text_to_aaq_form_subject_field(aaq_subject)
# Selecting a topic.
super().select_aaq_form_topic_value(
topic_value
aaq_question_data["valid_firefox_question"]["topic_value"]
)
# Adding text to question body.
super().add_text_to_aaq_textarea_field(
body_text
aaq_question_data["valid_firefox_question"]["question_body"]
)
# Some products contain another OS dropdown menu. We are selecting an option for those.
if os != "":
super().select_aaq_form_os_value(os)

if attach_image:
# Uploading an image to the aaq question form.
super().get_upload_image_button_locator().set_input_files(
super().aaq_question_test_data["valid_firefox_question"]["image_path"]
)
# Investigate why image upload is not working

# Waiting for the image preview to be displayed.
super().uploaded_image_locator()

# Returning the entered question subject for further usage.
return aaq_subject
super().click_aaq_form_submit_button()
super().is_post_reply_button_visible()
current_page_url = self._page.url

def adding_an_image_to_aaq_form(self):
super().get_upload_image_button_locator().set_input_files(
super().aaq_question_test_data["valid_firefox_question"]["image_path"]
)
return {"aaq_subject": aaq_subject, "question_page_url": current_page_url}
10 changes: 0 additions & 10 deletions playwright_tests/messages/AAQ_messages/aaq_form_page_messages.py

This file was deleted.

5 changes: 0 additions & 5 deletions playwright_tests/messages/AAQ_messages/aaq_widget.py

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 1 addition & 2 deletions playwright_tests/messages/homepage_messages.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
class HomepageMessages:
STAGE_HOMEPAGE_URL = "https://support.allizom.org"
STAGE_HOMEPAGE_URL_EN_US = "https://support.allizom.org/en-US/"
STAGE_HOMEPAGE_URL = "https://support.allizom.org/en-US/"
JOIN_OUR_COMMUNITY_CARD_TITLE = "Join Our Community"
JOIN_OUR_COMMUNITY_CARD_DESCRIPTION = (
"Grow and share your expertise with others. Answer questions and improve "
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
class KBArticlePageMessages:
CREATE_NEW_KB_ARTICLE_STAGE_URL = "https://support.allizom.org/en-US/kb/new"
GET_COMMUNITY_SUPPORT_ARTICLE_LINK = ("https://support.allizom.org/en-US/kb/get-community"
"-support?exit_aaq=1")

This file was deleted.

158 changes: 0 additions & 158 deletions playwright_tests/pages/aaq_pages/aaq_form_page.py

This file was deleted.

Loading

0 comments on commit fff9d33

Please sign in to comment.