Added Events page test #19

Merged
merged 4 commits into from Jun 1, 2012

Conversation

Projects
None yet
4 participants
Collaborator

rbillings commented May 7, 2012

No description provided.

@zacc zacc and 1 other commented on an outdated diff May 8, 2012

pages/events.py
+# 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
+
+ @property
+ def is_page_title_correct(self):
@zacc

zacc May 8, 2012

Contributor

Did you mean to add an assertion for this in the test?

@rbillings

rbillings May 8, 2012

Collaborator

Yes, that assertion was also in the docs.py and media.py and I was making them match. If it needs to be removed then I'll remove it from all three.

@zacc

zacc May 9, 2012

Contributor

OK. this method is exactly the same as: https://github.com/mozilla/qmo-tests/blob/master/page.py#L20 so it's duplicated code.

We have that one in page.py so we can access it anywhere.

@zacc

zacc May 9, 2012

Contributor

PS don't worry about removing it from the other pages just yet. It should be done in a separate pull to keep the pressure off this pull. Or better, pop it in the pivotal as a refactoring task and someone can pick it up and do it :)

Collaborator

rbillings commented May 24, 2012

If someone could check this I would appreciate it.

@AlinT AlinT commented on an outdated diff May 30, 2012

pages/regions/header.py
_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)
+
@AlinT

AlinT May 30, 2012

Contributor

blank line contains whitespace

@AlinT AlinT commented on an outdated diff May 30, 2012

tests/test_events.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.events import MediaPage
@AlinT

AlinT May 30, 2012

Contributor

You should import EventsPage, instead of MediaPage

Contributor

AlinT commented May 30, 2012

In pages/regions/header there are several white spaces before each of # of the MPL2 licence.This is also happening in several other pages.
If you can please remove them, if not leave them be and will make a future pull with this refactoring task.

@AlinT AlinT commented on the diff May 30, 2012

tests/test_events.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.events import MediaPage
+from pages.home import HomePage
+
+
+class TestEventsPage:
+
@AlinT

AlinT May 30, 2012

Contributor

You need to add the nondestructive mark for this test:
@pytest.mark.nondestructive
I've seen this mark is not used in other tests, is this intended or why is that?

@rbillings

rbillings May 30, 2012

Collaborator

AlinT: They weren't added because the tests were written prior to the introduction of the nondestructive marks- I'll fix that.

Contributor

AlinT commented May 31, 2012

This is a "by the book" pull!:)
Lgtm!

Contributor

klrmn commented Jun 1, 2012

LGTM

klrmn merged commit 3bad4d0 into mozilla:master Jun 1, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment