Skip to content

Commit

Permalink
Merge pull request mozilla#19 from rbillings/eventspage
Browse files Browse the repository at this point in the history
Added Events page test
  • Loading branch information
klrmn committed Jun 1, 2012
2 parents bd47a38 + 287f192 commit 3bad4d0
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
16 changes: 16 additions & 0 deletions 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
6 changes: 6 additions & 0 deletions pages/regions/header.py
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions 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)

0 comments on commit 3bad4d0

Please sign in to comment.