Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #19 from rbillings/eventspage

Added Events page test
  • Loading branch information...
commit 3bad4d0f5604b65f81ee8b93e1dde3e967145560 2 parents bd47a38 + 287f192
@klrmn klrmn authored
Showing with 43 additions and 0 deletions.
  1. +16 −0 pages/events.py
  2. +6 −0 pages/regions/header.py
  3. +21 −0 tests/test_events.py
View
16 pages/events.py
@@ -0,0 +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 base import BasePage
+
+
+class EventsPage(BasePage):
+
+ _page_title = u'Events | QMO \u2013 quality.mozilla.org'
+
+ def go_to_events_page(self):
+ self.selenium.get(self.testsetup.base_url + '/events')
+ self.is_the_current_page
View
6 pages/regions/header.py
@@ -10,9 +10,15 @@
class HeaderRegion(Page):
+ _events_link_locator = (By.CSS_SELECTOR, '#nav-main li:nth-child(4) a')
_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_events_link(self):
+ self.selenium.find_element(*self._events_link_locator).click()
+ from pages.events import EventsPage
+ return EventsPage(self.testsetup)
+
def click_media_link(self):
self.selenium.find_element(*self._media_link_locator).click()
from pages.media import MediaPage
View
21 tests/test_events.py
@@ -0,0 +1,21 @@
+#!/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.events import EventsPage
+from pages.home import HomePage
+
+
+class TestEventsPage:
+
+ @pytest.mark.nondestructive
+ def test_events_title(self, mozwebqa):
+ home_page = HomePage(mozwebqa)
+ home_page.go_to_home_page()
+ events_page = home_page.header_region.click_events_link()
+ Assert.true(events_page.is_the_current_page)
Please sign in to comment.
Something went wrong with that request. Please try again.