Permalink
Browse files

Code review update

save the author to self.author as part of init
  • Loading branch information...
1 parent 70abfd3 commit 7b79ce390d4dddef9554b7d1757ab67ad0e95da4 @teodosia teodosia committed Oct 4, 2012
Showing with 15 additions and 4 deletions.
  1. +11 −2 pages/author.py
  2. +4 −2 tests/test_profile.py
View
@@ -5,16 +5,25 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+from selenium.webdriver.common.by import By
+
from base import BasePage
class AuthorPage(BasePage):
_page_title = u"Posts by %s | QMO \u2013 quality.mozilla.org"
- def go_to_author_page(self, author):
- self.selenium.get(self.testsetup.base_url + '/author/' + author)
+ _posted_by_locator = (By.CSS_SELECTOR, 'div.entry-meta .vcard > a')
+
+ def go_to_author_page(self):
+ self.selenium.get(self.testsetup.base_url + '/author/' + self.author)
def __init__(self, testsetup, author):
BasePage.__init__(self, testsetup)
self._page_title = self._page_title % author
+ self.author = author
+
+ @property
+ def posted_by(self):
+ return self.selenium.find_elements(*self._posted_by_locator)
View
@@ -14,9 +14,11 @@
class TestUserRegistration:
@pytest.mark.nondestructive
- def test_that_user_profile(self, mozwebqa):
+ def test_that_accessing_author_profile_works(self, mozwebqa):
author_name = "rbillings"
author_page = AuthorPage(mozwebqa, author_name)
- author_page.go_to_author_page(author_name)
+ author_page.go_to_author_page()
+
Assert.true(author_page.is_the_current_page)
+ Assert.greater(len(author_page.posted_by), 0)

0 comments on commit 7b79ce3

Please sign in to comment.