This repository has been archived by the owner on Aug 20, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding bedrock, skipsprod markers and tests for partner page
- Loading branch information
Showing
3 changed files
with
107 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env python | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
from selenium.webdriver.common.by import By | ||
from selenium.webdriver.common.action_chains import ActionChains | ||
from pages.desktop.base import Base | ||
|
||
|
||
class Partners(Base): | ||
|
||
def go_to_page(self): | ||
self.open('/apps/partners/') | ||
|
||
_marketplace_header_locator = (By.CSS_SELECTOR, '#masthead > h2 > a > img') | ||
_apps_platform_billboard = (By.CSS_SELECTOR, '.billboard.menu-bar > ul > li:nth-of-type(1) >a') | ||
_marketplace_billboard = (By.CSS_SELECTOR, '.billboard.menu-bar > ul > li:nth-of-type(2) >a') | ||
_submit_apps_button = (By.CSS_SELECTOR, '.billboard.menu-bar > ul > li:nth-of-type(3) >a') | ||
_mdn_apps_link = (By.CSS_SELECTOR, '#mdn-link > a') | ||
_opening_soon_image = (By.CSS_SELECTOR, '#soon') | ||
_test_apps_image = (By.CSS_SELECTOR, '#test') | ||
_build_fanbase_image = (By.CSS_SELECTOR, '#build') | ||
_target_consumers_image = (By.CSS_SELECTOR, '#target') | ||
|
||
@property | ||
def are_billboards_visible(self): | ||
return self.is_element_visible(*self._marketplace_header_locator) and \ | ||
self.is_element_visible(*self._apps_platform_billboard) | ||
|
||
@property | ||
def is_opening_soon_image_visible(self): | ||
return self.is_element_visible(*self._opening_soon_image) | ||
|
||
@property | ||
def are_pointer_images_visible(self): | ||
return self.is_element_visible(*self._test_apps_image) and \ | ||
self.is_element_visible(*self._build_fanbase_image) and \ | ||
self.is_element_visible(*self._target_consumers_image) | ||
|
||
@property | ||
def click_submit_apps_button(self): | ||
element = self.selenium.find_element(*self._submit_apps_button) | ||
ActionChains(self.selenium).\ | ||
move_to_element(element).\ | ||
click().perform() | ||
return self.url_current_page |
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,42 @@ | ||
#!/usr/bin/env python | ||
|
||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
import pytest | ||
from pages.desktop.partners import Partners | ||
from unittestzero import Assert | ||
|
||
|
||
@pytest.mark.skipsprod | ||
class TestPartners: | ||
|
||
@pytest.mark.nondestructive | ||
@pytest.mark.bedrock | ||
def test_footer_section(self, mozwebqa): | ||
partners_page = Partners(mozwebqa) | ||
partners_page.go_to_page() | ||
Assert.true(partners_page.footer.are_footer_links_visible) | ||
|
||
@pytest.mark.nondestructive | ||
def test_header_section(self, mozwebqa): | ||
partners_page = Partners(mozwebqa) | ||
partners_page.go_to_page() | ||
Assert.true(partners_page.header.is_tabzilla_panel_visible) | ||
partners_page.header.toggle_tabzilla_dropdown() | ||
Assert.true(partners_page.header.are_tabzilla_links_visible) | ||
|
||
@pytest.mark.nondestructive | ||
def test_partner_billboard_links(self, mozwebqa): | ||
partners_page = Partners(mozwebqa) | ||
partners_page.go_to_page() | ||
Assert.true(partners_page.are_billboards_visible) | ||
Assert.true(partners_page.is_opening_soon_image_visible) | ||
|
||
@pytest.mark.nondestructive | ||
def test_submit_app_button(self, mozwebqa): | ||
partners_page = Partners(mozwebqa) | ||
partners_page.go_to_page() | ||
Assert.equal('https://marketplace.mozilla.org/en-US/login?to=/en-US/developers/', | ||
partners_page.click_submit_apps_button) |