in playwright_tests/pages/top_navbar.py [0:0]
def __init__(self, page: Page):
super().__init__(page)
# General page locators
self.menu_titles = page.locator("div#main-navigation a.mzp-c-menu-title")
self.sumo_nav_logo = page.locator(
"div.sumo-nav--logo").get_by_role("link").get_by_role("img")
# Locators belonging to the 'Explore Help Articles' top-navbar section.
self.explore_by_topic_top_navbar_header = page.locator(
"h4.mzp-c-menu-item-title").filter(has_text="Explore by topic")
self.explore_by_product_top_navbar_header = page.locator(
"h4.mzp-c-menu-item-title").filter(has_text="Explore by product")
self.explore_help_articles_top_navbar_option = page.locator(
"a[class='mzp-c-menu-title sumo-nav--link']").filter(has_text="Explore Help Articles")
self.explore_our_help_articles_view_all_option = page.locator(
"ul[class='mzp-c-menu-item-list sumo-nav--sublist'] li"
).get_by_role("link", name="View all products", exact=True)
self.explore_by_product_top_navbar_options = page.locator(
"//h4[text()='Explore by product']/../following-sibling::ul/li/a")
self.explore_by_topic_top_navbar_options = page.locator(
"//h4[text()='Explore by topic']/../following-sibling::ul/li/a")
# Locators belonging to the 'Ask a Question' top-navbar section.
self.ask_a_question_top_navbar = page.locator(
"li[class='mzp-c-menu-category mzp-has-drop-down mzp-js-expandable']").filter(
has_text="Ask a Question")
self.get_help_with_heading = page.locator(
"h4[class='mzp-c-menu-item-title']").filter(has_text="Get help with")
self.ask_a_question_top_navbar_options = page.get_by_role(
"link", name="Ask a Question", exact=True).locator("+ div li a")
self.aaq_firefox_browser_option = page.get_by_role(
"link", name="Ask a Question", exact=True).locator("+ div li").get_by_role(
"link").filter(has_text="Firefox desktop")
self.browse_all_products_option = page.locator(
"div#main-navigation").get_by_role("link", name="View all", exact=True)
# Locators belonging to the 'Community Forums' top-navbar section.
self.browse_by_product_top_navbar_header = page.locator(
"h4.mzp-c-menu-item-title").filter(has_text="Browse by product")
self.browse_all_forum_threads_by_topic_top_navbar_header = page.locator(
"h4.mzp-c-menu-item-title").filter(has_text="Browse all forum threads by topic")
self.community_forums_top_navbar_option = page.locator(
"a[class='mzp-c-menu-title sumo-nav--link']").filter(has_text="Community Forums")
self.browse_by_product_top_navbar_options = page.locator(
"//h4[text()='Browse by product']/../following-sibling::ul/li/a")
self.browse_all_forum_threads_by_topics_top_navbar_options = page.locator(
"//h4[text()='Browse all forum threads by topic']/../following-sibling::ul/li/a")
# Locators belonging to the 'Contribute' top-navbar section.
self.contribute_option = page.get_by_role("link").filter(has_text="Contribute")
self.contributor_discussions_top_navbar_header = page.locator(
"h4.mzp-c-menu-item-title").filter(has_text="Contributor discussions")
self.contributor_discussions_options = page.locator(
"//h4[text()='Contributor discussions']/../following-sibling::ul/li/a")
self.contributor_discussions_option = page.locator(
"h4.mzp-c-menu-item-title").filter(has_text="Contributor discussions")
self.article_discussions_option = page.locator(
"div#main-navigation").get_by_role("link", name="Article discussions", exact=True)
self.moderate_forum_content = page.locator(
"div#main-navigation").get_by_role("link").filter(has_text="Moderate forum content")
self.recent_revisions_option = page.locator(
"ul[class='mzp-c-menu-item-list sumo-nav--sublist']").get_by_role(
"link").filter(has_text="Recent revisions")
self.dashboards_option = page.locator(
"ul[class='mzp-c-menu-item-list sumo-nav--sublist']").get_by_role("link").filter(
has_text="Knowledge base dashboards")
self.media_gallery_option = page.locator(
"ul[class='mzp-c-menu-item-list sumo-nav--sublist']").get_by_role("link").filter(
has_text="Media gallery")
self.guides_option = page.locator(
"ul[class='mzp-c-menu-item-list sumo-nav--sublist']").get_by_role("link").filter(
has_text="Guides")
# Locators belonging to the 'Sign In/Up' top-navbar section.
self.signin_signup_button = page.locator("div#profile-navigation").get_by_role(
"link").filter(has_text="Sign In/Up")
self.signed_in_username = page.locator("span.sumo-nav--username")
self.signed_in_view_profile_option = page.locator(
"//h4[contains(text(), 'View Profile')]/parent::a")
self.signed_in_edit_profile_option = page.get_by_role("link").filter(
has_text="Edit Profile")
self.signed_in_my_questions_option = page.locator(
"div.sumo-nav--dropdown-thirds").get_by_role("link").filter(has_text="My Questions")
self.signed_in_settings_option = page.locator(
"//h4[contains(text(), 'Settings')]/parent::a")
self.signed_in_inbox_option = page.locator("//h4[contains(text(), 'Inbox')]/parent::a")
self.sign_out_button = page.locator("div#mzp-c-menu-panel-profile").get_by_role(
"link").get_by_text("Sign Out")
self.unread_message_profile_notification = page.locator(
"div#profile-navigation div.avatar-container-message-alert")
self.unread_message_count = page.locator("span.message-count-alert")