Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #151 from mozilla/master

[prod]merge master to prod
  • Loading branch information...
commit 05a18cecc1e971245ecaafe12dae1ce88c8ed9ff 2 parents 6edd082 + 14c136d
@retornam retornam authored
Showing with 2,670 additions and 1,848 deletions.
  1. +6 −1 .gitignore
  2. +6 −6 README.md
  3. +33 −0 conftest.py
  4. +2 −0  credentials.yaml
  5. +2 −3 mozwebqa.cfg
  6. +0 −134 page.py
  7. +0 −238 pages/base.py
  8. +0 −4 pages/desktop/__init__.py
  9. +43 −85 pages/desktop/about.py
  10. +67 −0 pages/desktop/apps.py
  11. +0 −71 pages/desktop/aurora.py
  12. +88 −0 pages/desktop/b2g.py
  13. +184 −0 pages/desktop/base.py
  14. +0 −71 pages/desktop/beta.py
  15. +0 −75 pages/desktop/channel.py
  16. +60 −0 pages/desktop/contribute.py
  17. +0 −65 pages/desktop/customize.py
  18. +0 −117 pages/desktop/features.py
  19. +35 −0 pages/desktop/localization.py
  20. +47 −0 pages/desktop/mission.py
  21. +37 −0 pages/desktop/mozillabased.py
  22. +0 −111 pages/desktop/newsletter.py
  23. +30 −0 pages/desktop/notes.py
  24. +27 −15 pages/desktop/performance.py
  25. +137 −0 pages/desktop/products.py
  26. +65 −39 pages/desktop/security.py
  27. +46 −0 pages/desktop/sms.py
  28. +43 −142 pages/desktop/technology.py
  29. +0 −70 pages/mobile/mobile.py
  30. +112 −0 pages/page.py
  31. +16 −0 requirements.txt
  32. +0 −10 requirements/requirements.txt
  33. +0 −37 test_about.py
  34. +0 −36 test_aurora.py
  35. +0 −34 test_beta.py
  36. +0 −41 test_channel.py
  37. +0 −112 test_common.py
  38. +0 −34 test_customize.py
  39. +0 −31 test_features.py
  40. +0 −25 test_mobile.py
  41. +0 −80 test_newsletter.py
  42. +0 −28 test_performance.py
  43. +0 −43 test_redirects.py
  44. +0 −30 test_security.py
  45. +0 −42 test_technology.py
  46. 0  pages/desktop/brand.py → tests/__init__.py
  47. +9 −3 { → tests}/test_404.py
  48. +144 −0 tests/test_about.py
  49. +91 −0 tests/test_apps.py
  50. +105 −0 tests/test_b2g.py
  51. +54 −0 tests/test_contribute.py
  52. +23 −15 { → tests}/test_download.py
  53. +33 −0 tests/test_localization.py
  54. +82 −0 tests/test_mission.py
  55. +76 −0 tests/test_mozillabased.py
  56. +22 −0 tests/test_notes.py
  57. +97 −0 tests/test_performance.py
  58. +232 −0 tests/test_products.py
  59. +134 −0 tests/test_redirect.py
  60. +147 −0 tests/test_redirect_landing.py
  61. +143 −0 tests/test_security.py
  62. +80 −0 tests/test_sms.py
  63. +112 −0 tests/test_technology.py
View
7 .gitignore
@@ -2,4 +2,9 @@
rmpyc.sh
/debug/**
results
-venv
+venv
+.codeintel/*
+.DS_Store
+*.yaml
+*.sh
+
View
12 README.md
@@ -1,7 +1,7 @@
Mozilla.com Selenium Tests
============================
-This repository holds automated tests for [http://www.mozilla.com][MOZ]
+This repository holds automated tests for [http://www.mozilla.org][MOZ]
[MOZ]: http://www.mozilla.org
@@ -25,7 +25,7 @@ follow `sudo easy_install pip` with `sudo pip install virtualenv`, and then
create and activate a [virtualenv](http://www.virtualenv.org) (e.g. `virtualenv
mcom-tests-env; source mcom-tests-env/bin/activate`) to create a clean
"virtual environment" for just this project. Then you can
-`pip install -r requiremenst/requirements.txt` in your virtual environment
+`pip install -r requirements.txt` in your virtual environment
without needing to use `sudo`.
If you don't mind installing globally, just run
@@ -34,7 +34,7 @@ If you don't mind installing globally, just run
followed by
- sudo pip install -r requirements/requirements.txt
+ sudo pip install -r requirements.txt
__note__
@@ -45,7 +45,7 @@ If you are running on Ubuntu/Debian you will need to first do
to install the required Python libraries.
### Selenium
-Once this is all set up you will need to download and start a Selenium server. You can download the latest Selenium server from [here][Selenium Downloads]. The filename will be something like 'selenium-server-standalone-x.x.jar (where x.x is current shipping version)'
+Once this is all set up, you will need to download and start a Selenium server. You can download the latest Selenium server from [here][Selenium Downloads]. The filename will be something like 'selenium-server-standalone-x.x.jar (where x.x is current shipping version)'
To start the Selenium server run the following command:
@@ -60,7 +60,7 @@ Change the path/name to the downloaded Selenium server file.
Once the above prerequisites have been met you can run the tests using the
following command:
- py.test --api=rc --baseurl=http://www.mozilla.org --browser=*firefox
+ py.test --driver=firefox --destructive
Writing Tests
-------------
@@ -73,7 +73,7 @@ we'd like to ask you to do:
3. Fork this project with your own GitHub account
4. Make sure all tests are passing, and submit a pull request with your changes
-[GitHub Templates]: https://github.com/AutomatedTester/mozwebqa-test-templates
+[GitHub Templates]: https://github.com/mozilla/mozwebqa-test-templates
[Style Guide]: https://wiki.mozilla.org/QA/Execution/Web_Testing/Docs/Automation/StyleGuide
License
View
33 conftest.py
@@ -0,0 +1,33 @@
+import pytest
+
+
+def pytest_addoption(parser):
+ parser.addoption(
+ '--bedrock',
+ action='store',
+ dest='bedrock',
+ metavar='bedrock',
+ help='marks tests so they use Bedrock branch')
+ parser.addoption(
+ '--skipsprod',
+ action='store',
+ dest='skipsprod',
+ metavar='skip',
+ help='marks tests as staging only and skips them on production')
+
+
+def pytest_configure(config):
+ config.addinivalue_line(
+ 'markers',
+ 'bedrock: marks tests so they use Bedrock branch')
+
+
+def pytest_runtest_setup(item):
+ if hasattr(item.obj, 'bedrock') and \
+ '/b' not in item.config.option.base_url:
+ item.config.option.base_url = item.config.option.base_url + '/b'
+ else:
+ item.config.option.base_url = item.config.option.base_url.replace('/b', '')
+ if hasattr(item.obj, 'skipsprod') \
+ and 'allizom.org' not in item.config.option.base_url:
+ pytest.skip("skipping tests marked staging only")
View
2  credentials.yaml
@@ -0,0 +1,2 @@
+default:
+ phone: 5555551212
View
5 mozwebqa.cfg
@@ -1,4 +1,3 @@
[DEFAULT]
-api=rc
-baseurl=http://www-dev.allizom.org
-browser=firefox
+api = webdriver
+baseurl = https://www.allizom.org
View
134 page.py
@@ -1,134 +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 re
-import time
-import base64
-
-
-http_regex = re.compile('https?://((\w+\.)+\w+\.\w+)')
-
-
-class Page(object):
- '''
- Base class for all Pages
- '''
-
- def __init__(self, testsetup):
- '''
- Constructor
- '''
- self.testsetup = testsetup
- self.selenium = testsetup.selenium
- self.base_url = testsetup.base_url
- self.timeout = testsetup.timeout
-
- @property
- def is_the_current_page(self):
- page_title = self.selenium.get_title()
- if not page_title == self._page_title:
- self.record_error()
- try:
- raise Exception("Expected page title to be: '" + self._page_title + "' but it was: '" + page_title + "'")
- except Exception:
- raise Exception('Expected page title does not match actual page title.')
- else:
- return True
-
- def open(self, url):
- self.selenium.open(url)
- self.selenium.wait_for_page_to_load(self.timeout)
-
- def get_text(self, locator):
- return self.selenium.get_text(locator)
-
- def click_link(self, link, wait_flag=False):
- self.selenium.click("link=%s" % (link))
- if(wait_flag):
- self.selenium.wait_for_page_to_load(self.timeout)
-
- def click(self, locator, wait_flag=False):
- self.selenium.click(locator)
- if(wait_flag):
- self.selenium.wait_for_page_to_load(self.timeout)
-
- def type(self, locator, str):
- self.selenium.type(locator, str)
-
- def click_button(self, button, wait_flag=False):
- self.selenium.click(button)
- if(wait_flag):
- self.selenium.wait_for_page_to_load(self.timeout)
-
- def get_url_current_page(self):
- return(self.selenium.get_location())
-
- def is_element_present(self, locator):
- return self.selenium.is_element_present(locator)
-
- def is_element_visible(self, locator):
- return self.selenium.is_element_present(locator) and self.selenium.is_visible(locator)
-
- def is_text_present(self, text):
- return self.selenium.is_text_present(text)
-
- def refresh(self):
- self.selenium.refresh()
- self.selenium.wait_for_page_to_load(self.timeout)
-
- def wait_for_element_present(self, element):
- count = 0
- while not self.is_element_present(element):
- time.sleep(1)
- count += 1
- if count == self.timeout / 1000:
- self.record_error()
- raise Exception(element + ' has not loaded')
-
- def wait_for_element_visible(self, element):
- self.wait_for_element_present(element)
- count = 0
- while not self.is_element_visible(element):
- time.sleep(1)
- count += 1
- if count == self.timeout / 1000:
- self.record_error()
- raise Exception(element + " is not visible")
-
- def wait_for_element_not_visible(self, element):
- count = 0
- while self.is_element_visible(element):
- time.sleep(1)
- count += 1
- if count == self.timeout / 1000:
- self.record_error()
- raise Exception(element + " is still visible")
-
- def wait_for_page(self, url_regex):
- count = 0
- while (re.search(url_regex, self.selenium.get_location(), re.IGNORECASE)) is None:
- time.sleep(1)
- count += 1
- if count == self.timeout / 1000:
- self.record_error()
- raise Exception("Sites Page has not loaded")
-
- def record_error(self):
- ''' Records an error. '''
-
- http_matches = http_regex.match(self.base_url)
- file_name = http_matches.group(1)
-
- print '-------------------'
- print 'Error at ' + self.selenium.get_location()
- print 'Page title ' + self.selenium.get_title()
- print '-------------------'
- filename = file_name + '_' + str(time.time()).split('.')[0] + '.png'
-
- print 'Screenshot of error in file ' + filename
- f = open(filename, 'wb')
- f.write(base64.decodestring(
- self.selenium.capture_entire_page_screenshot_to_string('')))
- f.close()
View
238 pages/base.py
@@ -1,238 +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 import selenium
-from page import Page
-
-
-class MozillaBasePage(Page):
-
- _header_tab_mozilla = "css=#tabzilla-nav>ul>li:nth-child(1)>h2"
- _header_tab_products = "css=#tabzilla-nav>ul>li:nth-child(2)>h2"
- _header_tab_innovation = "css=#tabzilla-nav>ul>li:nth-child(3)>h2"
- _header_tab_get_involved = "css=#tabzilla-nav>ul>li:nth-child(4)>h2"
- _header_tab_list = [
- _header_tab_mozilla,
- _header_tab_products,
- _header_tab_innovation,
- _header_tab_get_involved
- ]
-
- _header_logo_locator = "css=#header > div > h1 > a"
- #_desktop_header_locator = "css=#nav-main-desktop>a"
- _mobile_header_locator = "css=#nav-main-mobile > a"
- _addons_header_locator = "css=#nav-main-addons > a"
- _support_header_locator = "css=#nav-main-support > a"
- _about_header_locator = "css=#nav-main-about > a"
- _mozilla_header_locator = "css=#tabzilla"
- _header_list = [
- _header_logo_locator,
- _mobile_header_locator,
- _addons_header_locator,
- _support_header_locator,
- _about_header_locator,
- _mozilla_header_locator]
-
- _footer_features_locator = \
- "css=#footer-menu > ul > li:nth-child(1) > ul > li:nth-child(1) > a"
- _footer_customize_locator = \
- "css=#footer-menu > ul > li:nth-child(1) > ul > li:nth-child(2) > a"
- _footer_performance_locator = \
- "css=#footer-menu > ul > li:nth-child(1) > ul > li:nth-child(3) > a"
- _footer_technology_locator = \
- "css=#footer-menu > ul > li:nth-child(1) > ul > li:nth-child(4) > a"
- _footer_privacy_locator = \
- "css=#footer-menu > ul > li:nth-child(1) > ul > li:nth-child(5) > a"
- _footer_desktop_list = [
- _footer_features_locator,
- _footer_customize_locator,
- _footer_performance_locator,
- _footer_technology_locator,
- _footer_privacy_locator]
-
- _footer_twitter_locator = "css=#footer-twitter a"
- _footer_facebbook_locator = "css=#sub-footer-newsletter a"
- #_footer_moreways_locator = "css=#footer-connect a"
- _footer_affiliates_locator = "css=#footer-affiliates a"
- _footer_monthly_newsletter_locator = "css=#sub-footer-newsletter a"
- _footer_social_media_list = [
- _footer_twitter_locator,
- _footer_facebbook_locator,
- #_footer_moreways_locator,
- _footer_affiliates_locator,
- _footer_monthly_newsletter_locator]
-
- _footer_mobile_download_locator = \
- "css=#footer-menu > ul > li:nth-child(2) > ul > li:nth-child(1) > a"
- _footer_mfeatures_locator = \
- "css=#footer-menu >ul > li:nth-child(2) > ul > li:nth-child(2) > a"
- _footer_mcustom_locator = \
- "css=#footer-menu > ul >li:nth-child(2) > ul > li:nth-child(3) > a"
- _footer_mfaq_locator = \
- "css=#footer-menu > ul > li:nth-child(2) > ul > li:nth-child(4) > a"
- _footer_mobile_list = [
- _footer_mobile_download_locator,
- _footer_mfeatures_locator,
- _footer_mcustom_locator,
- _footer_mfaq_locator]
-
- _footer_release_download_locator = \
- "css=#footer-menu > ul > li:nth-child(3) > ul > li:nth-child(1) > a"
- _footer_aurora_locator = \
- "css=#footer-menu > ul>li:nth-child(3) > ul > li:nth-child(2) > a"
- _footer_beta_locator = \
- "css=#footer-menu > ul > li:nth-child(3) > ul > li:nth-child(3) > a"
- _footer_firefox_locator = \
- "css=#footer-menu > ul > li:nth-child(3) > ul > li:nth-child(4) > a"
- _footer_releases_list = [
- _footer_release_download_locator,
- _footer_aurora_locator,
- _footer_beta_locator,
- _footer_firefox_locator]
-
- _footer_desktop_addons_locator = \
- "css=#footer-menu > ul > li:nth-child(4) > ul > li:nth-child(1) > a"
- _footer_mobile_addons_locator = \
- "css=#footer-menu > ul > li:nth-child(4) > ul > li:nth-child(2) > a"
- _footer_personas_locator = \
- "css=#footer-menu > ul > li:nth-child(4) > ul > li:nth-child(3) > a"
- _footer_addons_list = [
- _footer_desktop_addons_locator,
- _footer_mobile_addons_locator,
- _footer_personas_locator]
-
- _footer_support_locator = \
- "css=#footer-menu > ul > li:nth-child(5) > ul > li:nth-child(1) > a"
- _footer_msupport_locator = \
- "css=#footer-menu > ul > li:nth-child(5) > ul > li:nth-child(2) > a"
- _footer_support_list = [
- _footer_support_locator,
- _footer_msupport_locator]
-
- _footer_blog_locator = \
- "css=#footer-menu > ul > li:nth-child(6) > ul > li:nth-child(1) > a"
- _footer_about_firefox_locator = \
- "css=#footer-menu > ul > li:nth-child(6) > ul > li:nth-child(2) > a"
- _footer_join_mozilla_locator = \
- "css=#footer-menu > ul > li:nth-child(6) > ul > li:nth-child(3) > a"
- _footer_participate_locator = \
- "css=#footer-menu > ul > li:nth-child(6) > ul > li:nth-child(4) > a"
- _footer_press_center_locator = \
- "css=#footer-menu > ul > li:nth-child(6) > ul > li:nth-child(5) > a"
- _footer_brand_locator = \
- "css=#footer-menu > ul > li:nth-child(6) > ul > li:nth-child(6) > a"
- _footer_careers_locator = \
- "css=#footer-menu > ul > li:nth-child(6) > ul > li:nth-child(7) > a"
- _footer_partnerships_locator = \
- "css=#footer-menu > ul > li:nth-child(6) > ul > li:nth-child(8) > a"
- _footer_contact_locator = \
- "css=#footer-menu > ul > li:nth-child(6) > ul > li:nth-child(9) > a"
- _footer_about_list = [
- _footer_blog_locator,
- _footer_about_firefox_locator,
- _footer_join_mozilla_locator,
- _footer_participate_locator,
- _footer_press_center_locator,
- _footer_brand_locator,
- _footer_careers_locator,
- _footer_partnerships_locator,
- _footer_contact_locator]
-
- _footer_privacy_policy_locator = "css=#footer-links > a:nth-child(1)"
- _footer_legal_notices_locator = "css=#footer-links > a:nth-child(2)"
- _footer_trademark_abuse_locator = "css=#footer-links > a:nth-child(3)"
- _footer_legal_list = [
- _footer_privacy_policy_locator,
- _footer_legal_notices_locator,
- _footer_trademark_abuse_locator]
-
- _right_download_button_locator = "css=span.download-title"
- _right_privacy_policy_locator = "link=Privacy Policy"
- _other_systems_locator = "link=Systems & Languages"
- _release_notes_locator = "link=Release Notes"
- _download_links_list = [
- _right_download_button_locator,
- _right_privacy_policy_locator,
- _other_systems_locator,
- _release_notes_locator]
-
- _monthly_news_locator = "css=.email.placeholder"
- _monthly_news_locator_button = "css=.email-open"
- _test_email_address = "me@example.com"
- _inline_privacy_checkbox = "css=#inline-privacy-check"
- _sign_me_up_button = "css=.subscribe"
- _success_pane_locator = "css=.successpane > h3"
-
-
- def click_tabzilla(self):
- self.click(self._mozilla_header_locator)
-
-
- @property
- def get_tabzilla_header_links(self):
- return self._header_tab_list
- @property
- def success_pane_locator(self):
- return self._success_pane_locator
-
- @property
- def sign_me_up_button(self):
- return self._sign_me_up_button
-
- @property
- def inline_privacy_checkbox(self):
- return self._inline_privacy_checkbox
-
- @property
- def test_email_address(self):
- return self._test_email_address
-
- @property
- def monthly_news_locator(self):
- return self._monthly_news_locator
-
- @property
- def monthly_news_locator_button(self):
- return self._monthly_news_locator_button
-
- @property
- def get_upper_download_links(self):
- return self._download_links_list
-
- @property
- def footer_about_links(self):
- return self._footer_about_list
-
- @property
- def footer_support_links(self):
- return self._footer_support_list
-
- @property
- def header_links(self):
- return self._header_list
-
- @property
- def footer_desktop_links(self):
- return self._footer_desktop_list
-
- @property
- def footer_social_links(self):
- return self._footer_social_media_list
-
- @property
- def footer_mobile_links(self):
- return self._footer_mobile_list
-
- @property
- def footer_release_download_links(self):
- return self._footer_releases_list
-
- @property
- def footer_addons_links(self):
- return self._footer_addons_list
-
- @property
- def footer_legal_links(self):
- return self._footer_legal_list
View
4 pages/desktop/__init__.py
@@ -1,4 +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/.
View
128 pages/desktop/about.py
@@ -1,90 +1,48 @@
#!/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.base import MozillaBasePage
-
-
-class AboutPage(MozillaBasePage):
-
- _participate_img = "css=#get-involved>h3>a>span"
- _txt_participate = "css=#get-involved>h3>a"
- _communications_img = "css=#press>h3>a>span"
- _txt_communications = "css=#press>h3>a"
- _careers_img = "css=#careers>h3>a>span"
- _txt_careers = "css=#careers>h3>a"
- _partnerships_img = "css=#partnerships>h3>a>span"
- _txt_partnerships = "css=#partnerships>h3>a"
- _legal_img = "css=#licensing>h3>a>span"
- _txt_legal = "css=#licensing>h3>a"
- _contact_us_img = "css=#contact>h3>a>span"
- _txt_contact_us = "css=#contact>h3>a"
- _store_img = "css=#store>h3>a>span"
- _txt_store = "css=#store>h3>a"
- _blog_img = "css=#blog>h3>a>span"
- _txt_blog = "css=#blog>h3>a"
-
- @property
- def participate_image(self):
- return self.is_element_present(self._participate_img)
-
- @property
- def participate_text(self):
- return self.is_element_present(self._txt_participate)
-
- @property
- def communications_image(self):
- return self.is_element_present(self._communications_img)
-
- @property
- def communications_text(self):
- return self.is_element_present(self._txt_communications)
-
- @property
- def careers_image(self):
- return self.is_element_present(self._careers_img)
-
- @property
- def careers_text(self):
- return self.is_element_present(self._txt_careers)
-
- @property
- def partnerships_image(self):
- return self.is_element_present(self._partnerships_img)
-
- @property
- def partnerships_text(self):
- return self.is_element_present(self._txt_partnerships)
-
- @property
- def legal_image(self):
- return self.is_element_present(self._legal_img)
-
- @property
- def legal_text(self):
- return self.is_element_present(self._txt_legal)
-
- @property
- def contact_us_image(self):
- return self.is_element_present(self._contact_us_img)
-
- @property
- def contact_us_text(self):
- return self.is_element_present(self._txt_contact_us)
-
- @property
- def store_image(self):
- return self.is_element_present(self._store_img)
-
- @property
- def store_text(self):
- return self.is_element_present(self._txt_store)
-
- @property
- def blog_image(self):
- return self.is_element_present(self._blog_img)
-
- @property
- def blog_text(self):
- return self.is_element_present(self._txt_blog)
+from selenium.webdriver.common.by import By
+from pages.desktop.base import Base
+
+
+class AboutPage(Base):
+
+ def go_to_page(self):
+ self.open('/about/')
+
+ major_links_list = [
+ {
+ 'locator': (By.CSS_SELECTOR, '#main-content ul.links:nth-of-type(1) li:nth-child(1) a'),
+ 'url_suffix': '/mission/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#main-content ul.links:nth-of-type(1) li:nth-child(2) a'),
+ 'url_suffix': 'careers.mozilla.org/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#main-content ul.links:nth-of-type(1) li:nth-child(3) a'),
+ 'url_suffix': 'blog.mozilla.org/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#main-content ul.links:nth-of-type(1) li:nth-child(4) a'),
+ 'url_suffix': '/styleguide',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#main-content ul.links:nth-of-type(1) li:nth-child(5) a'),
+ 'url_suffix': '/about/contact',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#main-content ul.links:nth-of-type(2) li:nth-child(1) a'),
+ 'url_suffix': '/products/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#main-content ul.links:nth-of-type(2) li:nth-child(2) a'),
+ 'url_suffix': '/contribute/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#main-content ul.links:nth-of-type(2) li:nth-child(3) a'),
+ 'url_suffix': 'blog.mozilla.org/press/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#main-content ul.links:nth-of-type(2) li:nth-child(4) a'),
+ 'url_suffix': '/privacy/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#main-content ul.links:nth-of-type(2) li:nth-child(5) a'),
+ 'url_suffix': '/about/partnerships',
+ }
+ ]
View
67 pages/desktop/apps.py
@@ -0,0 +1,67 @@
+#!/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 selenium.webdriver.support.ui import WebDriverWait
+from pages.desktop.base import Base
+
+
+class Apps(Base):
+
+ def go_to_page(self):
+ self.open('/apps/')
+
+ page_links_list = [
+ {
+ 'locator': (By.ID, 'marketplace-button'),
+ 'url_suffix': 'marketplace.firefox.com/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#showcased-nonfx a'),
+ 'url_suffix': '/mobile/aurora/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#apps-preview ul li:nth-of-type(1) > a'),
+ 'url_suffix': '#games',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#apps-preview ul li:nth-of-type(2) > a'),
+ 'url_suffix': '#news',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#apps-preview ul li:nth-of-type(3) > a'),
+ 'url_suffix': '#productivity',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#build ul li:nth-of-type(1) > a'),
+ 'url_suffix': 'marketplace.firefox.com/developers/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#build ul li:nth-of-type(2) > a'),
+ 'url_suffix': 'marketplace.firefox.com/developers/partners',
+ }
+ ]
+
+ _showcased_apps_links_locator = (By.CSS_SELECTOR, 'div.billboard a')
+ _sign_up_form_locator = (By.ID, 'footer-email-form')
+ _sign_up_form_email_input_locator = (By.ID, 'id_email')
+ _sign_up_form_html_radio_locator = (By.ID, 'id_fmt_0')
+ _sign_up_form_text_radio_locator = (By.ID, 'id_fmt_1')
+ _sign_up_form_privacy_checkbox_locator = (By.ID, 'id_privacy')
+ _sign_up_form_submit_button_locator = (By.ID, 'footer_email_submit')
+
+ @property
+ def showcased_apps_links(self):
+ return self.selenium.find_elements(*self._showcased_apps_links_locator)
+
+ @property
+ def is_sign_up_form_present(self):
+ return self.is_element_present(*self._sign_up_form_locator)
+
+ @property
+ def are_sign_up_form_fields_visible(self):
+ return self.is_element_visible(*self._sign_up_form_email_input_locator) \
+ and self.is_element_visible(*self._sign_up_form_html_radio_locator) \
+ and self.is_element_visible(*self._sign_up_form_text_radio_locator) \
+ and self.is_element_visible(*self._sign_up_form_privacy_checkbox_locator) \
+ and self.is_element_visible(*self._sign_up_form_submit_button_locator)
+
+ def expand_sign_up_form(self):
+ self.selenium.find_element(*self._sign_up_form_email_input_locator).click()
View
71 pages/desktop/aurora.py
@@ -1,71 +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.base import MozillaBasePage
-
-
-class AuroraPage(MozillaBasePage):
-
-
- _aurora_header = "css=#main-feature > h2 > img"
- _aurora_btn_locator = "css=.home-download > li > a"
- _all_systems_locator = "css=.download-other > a:nth-child(1)"
- _privacy_policy_locator = "css=.download-other > a:nth-child(2)"
- _email_locator = "css=#email"
- _aurora_checkbox_locator = "css=#check_aurora"
- _privacy_policy_checkbox_locator = "css=#inline-privacy-check"
- _sign_up_btn_locator = "css=#subscribe.button"
- _preview_features_locator = "css=#feature-list > li:nth-child(1) > h3"
- _share_feedback_locator = "css=#feature-list > li:nth-child(2) > h3"
- _shape_firefox_locator = "css=#feature-list > li:nth-child(3) > h3"
- _success_pane_locator = "css=.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.type(self._email_locator, email)
-
- def check_aurora_checkbox(self):
- return self.selenium.check(self._aurora_checkbox_locator)
-
- def agree_to_privacy_policy(self):
- self.selenium.check(self._privacy_policy_checkbox_locator)
-
- def click_sign_me_up(self):
- self.selenium.click(self._sign_up_btn_locator)
- self.selenium.wait_for_page_to_load(self.timeout)
-
- @property
- def newsletter_submitted_sucessfully(self):
- return self.get_text(self._success_pane_locator)
View
88 pages/desktop/b2g.py
@@ -0,0 +1,88 @@
+#!/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 BootToGecko(Base):
+
+ def go_to_page(self):
+ self.open('/b2g/')
+
+ _firefox_os_header_locator = (By.CSS_SELECTOR, '#main-feature > h2')
+ _welcome_section_locator = (By.CSS_SELECTOR, '#primary')
+ _new_web_standards_header_locator = (By.CSS_SELECTOR, '#secondary div.section:nth-of-type(1) > h3:nth-of-type(1)')
+ _freedom_platforms_header_locator = (By.CSS_SELECTOR, '#secondary div.section:nth-of-type(1) > h3:nth-of-type(2)')
+ _customizations_for_oems_header_locator = (By.CSS_SELECTOR, '#secondary div.section:nth-of-type(2) > h3')
+ _developer_opportunities_header_locator = (By.CSS_SELECTOR, '#secondary div.section:nth-of-type(3) > h3')
+ _consumer_freedom_header_locator = (By.CSS_SELECTOR, '#secondary div.section:nth-of-type(4) > h3')
+
+ b2g_nav_links_list = [
+ {
+ 'locator': (By.CSS_SELECTOR, '#nav-main > ul > li:nth-of-type(1) > a'),
+ 'url_suffix': '/apps/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#nav-main > ul > li:nth-of-type(2) > a'),
+ 'url_suffix': 'developer.mozilla.org/apps',
+ }
+ ]
+
+ images_list = [
+ {
+ 'locator': (By.CSS_SELECTOR, '#main-feature > h1 > img'),
+ 'img_name_suffix': 'wordmark-firefoxos.png',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#primary > img'),
+ 'img_name_suffix': 'firefox-phone.png',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#secondary div.section:nth-of-type(1) img'),
+ 'img_name_suffix': 'example-apps.jpg',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#secondary div.section:nth-of-type(2) img:nth-of-type(1)'),
+ 'img_name_suffix': 'example-radio.jpg',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#secondary div.section:nth-of-type(2) img:nth-of-type(2)'),
+ 'img_name_suffix': 'example-music.jpg',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#secondary div.section:nth-of-type(3) img'),
+ 'img_name_suffix': 'example-browser.jpg',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#secondary div.section:nth-of-type(4) img:nth-of-type(1)'),
+ 'img_name_suffix': 'example-videos.jpg',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#secondary div.section:nth-of-type(4) img:nth-of-type(2)'),
+ 'img_name_suffix': 'example-gallery.jpg',
+ }
+ ]
+
+ @property
+ def is_firefox_os_header_visible(self):
+ return self.is_element_visible(*self._firefox_os_header_locator)
+
+ @property
+ def is_welcome_section_visible(self):
+ return self.is_element_visible(*self._welcome_section_locator)
+
+ @property
+ def is_new_web_standards_header_visible(self):
+ return self.is_element_visible(*self._new_web_standards_header_locator)
+
+ @property
+ def is_freedom_platforms_header_visible(self):
+ return self.is_element_visible(*self._freedom_platforms_header_locator)
+
+ @property
+ def is_customizations_for_oems_header_visible(self):
+ return self.is_element_visible(*self._customizations_for_oems_header_locator)
+
+ @property
+ def is_developer_opportunities_header_visible(self):
+ return self.is_element_visible(*self._developer_opportunities_header_locator)
+
+ @property
+ def is_consumer_freedom_header_visible(self):
+ return self.is_element_visible(*self._consumer_freedom_header_locator)
View
184 pages/desktop/base.py
@@ -0,0 +1,184 @@
+#!/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.ui import WebDriverWait
+from pages.page import Page
+
+
+class Base(Page):
+
+ @property
+ def header(self):
+ return self.Header(self.testsetup)
+
+ @property
+ def footer(self):
+ return self.Footer(self.testsetup)
+
+ @property
+ def downloadRegion(self):
+ return self.DownloadRegion(self.testsetup)
+
+ def link_destination(self, locator):
+ link = self.selenium.find_element(*locator)
+ return link.get_attribute('href')
+
+ def image_source(self, locator):
+ link = self.selenium.find_element(*locator)
+ return link.get_attribute('src')
+
+ class Header(Page):
+
+ _tabzilla = (By.ID, 'tabzilla')
+ _tabzilla_panel = (By.ID, 'tabzilla-panel')
+ _tabzilla_search_textbox = (By.CSS_SELECTOR, '#tabzilla-search #q')
+
+ tabzilla_links_list = [
+ {
+ 'locator': (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(1) > ul > li:nth-of-type(1) > a'),
+ 'url_suffix': '/mission/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(1) > ul > li:nth-of-type(2) > a'),
+ 'url_suffix': '/about/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(1) > ul > li:nth-of-type(3) > a'),
+ 'url_suffix': '/projects/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(1) > ul > li:nth-of-type(4) > a'),
+ 'url_suffix': 'support.mozilla.org/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(1) > ul > li:nth-of-type(5) > a'),
+ 'url_suffix': 'developer.mozilla.org/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(2) > ul > li:nth-of-type(1) > a'),
+ 'url_suffix': 'www.mozilla.org/firefox',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(2) > ul > li:nth-of-type(2) > a'),
+ 'url_suffix': 'www.mozilla.org/thunderbird',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(2) > ul > li:nth-of-type(3) > a'),
+ 'url_suffix': 'www.mozilla.org/firefoxos',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(3) > ul > li:nth-of-type(1) > a'),
+ 'url_suffix': 'webfwd.org/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(3) > ul > li:nth-of-type(2) > a'),
+ 'url_suffix': 'mozillalabs.com/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(3) > ul > li:nth-of-type(3) > a'),
+ 'url_suffix': 'webmaker.org/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(4) > ul > li:nth-of-type(1) > a'),
+ 'url_suffix': 'www.mozilla.org/contribute/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(4) > ul > li:nth-of-type(2) > a'),
+ 'url_suffix': '/about/careers.html',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(4) > ul > li:nth-of-type(3) > a'),
+ 'url_suffix': '/about/mozilla-spaces/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#tabzilla-nav > ul > li:nth-child(4) > ul > li:nth-of-type(4) > a'),
+ 'url_suffix': 'donate.mozilla.org/',
+ },
+ ]
+
+ nav_links_list = [
+ {
+ 'locator': (By.CSS_SELECTOR, '#nav-main > ul > li:nth-child(1) > a'),
+ 'url_suffix': '/mission/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#nav-main > ul > li:nth-child(2) > a'),
+ 'url_suffix': '/about/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#nav-main > ul > li:nth-child(3) > a'),
+ 'url_suffix': '/products/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#nav-main > ul > li:nth-child(4) > a'),
+ 'url_suffix': '/contribute/',
+ }
+ ]
+
+ def toggle_tabzilla_dropdown(self):
+ toggle_state = self.selenium.execute_script('return Tabzilla.opened')
+ self.selenium.find_element(*self._tabzilla).click()
+ 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_search_box_visible(self):
+ return self.is_element_visible(*self._tabzilla_search_textbox)
+
+ class Footer(Page):
+
+ _footer_locator = (By.CSS_SELECTOR, '#colophon')
+ _footer_logo_link_locator = (By.CSS_SELECTOR, '.footer-logo > a')
+ _footer_logo_img_locator = (By.CSS_SELECTOR, '.footer-logo img')
+ expected_footer_logo_destination = '/en-US/'
+ expected_footer_logo_img = '/media/img/sandstone/footer-mozilla.png'
+
+ footer_links_list = [
+ {
+ 'locator': (By.CSS_SELECTOR, '#colophon div.footer-license p:nth-child(1) a'),
+ 'url_suffix': '/foundation/licensing/website-content.html',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#colophon ul.footer-nav:nth-of-type(1) li:nth-child(1) a'),
+ 'url_suffix': '/about/contact.html#map-mountain_view',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#colophon ul.footer-nav:nth-of-type(1) li:nth-child(2) a'),
+ 'url_suffix': '/privacy/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#colophon ul.footer-nav:nth-of-type(1) li:nth-child(3) a'),
+ 'url_suffix': '/about/legal.html',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#colophon ul.footer-nav:nth-of-type(1) li:nth-child(4) a'),
+ 'url_suffix': '/legal/fraud-report/index.html',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#colophon ul.footer-nav:nth-of-type(2) li:nth-child(1) a'),
+ 'url_suffix': 'twitter.com/firefox',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#colophon ul.footer-nav:nth-of-type(2) li:nth-child(2) a'),
+ 'url_suffix': 'facebook.com/Firefox',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#colophon ul.footer-nav:nth-of-type(2) li:nth-child(3) a'),
+ 'url_suffix': 'affiliates.mozilla.org/',
+ },
+ ]
+
+ @property
+ def footer_logo_destination(self):
+ footer_logo_link = self.selenium.find_element(*self._footer_logo_link_locator)
+ return footer_logo_link.get_attribute('href')
+
+ @property
+ def footer_logo_img(self):
+ footer_logo_img = self.selenium.find_element(*self._footer_logo_img_locator)
+ return footer_logo_img.get_attribute('src')
+
+ 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 is_download_link_visible(self):
+ return self.is_element_visible(*self._osx_download_locator) or \
+ self.is_element_visible(*self._windows_download_locator) or \
+ self.is_element_visible(*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
71 pages/desktop/beta.py
@@ -1,71 +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.base import MozillaBasePage
-
-
-class BetaPage(MozillaBasePage):
-
-
- _beta_header = "css=#main-feature > h2 > img"
- _beta_btn_locator = "css=.home-download > a"
- _supported_devices_locator = "css=.download-other > a:nth-child(1)"
- _privacy_policy_locator = "css=.download-other > a:nth-child(2)"
- _email_locator = "css=#email"
- _beta_checkbox_locator = "css=#check_beta"
- _privacy_policy_checkbox_locator = "css=#inline-privacy-check"
- _sign_up_btn_locator = "css=#subscribe.button"
- _test_features_locator = "css=#feature-list > li:nth-child(1) > h3"
- _polish_locator = "css=#feature-list > li:nth-child(2) > h3"
- _do_part_locator = "css=#feature-list > li:nth-child(3) > h3"
- _success_pane_locator = "css=.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.type(self._email_locator, email)
-
- def check_beta_checkbox(self):
- self.selenium.check(self._beta_checkbox_locator)
-
- def agree_to_privacy_policy(self):
- self.selenium.check(self._privacy_policy_checkbox_locator)
-
- def click_sign_me_up(self):
- self.selenium.click(self._sign_up_btn_locator)
- self.selenium.wait_for_page_to_load(self.timeout)
-
- @property
- def newsletter_submitted_sucessfully(self):
- return self.get_text(self._success_pane_locator)
View
75 pages/desktop/channel.py
@@ -1,75 +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.base import MozillaBasePage
-
-
-class ChannelPage(MozillaBasePage):
-
-
- _mozilla_firefox_logo = "css=#header > div > h1 > a"
- _beta_logo = "css=#toggler-logo-beta"
- _firefox_logo = "css=#toggler-logo-firefox"
- _aurora_logo = "css=#toggler-logo-aurora"
- _firefox_desktop_button = "css=#firefox-desktop-link > a"
- _firefox_mobile_button = "css=#firefox-mobile-link > a"
- _aurora_desktop_button = "css=#aurora-desktop-link > a"
- _aurora_mobile_button = "css=#aurora-mobile-link > a"
- _beta_desktop_button = "css=#beta-desktop-link > a"
- _beta_mobile_button = "css=#beta-mobile-link > a"
- _learn_more_button = "css=.more>a"
- _left_carousel = "css=#carousel-left"
- _right_carousel = "css=#carousel-right"
- _main_feature_header = "css=#main-feature>h2"
-
-
- def go_to_channel_page(self):
- self.open("/firefox/channel")
-
-
- def click_aurora_logo(self):
- self.click(self._aurora_logo)
-
-
- def click_beta_logo(self):
- self.click(self._beta_logo)
-
-
- def click_firefox_logo(self):
- self.click(self._firefox_logo)
-
- @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.click(self._right_carousel)
-
- def click_left_carousel(self):
- self.click(self._left_carousel)
View
60 pages/desktop/contribute.py
@@ -0,0 +1,60 @@
+#!/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 Contribute(Base):
+
+ def go_to_page(self):
+ self.open('/contribute/')
+
+ @property
+ def help_form(self):
+ return self.HelpForm(self.testsetup)
+
+ class HelpForm(Page):
+
+ _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')
+
+ _comments_locator = (By.ID, 'id_comments')
+
+ _privacy_checkbox_locator = (By.ID, 'id_privacy')
+ _privacy_title_locator = (By.CSS_SELECTOR, '.privacy-check-label span.title')
+
+ _newsletter_checkbox_locator = (By.ID, 'id_newsletter')
+ _newsletter_title_locator = (By.CSS_SELECTOR, '.field-newsletter > label')
+
+ _recaptcha_table_locator = (By.ID, 'recaptcha_table')
+ _recaptcha_response_field_locator = (By.ID, 'recaptcha_response_field')
+
+ privacy_link = {
+ 'locator': (By.CSS_SELECTOR, '.privacy-check-label span.title > a'),
+ 'url_suffix': '/privacy-policy'
+ }
+
+ @property
+ def elements_are_visible(self):
+ return self.is_element_visible(*self._want_to_help_title_locator) and\
+ self.is_element_visible(*self._comments_locator) and\
+ self.is_element_visible(*self._area_of_interest_locator) and\
+ self.is_element_visible(*self._privacy_checkbox_locator) and\
+ self.is_element_visible(*self._privacy_title_locator) and\
+ self.is_element_visible(*self._newsletter_checkbox_locator) and\
+ self.is_element_visible(*self._newsletter_title_locator) and\
+ self.is_element_visible(*self._recaptcha_table_locator) and\
+ self.is_element_visible(*self._recaptcha_response_field_locator) and\
+ self.is_element_visible(*self._submit_button_locator)
+
+ def click_email(self):
+ self.selenium.find_element(*self._email_field_locator).click()
+ self.wait_for_ajax()
View
65 pages/desktop/customize.py
@@ -1,65 +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.base import MozillaBasePage
-
-
-class CustomizePage(MozillaBasePage):
-
- _style_ico = "css=#cust-style"
- _addons_ico = "css=#cust-addons"
- _plugins_ico = "css=#cust-plugins"
- _interface_ico = "css=#cust-interface"
- _sync_ico = "css=#cust-sync"
- _style_img = "css=.persona-preview"
- _plugins_img = "css=#plugins>.features-image>img"
- _interface_img = "css=#interface>.features-image>img"
- _sync_img = "css=.mozilla-video-control-overlay"
- _addons_feature = "css=.mozilla-video-control-overlay"
- _top_feature = "css=#top-features"
-
- @property
- def style_icon(self):
- return self.is_element_present(self._style_ico)
-
- @property
- def addons_icon(self):
- return self.is_element_present(self._addons_ico)
-
- @property
- def plugins_icon(self):
- return self.is_element_present(self._plugins_ico)
-
- @property
- def interface_icon(self):
- return self.is_element_present(self._interface_ico)
-
- @property
- def sync_icon(self):
- return self.is_element_present(self._sync_ico)
-
- @property
- def style_image(self):
- return self.is_element_present(self._style_img)
-
- @property
- def plugins_image(self):
- return self.is_element_present(self._plugins_img)
-
- @property
- def interface_image(self):
- return self.is_element_present(self._interface_img)
-
- @property
- def sync_image(self):
- return self.is_element_present(self._sync_img)
-
- @property
- def addons_feature(self):
- return self.is_element_present(self._addons_feature)
-
- @property
- def top_feature(self):
- return self.is_element_present(self._top_feature)
View
117 pages/desktop/features.py
@@ -1,117 +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.base import MozillaBasePage
-
-
-class FeaturesPage(MozillaBasePage):
-
- _made_easy_locator = \
- "css=#main-feature>.feature-links>#made-easy>a"
- _high_performance_locator = \
- "css=#main-feature>.feature-links>#high-performance>a"
- _advanced_security_locator = \
- "css=#main-feature>.feature-links>#advanced-security>a"
- _powerful_personalization_locator = \
- "css=#main-feature>.feature-links>#powerful-personalization>a"
- _universal_access_locator = \
- "css=#main-feature>.feature-links>#cutting-edge>a"
- _cutting_edge_locator = \
- "css=#main-feature>.feature-links>#universal-access>a"
-
- _made_easy_image = \
- "css=#madeeasy>.features-container>.feature>.right"
- _app_tabs_image = \
- "css=#madeeasy>.features-container>.feature>.column1>.sub-feature>.right"
- _switch_tab_image = \
- "css=#madeeasy>.features-container>.feature>.column2>.sub-feature>.right"
- _panorama_image = \
- "css=#madeeasy>.features-container>.feature>.column3>.sub-feature>.right"
- _sync_image = \
- "css=#madeeasy>.features-container>.column-span>.right"
- _easy_search_image = \
- "//*[@id='madeeasy']/div/div[8]/div[4]/img"
- _one_bookmark_image = \
- "css=#madeeasy>.features-container>.feature>.oneclickbookmarking>.right"
- _speed_image = \
- "css=.mozilla-video-control-overlay"
- _security_image = \
- "css=#advancedsecurity>.features-container>.column1>.feature>.right"
- _private_browsing_image = \
- "css=#advancedsecurity>.features-container>.column2>.feature>.right"
- _auto_update_image = \
- "css=#advancedsecurity>.features-container>.column3>.feature>.right"
- _addons_manager_image = \
- "css=#powerfulpersonalization>.features-container>.addons-manager>.right"
- personas_image = \
- "css=#powerfulpersonalization>.features-container>.column1>.feature>.right"
-
- @property
- def made_easy(self):
- return self.is_element_present(self._made_easy_locator)
-
- @property
- def high_performance(self):
- return self.is_element_present(self._high_performance_locator)
-
- @property
- def advanced_security(self):
- return self.is_element_present(self._advanced_security_locator)
-
- @property
- def powerful_personalization(self):
- return self.is_element_present(self._powerful_personalization_locator)
-
- @property
- def universal_access(self):
- return self.is_element_present(self._universal_access_locator)
-
- @property
- def cutting_edge(self):
- return self.is_element_present(self._cutting_edge_locator)
-
- @property
- def made_easy_img(self):
- return self.is_element_present(self._made_easy_image)
-
- @property
- def app_tabs_img(self):
- return self.is_element_present(self._app_tabs_image)
-
- @property
- def switch_tab_img(self):
- return self.is_element_present(self._switch_tab_image)
-
- @property
- def panorama_img(self):
- return self.is_element_present(self._panorama_image)
-
- @property
- def sync_img(self):
- return self.is_element_present(self._sync_image)
-
- @property
- def easy_search_img(self):
- return self.is_element_present(self._easy_search_image)
-
- @property
- def one_bookmark_img(self):
- return self.is_element_present(self._one_bookmark_image)
-
- @property
- def speed_img(self):
- return self.is_element_present(self._speed_image)
-
- @property
- def security_img(self):
- return self.is_element_present(self._security_image)
-
- @property
- def private_browsing_img(self):
- return self.is_element_present(self._private_browsing_image)
-
- @property
- def auto_update_img(self):
- return self.is_element_present(self._auto_update_image)
View
35 pages/desktop/localization.py
@@ -0,0 +1,35 @@
+from selenium.webdriver.common.by import By
+from pages.desktop.base import Base
+
+
+class Localization(Base):
+ _released_languages_locator = (By.CSS_SELECTOR, '#languages table.downloads')
+ _beta_languages_locator = (By.CSS_SELECTOR, '#beta_versions table.downloads')
+ _language_locator = (By.CSS_SELECTOR, 'tbody tr')
+ _windows_download_link = (By.CSS_SELECTOR, 'td a.download-windows')
+ _osx_download_link = (By.CSS_SELECTOR, 'td a.download-osx')
+ _linux_download_link = (By.CSS_SELECTOR, 'td a.download-linux')
+
+ def go_to_page(self):
+ self.open('/firefox/all.html')
+
+ def get_language_properties(self, table_locator):
+ languages = []
+ table = self.selenium.find_element(*table_locator)
+ for language in table.find_elements(*self._language_locator):
+ language_properties = {} #dictionary to hold language properties
+ language_properties['id'] = language.get_attribute('id')
+ language_properties['windows_url'] = language.find_element(*self._windows_download_link).get_attribute('href')
+ language_properties['osx_url'] = language.find_element(*self._osx_download_link).get_attribute('href')
+ language_properties['linux_url'] = language.find_element(*self._linux_download_link).get_attribute('href')
+ languages.append(language_properties)
+ return languages
+
+ @property
+ def get_released_languages(self):
+ return self.get_language_properties(self._released_languages_locator)
+
+ @property
+ def get_beta_languages(self):
+ return self.get_language_properties(self._beta_languages_locator)
+
View
47 pages/desktop/mission.py
@@ -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 pages.desktop.base import Base
+from selenium.webdriver.common.by import By
+
+
+class Mission(Base):
+
+ major_links_list = [
+ {
+ 'locator': (By.CSS_SELECTOR, '#main-content div.main a'),
+ 'url_suffix': '/about/manifesto.html',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#main-content ul.links li:nth-child(1) a'),
+ 'url_suffix': '/contribute/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#main-content ul.links li:nth-child(2) a'),
+ 'url_suffix': '/about/history.html',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#main-content ul.links li:nth-child(3) a'),
+ 'url_suffix': '/about/forums/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#main-content ul.links li:nth-child(4) a'),
+ 'url_suffix': '/about/governance.html',
+ }
+ ]
+
+ _video_sources_locator = (By.CSS_SELECTOR, 'video source')
+ _video_overlay_locator = (By.CSS_SELECTOR, '.mozilla-video-control-overlay')
+
+ def go_to_page(self):
+ self.open('/mission/')
+
+ @property
+ def is_video_overlay_visible(self):
+ return self.is_element_visible(*self._video_overlay_locator)
+
+ @property
+ def video_sources_list(self):
+ srcs = []
+ for source in self.selenium.find_elements(*self._video_sources_locator):
+ srcs.append(source.get_attribute('src'))
+ return srcs
View
37 pages/desktop/mozillabased.py
@@ -0,0 +1,37 @@
+#!/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 MozillaBasedPage(Base):
+ _productlist_locator = (By.CSS_SELECTOR, '.productlist')
+ _product_locator = (By.CSS_SELECTOR, 'li > h3 > a')
+ _logo_locator = (By.CSS_SELECTOR, 'img')
+ _billboard_locator = (By.CSS_SELECTOR, '#featured.billboard')
+
+ def go_to_page(self):
+ self.open('/projects/mozilla-based/')
+
+ def get_product_properties(self, unorderedlist_locator):
+ products = []
+ unorderedlist = self.selenium.find_element(*unorderedlist_locator)
+ for product in unorderedlist.find_elements(*self._product_locator):
+ product_properties = {}
+ product_properties['text'] = product.get_attribute('text')
+ product_properties['url'] = product.get_attribute('href')
+ product_properties['logo'] = \
+ product.find_element(*self._logo_locator).get_attribute('src')
+ products.append(product_properties)
+ return products
+
+ @property
+ def get_product_list(self):
+ return self.get_product_properties(self._productlist_locator)
+
+ @property
+ def get_billboard_product_list(self):
+ return self.get_product_properties(self._billboard_locator)
View
111 pages/desktop/newsletter.py
@@ -1,111 +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.base import MozillaBasePage
-
-
-class NewsletterPage(MozillaBasePage):
-
- _email_sel = "css=.email"
- _agree_to_privacy_policy_checkbox_sel = "css=.privacy-check"
- _submit_button_sel = "css=#content input[name=submit]"
- _privacy_policy_error_sel = "css=.privacy-field.field-error"
- _success_pane_sel = "css=.success-pane"
-
- def go_to_newsletter_page(self, url='/en-US/newsletter/'):
- self.selenium.open(url)
-
- def type_email(self, email):
- self.selenium.type(self._email_sel, email)
-
- def agree_to_privacy_policy(self):
- self.selenium.check(self._agree_to_privacy_policy_checkbox_sel)
-
- def click_sign_me_up(self):
- self.selenium.click(self._submit_button_sel)
- self.selenium.wait_for_page_to_load(self.timeout)
-
- @property
- def is_privacy_policy_error_visible(self):
- return self.is_element_visible(self._privacy_policy_error_sel)
-
- @property
- def is_success_visible(self):
- return self.is_element_visible(self._success_pane_sel)
-
-
-class MainNewsletterPage(NewsletterPage):
-
- _other_newsletters_sel = "css=#other-newsletters"
-
- @property
- def is_success_visible(self):
- return self.is_element_visible(self._other_newsletters_sel)
-
-
-class OtherNewsletterPage(MozillaBasePage):
-
- _email_sel = "css=input[name=email]"
- _country_sel = "css=select[name=country]"
- _lang_sel = "css=select[name=lang]"
- _mozilla_and_you_sel = "css=input[name=mozilla-and-you]"
- _submit_sel = "css=input[name=submit]"
- _form_sel = "css=#content form"
-
- def goto_page(self, email, country, lang, format):
- self._format_sel = 'css=input[name=format][value=%s]' % format
- self.selenium.open('/en-US/newsletter/new/?email=%s&country=%s&lang=%s&format=%s'
- % (email, country, lang, format))
-
- def get_email(self):
- return self.selenium.get_value(self._email_sel)
-
- def get_country(self):
- return self.selenium.get_value(self._country_sel)
-
- def get_lang(self):
- return self.selenium.get_value(self._lang_sel)
-
- def get_format(self):
- return (self.selenium.get_value(self._format_sel) == 'on' and
- self.selenium.get_attribute(self._format_sel + '@value'))
-
- def click_submit(self):
- self.selenium.click(self._submit_sel)
- self.selenium.wait_for_page_to_load(self.timeout)
-
- @property
- def is_mozilla_and_you_selected(self):
- return self.selenium.get_value(self._mozilla_and_you_sel) == 'on'
-
- @property
- def is_form_visible(self):
- return self.selenium.is_element_present(self._form_sel)
-
- @property
- def is_success_visible(self):
- return (self.selenium.is_text_present('thank') or
- self.selenium.is_text_present('Thank'))
-
-
-class FooterNewsletterPage(NewsletterPage):
-
- _form_pane_sel = 'css=#sub-footer .form-pane'
- _open_button_sel = 'css=#sub-footer a.email-open'
- _email_sel = "css=#sub-footer .email"
- _agree_to_privacy_policy_checkbox_sel = "css=#sub-footer .privacy-check"
- _submit_button_sel = "css=#sub-footer input[name=submit]"
- _privacy_policy_error_sel = "css=#sub-footer .privacy-field .field-error"
- _success_pane_sel = "css=#sub-footer .success-pane"
-
- def go_to_newsletter_page(self):
- self.selenium.open('/en-US/firefox/features/')
-
- def click_open_button(self):
- self.selenium.click(self._open_button_sel)
-
- @property
- def is_form_pane_visible(self):
- return self.selenium.is_visible(self._form_pane_sel)
View
30 pages/desktop/notes.py
@@ -0,0 +1,30 @@
+#!/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 selenium.webdriver.common.by import By
+
+
+class Notes(Base):
+
+ _firefox_notes_header_locator = (By.CSS_SELECTOR, '#main-feature > h2')
+
+ def go_to_page(self):
+ self.open('/firefox/notes/')
+
+ @property
+ def firefox_notes_header_text(self):
+ return self.selenium.find_element(*self._firefox_notes_header_locator).text
+
+ @property
+ def all_links(self):
+ current_url = self.selenium.current_url
+ urls = []
+ links = self.selenium.find_elements(By.TAG_NAME, 'a')
+ for link in links:
+ href = link.get_attribute('href')
+ if len(href) > 0 and href not in urls and current_url not in href:
+ urls.append(href)
+ return urls
View
42 pages/desktop/performance.py
@@ -3,28 +3,40 @@
# 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.base import MozillaBasePage
+from pages.desktop.base import Base
+from selenium.webdriver.common.by import By
-class PerformancePage(MozillaBasePage):
+class Performance(Base):
- _perf_web = "css=#perf-web"
- _perf_hardware = "css=#perf-hardware"
- _perf_hardware_img = "css=#hardware>.section-image"
- _video_overlay = "css=.mozilla-video-control-overlay"
+ _perf_hardware_img_locator = (By.CSS_SELECTOR, "#hardware > .row > .span7 > img")
+ _video_overlay_locator = (By.CSS_SELECTOR, ".mozilla-video-control-overlay")
+ _video_sources_locator = (By.CSS_SELECTOR, 'video source')
- @property
- def perf_web_ico(self):
- return self.is_element_present(self._perf_web)
+ def go_to_page(self):
+ self.open("/firefox/performance/")
+
+ billboard_links_list = [
+ {
+ 'locator': (By.CSS_SELECTOR, '.menu-bar.billboard > ul > li:nth-of-type(1) > a'),
+ 'url_suffix': '#web',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '.menu-bar.billboard > ul > li:nth-of-type(2) > a'),
+ 'url_suffix': '#hardware',
+ }
+ ]
@property
- def perf_hardware_ico(self):
- return self.is_element_present(self._perf_hardware)
+ def perf_hardware_img_src(self):
+ return self.selenium.find_element(*self._perf_hardware_img_locator).get_attribute('src')
@property
- def perf_hardware_img(self):
- return self.is_element_present(self._perf_hardware_img)
+ def is_video_overlay_visible(self):
+ return self.is_element_present(*self._video_overlay_locator)
@property
- def video_overlay(self):
- return self.is_element_present(self._video_overlay)
+ def video_sources_list(self):
+ srcs = []
+ for source in self.selenium.find_elements(*self._video_sources_locator):
+ srcs.append(source.get_attribute('src'))
+ return srcs
View
137 pages/desktop/products.py
@@ -0,0 +1,137 @@
+#!/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 ProductsPage(Base):
+
+ def go_to_page(self):
+ self.open('/products/')
+
+ product_nav_links_list = [
+ {
+ 'locator': (By.CSS_SELECTOR, '#products-nav li:nth-child(1) a'),
+ 'url_suffix': '/products/#products',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#products-nav li:nth-child(2) a'),
+ 'url_suffix': '/products/#innovations',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#products-nav li:nth-child(3) a'),
+ 'url_suffix': '/products/#tools',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#products-nav li:nth-child(4) a'),
+ 'url_suffix': '/products/#platforms',
+ }
+ ]
+
+ images_list = [
+ {
+ 'locator': (By.CSS_SELECTOR, '#products li:nth-child(1) a img'),
+ 'img_name_suffix': 'badge-firefox.jpg',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#products li:nth-child(2) a img'),
+ 'img_name_suffix': 'badge-firefoxos.jpg',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#products li:nth-child(3) a img'),
+ 'img_name_suffix': 'badge-marketplace.jpg',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#products li:nth-child(4) a img'),
+ 'img_name_suffix': 'badge-persona.jpg',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#products li:nth-child(5) a img'),
+ 'img_name_suffix': 'badge-thunderbird.jpg',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#products li:nth-child(6) a img'),
+ 'img_name_suffix': 'badge-webmaker.jpg',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#innovations li:nth-child(1) a img'),
+ 'img_name_suffix': 'badge-webfwd.jpg',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#innovations li:nth-child(2) a img'),
+ 'img_name_suffix': 'badge-labs.jpg',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#innovations li:nth-child(3) a img'),
+ 'img_name_suffix': 'badge-pancake.jpg',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#tools li:nth-child(1) a img'),
+ 'img_name_suffix': 'badge-tools.jpg',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#tools li:nth-child(2) a img'),
+ 'img_name_suffix': 'badge-bugzilla.jpg',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#tools li:nth-child(3) a img'),
+ 'img_name_suffix': 'badge-firebug.jpg',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#platforms li:nth-child(1) a img'),
+ 'img_name_suffix': 'badge-gecko.jpg',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#platforms li:nth-child(2) a img'),
+ 'img_name_suffix': 'badge-xulrunner.jpg',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#platforms li:nth-child(3) img'),
+ 'img_name_suffix': 'badge-reserved.jpg',
+ }
+ ]
+
+ products_links_list = [
+ {
+ 'locator': (By.CSS_SELECTOR, '#products li:nth-child(1) a'),
+ 'url_suffix': '/firefox/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#products li:nth-child(2) a'),
+ 'url_suffix': '/firefoxos/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#products li:nth-child(3) a'),
+ 'url_suffix': '/apps/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#products li:nth-child(4) a'),
+ 'url_suffix': '/persona/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#products li:nth-child(5) a'),
+ 'url_suffix': '/thunderbird/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#products li:nth-child(6) a'),
+ 'url_suffix': 'webmaker.org/',
+ }
+ ]
+
+ innovations_links_list = [
+ {
+ 'locator': (By.CSS_SELECTOR, '#innovations li:nth-child(1) a'),
+ 'url_suffix': 'webfwd.org/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#innovations li:nth-child(2) a'),
+ 'url_suffix': 'mozillalabs.com/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#innovations li:nth-child(3) a'),
+ 'url_suffix': 'wiki.mozilla.org/Pancake',
+ }
+ ]
+
+ tools_links_list = [
+ {
+ 'locator': (By.CSS_SELECTOR, '#tools li:nth-child(1) a'),
+ 'url_suffix': '/Tools/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#tools li:nth-child(2) a'),
+ 'url_suffix': 'www.bugzilla.org/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#tools li:nth-child(3) a'),
+ 'url_suffix': 'getfirebug.com/',
+ }
+ ]
+
+ platforms_links_list = [
+ {
+ 'locator': (By.CSS_SELECTOR, '#platforms li:nth-child(1) a'),
+ 'url_suffix': '/Gecko',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#platforms li:nth-child(2) a'),
+ 'url_suffix': '/XULRunner',
+ }
+ ]
View
104 pages/desktop/security.py
@@ -3,48 +3,74 @@
# 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.base import MozillaBasePage
+from selenium.webdriver.common.by import By
+from pages.desktop.base import Base
-class SecurityPage(MozillaBasePage):
+class Security(Base):
- _protecting_privacy_ico = "css=#security-privacy"
- _browser_security_ico = "css=#security-secure"
- _in_control_ico = "css=#security-control"
- _mission_ico = "css=#security-mission"
- _privacy_img = "css=#privacy>.section-image>img"
- _browser_security_img = "css=#secure>.section-image>img"
- _control_img = "css=#control>.section-image>img"
- _mission_img = "css=#mission>.section-image>img"
+ billboard_links_list = [
+ {
+ 'locator': (By.CSS_SELECTOR, '.menu-bar.billboard > ul > li:nth-of-type(1) > a'),
+ 'url_suffix': '#privacy',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '.menu-bar.billboard > ul > li:nth-of-type(2) > a'),
+ 'url_suffix': '#secure',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '.menu-bar.billboard > ul > li:nth-of-type(3) > a'),
+ 'url_suffix': '#control',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '.menu-bar.billboard > ul > li:nth-of-type(4) > a'),
+ 'url_suffix': '#mission',
+ }
+ ]
- @property
- def protecting_privacy_ico(self):
- return self.is_element_present(self._protecting_privacy_ico)
+ section_links_list = [
+ {
+ 'locator': (By.CSS_SELECTOR, '#privacy > .row > .section-list.span3 > li:nth-of-type(1) > p > a'),
+ 'url_suffix': 'support.mozilla.org/kb/how-do-i-stop-websites-tracking-me',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#privacy > .row > .section-list.span3 > li:nth-of-type(2) > p > a'),
+ 'url_suffix': 'support.mozilla.org/kb/Private%20Browsing',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#privacy > .row > .section-list.span3 > li:nth-of-type(3) > p > a'),
+ 'url_suffix': 'support.mozilla.org/kb/Clear%20Recent%20History',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#privacy > .row > .section-list.span3 > li:nth-of-type(4) > p > a'),
+ 'url_suffix': 'support.mozilla.org/kb/Clear%20Recent%20History#w_how-do-i-remove-a-single-website-from-my-history',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#secure > .row > .section-list.span3 > li:nth-of-type(1) > p > a'),
+ 'url_suffix': 'support.mozilla.org/kb/Site%20Identity%20Button',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#control > .row > .section-list.span3 > li:nth-of-type(1) > p > a'),
+ 'url_suffix': '/plugincheck/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#control > .row > .section-list.span3 > li:nth-of-type(3) > p > a'),
+ 'url_suffix': 'support.mozilla.org/kb/Options%20window%20-%20Security%20panel'
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#mission > .row > .section-list.span3 > li:nth-of-type(1) > p > a'),
+ 'url_suffix': '/legal/privacy/firefox.html',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#mission > .row > .section-list.span3 > li:nth-of-type(2) > p > a'),
+ 'url_suffix': '/about/mission.html',
+ }
+ ]
- @property
- def browser_security_ico(self):
- return self.is_element_present(self._browser_security_ico)
+ images_list = [
+ {
+ 'locator': (By.CSS_SELECTOR, '#privacy > .row > .section-image > .platform-img.js'),
+ 'img_name_contains': 'screenshot-privacy',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#secure > .row > .section-image > .platform-img.js'),
+ 'img_name_contains': 'screenshot-anti-malware',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#control > .row > .section-image > .platform-img.js'),
+ 'img_name_contains': 'screenshot-plugins',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '#mission > .row > .section-image.span4 > img'),
+ 'img_name_contains': 'community',
+ }
+ ]
- @property
- def in_control_ico(self):
- return self.is_element_present(self._in_control_ico)
-
- @property
- def mission_ico(self):
- return self.is_element_present(self._mission_ico)
-
- @property
- def privacy_img(self):
- return self.is_element_present(self._privacy_img)
-
- @property
- def browser_security_img(self):
- return self.is_element_present(self._browser_security_img)
-
- @property
- def control_img(self):
- return self.is_element_present(self._control_img)
-
- @property
- def mission_img(self):
- return self.is_element_present(self._mission_img)
+ def go_to_page(self):
+ self.open('/firefox/security/')
View
46 pages/desktop/sms.py
@@ -0,0 +1,46 @@
+#!/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.ui import WebDriverWait
+from pages.desktop.base import Base
+
+
+class SMS(Base):
+
+ def go_to_page(self):
+ self.open('/firefox/sms/')
+
+ _send_link_button = (By.CSS_SELECTOR, '.button.arrow')
+ _google_play_link = (By.CSS_SELECTOR, '.also a')
+ _sms_confirmation = (By.CSS_SELECTOR, '.large')
+ _phone_textbox = (By.CSS_SELECTOR, '#number')
+
+ info_links_list = [
+ {
+ 'locator': (By.CSS_SELECTOR, '.more p:nth-child(1) a'),
+ 'url_suffix': '/firefox/mobile/platforms/',
+ }, {
+ 'locator': (By.CSS_SELECTOR, '.more p:nth-child(2) a'),
+ 'url_suffix': '/firefox/mobile/features/',
+ }
+ ]
+
+ @property
+ def is_textbox_visible(self):
+ return self.is_element_visible(*self._phone_textbox)
+
+ @property
+ def is_google_play_link_visible(self):
+ return self.is_element_visible(*self._google_play_link)
+
+ def submit_sms_form(self, user='default'):
+ credentials = self.testsetup.credentials[user]
+ phonetextbox = self.selenium.find_element(*self._phone_textbox)
+ phonetextbox.send_keys(credentials['phone'])
+ self.selenium.find_element(*self._send_link_button).click()
+ WebDriverWait(self.selenium, self.timeout).until(lambda s: s.find_element(*self._sms_confirmation))
+ return self.is_element_visible(*self._sms_confirmation)
View
185 pages/desktop/technology.py
@@ -3,145 +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 pages.base import MozillaBasePage
-
-
-class TechnologyPage(MozillaBasePage):
-
- _innovation_btn = "css=#tech-html5"
- _css_btn = "css=#tech-css"
- _api_btn = "css=#tech-apis"
- _dev_btn = "css=#tech-tools"
- _svg_btn = "css=#tech-svg"
- _security_btn = "css=#tech-security"
- _rollover_btn = "css=#click-star>span"
-
- _section_html5 = "css=#html5"
- _section_css = "css=#css"
- _section_api = "css=#apis"
- _section_tools = "css=#tools"
- _section_svg = "css=#svg"
- _section_security = "css=#security"
-
- _html5_forms = "css=#html5>article:nth-of-type(1)>h1"
- _html5_parser = "css=#html5>article:nth-of-type(3)>h1"
- _html5_webm = "css=#html5>article:nth-of-type(4)>h1"
- _html5_video = "css=#html5>article:nth-of-type(5)>h1"
- _html5_videop = "css=#html5>article:nth-of-type(6)>h1"
- _html5_history = "css=#html5>article:nth-of-type(7)>h1"
-
- _css_transitions = "css=#css>article:nth-of-type(1)>h1"
- _css_calc = "css=#css>article:nth-of-type(2)>h1"
- _css_any = "css=#css>article:nth-of-type(3)>h1"
- _css_element = "css=#css>article:nth-of-type(4)>h1"
- _css_placeholder = "css=#css>article:nth-of-type(5)>h1"
- _css_border = "css=#css>article:nth-of-type(6)>h1"
- _css_boxshadow = "css=#css>article:nth-of-type(7)>h1"
- _css_font = "css=#css>article:nth-of-type(8)>h1"
- _css_units = "css=#css>article:nth-of-type(9)>h1"
- _css_unit = "css=#css>article:nth-of-type(10)>h1"
- _css_device = "css=#css>article:nth-of-type(11)>h1"
- _css_tabsize = "css=#css>article:nth-of-type(12)>h1"
- _css_focusring = "css=#css>article:nth-of-type(13)>h1"
- _css_image_rect = "css=#css>article:nth-of-type(14)>h1"
- _css_resizeable = "css=#css>article:nth-of-type(15)>h1"
-
- _api_ecmascript = "css=#apis>article:nth-of-type(1)>h1"
- _api_webgl = "css=#apis>article:nth-of-type(2)>h1"
- _api_csupport = "css=#apis>article:nth-of-type(3)>h1"
- _api_slice = "css=#apis>article:nth-of-type(4)>h1"
- _api_fileapi = "css=#apis>article:nth-of-type(5)>h1"
- _api_touchevents = "css=#apis>article:nth-of-type(6)>h1"
- _api_click = "css=#apis>article:nth-of-type(7)>h1"
- _api_indexeddb = "css=#apis>article:nth-of-type(8)>h1"
- _api_formdata = "css=#apis>article:nth-of-type(9)>h1"
- _api_canvas = "css=#apis>article:nth-of-type(10)>h1"
- _api_audio = "css=#apis>article:nth-of-type(11)>h1"
-
- _dev_webconsole = "css=#tools>article:nth-of-type(1)>h1"
- _dev_firebug = "css=#tools>article:nth-of-type(2)>h1"
-
- _svg_animation = "css=#svg>article:nth-of-type(1)>h1"
- _svg_backgrounds = "css=#svg>article:nth-of-type(2)>h1"
-
- _security_csp = "css=#security>article:nth-of-type(1)>h1"
- _security_xframe = "css=#security>article:nth-of-type(2)>h1"
- _security_hsts = "css=#security>article:nth-of-type(3)>h1"
- _security_cors = "css=#security>article:nth-of-type(4)>h1"
- _security_visited = "css=#security>article:nth-of-type(5)>h1"
-
- @property
- def innovation_button(self):
- return self.is_element_present(self._innovation_btn)
-
- @property
- def css_button(self):
- return self.is_element_present(self._css_btn)
-
- @property
- def api_button(self):
- return self.is_element_present(self._api_btn)
-
- @property
- def dev_button(self):
- return self.is_element_present(self._dev_btn)
-
- @property
- def svg_button(self):
- return self.is_element_present(self._svg_btn)