diff --git a/tests/functional/firefox/family/test_family.py b/tests/functional/firefox/family/test_family.py index 66cb7f4fb6f..6c87ebc9f09 100644 --- a/tests/functional/firefox/family/test_family.py +++ b/tests/functional/firefox/family/test_family.py @@ -7,13 +7,6 @@ from pages.firefox.family.landing import FamilyPage -@pytest.mark.skip_if_firefox(reason="Nav download button is displayed only to non-Firefox users") -@pytest.mark.nondestructive -def test_firefox_nav_download_button_is_displayed(base_url, selenium): - page = FamilyPage(selenium, base_url).open() - assert page.is_firefox_nav_download_button_displayed - - @pytest.mark.skip_if_not_firefox(reason="Nav CTA is only hidden for Firefox users") @pytest.mark.nondestructive def test_firefox_nav_cta_is_displayed(base_url, selenium): diff --git a/tests/functional/test_navigation.py b/tests/functional/test_navigation.py index 5a26376cfe6..c3fafe7ed97 100644 --- a/tests/functional/test_navigation.py +++ b/tests/functional/test_navigation.py @@ -10,43 +10,46 @@ @pytest.mark.smoke @pytest.mark.nondestructive def test_navigation(base_url, selenium): - page = HomePage(selenium, base_url).open() - firefox_desktop_page = page.navigation.open_firefox_desktop_page() - assert firefox_desktop_page.seed_url in selenium.current_url + page = HomePage(selenium, base_url, locale="de").open() + page.navigation.open_firefox_menu() + assert page.navigation.is_firefox_menu_displayed - page.open() - developer_edition_page = page.navigation.open_developer_edition_page() - assert developer_edition_page.seed_url in selenium.current_url + page.navigation.open_products_menu() + assert page.navigation.is_products_menu_displayed + assert not page.navigation.is_firefox_menu_displayed - page.open() - manifesto_page = page.navigation.open_manifesto_page() - assert manifesto_page.seed_url in selenium.current_url + page.navigation.open_about_menu() + assert page.navigation.is_about_menu_displayed + assert not page.navigation.is_products_menu_displayed + + page.navigation.open_innovation_menu() + assert page.navigation.is_innovation_menu_displayed + assert not page.navigation.is_about_menu_displayed @pytest.mark.smoke @pytest.mark.nondestructive def test_mobile_navigation(base_url, selenium_mobile): - page = HomePage(selenium_mobile, base_url).open() + page = HomePage(selenium_mobile, base_url, locale="de").open() page.navigation.show() - firefox_desktop_page = page.navigation.open_firefox_desktop_page() - assert firefox_desktop_page.seed_url in selenium_mobile.current_url + page.navigation.open_firefox_menu() + assert page.navigation.is_firefox_menu_displayed - page.open() - page.navigation.show() - developer_edition_page = page.navigation.open_developer_edition_page() - assert developer_edition_page.seed_url in selenium_mobile.current_url + page.navigation.open_products_menu() + assert page.navigation.is_products_menu_displayed - page.open() - page.navigation.show() - manifesto_page = page.navigation.open_manifesto_page() - assert manifesto_page.seed_url in selenium_mobile.current_url + page.navigation.open_about_menu() + assert page.navigation.is_about_menu_displayed + + page.navigation.open_innovation_menu() + assert page.navigation.is_innovation_menu_displayed @pytest.mark.smoke @pytest.mark.nondestructive @pytest.mark.skip_if_firefox(reason="Firefox download button is shown only to non-Firefox users.") def test_navigation_download_firefox_button(base_url, selenium): - page = HomePage(selenium, base_url).open() + page = HomePage(selenium, base_url, locale="de").open() assert not page.navigation.is_mozilla_vpn_button_displayed assert page.navigation.is_firefox_download_button_displayed @@ -54,6 +57,6 @@ def test_navigation_download_firefox_button(base_url, selenium): @pytest.mark.nondestructive @pytest.mark.skip_if_not_firefox(reason="Mozilla VPN button is shown only to Firefox users.") def test_navigation_mozilla_vpn_button(base_url, selenium): - page = HomePage(selenium, base_url).open() + page = HomePage(selenium, base_url, locale="de").open() assert not page.navigation.is_firefox_download_button_displayed assert page.navigation.is_mozilla_vpn_button_displayed diff --git a/tests/pages/base.py b/tests/pages/base.py index dedfa80f900..5dfa1a8bea0 100644 --- a/tests/pages/base.py +++ b/tests/pages/base.py @@ -48,13 +48,14 @@ class Navigation(BaseRegion): _root_locator = (By.CLASS_NAME, "c-navigation") _toggle_locator = (By.CLASS_NAME, "c-navigation-menu-button") _menu_locator = (By.CLASS_NAME, "c-navigation-items") - _firefox_menu_locator = (By.CSS_SELECTOR, '.c-menu-title[aria-controls="c-menu-panel-firefox"]') - _products_menu_locator = (By.CSS_SELECTOR, '.c-menu-title[aria-controls="c-menu-panel-products"]') - _about_menu_locator = (By.CSS_SELECTOR, '.c-menu-title[aria-controls="c-menu-panel-about"]') - _innovation_menu_locator = (By.CSS_SELECTOR, '.c-menu-title[aria-controls="c-menu-panel-innovation"]') - _firefox_desktop_page_locator = (By.CSS_SELECTOR, '.c-menu-item-link[data-link-text="Firefox Desktop Browser"]') - _developer_edition_page_locator = (By.CSS_SELECTOR, '.c-menu-item-link[data-link-text="Firefox Developer Edition"]') - _manifesto_page_locator = (By.CSS_SELECTOR, '.c-menu-item-link[data-link-text="Mozilla Manifesto"]') + _firefox_menu_link_locator = (By.CSS_SELECTOR, '.c-menu-title[aria-controls="c-menu-panel-firefox"]') + _firefox_menu_locator = (By.ID, "c-menu-panel-firefox") + _products_menu_link_locator = (By.CSS_SELECTOR, '.c-menu-title[aria-controls="c-menu-panel-products"]') + _products_menu_locator = (By.ID, "c-menu-panel-products") + _about_menu_link_locator = (By.CSS_SELECTOR, '.c-menu-title[aria-controls="c-menu-panel-about"]') + _about_menu_locator = (By.ID, "c-menu-panel-about") + _innovation_menu_link_locator = (By.CSS_SELECTOR, '.c-menu-title[aria-controls="c-menu-panel-innovation"]') + _innovation_menu_locator = (By.ID, "c-menu-panel-innovation") _firefox_download_button_locator = (By.CSS_SELECTOR, "#protocol-nav-download-firefox > .download-link") _mozilla_vpn_button_locator = (By.CSS_SELECTOR, '.c-navigation-vpn-cta-container > [data-cta-text="Get Mozilla VPN"]') @@ -78,36 +79,37 @@ def is_displayed(self): return self.find_element(*self._menu_locator).is_displayed() and "is-active" in toggle.get_attribute("class") def open_navigation_menu(self, locator): - firefox_menu = self.find_element(*locator) - firefox_menu.click() - self.wait.until(lambda s: firefox_menu.is_displayed) - - def open_firefox_desktop_page(self): - self.open_navigation_menu(self._firefox_menu_locator) - link = self.find_element(*self._firefox_desktop_page_locator) - href = link.get_attribute("href") - self.page.set_attribute(link, att_name="href", att_value=href + "?automation=true") - link.click() - from .firefox.new.download import DownloadPage - - return DownloadPage(self.selenium, self.page.base_url).wait_for_page_to_load() - - def open_developer_edition_page(self): - self.open_navigation_menu(self._innovation_menu_locator) - link = self.find_element(*self._developer_edition_page_locator) - href = link.get_attribute("href") - self.page.set_attribute(link, att_name="href", att_value=href + "?automation=true") - link.click() - from .firefox.developer import DeveloperPage - - return DeveloperPage(self.selenium, self.page.base_url).wait_for_page_to_load() - - def open_manifesto_page(self): - self.open_navigation_menu(self._about_menu_locator) - link = self.find_element(*self._manifesto_page_locator) - href = link.get_attribute("href") - self.page.set_attribute(link, att_name="href", att_value=href + "?automation=true") - link.click() - from .manifesto import ManifestoPage - - return ManifestoPage(self.selenium, self.page.base_url).wait_for_page_to_load() + menu = self.find_element(*locator) + menu.click() + + @property + def is_firefox_menu_displayed(self): + return self.is_element_displayed(*self._firefox_menu_locator) + + @property + def is_products_menu_displayed(self): + return self.is_element_displayed(*self._products_menu_locator) + + @property + def is_about_menu_displayed(self): + return self.is_element_displayed(*self._about_menu_locator) + + @property + def is_innovation_menu_displayed(self): + return self.is_element_displayed(*self._innovation_menu_locator) + + def open_firefox_menu(self): + self.open_navigation_menu(self._firefox_menu_link_locator) + self.wait.until(lambda s: self.is_firefox_menu_displayed) + + def open_products_menu(self): + self.open_navigation_menu(self._products_menu_link_locator) + self.wait.until(lambda s: self.is_products_menu_displayed) + + def open_about_menu(self): + self.open_navigation_menu(self._about_menu_link_locator) + self.wait.until(lambda s: self.is_about_menu_displayed) + + def open_innovation_menu(self): + self.open_navigation_menu(self._innovation_menu_link_locator) + self.wait.until(lambda s: self.is_innovation_menu_displayed) diff --git a/tests/pages/firefox/family/landing.py b/tests/pages/firefox/family/landing.py index 0b4716e6e4b..f73ceebaab9 100644 --- a/tests/pages/firefox/family/landing.py +++ b/tests/pages/firefox/family/landing.py @@ -14,8 +14,6 @@ class FamilyPage(BasePage): _firefox_nav_cta_locator = (By.CSS_SELECTOR, ".c-navigation-shoulder") - _firefox_nav_download_button_locator = (By.CSS_SELECTOR, "[data-cta-position='nav']") - _firefox_desktop_download_button_locator = (By.CSS_SELECTOR, "[data-cta-position='download section']") _firefox_make_default_button_locator = (By.CSS_SELECTOR, "[data-cta-text='Set Firefox as your default browser']") @@ -26,10 +24,6 @@ class FamilyPage(BasePage): def is_firefox_nav_cta_displayed(self): return self.is_element_displayed(*self._firefox_nav_cta_locator) - @property - def is_firefox_nav_download_button_displayed(self): - return self.is_element_displayed(*self._firefox_nav_download_button_locator) - @property def is_firefox_desktop_download_button_displayed(self): return self.is_element_displayed(*self._firefox_desktop_download_button_locator) diff --git a/tests/playwright/specs/navigation.spec.js b/tests/playwright/specs/navigation.spec.js index e90f297e5ee..360a7855e6c 100644 --- a/tests/playwright/specs/navigation.spec.js +++ b/tests/playwright/specs/navigation.spec.js @@ -8,7 +8,7 @@ const { test, expect } = require('@playwright/test'); const openPage = require('../scripts/open-page'); -const url = '/en-US/'; +const url = '/de/'; test.describe( `${url} navigation (desktop)`, diff --git a/tests/playwright/specs/products/vpn/vpn-landing.spec.js b/tests/playwright/specs/products/vpn/vpn-landing.spec.js index 780cf41c7b6..64a9b1fc69c 100644 --- a/tests/playwright/specs/products/vpn/vpn-landing.spec.js +++ b/tests/playwright/specs/products/vpn/vpn-landing.spec.js @@ -25,9 +25,6 @@ test.describe( }); test(`Country code: ${country}`, async ({ page }) => { - const getVpnNavButton = page.getByTestId( - 'get-mozilla-vpn-nav-button' - ); const getVpnHeroButton = page.getByTestId( 'get-mozilla-vpn-hero-button' ); @@ -46,10 +43,6 @@ test.describe( const getVpnFooterButton = page.getByTestId( 'get-mozilla-vpn-footer-button' ); - - const waitlistNavButton = page.getByTestId( - 'join-waitlist-nav-button' - ); const waitlistHeroButton = page.getByTestId( 'join-waitlist-hero-button' ); @@ -67,7 +60,6 @@ test.describe( ); // Assert Get Mozilla VPN buttons are displayed. - await expect(getVpnNavButton).toBeVisible(); await expect(getVpnHeroButton).toBeVisible(); await expect(getVpnTwelveMonthButton).toBeVisible(); await expect(getVpnMonthlyButton).toBeVisible(); @@ -78,7 +70,6 @@ test.describe( // Assert Join Waitlist buttons are not displayed. await expect(waitlistHeroButton).not.toBeVisible(); await expect(waitlistNotAvailableButton).not.toBeVisible(); - await expect(waitlistNavButton).not.toBeVisible(); await expect(waitlistSecondaryButton).not.toBeVisible(); await expect(waitlistTertiaryButton).not.toBeVisible(); await expect(waitlistFooterButton).not.toBeVisible(); @@ -93,9 +84,6 @@ test.describe( }); test(`Country code: ${country}`, async ({ page }) => { - const getVpnNavButton = page.getByTestId( - 'get-mozilla-vpn-nav-button' - ); const getVpnHeroButton = page.getByTestId( 'get-mozilla-vpn-hero-button' ); @@ -114,10 +102,6 @@ test.describe( const getVpnFooterButton = page.getByTestId( 'get-mozilla-vpn-footer-button' ); - - const waitlistNavButton = page.getByTestId( - 'join-waitlist-nav-button' - ); const waitlistHeroButton = page.getByTestId( 'join-waitlist-hero-button' ); @@ -135,7 +119,6 @@ test.describe( ); // Assert Join Waitlist buttons are displayed. - await expect(waitlistNavButton).toBeVisible(); await expect(waitlistHeroButton).toBeVisible(); await expect(waitlistNotAvailableButton).toBeVisible(); await expect(waitlistSecondaryButton).toBeVisible(); @@ -143,7 +126,6 @@ test.describe( await expect(waitlistFooterButton).toBeVisible(); // Assert Get Mozilla VPN buttons are not displayed. - await expect(getVpnNavButton).not.toBeVisible(); await expect(getVpnHeroButton).not.toBeVisible(); await expect(getVpnTwelveMonthButton).not.toBeVisible(); await expect(getVpnMonthlyButton).not.toBeVisible();