Permalink
Browse files

Merge pull request #18 from rbillings/media_page

Media page
  • Loading branch information...
2 parents 475faf0 + 35415e8 commit bd47a3873c74d2305c1d428b326f425c324b4af9 @m8ttyB m8ttyB committed May 7, 2012
Showing with 54 additions and 7 deletions.
  1. +1 −0 .gitignore
  2. +6 −3 pages/docs.py
  3. +2 −2 pages/home.py
  4. +20 −0 pages/media.py
  5. +6 −1 pages/regions/header.py
  6. +0 −1 tests/test_docs.py
  7. +19 −0 tests/test_media.py
View
@@ -3,3 +3,4 @@
*.tmproj
*.komodoproject
results*
+tests/build
View
@@ -8,9 +8,12 @@
class DocsPage(BasePage):
-
- _page_title = u"Docs | QMO \u2013 quality.mozilla.org"
+ _page_title = u'Docs | QMO \u2013 quality.mozilla.org'
def go_to_docs_page(self):
- self.selenium.get(self.testsetup.base_url + "/docs")
+ self.selenium.get(self.testsetup.base_url + '/docs')
self.is_the_current_page
+
+ @property
+ def is_page_title_correct(self):
+ return self.selenium.get_title() == self._page_title
View
@@ -9,8 +9,8 @@
class HomePage(BasePage):
- _page_title = u"QMO \u2013 quality.mozilla.org | The Home of Mozilla QA"
+ _page_title = u'QMO \u2013 quality.mozilla.org | The Home of Mozilla QA'
def go_to_home_page(self):
- self.selenium.get(self.testsetup.base_url + "/")
+ self.selenium.get(self.testsetup.base_url + '/')
self.is_the_current_page
View
@@ -0,0 +1,20 @@
+ #!/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 base import BasePage
+
+
+class MediaPage(BasePage):
+
+ _page_title = u'QMO Videos | QMO \u2013 quality.mozilla.org'
+
+ def go_to_media_page(self):
+ self.selenium.get(self.testsetup.base_url + '/media')
+ self.is_the_current_page
+
+ @property
+ def is_page_title_correct(self):
+ return self.selenium.get_title() == self._page_title
View
@@ -10,9 +10,14 @@
class HeaderRegion(Page):
-
+ _media_link_locator = (By.CSS_SELECTOR, '#nav-main li:nth-child(5) a')
_docs_link_locator = (By.CSS_SELECTOR, '#nav-main li:nth-child(6) a')
+ def click_media_link(self):
+ self.selenium.find_element(*self._media_link_locator).click()
+ from pages.media import MediaPage
+ return MediaPage(self.testsetup)
+
def click_docs_link(self):
self.selenium.find_element(*self._docs_link_locator).click()
from pages.docs import DocsPage
View
@@ -7,7 +7,6 @@
from unittestzero import Assert
from pages.docs import DocsPage
-
from pages.home import HomePage
View
@@ -0,0 +1,19 @@
+ #!/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 unittestzero import Assert
+
+from pages.media import MediaPage
+from pages.home import HomePage
+
+
+class TestMediaPage:
+
+ def test_media_title(self, mozwebqa):
+ home_page = HomePage(mozwebqa)
+ home_page.go_to_home_page()
+ media_page = home_page.header_region.click_media_link()
+ Assert.true(media_page.is_the_current_page)

0 comments on commit bd47a38

Please sign in to comment.