Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

clean running tests for webdriver branch

  • Loading branch information...
commit 5da9b36b7b994cef497362d26aa45bf08330b9ee 1 parent 15e2712
@retornam retornam authored
Showing with 328 additions and 859 deletions.
  1. +23 −0 conftest.py
  2. +1 −2  mozwebqa.cfg
  3. +0 −70 pages/desktop/aurora.py
  4. +56 −15 pages/desktop/base.py
  5. +0 −70 pages/desktop/beta.py
  6. +0 −72 pages/desktop/channel.py
  7. +32 −37 pages/desktop/contribute.py
  8. +0 −14 pages/desktop/customize.py
  9. +0 −14 pages/desktop/features.py
  10. +0 −88 pages/desktop/home.py
  11. +7 −10 pages/desktop/mission.py
  12. +11 −8 pages/desktop/performance.py
  13. +0 −22 pages/desktop/regions/menu_bar_billboard.py
  14. +48 −30 pages/desktop/security.py
  15. +3 −36 pages/desktop/{technology_page.py → technology.py}
  16. 0  pages/{desktop/regions → mobile}/__init__.py
  17. +1 −1  requirements.txt
  18. +8 −7 tests/test_404.py
  19. +0 −38 tests/test_aurora.py
  20. +0 −38 tests/test_beta.py
  21. +0 −45 tests/test_channel.py
  22. +10 −42 tests/test_contribute.py
  23. +0 −27 tests/test_customize.py
  24. +12 −10 tests/test_download.py
  25. +0 −24 tests/test_features.py
  26. +0 −32 tests/test_header_footer.py
  27. +0 −45 tests/test_homepage.py
  28. +22 −12 tests/test_mission.py
  29. +30 −11 tests/test_performance.py
  30. +13 −10 tests/{test_redirects.py → test_redirect.py}
  31. +31 −17 tests/test_security.py
  32. +20 −12 tests/test_technology.py
View
23 conftest.py
@@ -0,0 +1,23 @@
+import pytest
+
+
+def pytest_addoption(parser):
+ parser.addoption(
+ '--nonbedrock',
+ action='store',
+ dest='nonbedrock',
+ metavar='nonbedrock',
+ help='marks tests so they do not use Bedrock branch')
+
+
+def pytest_configure(config):
+ config.addinivalue_line(
+ 'markers',
+ 'nonbedrock: marks tests so they do not use Bedrock branch')
+
+
+def pytest_runtest_setup(item):
+ if 'nonbedrock' in item.keywords:
+ item.config.option.base_url = item.config.option.base_url.replace('/b', '')
+ else:
+ pass
View
3  mozwebqa.cfg
@@ -1,4 +1,3 @@
[DEFAULT]
api = webdriver
-baseurl = https://www-dev.allizom.org/b
-
+baseurl = https://www-dev.allizom.org
View
70 pages/desktop/aurora.py
@@ -1,70 +0,0 @@
-#!/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 pages.desktop.base import Base
-
-
-class AuroraPage(Base):
-
- _aurora_header = (By.CSS_SELECTOR, '#main-feature > h2 > img')
- _aurora_btn_locator = (By.CSS_SELECTOR, '.home-download > li > a')
- _all_systems_locator = (By.CSS_SELECTOR, '.download-other > a:nth-child(1)')
- _privacy_policy_locator = (By.CSS_SELECTOR, '.download-other > a:nth-child(2)')
- _email_locator = (By.CSS_SELECTOR, '#email')
- _aurora_checkbox_locator = (By.CSS_SELECTOR, '#check_aurora')
- _privacy_policy_checkbox_locator = (By.CSS_SELECTOR, '#inline-privacy-check')
- _sign_up_btn_locator = (By.CSS_SELECTOR, '#subscribe.button')
- _preview_features_locator = (By.CSS_SELECTOR, '#feature-list > li:nth-child(1) > h3')
- _share_feedback_locator = (By.CSS_SELECTOR, '#feature-list > li:nth-child(2) > h3')
- _shape_firefox_locator = (By.CSS_SELECTOR, '#feature-list > li:nth-child(3) > h3')
- _success_pane_locator = (By.CSS_SELECTOR, '.success-pane > h3')
-
- def go_to_aurora_page(self):
- self.open("/aurora/")
-
- @property
- def is_preview_features_header_present(self):
- return self.is_element_present(*self._preview_features_locator)
-
- @property
- def is_share_feedback_header_present(self):
- return self.is_element_present(*self._share_feedback_locator)
-
- @property
- def is_shape_firefox_header_present(self):
- return self.is_element_present(*self._shape_firefox_locator)
-
- @property
- def is_aurora_header_present(self):
- return self.is_element_present(*self._aurora_header)
-
- @property
- def is_aurora_download_button_present(self):
- return self.is_element_present(*self._aurora_btn_locator)
-
- @property
- def is_all_systems_and_languages_link_present(self):
- return self.is_element_present(*self._all_systems_locator)
-
- @property
- def is_privacy_policy_link_present(self):
- return self.is_element_present(*self._privacy_policy_locator)
-
- def type_email(self, email):
- self.selenium.find_element(*self._email_locator).send_keys(email)
-
- def check_aurora_checkbox(self):
- return self.selenium.find_element(*self._aurora_checkbox_locator).click()
-
- def agree_to_privacy_policy(self):
- self.selenium.find_element(*self._privacy_policy_checkbox_locator).click()
-
- def click_sign_me_up(self):
- self.selenium.find_element(*self._sign_up_btn_locator).click()
-
- @property
- def newsletter_submitted_sucessfully(self):
- return self.selenium.find_element(*self._success_pane_locator).text
View
71 pages/desktop/base.py
@@ -2,11 +2,10 @@
# 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/
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
-
from pages.page import Page
@@ -18,7 +17,6 @@ class Base(Page):
_addons_link = (By.CSS_SELECTOR, '#nav-main-addons > a')
_support_link = (By.CSS_SELECTOR, '#nav-main-support > a')
_about_link = (By.CSS_SELECTOR, '#nav-main-about > a')
- _menu_bar_billboard_locator = (By.CSS_SELECTOR, '.menu-bar ul li')
@property
def header(self):
@@ -29,18 +27,15 @@ def footer(self):
return self.Footer(self.testsetup)
@property
- def menu_bar_billboard(self):
- from pages.desktop.regions.menu_bar_billboard import MenuBarBillboard
- return [MenuBarBillboard(self.testsetup, web_element) for web_element in
- self.selenium.find_elements(*self._menu_bar_billboard_locator)]
+ def downloadRegion(self):
+ return self.DownloadRegion(self.testsetup)
class Header(Page):
_tabzilla = (By.ID, 'tabzilla')
_tabzilla_panel = (By.ID, 'tabzilla-panel')
-
- _tabzilla_mission_link = (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(1) > ul > li:nth-of-type(1) > a')
_tabzilla_about_link = (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(1) > ul > li:nth-of-type(2) > a')
+ _tabzilla_mission_link = (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(1) > ul > li:nth-of-type(1) > a')
_tabzilla_projects_link = (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(1) > ul > li:nth-of-type(3) > a')
_tabzilla_support_link = (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(1) > ul > li:nth-of-type(4) > a')
_tabzilla_developer_network_link = (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(1) > ul > li:nth-of-type(5) > a')
@@ -52,22 +47,37 @@ class Header(Page):
_tabzilla_work_link = (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(4) > ul > li:nth-of-type(2) > a')
_tabzilla_findus_link = (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(4) > ul > li:nth-of-type(3) > a')
_tabzilla_joinus_link = (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(4) > ul > li:nth-of-type(4) > a')
- _tabzilla_learnmore_link = (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(4) > ul > li:nth-of-type(5) > a')
_tabzilla_search_textbox = (By.CSS_SELECTOR, '#tabzilla-search #q')
def toggle_tabzilla_dropdown(self):
- state = self.selenium.execute_script("return Tabzilla.opened")
+ toggle_state = self.selenium.execute_script('return Tabzilla.opened')
self.selenium.find_element(*self._tabzilla).click()
- WebDriverWait(self.selenium, 5).until(lambda s: state != s.execute_script("return Tabzilla.opened"))
+ WebDriverWait(self.selenium, 5).until(lambda state: toggle_state != state.execute_script('return Tabzilla.opened'))
@property
def is_tabzilla_panel_visible(self):
return self.is_element_visible(*self._tabzilla)
@property
- def is_tabzilla_searchbox_visible(self):
+ def is_tabzilla_search_box_visible(self):
return self.is_element_visible(*self._tabzilla_search_textbox)
+ @property
+ def are_tabzilla_links_visible(self):
+ return self.is_element_visible(*self._tabzilla_mission_link) and \
+ self.is_element_visible(*self._tabzilla_about_link) and \
+ self.is_element_visible(*self._tabzilla_projects_link) and \
+ self.is_element_visible(*self._tabzilla_support_link) and \
+ self.is_element_visible(*self._tabzilla_developer_network_link) and \
+ self.is_element_visible(*self._tabzilla_firefox_link) and \
+ self.is_element_visible(*self._tabzilla_thunderbird_link) and \
+ self.is_element_visible(*self._tabzilla_webfwd_link) and \
+ self.is_element_visible(*self._tabzilla_labs_link) and \
+ self.is_element_visible(*self._tabzilla_volunteer_link) and \
+ self.is_element_visible(*self._tabzilla_work_link) and \
+ self.is_element_visible(*self._tabzilla_findus_link) and \
+ self.is_element_visible(*self._tabzilla_joinus_link)
+
class Footer(Page):
_footer = (By.TAG_NAME, 'footer')
@@ -83,5 +93,36 @@ class Footer(Page):
_creative_commons_license = (By.CSS_SELECTOR, '.span3 > p > a')
@property
- def is_visible(self):
- return self.is_element_visible(*self._footer)
+ def are_footer_links_visible(self):
+ return self.is_element_visible(*self._footer) and \
+ self.is_element_visible(*self._footer_mozilla_link) and \
+ self.is_element_visible(*self._contact_us_link) and \
+ self.is_element_visible(*self._privacy_policy_link) and \
+ self.is_element_visible(*self._legal_notices_link) and \
+ self.is_element_visible(*self._report_trademark_link) and \
+ self.is_element_visible(*self._twitter_link) and \
+ self.is_element_visible(*self._facebook_link) and \
+ self.is_element_visible(*self._firefox_affiliates_link) and \
+ self.is_element_visible(*self._creative_commons_license)
+
+ class DownloadRegion(Page):
+
+ _osx_download_locator = (By.CSS_SELECTOR, '.os_osx > a')
+ _windows_download_locator = (By.CSS_SELECTOR, 'os_windows > a')
+ _linux_download_locator = (By.CSS_SELECTOR, 'os_linux > a')
+
+ _systems_and_languages_locator = (By.CSS_SELECTOR, '.download-other > a:nth-of-type(1)')
+ _whats_new_locator = (By.CSS_SELECTOR, '.download-other > a:nth-of-type(2)')
+ _privacy_locator = (By.CSS_SELECTOR, '.download-other > a:nth-of-type(3)')
+
+ @property
+ def are_download_links_present(self):
+ return self.is_element_present(*self._osx_download_locator) or \
+ self.is_element_present(*self._windows_download_locator) or \
+ self.is_element_present(*self._linux_download_locator)
+
+ @property
+ def are_secondary_links_visible(self):
+ return self.is_element_visible(*self._systems_and_languages_locator) and \
+ self.is_element_visible(*self._whats_new_locator) and \
+ self.is_element_visible(*self._privacy_locator)
View
70 pages/desktop/beta.py
@@ -1,70 +0,0 @@
-#!/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 pages.desktop.base import Base
-
-
-class BetaPage(Base):
-
- _beta_header = (By.CSS_SELECTOR, '#main-feature > h2 > img')
- _beta_btn_locator = (By.CSS_SELECTOR, '.home-download > a')
- _supported_devices_locator = (By.CSS_SELECTOR, '.download-other > a:nth-child(1)')
- _privacy_policy_locator = (By.CSS_SELECTOR, '.download-other > a:nth-child(2)')
- _email_locator = (By.CSS_SELECTOR, '#email')
- _beta_checkbox_locator = (By.CSS_SELECTOR, '#check_beta')
- _privacy_policy_checkbox_locator = (By.CSS_SELECTOR, '#inline-privacy-check')
- _sign_up_btn_locator = (By.CSS_SELECTOR, '#subscribe.button')
- _test_features_locator = (By.CSS_SELECTOR, '#feature-list > li:nth-child(1) > h3')
- _polish_locator = (By.CSS_SELECTOR, '#feature-list > li:nth-child(2) > h3')
- _do_part_locator = (By.CSS_SELECTOR, '#feature-list > li:nth-child(3) > h3')
- _success_pane_locator = (By.CSS_SELECTOR, '.success-pane > h3')
-
- def go_to_mobile_beta_page(self):
- self.open("/mobile/beta/")
-
- @property
- def is_test_features_header_present(self):
- return self.is_element_present(*self._test_features_locator)
-
- @property
- def is_do_part_header_present(self):
- return self.is_element_present(*self._do_part_locator)
-
- @property
- def is_polish_header_present(self):
- return self.is_element_present(*self._polish_locator)
-
- @property
- def is_beta_header_present(self):
- return self.is_element_present(*self._beta_header)
-
- @property
- def is_beta_download_button_present(self):
- return self.is_element_present(*self._beta_btn_locator)
-
- @property
- def is_supported_devices_link_present(self):
- return self.is_element_present(*self._supported_devices_locator)
-
- @property
- def is_privacy_policy_link_present(self):
- return self.is_element_present(*self._privacy_policy_locator)
-
- def type_email(self, email):
- self.selenium.find_element(*self._email_locator).send_keys(email)
-
- def check_beta_checkbox(self):
- self.selenium.find_element(*self._beta_checkbox_locator).click()
-
- def agree_to_privacy_policy(self):
- self.selenium.find_element(*self._privacy_policy_checkbox_locator).click()
-
- def click_sign_me_up(self):
- self.selenium.find_element(*self._sign_up_btn_locator).click()
-
- @property
- def newsletter_submitted_sucessfully(self):
- return self.selenium.find_element(*self._success_pane_locator).text
View
72 pages/desktop/channel.py
@@ -1,72 +0,0 @@
-#!/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 pages.desktop.base import Base
-
-
-class ChannelPage(Base):
-
- _mozilla_firefox_logo = (By.CSS_SELECTOR, "#header > div > h1 > a")
- _beta_logo = (By.CSS_SELECTOR, "#toggler-logo-beta")
- _firefox_logo = (By.CSS_SELECTOR, "#toggler-logo-firefox")
- _aurora_logo = (By.CSS_SELECTOR, "#toggler-logo-aurora")
- _firefox_desktop_button = (By.CSS_SELECTOR, "#firefox-desktop-link > a")
- _firefox_mobile_button = (By.CSS_SELECTOR, "#firefox-mobile-link > a")
- _aurora_desktop_button = (By.CSS_SELECTOR, "#aurora-desktop-link > a")
- _aurora_mobile_button = (By.CSS_SELECTOR, "#aurora-mobile-link > a")
- _beta_desktop_button = (By.CSS_SELECTOR, "#beta-desktop-link > a")
- _beta_mobile_button = (By.CSS_SELECTOR, "#beta-mobile-link > a")
- _learn_more_button = (By.CSS_SELECTOR, ".more > a")
- _left_carousel = (By.CSS_SELECTOR, "#carousel-left")
- _right_carousel = (By.CSS_SELECTOR, "#carousel-right")
- _main_feature_header = (By.CSS_SELECTOR, "#main-feature > h2")
-
- def go_to_channel_page(self):
- self.open("/firefox/channel")
-
- def click_aurora_logo(self):
- self.selenium.find_element(*self._aurora_logo).click()
-
- def click_beta_logo(self):
- self.selenium.find_element(*self._beta_logo).click()
-
- def click_firefox_logo(self):
- self.selenium.find_element(*self._firefox_logo).click()
-
- @property
- def is_main_feature_heading_present(self):
- return self.is_element_present(*self._main_feature_header)
-
- @property
- def is_mozilla_firefox_logo_present(self):
- return self.is_element_present(*self._mozilla_firefox_logo)
-
- @property
- def is_beta_logo_present(self):
- return self.is_element_present(*self._beta_logo)
-
- @property
- def is_firefox_logo_present(self):
- return self.is_element_present(*self._firefox_logo)
-
- @property
- def is_aurora_logo_present(self):
- return self.is_element_present(*self._aurora_logo)
-
- @property
- def is_left_carousel_present(self):
- return self.is_element_present(*self._left_carousel)
-
- @property
- def is_right_carousel_present(self):
- return self.is_element_present(*self._right_carousel)
-
- def click_right_carousel(self):
- self.selenium.find_element(*self._right_carousel).click()
-
- def click_left_carousel(self):
- self.selenium.find_element(*self._left_carousel).click()
View
69 pages/desktop/contribute.py
@@ -21,7 +21,7 @@ def help_form(self):
class HelpForm(Page):
- _title_locator = (By.CSS_SELECTOR, 'div.row > .form-column-1 > h3')
+ _want_to_help_title_locator = (By.CSS_SELECTOR, 'div.row > .form-column-1 > h3')
_email_field_locator = (By.ID, 'id_email')
_area_of_interest_locator = (By.ID, 'id_interest')
_submit_button_locator = (By.ID, 'form-submit')
@@ -30,71 +30,66 @@ class HelpForm(Page):
_comments_locator = (By.ID, 'id_comments')
_privacy_checkbox_locator = (By.ID, 'id_privacy')
- _privacy_title_locator = (By.CSS_SELECTOR, '.privacy-check-label span.title')
- _privacy_title_link_locator = (By.CSS_SELECTOR, '.privacy-check-label span.title > a')
+ _privacy_title_locator = (By.CSS_SELECTOR, '.privacy-check-label span.title')
+ _privacy_title_link_locator = (By.CSS_SELECTOR, '.privacy-check-label span.title > a')
_newsletter_checkbox_locator = (By.ID, 'id_newsletter')
_newsletter_title_locator = (By.CSS_SELECTOR, '.field-newsletter > label')
- _root_locator = (By.ID, 'help-form')
-
- def __init__(self, testsetup):
- Page.__init__(self, testsetup)
- self._root = self.selenium.find_element(*self._root_locator)
-
- @property
- def title(self):
- return self._root.find_element(*self._title_locator).text
+ _form_section_locator = (By.ID, 'help-form')
@property
- def email_placeholder(self):
- return self._root.find_element(*self._email_field_locator).get_attribute('placeholder')
+ def get_help_form_tile(self):
+ return self.selenium.find_element(*self._want_to_help_title_locator).text
@property
- def areas_of_interest_text(self):
- return [area.text for area in Select(self._root.find_element(*self._area_of_interest_locator)).options]
+ def get_email_placeholder(self):
+ return self.selenium.find_element(*self._email_feild_locator).get_attribute('placeholder')
@property
- def area_of_interest_selected_option(self):
- return Select(self._root.find_element(*self._area_of_interest_locator)).first_selected_option.text
+ def get_areas_of_interest_text(self):
+ return [area.text for area in \
+ Select(self.selenium.find_element(*self._area_of_interest_locator))]
@property
- def submit_button_text(self):
- return self._root.find_element(*self._submit_button_locator).get_attribute('value')
+ def get_submit_button_text(self):
+ return self.selenium.find_element(*self._submit_button_locator).get_attribute_('value')
@property
- def note_message(self):
- return self._root.find_element(*self._note_message_locator).text
+ def get_note_message(self):
+ return self.selenium.find_element(*self._note_message_locator).text
@property
- def comments_placeholder(self):
- return self._root.find_element(*self._comments_locator).get_attribute('placeholder')
+ def get_comments_placeholder(self):
+ return self.selenium.find_element(*self._comments_ocator).get_attribute('placeholder')
@property
- def privacy_text(self):
- return self._root.find_element(*self._privacy_title_locator).text
+ def get_privacy_text(self):
+ return self.selenium.find_element(*self._privacy_title_locator).text
@property
- def privacy_link(self):
- return self._root.find_element(*self._privacy_title_link_locator).get_attribute('href')
+ def get_privacy_link(self):
+ return self.selenium.find_element(*self.privacy_title_link_locator).get_attribute('href')
@property
- def newsletter_text(self):
- return self._root.find_element(*self._newsletter_title_locator).text
+ def get_newsletter_text(self):
+ return self.selenium.find_element(*self.newsletter_title_locator).text
@property
def is_additional_info_visible(self):
return self.is_element_visible(*self._privacy_title_locator) and \
- self.is_element_visible(*self._privacy_checkbox_locator) and\
- self.is_element_visible(*self._note_message_locator) and\
- self.is_element_visible(*self._comments_locator) and\
- self.is_element_visible(*self._newsletter_checkbox_locator) and\
- self.is_element_visible(*self._newsletter_title_locator)
+ self.is_element_visible(*self._privacy_checkbox_locator) and \
+ self.is_element_visible(*self._note_message_locator) and \
+ self.is_element_visible(*self._comments_locator) and \
+ self.is_element_visible(*self._newsletter_checkbox_locator) and \
+ self.is_element_visible(*self.newsletter_title_locator)
+ @property
def click_email(self):
- self._root.find_element(*self._email_field_locator).click()
+ self.selenium.find_element(*self._email_field_locator).click()
self.wait_for_ajax()
+ @property
def click_area_of_interest(self):
- self._root.find_element(*self._area_of_interest_locator).click()
+ self.selenium.find_element(*self._area_of_interest_locator).click()
self.wait_for_ajax()
View
14 pages/desktop/customize.py
@@ -1,14 +0,0 @@
-#!/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 pages.desktop.base import Base
-
-
-class CustomizePage(Base):
-
- def go_to_page(self):
- self.open('/firefox/customize/')
View
14 pages/desktop/features.py
@@ -1,14 +0,0 @@
-#!/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 pages.desktop.base import Base
-
-
-class FeaturesPage(Base):
-
- def go_to_page(self):
- self.open('/firefox/features/')
View
88 pages/desktop/home.py
@@ -1,88 +0,0 @@
-#!/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.support.select import Select
-from pages.desktop.base import Base
-from pages.page import Page
-
-
-class Home(Base):
- _home_news_title_locator = (By.CSS_SELECTOR, '#home-news > h3')
- _home_news_links_locator = (By.CSS_SELECTOR, '#home-news > h4 > a')
-
- def go_to_page(self):
- self.selenium.get(self.base_url)
-
- @property
- def home_news_title(self):
- return self.selenium.find_element(*self._home_news_title_locator).text
-
- @property
- def home_news_links(self):
- return [news.get_attribute('href') for news in self.selenium.find_elements(*self._home_news_links_locator)]
-
- @property
- def email_form(self):
- return self.EmailForm(self.testsetup)
-
- class EmailForm(Page):
-
- _title_locator = (By.TAG_NAME, 'h3')
-
- _email_field_locator = (By.ID, 'id_email')
- _country_selector_locator = (By.ID, 'country')
- _privacy_checkbox_locator = (By.ID, 'id_privacy')
- _privacy_title_locator = (By.CSS_SELECTOR, '.field-privacy span.title')
- _privacy_title_link_locator = (By.CSS_SELECTOR, 'div.field.field-privacy span.title > a')
-
- _submit_button_locator = (By.ID, 'footer_email_submit')
- _form_details_locator = (By.CSS_SELECTOR, '.form-submit > p > small')
-
- _root_locator = (By.ID, 'footer-email-form')
-
- def __init__(self, testsetup):
- Page.__init__(self, testsetup)
- self._root = self.selenium.find_element(*self._root_locator)
-
- @property
- def title(self):
- return self._root.find_element(*self._title_locator).text
-
- @property
- def email_placeholder(self):
- return self._root.find_element(*self._email_field_locator).get_attribute('placeholder')
-
- @property
- def submit_button_text(self):
- return self._root.find_element(*self._submit_button_locator).get_attribute('value')
-
- @property
- def privacy_text(self):
- return self._root.find_element(*self._privacy_title_locator).text
-
- @property
- def privacy_link(self):
- return self._root.find_element(*self._privacy_title_link_locator).get_attribute('href')
-
- @property
- def form_details_text(self):
- return self._root.find_element(*self._form_details_locator).text
-
- @property
- def is_additional_info_visible(self):
- return self.is_element_visible(*self._privacy_title_locator) and \
- self.is_element_visible(*self._privacy_checkbox_locator) and\
- self.is_element_visible(*self._form_details_locator) and \
- self.is_element_visible(*self._country_selector_locator)
-
- @property
- def country_count(self):
- return len(Select(self._root.find_element(*self._country_selector_locator)).options)
-
- def click_email(self):
- self._root.find_element(*self._email_field_locator).click()
- self.wait_for_ajax()
View
17 pages/desktop/mission.py
@@ -8,7 +8,7 @@
from selenium.webdriver.common.by import By
-class MissionPage(Base):
+class Mission(Base):
_mission_sidebar_link = (By.CSS_SELECTOR, '.sidebar > nav > ul > li:nth-of-type(1) > a')
_forums_sidebar_link = (By.CSS_SELECTOR, '.sidebar > nav > ul > li:nth-of-type(2) > a')
@@ -21,24 +21,21 @@ class MissionPage(Base):
_get_involved_learn_more_link = (By.CSS_SELECTOR, '.reference:nth-of-type(2) > .more')
def go_to_page(self):
- self.open('/en-US/mission')
+ self.open('/mission/')
@property
def are_sidebar_links_visible(self):
- self.is_element_visible(*self._mission_sidebar_link)
- self.is_element_visible(*self._forums_sidebar_link)
- self.is_element_visible(*self._governance_sidebar_link)
+ return self.is_element_visible(*self._mission_sidebar_link) and \
+ self.is_element_visible(*self._forums_sidebar_link) and \
+ self.is_element_visible(*self._governance_sidebar_link) and \
self.is_element_visible(*self._history_sidebar_link)
- return True
@property
def are_breadcrumb_links_visible(self):
- self.is_element_visible(*self._home_breadcrumb_link)
+ return self.is_element_visible(*self._home_breadcrumb_link) and \
self.is_element_visible(*self._mission_breadcrumb_link)
- return True
@property
def are_learn_more_links_visible(self):
- self.is_element_visible(*self._our_projects_learn_more_link)
+ return self.is_element_visible(*self._our_projects_learn_more_link) and \
self.is_element_visible(*self._get_involved_learn_more_link)
- return True
View
19 pages/desktop/performance.py
@@ -7,25 +7,28 @@
from selenium.webdriver.common.by import By
-class PerformancePage(Base):
+class Performance(Base):
- _perf_web = (By.CSS_SELECTOR, "#perf-web")
- _perf_hardware = (By.CSS_SELECTOR, "#perf-hardware")
- _perf_hardware_img = (By.CSS_SELECTOR, "#hardware>.section-image")
+ _perf_web = (By.CSS_SELECTOR, ".menu-bar.billboard > ul > li:nth-of-type(1) > a")
+ _perf_hardware = (By.CSS_SELECTOR, ".menu-bar.billboard > ul > li:nth-of-type(2) > a")
+ _perf_hardware_img = (By.CSS_SELECTOR, "#hardware > .row > .span7 > img")
_video_overlay = (By.CSS_SELECTOR, ".mozilla-video-control-overlay")
+ def go_to_page(self):
+ self.open("/firefox/performance/")
+
@property
def perf_web_ico(self):
- return self.is_element_present(self._perf_web)
+ return self.is_element_present(*self._perf_web)
@property
def perf_hardware_ico(self):
- return self.is_element_present(self._perf_hardware)
+ return self.is_element_present(*self._perf_hardware)
@property
def perf_hardware_img(self):
- return self.is_element_present(self._perf_hardware_img)
+ return self.is_element_present(*self._perf_hardware_img)
@property
def video_overlay(self):
- return self.is_element_present(self._video_overlay)
+ return self.is_element_present(*self._video_overlay)
View
22 pages/desktop/regions/menu_bar_billboard.py
@@ -1,22 +0,0 @@
-#!/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 pages.page import Page
-
-
-class MenuBarBillboard(Page):
-
- _name_locator = (By.CSS_SELECTOR, ' > a')
-
- def __init__(self, testsetup, web_element):
- Page.__init__(self, testsetup)
- self._root_element = web_element
-
- @property
- def menu_name(self):
- return self._root_element.text
View
78 pages/desktop/security.py
@@ -1,51 +1,69 @@
#!/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/
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from selenium.webdriver.common.by import By
from pages.desktop.base import Base
-class SecurityPage(Base):
+class Security(Base):
- _protecting_privacy_ico = (By.CSS_SELECTOR, "#security-privacy")
- _browser_security_ico = (By.CSS_SELECTOR, "#security-secure")
- _in_control_ico = (By.CSS_SELECTOR, "#security-control")
- _mission_ico = (By.CSS_SELECTOR, "#security-mission")
- _privacy_img = (By.CSS_SELECTOR, "#privacy>.section-image>img")
- _browser_security_img = (By.CSS_SELECTOR, "#secure>.section-image>img")
- _control_img = (By.CSS_SELECTOR, "#control>.section-image>img")
- _mission_img = (By.CSS_SELECTOR, "#mission>.section-image>img")
+ _menu_protect_your_privacy = (By.CSS_SELECTOR, '.menu-bar.billboard > ul > li:nth-of-type(1) > a')
+ _menu_browse_with_security = (By.CSS_SELECTOR, '.menu-bar.billboard > ul > li:nth-of-type(2) > a')
+ _menu_stay_in_control = (By.CSS_SELECTOR, '.menu-bar.billboard > ul > li:nth-of-type(3) > a')
+ _menu_part_of_our_mission = (By.CSS_SELECTOR, '.menu-bar.billboard > ul > li:nth-of-type(4) > a')
- @property
- def protecting_privacy_ico(self):
- return self.is_element_present(self._protecting_privacy_ico)
+ _privacy_screeenshot = (By.CSS_SELECTOR, '#privacy > .row > .section-image > .platform-img.js')
+ _security_screenshot = (By.CSS_SELECTOR, '#secure > .row > .section-image > .platform-img.js')
+ _control_image = (By.CSS_SELECTOR, '#control > .row > .section-image > .platform-img.js')
+ _mission_image = (By.CSS_SELECTOR, '#mission > .row > .section-image.span4 > img')
- @property
- def browser_security_ico(self):
- return self.is_element_present(self._browser_security_ico)
+ _section_do_not_track_ = (By.CSS_SELECTOR, '#privacy > .row > .section-list.span3 > li:nth-of-type(1 ) > h4')
+ _section_private_browsing = (By.CSS_SELECTOR, '#privacy > .row > .section-list.span3 > li:nth-of-type(2) > h4')
+ _section_clear_recent_history = (By.CSS_SELECTOR, '#privacy > .row > .section-list.span3 > li:nth-of-type(3) > h4')
+ _section_forget_this_site = (By.CSS_SELECTOR, '#privacy > .row > .section-list.span3 > li:nth-of-type(4) > h4')
+ _section_content_security_policy = (By.CSS_SELECTOR, '#privacy > .row > .section-list.span3 > li:nth-of-type(5) > h4')
- @property
- def in_control_ico(self):
- return self.is_element_present(self._in_control_ico)
+ _section_instant_web_id = (By.CSS_SELECTOR, '#secure > .row > .section-list.span3 > li:nth-of-type(1) > h4')
+ _section_anti_phishing_malware = (By.CSS_SELECTOR, '#secure > .row > .section-list.span3 > li:nth-of-type(2) > h4')
+ _section_secure_installation = (By.CSS_SELECTOR, '#secure > .row > .section-list.span3 > li:nth-of-type(3) > h4')
+ _section_av_integration = (By.CSS_SELECTOR, '#secure > .row > .section-list.span3 > li:nth-of-type(4) > h4')
- @property
- def mission_ico(self):
- return self.is_element_present(self._mission_ico)
+ _section_plugin_check = (By.CSS_SELECTOR, '#control > .row > .section-list.span3 > li:nth-of-type(1) > h4')
+ _section_parental_controls = (By.CSS_SELECTOR, '#control > .row > .section-list.span3 > li:nth-of-type(2) > h4')
+ _section_customized_settings = (By.CSS_SELECTOR, '#control > .row > .section-list.span3 > li:nth-of-type(3) > h4')
+
+ _section_privacy_commitment = (By.CSS_SELECTOR, '#mission > .row > .section-list.span3 > li:nth-of-type(1) > h4')
+ _section_mission_matters = (By.CSS_SELECTOR, '#mission > .row > .section-list.span3 > li:nth-of-type(2) > h4')
+
+ _return_to_top_link = (By.CSS_SELECTOR, '.top-link > a')
+
+ def go_to_page(self):
+ self.open('/firefox/security/')
@property
- def privacy_img(self):
- return self.is_element_present(self._privacy_img)
+ def are_menus_visible(self):
+ return self.is_element_visible(*self._menu_protect_your_privacy) and \
+ self.is_element_visible(*self._menu_browse_with_security) and \
+ self.is_element_visible(*self._menu_stay_in_control) and \
+ self.is_element_visible(*self._menu_part_of_our_mission)
@property
- def browser_security_img(self):
- return self.is_element_present(self._browser_security_img)
+ def are_screenshots_visible(self):
+ return self.is_element_visible(*self._privacy_screenshot) and \
+ self.is_element_visible(*self._security_screenshot) and \
+ self.is_element_visible(*self._control_image) and \
+ self.is_element_visible(*self._mission_image)
@property
- def control_img(self):
- return self.is_element_present(self._control_img)
+ def are_privacy_titles_visible(self):
+ return self.is_element_visible(*self._section_do_not_track) and \
+ self.is_element_visible(*self._section_private_browsing) and \
+ self.is_element_visible(*self._section_clear_recent_history) and \
+ self.is_element_visible(*self._section_forget_this_site) and \
+ self.is_element_visible(*self._section_content_security_policy)
@property
- def mission_img(self):
- return self.is_element_present(self._mission_img)
+ def click_return_to_top(self):
+ self.click(self._return_to_top_link)
View
39 pages/desktop/technology_page.py → pages/desktop/technology.py
@@ -1,20 +1,16 @@
#!/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 pages.desktop.base import Base
-from pages.page import Page
from selenium.webdriver.common.by import By
-from selenium.webdriver import ActionChains
-from selenium.common.exceptions import NoSuchElementException
+from pages.desktop.base import Base
-class TechnologyPage(Base):
+class Technology(Base):
def go_to_page(self):
- self.open('/en-US/firefox/technology/')
+ self.open('/firefox/technology/')
_developer_tools_link = (By.CSS_SELECTOR, '.menu-bar > ul > li:nth-of-type(1) > a')
_html5_link = (By.CSS_SELECTOR, '.menu-bar > ul > li:nth-of-type(1) > a')
@@ -40,8 +36,6 @@ def go_to_page(self):
_video_preload_section = (By.CSS_SELECTOR, '#html5 > article:nth-of-type(5) > h1')
_history_state_section = (By.CSS_SELECTOR, '#html5 > article:nth-of-type(6) > h1')
- _bulb_article_locator = (By.CSS_SELECTOR, '#wall article > article')
-
@property
def is_developer_tools_link_visible(self):
return self.is_element_visible(*self._developer_tools_link)
@@ -65,30 +59,3 @@ def is_svg_link_visible(self):
@property
def is_security_link_visible(self):
return self.is_element_visible(*self._security_link)
-
- @property
- def bulbs(self):
- return [self.Bulb(self.testsetup, bulb) for bulb in self.selenium.find_elements(*self._bulb_article_locator)]
-
- class Bulb(Page):
-
- _learn_more_locator = (By.CSS_SELECTOR, 'a.learn')
-
- def __init__(self, testsetup, element):
- Page.__init__(self, testsetup)
- self._root = element
-
- def hover(self):
- ActionChains(self._root).move_to_element(self._root).perform()
-
- @property
- def is_learn_more_present(self):
- try:
- self._root.find_element(*self._learn_more_locator)
- return True
- except NoSuchElementException:
- return False
-
- @property
- def is_learn_more_displayed(self):
- return self._root.find_element(*self._learn_more_locator).is_displayed()
View
0  pages/desktop/regions/__init__.py → pages/mobile/__init__.py
File renamed without changes
View
2  requirements.txt
@@ -13,4 +13,4 @@ pytest-mozwebqa==0.9
pytest-xdist==1.8
requests==0.11.1
selenium
-wsgiref==0.1.2
+wsgiref==0.1.2
View
15 tests/test_404.py
@@ -14,16 +14,17 @@
class TestStatus(object):
@pytest.mark.nondestructive
+ @pytest.mark.nonbedrock
def test_status_code_returns_404(self, mozwebqa):
- url=mozwebqa.base_url+'/abck'
- response=requests.get(url)
+ url = mozwebqa.base_url + '/abck'
+ response = requests.get(url)
Assert.equal(response.status_code, 404)
- @pytest.mark.xfail(reason="Bug 744671 - x-robots-tag header not set after redirect")
+ @pytest.mark.xfail(reason='Bug 744671 - x-robots-tag header not set after redirect')
@pytest.mark.nondestructive
def test_xrobots_tag_is_present(self, mozwebqa):
- '''Test for X-Robots-Tag header'''
- url=mozwebqa.base_url
- response=requests.get(url)
- Assert.contains("x-robots-tag", response.headers.keys())
+ """Test for X-Robots-Tag header"""
+ url = mozwebqa.base_url
+ response = requests.get(url)
+ Assert.contains('x-robots-tag', response.headers.keys())
Assert.contains('noodp', response.headers.values())
View
38 tests/test_aurora.py
@@ -1,38 +0,0 @@
-#!/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 unittestzero import Assert
-from pages.desktop.aurora import AuroraPage
-
-
-class TestAurora:
-
- @pytest.mark.nondestructive
- def test_that_headers_are_present(self, mozwebqa):
- aurora_pg = AuroraPage(mozwebqa)
- aurora_pg.go_to_aurora_page()
- Assert.true(aurora_pg.is_preview_features_header_present)
- Assert.true(aurora_pg.is_share_feedback_header_present)
- Assert.true(aurora_pg.is_shape_firefox_header_present)
- Assert.true(aurora_pg.is_aurora_header_present)
-
- @pytest.mark.nondestructive
- def test_download_button_section(self, mozwebqa):
- aurora_pg = AuroraPage(mozwebqa)
- aurora_pg.go_to_aurora_page()
- Assert.true(aurora_pg.is_aurora_download_button_present)
- Assert.true(aurora_pg.is_all_systems_and_languages_link_present)
- Assert.true(aurora_pg.is_privacy_policy_link_present)
-
- @pytest.mark.nondestructive
- def test_aurora_newsletter_submission(self, mozwebqa):
- aurora_pg = AuroraPage(mozwebqa)
- aurora_pg.go_to_aurora_page()
- aurora_pg.type_email("test@test.com")
- aurora_pg.check_aurora_checkbox()
- aurora_pg.agree_to_privacy_policy()
- aurora_pg.click_sign_me_up()
- Assert.equal(aurora_pg.newsletter_submitted_sucessfully, "Thanks for subscribing!")
View
38 tests/test_beta.py
@@ -1,38 +0,0 @@
-#!/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 unittestzero import Assert
-from pages.desktop.beta import BetaPage
-
-
-class TestBeta:
-
- @pytest.mark.nondestructive
- def test_that_headers_are_present(self, mozwebqa):
- beta_pg = BetaPage(mozwebqa)
- beta_pg.go_to_mobile_beta_page()
- Assert.true(beta_pg.is_test_features_header_present)
- Assert.true(beta_pg.is_do_part_header_present)
- Assert.true(beta_pg.is_polish_header_present)
- Assert.true(beta_pg.is_beta_header_present)
-
- @pytest.mark.nondestructive
- def test_download_button_section(self, mozwebqa):
- beta_pg = BetaPage(mozwebqa)
- beta_pg.go_to_mobile_beta_page()
- Assert.true(beta_pg.is_beta_download_button_present)
- Assert.true(beta_pg.is_supported_devices_link_present)
- Assert.true(beta_pg.is_privacy_policy_link_present)
-
- @pytest.mark.nondestructive
- def test_beta_newsletter_submission(self, mozwebqa):
- beta_pg = BetaPage(mozwebqa)
- beta_pg.go_to_mobile_beta_page()
- beta_pg.type_email("test@test.com")
- beta_pg.check_beta_checkbox()
- beta_pg.agree_to_privacy_policy()
- beta_pg.click_sign_me_up()
- Assert.equal(beta_pg.newsletter_submitted_sucessfully, "Thanks for subscribing!")
View
45 tests/test_channel.py
@@ -1,45 +0,0 @@
-#!/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 unittestzero import Assert
-from pages.desktop.channel import ChannelPage
-
-
-class TestChannelPage:
-
- @pytest.mark.nondestructive
- def test_that_logos_are_present(self, mozwebqa):
- channel_pg = ChannelPage(mozwebqa)
- channel_pg.go_to_channel_page()
- Assert.true(channel_pg.is_beta_logo_present)
- Assert.true(channel_pg.is_firefox_logo_present)
- Assert.true(channel_pg.is_aurora_logo_present)
-
- @pytest.mark.nondestructive
- def test_beta_sub_page(self, mozwebqa):
- channel_pg = ChannelPage(mozwebqa)
- channel_pg.go_to_channel_page()
- channel_pg.click_beta_logo()
-
- @pytest.mark.nondestructive
- def test_aurora_sub_page(self, mozwebqa):
- channel_pg = ChannelPage(mozwebqa)
- channel_pg.go_to_channel_page()
- channel_pg.click_aurora_logo()
-
- @pytest.mark.nondestructive
- def test_firefox_sub_page(self, mozwebqa):
- channel_pg = ChannelPage(mozwebqa)
- channel_pg.go_to_channel_page()
- channel_pg.click_firefox_logo()
-
- @pytest.mark.nondestructive
- def test_that_carousels_are_present(self, mozwebqa):
- channel_pg = ChannelPage(mozwebqa)
- channel_pg.go_to_channel_page()
- Assert.true(channel_pg.is_right_carousel_present)
- Assert.true(channel_pg.is_left_carousel_present)
View
52 tests/test_contribute.py
@@ -9,50 +9,18 @@
from unittestzero import Assert
-
class TestContribute:
- areas_of_interest = [u'Area of interest?', u'Helping Users', u'Localization',
- u'Testing and QA', u'Coding', u'Add-ons', u'Marketing',
- u'Student Reps', u'Web Development', u'Developer Documentation',
- u'Systems Administration', u'User Research', u'Thunderbird',
- u'Accessibility', u'Other', u'I have a suggestion for Firefox', u'I need help with a Firefox issue']
-
@pytest.mark.nondestructive
- def test_want_to_help_area(self, mozwebqa):
- contribute = Contribute(mozwebqa)
- contribute.go_to_page()
-
- help_form = contribute.help_form
-
- Assert.equal('Want to help?', help_form.title)
- Assert.equal('YOUR EMAIL HERE', help_form.email_placeholder)
-
- for idx, area in enumerate(help_form.areas_of_interest_text):
- Assert.equal(self.areas_of_interest[idx], area)
-
- Assert.equal('Area of interest?', help_form.area_of_interest_selected_option)
- Assert.equal(u'Submit\xa0\xbb', help_form.submit_button_text)
-
- Assert.false(help_form.is_additional_info_visible)
-
- help_form.click_email()
-
- Assert.true(help_form.is_additional_info_visible)
-
- Assert.equal('Send us a note and we can get you started right away.', help_form.note_message)
- Assert.equal(u'Hi, I\u2019m interested in\u2026', help_form.comments_placeholder)
- Assert.equal('I agree to the Privacy Policy', help_form.privacy_text)
- Assert.contains('/privacy-policy', help_form.privacy_link)
- Assert.equal(u'I\u2019d like to receive regular contribution news by email', help_form.newsletter_text)
+ def test_footer_section(self, mozwebqa):
+ contribute_page = Contribute(mozwebqa)
+ contribute_page.go_to_page()
+ Assert.true(contribute_page.footer.are_footer_links_visible)
@pytest.mark.nondestructive
- def test_that_clicking_on_areas_of_interest_opens_the_help_form(self, mozwebqa):
- contribute = Contribute(mozwebqa)
- contribute.go_to_page()
-
- help_form = contribute.help_form
-
- Assert.false(help_form.is_additional_info_visible)
- help_form.click_email()
- Assert.true(help_form.is_additional_info_visible)
+ def test_header_section(self, mozwebqa):
+ contribute_page = Contribute(mozwebqa)
+ contribute_page.go_to_page()
+ Assert.true(contribute_page.header.is_tabzilla_panel_visible)
+ contribute_page.header.toggle_tabzilla_dropdown()
+ Assert.true(contribute_page.header.are_tabzilla_links_visible)
View
27 tests/test_customize.py
@@ -1,27 +0,0 @@
-#!/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 unittestzero import Assert
-
-from pages.desktop.customize import CustomizePage
-
-
-class TestCustomize:
-
- expected_menu_bar_billboard = ["Add Style:\nPersonas", "Customize:\nAdd-ons", "Make It Work:\nPlugins",
- "Adapt Your\nInterface", "Stay In\nSync"]
-
- @pytest.mark.nondestructive
- def test_customize_menu_text(self, mozwebqa):
- customize_pg = CustomizePage(mozwebqa)
- customize_pg.go_to_page()
-
- Assert.equal(5, len(customize_pg.menu_bar_billboard))
-
- for idx, menu_item in enumerate(customize_pg.menu_bar_billboard):
- Assert.equal(self.expected_menu_bar_billboard[idx], menu_item.menu_name)
View
22 tests/test_download.py
@@ -7,16 +7,17 @@
from unittestzero import Assert
import pytest
import requests
-xfail = pytest.mark.xfail
+
@pytest.mark.skip_selenium
+@pytest.mark.nondestructive
class TestDownload(object):
def download_base_url(self, base_url):
- if '/b/' in base_url:
- return '%s/products/download.html' % base_url.replace('/b/', '')
+ if '/b' in base_url:
+ return '%s/en-US/products/download.html' % base_url.replace('/b', '')
else:
- return '%s/products/download.html' % base_url
+ return '%s/en-US/products/download.html' % base_url
def test_osx_download_button_returns_status_code_200(self, mozwebqa):
url = self.download_base_url(mozwebqa.base_url)
@@ -24,7 +25,7 @@ def test_osx_download_button_returns_status_code_200(self, mozwebqa):
html = BeautifulStoneSoup(response.content)
link = html.find('li', 'os_osx').a['href']
print link
- response = requests.get(link)
+ response = requests.head(link, allow_redirects=True)
Assert.equal(response.status_code, 200)
def test_linux_download_button_returns_status_code_200(self, mozwebqa):
@@ -33,25 +34,26 @@ def test_linux_download_button_returns_status_code_200(self, mozwebqa):
html = BeautifulStoneSoup(response.content)
link = html.find('li', 'os_linux').a['href']
print link
- response = requests.head(link)
+ response = requests.head(link, allow_redirects=True)
Assert.equal(response.status_code, 200)
def test_windows_download_button_returns_status_code_200(self, mozwebqa):
+
url = self.download_base_url(mozwebqa.base_url)
response = requests.get(url)
html = BeautifulStoneSoup(response.content)
link = html.find('li', 'os_windows').a['href']
print link
- response = requests.head(link)
+ response = requests.head(link, allow_redirects=True)
Assert.equal(response.status_code, 200)
def test_download_button_returns_status_code_200_using_google_chrome(self, mozwebqa):
- """https://bugzilla.mozilla.org/show_bug.cgi?id=672713"""
+ '''https://bugzilla.mozilla.org/show_bug.cgi?id=672713'''
url = self.download_base_url(mozwebqa.base_url)
response = requests.get(url,
- headers={'User-Agent':'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.872.0 Safari/535.2'})
+ headers={'User-Agent': 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.872.0 Safari/535.2'})
html = BeautifulStoneSoup(response.content)
link = html.find('li', 'os_windows').a['href']
print link
- response = requests.head(link)
+ response = requests.head(link, allow_redirects=True)
Assert.equal(response.status_code, 200)
View
24 tests/test_features.py
@@ -1,24 +0,0 @@
-#!/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 unittestzero import Assert
-from pages.desktop.features import FeaturesPage
-
-
-class TestFeatures:
-
- expected_menu_bar_billboard = ["Browsing\nMade Easy", "High\nPerformance", "Advanced\nSecurity",
- "Powerful\nPersonalization", "The Cutting\nEdge", "Universal\nAccess"]
-
- @pytest.mark.nondestructive
- def test_menu_bar_billboard_names(self, mozwebqa):
- features_pg = FeaturesPage(mozwebqa)
- features_pg.go_to_page()
-
- for idx, menu_item in enumerate(features_pg.menu_bar_billboard):
- Assert.equal(self.expected_menu_bar_billboard[idx], menu_item.menu_name)
View
32 tests/test_header_footer.py
@@ -1,32 +0,0 @@
-#!/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 unittestzero import Assert
-from pages.desktop.technology_page import TechnologyPage
-
-
-class TestHeaderFooter:
-
- @pytest.mark.xfail(reason="Selenium issue 3492")
- @pytest.mark.nondestructive
- def test_header_section_visible(self, mozwebqa):
- technology_page = TechnologyPage(mozwebqa)
- technology_page.go_to_page()
-
- technology_page.header.toggle_tabzilla_dropdown()
- Assert.true(technology_page.header.is_tabzilla_panel_visible)
- Assert.true(technology_page.header.is_tabzilla_searchbox_visible)
-
- technology_page.header.toggle_tabzilla_dropdown()
- Assert.false(technology_page.header.is_tabzilla_panel_visible)
-
- @pytest.mark.nondestructive
- def test_footer_section_visible(self, mozwebqa):
- technology_page = TechnologyPage(mozwebqa)
- technology_page.go_to_page()
-
- Assert.true(technology_page.footer.is_visible)
View
45 tests/test_homepage.py
@@ -1,45 +0,0 @@
-#!/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.home import Home
-from unittestzero import Assert
-
-
-class TestHomepage:
-
- @pytest.mark.nondestructive
- def test_blog_links(self, mozwebqa):
- home = Home(mozwebqa)
- home.go_to_page()
-
- Assert.equal('In the news', home.home_news_title)
-
- for link in home.home_news_links:
- Assert.contains('blog.mozilla', link)
-
- @pytest.mark.nondestructive
- def test_get_updates_area(self, mozwebqa):
- home = Home(mozwebqa)
- home.go_to_page()
-
- email_form = home.email_form
-
- Assert.equal('Get Mozilla updates:', email_form.title)
- Assert.equal('YOUR EMAIL HERE', email_form.email_placeholder)
- Assert.equal(u'Sign me up\xa0\xbb', email_form.submit_button_text)
-
- Assert.false(email_form.is_additional_info_visible)
-
- email_form.click_email()
-
- Assert.true(email_form.is_additional_info_visible)
-
- Assert.equal('I agree to the Privacy Policy', email_form.privacy_text)
- Assert.contains('/privacy-policy', email_form.privacy_link)
- Assert.equal('We will only send you Mozilla-related information.', email_form.form_details_text)
-
- Assert.equal(232, email_form.country_count)
View
34 tests/test_mission.py
@@ -1,23 +1,33 @@
-from pages.desktop.mission import MissionPage
+#!/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.mission import Mission
from unittestzero import Assert
-class TestMissionPage:
+class TestMission:
+ @pytest.mark.nondestructive
def test_sidebar_links(self, mozwebqa):
- missionPage = MissionPage(mozwebqa)
+ missionPage = Mission(mozwebqa)
missionPage.go_to_page()
Assert.true(missionPage.are_sidebar_links_visible)
Assert.true(missionPage.are_breadcrumb_links_visible)
Assert.true(missionPage.are_learn_more_links_visible)
- def test_header_section_present(self, mozwebqa):
- missionPage = MissionPage(mozwebqa)
- missionPage.go_to_page()
- missionPage.toggle_tabzilla_dropdown()
- Assert.true(missionPage.are_tabzilla_links_present)
+ @pytest.mark.nondestructive
+ def test_footer_section(self, mozwebqa):
+ mission_page = Mission(mozwebqa)
+ mission_page.go_to_page()
+ Assert.true(mission_page.footer.are_footer_links_visible)
- def test_footer_section_present(self, mozwebqa):
- missionPage = MissionPage(mozwebqa)
- missionPage.go_to_page()
- Assert.true(missionPage.are_footer_links_present)
+ @pytest.mark.nondestructive
+ def test_header_section(self, mozwebqa):
+ mission_page = Mission(mozwebqa)
+ mission_page.go_to_page()
+ Assert.true(mission_page.header.is_tabzilla_panel_visible)
+ mission_page.header.toggle_tabzilla_dropdown()
+ Assert.true(mission_page.header.are_tabzilla_links_visible)
View
41 tests/test_performance.py
@@ -3,27 +3,46 @@
# 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 unittestzero import Assert
-from pages.desktop.performance import PerformancePage
+from pages.desktop.performance import Performance
import pytest
-xfail = pytest.mark.xfail
class TestPerformance:
@pytest.mark.nondestructive
+ def test_footer_section(self, mozwebqa):
+ performance_page = Performance(mozwebqa)
+ performance_page.go_to_page()
+ Assert.true(performance_page.footer.are_footer_links_visible)
+
+ @pytest.mark.nondestructive
+ def test_header_section(self, mozwebqa):
+ performance_page = Performance(mozwebqa)
+ performance_page.go_to_page()
+ Assert.true(performance_page.header.is_tabzilla_panel_visible)
+ performance_page.header.toggle_tabzilla_dropdown()
+ Assert.true(performance_page.header.are_tabzilla_links_visible)
+
+ @pytest.mark.nondestructive
+ def test_download_button_section(self, mozwebqa):
+ performance_page = Performance(mozwebqa)
+ performance_page.go_to_page()
+ Assert.true(performance_page.downloadRegion.are_download_links_present)
+ Assert.true(performance_page.downloadRegion.are_secondary_links_visible)
+
+ @pytest.mark.nondestructive
def test_performance_icons(self, mozwebqa):
self.selenium = mozwebqa.selenium
- performance_pg = PerformancePage(mozwebqa)
- performance_pg.open("/firefox/performance/")
- Assert.true(performance_pg.video_overlay)
- Assert.true(performance_pg.perf_web_ico)
- Assert.true(performance_pg.perf_hardware_ico)
+ performance_page = Performance(mozwebqa)
+ performance_page.go_to_page()
+ Assert.true(performance_page.video_overlay)
+ Assert.true(performance_page.perf_web_ico)
+ Assert.true(performance_page.perf_hardware_ico)
@pytest.mark.nondestructive
def test_performance_images(self, mozwebqa):
self.selenium = mozwebqa.selenium
- performance_pg = PerformancePage(mozwebqa)
- performance_pg.open("/firefox/performance/")
- Assert.true(performance_pg.perf_hardware_img)
+ performance_page = Performance(mozwebqa)
+ performance_page.go_to_page()
+ Assert.true(performance_page.perf_hardware_img)
View
23 tests/test_redirects.py → tests/test_redirect.py
@@ -7,37 +7,40 @@
import requests
import pytest
-xfail = pytest.mark.xfail
-
@pytest.mark.skip_selenium
class TestRedirects(object):
+ @pytest.mark.nondestructive
def test_redirects_from_mozilla_dot_com(self, mozwebqa):
url = mozwebqa.base_url
response = requests.get(url)
Assert.contains(url, response.url)
+ @pytest.mark.nondestructive
def test_fennec_redirects_to_mobile(self, mozwebqa):
- url = mozwebqa.base_url + "/fennec"
+ url = mozwebqa.base_url + "/fennec/"
response = requests.get(url)
- result = mozwebqa.base_url + "en-US/mobile/"
+ result = mozwebqa.base_url + "/en-US/mobile/"
Assert.equal(result, response.url)
+ @pytest.mark.nondestructive
def test_firefox_mobile_redirects_to_mobile(self, mozwebqa):
- url = mozwebqa.base_url + "/firefox/mobile"
+ url = mozwebqa.base_url + "/firefox/mobile/"
response = requests.get(url)
- result = mozwebqa.base_url + "en-US/mobile/"
+ result = mozwebqa.base_url + "/en-US/mobile/"
Assert.equal(result, response.url)
+ @pytest.mark.nondestructive
def test_aurora_redirects_to_firefox_aurora(self, mozwebqa):
- url = mozwebqa.base_url + "/aurora"
+ url = mozwebqa.base_url + "/aurora/"
response = requests.get(url)
- result = mozwebqa.base_url + "en-US/firefox/aurora/"
+ result = mozwebqa.base_url + "/en-US/firefox/aurora/"
Assert.equal(result, response.url)
+ @pytest.mark.nondestructive
def test_redirect_to_trailing_slash(self, mozwebqa):
- url = mozwebqa.base_url + "/community"
+ url = mozwebqa.base_url + "/community/"
response = requests.get(url)
- result = mozwebqa.base_url + "community/"
+ result = mozwebqa.base_url + "/community/"
Assert.equal(result, response.url)
View
48 tests/test_security.py
@@ -1,31 +1,45 @@
#!/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.security import Security
from unittestzero import Assert
-from pages.desktop.security import SecurityPage
class TestSecurity:
@pytest.mark.nondestructive
- def test_security_icons(self, mozwebqa):
- self.selenium = mozwebqa.selenium
- security_pg = SecurityPage(mozwebqa)
- security_pg.open("/firefox/security/")
- Assert.true(security_pg.protecting_privacy_ico)
- Assert.true(security_pg.browser_security_ico)
- Assert.true(security_pg.in_control_ico)
- Assert.true(security_pg.mission_ico)
+ def test_footer_section(self, mozwebqa):
+ security_page = Security(mozwebqa)
+ security_page.go_to_page()
+ Assert.true(security_page.footer.are_footer_links_visible)
+
+ @pytest.mark.nondestructive
+ def test_header_section(self, mozwebqa):
+ security_page = Security(mozwebqa)
+ security_page.go_to_page()
+ Assert.true(security_page.header.is_tabzilla_panel_visible)
+ security_page.header.toggle_tabzilla_dropdown()
+ Assert.true(security_page.header.are_tabzilla_links_visible)
@pytest.mark.nondestructive
- def test_security_images(self, mozwebqa):
- self.selenium = mozwebqa.selenium
- security_pg = SecurityPage(mozwebqa)
- security_pg.open("/firefox/security/")
- Assert.true(security_pg.privacy_img)
- Assert.true(security_pg.browser_security_img)
- Assert.true(security_pg.control_img)
- Assert.true(security_pg.mission_img)
+ def test_download_button_section(self, mozwebqa):
+ security_page = Security(mozwebqa)
+ security_page.go_to_page()
+ Assert.true(security_page.downloadRegion.are_download_links_present)
+ Assert.true(security_page.downloadRegion.are_secondary_links_visible)
+
+ @pytest.mark.nondestructive
+ def test_are_menus_visible(self, mozwebqa):
+ security_page = Security(mozwebqa)
+ security_page.go_to_page()
+ Assert.true(security_page.are_menus_visible)
+
+ @pytest.mark.nondestructive
+ def test_are_screenshots_visible(self, mozwebqa):
+ security_page = Security(mozwebqa)
+ security_page.go_to_page()
+ Assert.true(security_page.are_screenshots_visible)
View
32 tests/test_technology.py
@@ -2,21 +2,20 @@
# 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/
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import pytest
from unittestzero import Assert
-from pages.desktop.technology_page import TechnologyPage
+from pages.desktop.technology import Technology
class TestTechnologyPage:
@pytest.mark.nondestructive
def test_billboard_links_are_visible(self, mozwebqa):
- technology_page = TechnologyPage(mozwebqa)
+ technology_page = Technology(mozwebqa)
technology_page.go_to_page()
-
Assert.true(technology_page.is_developer_tools_link_visible)
Assert.true(technology_page.is_html5_link_visible)
Assert.true(technology_page.is_css_link_visible)
@@ -25,13 +24,22 @@ def test_billboard_links_are_visible(self, mozwebqa):
Assert.true(technology_page.is_security_link_visible)
@pytest.mark.nondestructive
- @pytest.mark.xfail(reason="Selenium issue 3492")
- def test_that_learn_more_is_shown_on_mouse_over(self, mozwebqa):
- technology_page = TechnologyPage(mozwebqa)
+ def test_footer_section(self, mozwebqa):
+ technology_page = Technology(mozwebqa)
+ technology_page.go_to_page()
+ Assert.true(technology_page.footer.are_footer_links_visible)
+
+ @pytest.mark.nondestructive
+ def test_header_section(self, mozwebqa):
+ technology_page = Technology(mozwebqa)
technology_page.go_to_page()
+ Assert.true(technology_page.header.is_tabzilla_panel_visible)
+ technology_page.header.toggle_tabzilla_dropdown()
+ Assert.true(technology_page.header.are_tabzilla_links_visible)
- for bulb in technology_page.bulbs:
- if bulb.is_learn_more_present:
- Assert.false(bulb.is_learn_more_displayed)
- bulb.hover()
- Assert.true(bulb.is_learn_more_displayed)
+ @pytest.mark.nondestructive
+ def test_download_button_section(self, mozwebqa):
+ technology_page = Technology(mozwebqa)
+ technology_page.go_to_page()
+ Assert.true(technology_page.downloadRegion.are_download_links_present)
+ Assert.true(technology_page.downloadRegion.are_secondary_links_visible)
Please sign in to comment.
Something went wrong with that request. Please try again.