Permalink
Browse files

Merge pull request #123 from zacc/add_nondestructive_tags

Add nondestructive tags
  • Loading branch information...
2 parents a96bb11 + bfea47a commit 43c6a28ac3764828855edbec6092db4329d0ec9f @m8ttyB m8ttyB committed Apr 11, 2012
Showing with 50 additions and 11 deletions.
  1. +19 −1 tests/test_crash_reports.py
  2. +6 −1 tests/test_layout.py
  3. +18 −6 tests/test_search.py
  4. +5 −2 tests/test_smoke_tests.py
  5. +2 −1 tests/test_specific_versions.py
View
20 tests/test_crash_reports.py
@@ -16,6 +16,7 @@ class TestCrashReports:
_expected_products = ['Firefox', 'Thunderbird', 'SeaMonkey', 'Camino', 'Fennec', 'FennecAndroid']
+ @pytest.mark.nondestructive
@pytest.mark.parametrize(('product'), _expected_products)
def test_that_reports_form_has_same_product(self, mozwebqa, product):
csp = CrashStatsHomePage(mozwebqa)
@@ -26,6 +27,7 @@ def test_that_reports_form_has_same_product(self, mozwebqa, product):
crash_adu = csp.header.select_report('Crashes per User')
Assert.equal(crash_adu.header.current_product, crash_adu.product_select)
+ @pytest.mark.nondestructive
@pytest.mark.parametrize(('product'), _expected_products)
def test_that_current_version_selected_in_top_crashers_header(self, mozwebqa, product):
csp = CrashStatsHomePage(mozwebqa)
@@ -35,6 +37,7 @@ def test_that_current_version_selected_in_top_crashers_header(self, mozwebqa, pr
Assert.equal(product, cstc.page_heading_product)
Assert.equal(cstc.header.current_version, cstc.page_heading_version)
+ @pytest.mark.nondestructive
def test_that_top_crasher_filter_all_return_results(self, mozwebqa):
# https://bugzilla.mozilla.org/show_bug.cgi?id=678906
csp = CrashStatsHomePage(mozwebqa)
@@ -47,6 +50,7 @@ def test_that_top_crasher_filter_all_return_results(self, mozwebqa):
cstc.click_filter_by('All')
Assert.greater(cstc.results_count, 0)
+ @pytest.mark.nondestructive
def test_that_selecting_nightly_builds_loads_page_and_link_to_ftp_works(self, mozwebqa):
csp = CrashStatsHomePage(mozwebqa)
nightly_builds_page = csp.header.select_report('Nightly Builds')
@@ -60,6 +64,7 @@ def test_that_selecting_nightly_builds_loads_page_and_link_to_ftp_works(self, mo
nightly_builds_page.click_link_to_ftp()
Assert.equal(website_link, nightly_builds_page.get_url_current_page())
+ @pytest.mark.nondestructive
@pytest.mark.parametrize(('product'), _expected_products)
def test_that_products_page_links_work(self, mozwebqa, product):
products_page = ProductsLinksPage(mozwebqa)
@@ -70,6 +75,7 @@ def test_that_products_page_links_work(self, mozwebqa, product):
Assert.true(csp.get_url_current_page().endswith(product))
Assert.contains(product, csp.page_heading)
+ @pytest.mark.nondestructive
def test_that_top_crasher_filter_browser_return_results(self, mozwebqa):
# https://bugzilla.mozilla.org/show_bug.cgi?id=678906
csp = CrashStatsHomePage(mozwebqa)
@@ -82,6 +88,7 @@ def test_that_top_crasher_filter_browser_return_results(self, mozwebqa):
cstc.click_filter_by('Browser')
Assert.greater(cstc.results_count, 0)
+ @pytest.mark.nondestructive
def test_that_top_crasher_filter_plugin_return_results(self, mozwebqa):
# https://bugzilla.mozilla.org/show_bug.cgi?id=678906
csp = CrashStatsHomePage(mozwebqa)
@@ -94,7 +101,8 @@ def test_that_top_crasher_filter_plugin_return_results(self, mozwebqa):
cstc.click_filter_by('Plugin')
Assert.greater(cstc.results_count, 0)
- @xfail(reason='Disabled until Bug 603561 is fixed')
+ @pytest.mark.xfail(reason='Disabled until Bug 603561 is fixed')
+ @pytest.mark.nondestructive
def test_that_top_changers_is_highlighted_when_chosen(self, mozwebqa):
"""
Test for https://bugzilla.mozilla.org/show_bug.cgi?id=679229
@@ -107,6 +115,7 @@ def test_that_top_changers_is_highlighted_when_chosen(self, mozwebqa):
Assert.equal(cstc.header.current_report, 'Top Changers')
@pytest.mark.xfail(run=False, reason="Bug 721928 - We shouldn't let the user query /daily for dates past for which we don't have data")
+ @pytest.mark.nondestructive
def test_that_filtering_for_a_past_date_returns_results(self, mozwebqa):
"""
https://www.pivotaltracker.com/story/show/17141439
@@ -118,6 +127,7 @@ def test_that_filtering_for_a_past_date_returns_results(self, mozwebqa):
Assert.true(crash_per_user.is_table_visible)
Assert.equal('1995-01-01', crash_per_user.last_row_date_value)
+ @pytest.mark.nondestructive
@pytest.mark.parametrize(('product'), _expected_products)
def test_that_top_crashers_reports_links_work(self, mozwebqa, product):
"""
@@ -134,6 +144,7 @@ def test_that_top_crashers_reports_links_work(self, mozwebqa, product):
top_crasher_page.return_to_previous_page()
top_crashers = csp.release_channels
+ @pytest.mark.nondestructive
@pytest.mark.parametrize(('product'), _expected_products)
def test_the_product_releases_return_results(self, mozwebqa, product):
"""
@@ -149,6 +160,7 @@ def test_the_product_releases_return_results(self, mozwebqa, product):
top_crasher_page.return_to_previous_page()
top_crashers = csp.release_channels
+ @pytest.mark.nondestructive
def test_that_7_days_is_selected_default_for_nightlies(self, mozwebqa):
"""
https://www.pivotaltracker.com/story/show/17088605
@@ -159,6 +171,7 @@ def test_that_7_days_is_selected_default_for_nightlies(self, mozwebqa):
Assert.equal(tc_page.current_days_filter, '7')
+ @pytest.mark.nondestructive
def test_that_only_browser_reports_have_browser_icon(self, mozwebqa):
"""
https://www.pivotaltracker.com/story/show/17099455
@@ -171,6 +184,7 @@ def test_that_only_browser_reports_have_browser_icon(self, mozwebqa):
Assert.true(signature_item.is_browser_icon_visible, "Signature %s did not have a browser icon" % signature_item.text)
Assert.false(signature_item.is_plugin_icon_visible, "Signature %s unexpextedly had a plugin icon" % signature_item.text)
+ @pytest.mark.nondestructive
def test_that_only_plugin_reports_have_plugin_icon(self, mozwebqa):
"""
https://www.pivotaltracker.com/story/show/17099455
@@ -184,6 +198,7 @@ def test_that_only_plugin_reports_have_plugin_icon(self, mozwebqa):
Assert.true(signature_item.is_plugin_icon_visible, "Signature %s did not have a plugin icon" % signature_item.text)
Assert.false(signature_item.is_browser_icon_visible, "Signature %s unexpextedly had a browser icon" % signature_item.text)
+ @pytest.mark.nondestructive
@pytest.mark.xfail(reason="haven't found a subtitution for the is_alert_present() method yet")
def test_that_no_mixed_content_warnings_are_displayed(self, mozwebqa):
"""
@@ -196,6 +211,7 @@ def test_that_no_mixed_content_warnings_are_displayed(self, mozwebqa):
Assert.true(cpu.is_the_current_page)
Assert.false(cpu.is_mixed_content_warning_shown)
+ @pytest.mark.nondestructive
def test_that_lowest_version_topcrashers_do_not_return_errors(self, mozwebqa):
"""
https://bugzilla.mozilla.org/show_bug.cgi?id=655506
@@ -208,6 +224,7 @@ def test_that_lowest_version_topcrashers_do_not_return_errors(self, mozwebqa):
cstc.click_filter_by('Plugin')
Assert.not_equal(self, 'Unable to load data System error, please retry in a few minutes', cstc.page_heading)
+ @pytest.mark.nondestructive
def test_that_malformed_urls_on_query_do_not_return_500_error(self, mozwebqa):
"""
https://www.pivotaltracker.com/story/show/18059001
@@ -220,6 +237,7 @@ def test_that_malformed_urls_on_query_do_not_return_500_error(self, mozwebqa):
csas.filter_reports()
Assert.equal('No results were found.', csas.query_results_text(1))
+ @pytest.mark.nondestructive
def test_that_top_changers_data_is_available(self, mozwebqa):
"""
https://www.pivotaltracker.com/story/show/18059119
View
7 tests/test_layout.py
@@ -12,6 +12,7 @@
class TestLayout:
+ @pytest.mark.nondestructive
def test_that_products_are_sorted_correctly(self, mozwebqa):
csp = CrashStatsHomePage(mozwebqa)
@@ -20,25 +21,29 @@ def test_that_products_are_sorted_correctly(self, mozwebqa):
products = [product.text for product in csp.header.product_list]
Assert.equal(product_list, products)
- @xfail(reason='Bug 687841 - Versions in Navigation Bar appear in wrong order')
+ @pytest.mark.xfail(reason='Bug 687841 - Versions in Navigation Bar appear in wrong order')
+ @pytest.mark.nondestructive
def test_that_product_versions_are_ordered_correctly(self, mozwebqa):
csp = CrashStatsHomePage(mozwebqa)
Assert.is_sorted_descending(csp.header.current_versions)
Assert.is_sorted_descending(csp.header.other_versions)
+ @pytest.mark.nondestructive
def test_that_topcrasher_is_not_returning_http500(self, mozwebqa):
csp = CrashStatsHomePage(mozwebqa)
csp.selenium.get(mozwebqa.base_url + '/topcrasher')
tc = CrashStatsTopCrashers(mozwebqa)
Assert.contains('Top Crashers', tc.page_heading)
Assert.true(tc.results_found, 'No results found!')
+ @pytest.mark.nondestructive
def test_that_report_is_not_returning_http500(self, mozwebqa):
csp = CrashStatsHomePage(mozwebqa)
csp.selenium.get(mozwebqa.base_url + '/report')
Assert.contains('Page not Found', csp.page_heading)
+ @pytest.mark.nondestructive
def test_that_correlation_is_not_returning_http500(self, mozwebqa):
csp = CrashStatsHomePage(mozwebqa)
csp.selenium.get(mozwebqa.base_url + '/correlation')
View
24 tests/test_search.py
@@ -12,12 +12,14 @@
class TestSearchForIdOrSignature:
+ @pytest.mark.nondestructive
def test_that_when_item_not_available(self, mozwebqa):
csp = CrashStatsHomePage(mozwebqa)
results = csp.header.search_for_crash("this won't exist")
Assert.false(results.results_found)
+ @pytest.mark.nondestructive
def test_that_search_for_valid_signature(self, mozwebqa):
""".....
This is a test for
@@ -30,41 +32,47 @@ def test_that_search_for_valid_signature(self, mozwebqa):
result = csp.header.search_for_crash(signature)
Assert.true(result.results_found)
+ @pytest.mark.nondestructive
def test_that_advanced_search_for_firefox_can_be_filtered(self, mozwebqa):
csp = CrashStatsHomePage(mozwebqa)
cs_advanced = csp.header.click_advanced_search()
cs_advanced.filter_reports()
Assert.contains('product is one of Firefox', cs_advanced.query_results_text(0))
+ @pytest.mark.nondestructive
def test_that_advanced_search_for_thunderbird_can_be_filtered(self, mozwebqa):
csp = CrashStatsHomePage(mozwebqa)
csp.header.select_product('Thunderbird')
cs_advanced = csp.header.click_advanced_search()
cs_advanced.filter_reports()
Assert.contains('product is one of Thunderbird', cs_advanced.query_results_text(0))
+ @pytest.mark.nondestructive
def test_that_advanced_search_for_fennec_can_be_filtered(self, mozwebqa):
csp = CrashStatsHomePage(mozwebqa)
csp.header.select_product('Fennec')
cs_advanced = csp.header.click_advanced_search()
cs_advanced.filter_reports()
Assert.contains('product is one of Fennec', cs_advanced.query_results_text(0))
+ @pytest.mark.nondestructive
def test_that_advanced_search_for_camino_can_be_filtered(self, mozwebqa):
csp = CrashStatsHomePage(mozwebqa)
csp.header.select_product('Camino')
cs_advanced = csp.header.click_advanced_search()
cs_advanced.filter_reports()
Assert.contains('product is one of Camino', cs_advanced.query_results_text(0))
+ @pytest.mark.nondestructive
def test_that_advanced_search_for_seamonkey_can_be_filtered(self, mozwebqa):
csp = CrashStatsHomePage(mozwebqa)
csp.header.select_product('SeaMonkey')
cs_advanced = csp.header.click_advanced_search()
cs_advanced.filter_reports()
Assert.contains('product is one of SeaMonkey', cs_advanced.query_results_text(0))
- @xfail(reason='Disabled until bug 688256 is fixed')
+ @pytest.mark.xfail(reason='Disabled until bug 688256 is fixed')
+ @pytest.mark.nondestructive
def test_that_advanced_search_drilldown_results_are_correct(self, mozwebqa):
# https://bugzilla.mozilla.org/show_bug.cgi?id=679310
csp = CrashStatsHomePage(mozwebqa)
@@ -79,7 +87,8 @@ def test_that_advanced_search_drilldown_results_are_correct(self, mozwebqa):
cssr.click_reports()
Assert.equal(results_page_count, cssr.total_items_label)
- @prod
+ @pytest.mark.prod
+ @pytest.mark.nondestructive
def test_that_search_for_a_given_build_id_works(self, mozwebqa):
"""
https://www.pivotaltracker.com/story/show/17368401
@@ -96,8 +105,9 @@ def test_that_search_for_a_given_build_id_works(self, mozwebqa):
else:
Assert.equal(cs_advanced.query_results_text(1), 'No results were found.')
- @prod
- @xfail(reason='Disabled until bug 720037 is fixed')
+ @pytest.mark.prod
+ @pytest.mark.xfail(reason='Disabled until bug 720037 is fixed')
+ @pytest.mark.nondestructive
def test_that_filter_for_browser_results(self, mozwebqa):
#https://www.pivotaltracker.com/story/show/17769047
csp = CrashStatsHomePage(mozwebqa)
@@ -116,7 +126,8 @@ def test_that_filter_for_browser_results(self, mozwebqa):
Assert.true(cs_advanced.is_browser_icon_visible)
- @prod
+ @pytest.mark.prod
+ @pytest.mark.nondestructive
def test_that_plugin_filters_result(self, mozwebqa):
#https://www.pivotaltracker.com/story/show/17769047
csp = CrashStatsHomePage(mozwebqa)
@@ -134,7 +145,8 @@ def test_that_plugin_filters_result(self, mozwebqa):
Assert.true(cs_advanced.is_plugin_icon_visible)
- @prod
+ @pytest.mark.prod
+ @pytest.mark.nondestructive
def test_that_plugin_filename_column_sorts(self, mozwebqa):
"""
https://bugzilla.mozilla.org/show_bug.cgi?id=562380
View
7 tests/test_smoke_tests.py
@@ -15,6 +15,7 @@ class TestSmokeTests:
_expected_products = ['Firefox', 'Thunderbird', 'SeaMonkey', 'Camino', 'Fennec', 'FennecAndroid']
+ @pytest.mark.nondestructive
def test_that_server_status_page_loads(self, mozwebqa):
csp = CrashStatsHomePage(mozwebqa)
csstat = csp.click_server_status()
@@ -23,7 +24,7 @@ def test_that_server_status_page_loads(self, mozwebqa):
Assert.true(csstat.are_graphs_present, '4 graphs not found')
Assert.true(csstat.is_latest_raw_stats_present, 'Raw stats not found')
- @xfail(reason='Disabled till Bug 612679 is fixed')
+ @pytest.mark.xfail(reason='Disabled till Bug 612679 is fixed')
@pytest.mark.nondestructive
def test_that_options_are_sorted_the_same(self, mozwebqa):
csp = CrashStatsHomePage(mozwebqa)
@@ -55,11 +56,13 @@ def test_that_advanced_search_view_signature_for_product_crash(self, mozwebqa, p
cssr = cs_advanced.click_first_signature()
Assert.contains(signature, cssr.page_heading)
+ @pytest.mark.nondestructive
def test_that_simple_querystring_doesnt_return_500(self, mozwebqa):
response = urllib.urlopen(mozwebqa.base_url + '/query/simple')
Assert.equal(404, response.getcode())
- @xfail(reason='Bug 631737')
+ @pytest.mark.xfail(reason='Bug 631737')
+ @pytest.mark.nondestructive
def test_that_bugzilla_link_contain_current_site(self, mozwebqa):
"""
Bug 631737
View
3 tests/test_specific_versions.py
@@ -5,10 +5,11 @@
from pages.crash_stats_page import CrashStatsHomePage
from unittestzero import Assert
-
+import pytest
class TestSpecificVersions:
+ @pytest.mark.nondestructive
def test_that_selecting_exact_version_doesnt_show_other_versions(self, mozwebqa):
csp = CrashStatsHomePage(mozwebqa)

0 comments on commit 43c6a28

Please sign in to comment.