Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Test to ensure that user-profiles are working #29

Merged
merged 3 commits into from Oct 9, 2012

Conversation

Projects
None yet
5 participants
Contributor

bebef1987 commented Oct 1, 2012

can we add more straight to this test

assert that the articles shown are from that author
assert the name is present on the page title
etc.

@klrmn klrmn and 1 other commented on an outdated diff Oct 1, 2012

pages/author.py
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+
+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)
+
+ def __init__(self, testsetup, author):
+ BasePage.__init__(self, testsetup)
+ self._page_title = self._page_title % author
@klrmn

klrmn Oct 1, 2012

Contributor

why not save the author to self.author as part of init, so that you won't have to specify it in go_to_author_page, just take it from self.author

@teodosia

teodosia Oct 4, 2012

Contributor

Done.

@klrmn klrmn commented on the diff Oct 1, 2012

pages/author.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 AuthorPage(BasePage):
+
+ _page_title = u"Posts by %s | QMO \u2013 quality.mozilla.org"
@klrmn

klrmn Oct 1, 2012

Contributor

is is_the_current_page going to know how to fill in that %s?

@teodosia

teodosia Oct 2, 2012

Contributor

The %s is filled in the init

@teodosia teodosia Code review update
save the author to self.author as part of init
7b79ce3

@AlinT AlinT commented on an outdated diff Oct 8, 2012

tests/test_profile.py
+
+import pytest
+from unittestzero import Assert
+
+from pages.author import AuthorPage
+
+
+class TestUserRegistration:
+
+ @pytest.mark.nondestructive
+ def test_that_accessing_author_profile_works(self, mozwebqa):
+ author_name = "rbillings"
+
+ author_page = AuthorPage(mozwebqa, author_name)
+ author_page.go_to_author_page()
+
@AlinT

AlinT Oct 8, 2012

Contributor

blank line contains whitespace

Contributor

AlinT commented Oct 8, 2012

Beside the pep8 comment the pull looks good to me!
I only wonder if the Assert.greater is enough, or should we also test for other stuff on the author page?

Contributor

teodosia commented Oct 8, 2012

@AlinT The title contains the name of the author and that is checked in is_the_current_page. The purpose of the test was to check that the page doesn't return Internal Server Error (bug 758285), but I'm happy to add other checks if that's needed.

Contributor

zacc commented Oct 9, 2012

LGTM, I'll merge it in.

@zacc zacc pushed a commit that referenced this pull request Oct 9, 2012

zacc Merge pull request #29 from teodosia/user-profile
Test to ensure that user-profiles are working
b50d601

@zacc zacc merged commit b50d601 into mozilla:master Oct 9, 2012

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