Skip to content

Commit

Permalink
Merge pull request #6129 from emilghittasv/playwright-framework-refactor
Browse files Browse the repository at this point in the history
Playwright add chromium browser option & rename TestUtilities class and instances
  • Loading branch information
emilghittasv authored Jul 19, 2024
2 parents c4eb68b + 29d1844 commit f9c7d42
Show file tree
Hide file tree
Showing 42 changed files with 1,980 additions and 2,069 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -12,7 +12,7 @@ on:
type: choice
options:
- firefox
- chrome
- chromium
TestSuite:
description: Test Suite to run
required: true
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from playwright_tests.pages.top_navbar import TopNavbar


class TestUtilities:
class Utilities:
def __init__(self, page: Page):
self.page = page

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
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
from playwright_tests.pages.ask_a_question.aaq_pages.aaq_form_page import AAQFormPage
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)

Expand Down
4 changes: 2 additions & 2 deletions playwright_tests/flows/auth_flows/auth_flow.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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 (
Expand All @@ -16,7 +16,7 @@
SubmitKBArticlePage)


class AddKbArticleFlow(TestUtilities, SubmitKBArticlePage, AddKbMediaFlow, KBArticlePage,
class AddKbArticleFlow(Utilities, SubmitKBArticlePage, AddKbMediaFlow, KBArticlePage,
KBArticleShowHistoryPage, KBArticleReviewRevisionPage, EditKBArticlePage):

def __init__(self, page: Page):
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -7,7 +7,7 @@
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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -10,7 +10,7 @@
SubmitKBArticlePage


class EditArticleMetaFlow(TestUtilities, KBArticleEditMetadata, SubmitKBArticlePage,
class EditArticleMetaFlow(Utilities, KBArticleEditMetadata, SubmitKBArticlePage,
KBArticlePage):

def __init__(self, page: Page):
Expand Down
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -9,7 +9,7 @@
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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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 \
Expand All @@ -13,7 +13,7 @@
SubmitKBArticlePage


class KbArticleTranslationFlow(TranslateArticlePage, TestUtilities, SubmitKBArticlePage,
class KbArticleTranslationFlow(TranslateArticlePage, Utilities, SubmitKBArticlePage,
KBArticleShowHistoryPage, KBArticleReviewRevisionPage):
def __init__(self, page: Page):
super().__init__(page)
Expand Down
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 2 additions & 2 deletions playwright_tests/flows/user_groups_flows/user_group_flow.py
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -10,7 +10,7 @@


class EditProfileDataFlow(MyProfileEdit,
TestUtilities,
Utilities,
MyProfileEditContributionAreasPage,
TopNavbar,
UserNavbar,
Expand Down
1 change: 1 addition & 0 deletions playwright_tests/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading

0 comments on commit f9c7d42

Please sign in to comment.