-
Notifications
You must be signed in to change notification settings - Fork 746
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5901 from emilghittasv/recent-revisions-playwrigh…
…t-coverage Expanding playwright over the following kb sections: show history (coverage increase), article revision page, contributors, recent revisions dashboard
- Loading branch information
Showing
27 changed files
with
2,400 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
playwright_tests/flows/explore_help_articles_flows/article_flows/add_kb_revision_flow.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
from playwright_tests.core.testutilities import TestUtilities | ||
from playwright.sync_api import Page | ||
from playwright_tests.pages.explore_help_articles.articles.kb_article_page import KBArticlePage | ||
from playwright_tests.pages.explore_help_articles.articles.kb_article_show_history_page import \ | ||
KBArticleShowHistoryPage | ||
from playwright_tests.pages.explore_help_articles.articles.kb_edit_article_page import ( | ||
EditKBArticlePage) | ||
|
||
|
||
class AddKBArticleRevision(TestUtilities, | ||
KBArticlePage, | ||
EditKBArticlePage, | ||
KBArticleShowHistoryPage): | ||
def __init__(self, page: Page): | ||
super().__init__(page) | ||
|
||
def submit_new_kb_revision(self, | ||
keywords=None, | ||
search_result_summary=None, | ||
content=None, | ||
expiry_date=None, | ||
changes_description=None, | ||
is_admin=False | ||
) -> str: | ||
|
||
super()._click_on_edit_article_option() | ||
|
||
# Only admin accounts can update article keywords. | ||
if is_admin: | ||
# Keywords step. | ||
if keywords is None: | ||
super()._fill_edit_article_keywords_field( | ||
self.kb_article_test_data['updated_keywords'] | ||
) | ||
else: | ||
super()._fill_edit_article_keywords_field(keywords) | ||
|
||
# Search Result Summary step. | ||
if search_result_summary is None: | ||
super()._fill_edit_article_search_result_summary_field( | ||
self.kb_article_test_data['updated_search_result_summary'] | ||
) | ||
else: | ||
super()._fill_edit_article_search_result_summary_field(search_result_summary) | ||
|
||
# Content step. | ||
if content is None: | ||
super()._fill_edit_article_content_field( | ||
self.kb_article_test_data['updated_article_content'] | ||
) | ||
else: | ||
super()._fill_edit_article_content_field(content) | ||
|
||
# Expiry date step. | ||
if expiry_date is None: | ||
super()._fill_edit_article_expiry_date( | ||
self.kb_article_test_data['updated_expiry_date'] | ||
) | ||
else: | ||
super()._fill_edit_article_expiry_date(expiry_date) | ||
|
||
# Submitting for preview steps | ||
super()._click_submit_for_review_button() | ||
|
||
if changes_description is None: | ||
super()._fill_edit_article_changes_panel_comment( | ||
self.kb_article_test_data['changes_description'] | ||
) | ||
else: | ||
super()._fill_edit_article_changes_panel_comment(changes_description) | ||
|
||
super()._click_edit_article_changes_panel_submit_button() | ||
|
||
return super()._get_last_revision_id() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
playwright_tests/messages/explore_help_articles/kb_article_show_history_page_messages.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class KBArticleShowHistoryPageMessages: | ||
PAGE_TITLE = "History of " | ||
DEFAULT_REVISION_FOR_LOCALE = "English" | ||
|
||
def get_delete_revision_endpoint(self, article_slug: str, revision_id: int) -> str: | ||
return f"https://support.allizom.org/en-US/kb/{article_slug}/revision/{revision_id}/delete" | ||
|
||
def get_remove_contributor_page_header(self, expected_username: str) -> str: | ||
return (f"Are you sure you want to remove {expected_username} from the document " | ||
f"contributors?") | ||
|
||
def get_contributor_added_message(self, expected_username: str) -> str: | ||
return f"{expected_username} added to the contributors successfully!" | ||
|
||
def get_contributor_removed_message(self, expected_username: str) -> str: | ||
return f"{expected_username} removed from the contributors successfully!" |
Oops, something went wrong.