Permalink
Browse files

Merge pull request #12 from zacc/master

Update plugin and tests
  • Loading branch information...
stephendonner committed Aug 2, 2012
2 parents 327e081 + 8a5b567 commit 48ec9e75f49f0eda05608f55d2125363f95829ea
Showing with 23 additions and 10 deletions.
  1. +2 −2 pages/page_object.py
  2. +6 −4 requirements.txt
  3. +5 −1 tests/test_file.py
  4. +8 −3 tests/test_nondestructive.py
  5. +2 −0 tests/test_xfail.py
View
@@ -17,8 +17,8 @@ class MySiteHomePage(Base):
_some_elements_locator = (By.CSS_SELECTOR, 'li .someElementsLocator')
# Demo locators
- _page_title = "Home of the Mozilla Project"
- _header_locator = (By.CSS_SELECTOR, '#header h1 a')
+ _page_title = u"Mozilla \u2014 Home of the Mozilla Project \u2014 mozilla.org"
+ _header_locator = (By.CSS_SELECTOR, 'h1')
@property
def header_text(self):
View
@@ -1,8 +1,10 @@
# This pulls in all the libraries needed to run Selenium tests
# on Mozilla WebQA projects
+PyYAML==3.10
+UnittestZero
+py==1.4.9
+pytest==2.2.4
+pytest-mozwebqa==1.0
+requests==0.13.3
selenium
-pytest==2.1.3
-pytest-xdist==1.6
-pytest-mozwebqa==0.7.1
-unittestzero==0.1.6
View
@@ -3,19 +3,23 @@
# 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.page_object import MySiteHomePage
class TestTemplate():
+ @pytest.mark.nondestructive
def test_load_baseurl_and_assert_header(self, mozwebqa):
'''
Demo Test - Verify Header is correct on Amo Page
'''
home_page = MySiteHomePage(mozwebqa)
home_page.go_to_home_page()
- Assert.equal(home_page.header_text, 'mozilla')
+ Assert.equal(home_page.header_text, 'We are')
+ @pytest.mark.nondestructive
def test_that_we_do_something_to_find_a_bug(self, mozwebqa):
pass
@@ -13,13 +13,18 @@ class TestNonDestructive():
@pytest.mark.nondestructive
def test_load_baseurl_nondestructive(self, mozwebqa):
- '''
+ """
This test is nondestructive - it does not write
to the database or leave a mark on the website
- '''
+ """
home_page = MySiteHomePage(mozwebqa)
home_page.go_to_home_page()
Assert.true(home_page.is_the_current_page)
- def test_that_we_do_something_to_find_a_bug(self, mozwebqa):
+ def test_load_baseurl_destructive(self, mozwebqa):
+ """
+ This test is *not* marked as nondestructive and
+ will be automatically skipped when run against
+ a sensitive (ie Production) URL
+ """
pass
View
@@ -11,6 +11,7 @@
class TestXfail():
+ @pytest.mark.nondestructive
@pytest.mark.xfail(reason='Header text is incorrect')
def test_load_baseurl_xfail(self, mozwebqa):
'''
@@ -21,6 +22,7 @@ def test_load_baseurl_xfail(self, mozwebqa):
home_page.go_to_home_page()
Assert.equal(home_page.header_text, 'BlaBla')
+ @pytest.mark.nondestructive
@pytest.mark.xfail
def test_that_we_do_something_to_find_a_bug(self, mozwebqa):
'''

0 comments on commit 48ec9e7

Please sign in to comment.