Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'media_page'

Conflicts:
	pages/docs.py
	pages/regions/header.py
	tests/test_docs.py
  • Loading branch information...
commit 35415e835c099928e769b8fee0f96a0826dcb4a2 2 parents 475faf0 + cf8d9a7
@rbillings rbillings authored
View
1  .gitignore
@@ -3,3 +3,4 @@
*.tmproj
*.komodoproject
results*
+tests/build
View
9 pages/docs.py
@@ -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
4 pages/home.py
@@ -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
20 pages/media.py
@@ -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
7 pages/regions/header.py
@@ -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
1  tests/test_docs.py
@@ -7,7 +7,6 @@
from unittestzero import Assert
from pages.docs import DocsPage
-
from pages.home import HomePage
View
19 tests/test_media.py
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.