-
Notifications
You must be signed in to change notification settings - Fork 722
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 #6133 from emilghittasv/expand-playwright-top-navb…
…ar-coverage Expand playwright coverage over the new top-navbar options
- Loading branch information
Showing
8 changed files
with
464 additions
and
49 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
16 changes: 16 additions & 0 deletions
16
...contribute/contribute_pages/contributor_discussions_pages/contributor_discussions_page.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 @@ | ||
from playwright.sync_api import Page | ||
from playwright_tests.core.basepage import BasePage | ||
|
||
""" | ||
This class contains the locators and actions for the general "Contributor Discussions" page. | ||
""" | ||
|
||
|
||
class ContributorDiscussionPage(BasePage): | ||
__contributor_discussions_page_title = "//div[@id='forums']/h1" | ||
|
||
def __init__(self, page: Page): | ||
super().__init__(page) | ||
|
||
def _get_contributor_discussions_page_title(self) -> str: | ||
return super()._get_text_of_element(self.__contributor_discussions_page_title) |
24 changes: 24 additions & 0 deletions
24
...tests/pages/contribute/contribute_pages/contributor_discussions_pages/discussions_page.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,24 @@ | ||
import re | ||
from playwright.sync_api import Page | ||
from playwright_tests.core.basepage import BasePage | ||
|
||
""" | ||
This class contains the locators and actions for the {x} discussions page. | ||
""" | ||
|
||
|
||
class DiscussionsPage(BasePage): | ||
__discussions_page_title = "//article[@id='threads']/h1" | ||
__contributor_discussions_side_nav_selected_option = ("//nav[@id='for-contributors-sidebar']//" | ||
"a[@class='selected']") | ||
|
||
def __init__(self, page: Page): | ||
super().__init__(page) | ||
|
||
def _get_contributor_discussions_page_title(self) -> str: | ||
return super()._get_text_of_element(self.__discussions_page_title) | ||
|
||
def _get_contributor_discussions_side_nav_selected_option(self) -> str: | ||
option = super()._get_text_of_element( | ||
self.__contributor_discussions_side_nav_selected_option) | ||
return re.sub(r'\s+', ' ', option).strip() |
32 changes: 32 additions & 0 deletions
32
playwright_tests/pages/explore_help_articles/explore_by_topic_page.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,32 @@ | ||
import re | ||
|
||
from playwright.sync_api import Page | ||
|
||
from playwright_tests.core.basepage import BasePage | ||
|
||
|
||
class ExploreByTopicPage(BasePage): | ||
__explore_by_topic_page_header = "//div[@class='documents-product-title']/h1" | ||
__filter_by_product_dropdown_selected_option = ("//select[@id='products-topics-dropdown" | ||
"']/option[@selected]") | ||
__all_topics_side_navbar_options = "//ul[@class='sidebar-nav--list']/li/a" | ||
__all_topics_selected_option = ("//ul[@class='sidebar-nav--list']/li/a[contains(@class, " | ||
"'selected')]") | ||
__AAQ_widget_continue_button = ("//div[@class='aaq-widget card is-inverse elevation-01 " | ||
"text-center radius-md']/a") | ||
__AAQ_widget_text = ("//div[@class='aaq-widget card is-inverse elevation-01 text-center " | ||
"radius-md']/p") | ||
__volunteer_learn_more_option = "//section[@id='get-involved-button']//a" | ||
|
||
def __init__(self, page: Page): | ||
super().__init__(page) | ||
|
||
def _get_explore_by_topic_page_header(self) -> str: | ||
return super()._get_text_of_element(self.__explore_by_topic_page_header) | ||
|
||
def _get_selected_topic_side_navbar_option(self) -> str: | ||
return super()._get_text_of_element(self.__all_topics_selected_option) | ||
|
||
def _get_current_topic_filter_dropdown_option(self) -> str: | ||
option = super()._get_text_of_element(self.__filter_by_product_dropdown_selected_option) | ||
return re.sub(r'\s+', ' ', option).strip() |
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
Oops, something went wrong.