def test_that_reports_form_has_same_product(self, mozwebqa, product): csp = CrashStatsHomePage(mozwebqa) csp.header.select_product(product) assert product in csp.page_title crash_adu = csp.header.select_report('Crashes per User') assert crash_adu.header.current_product == crash_adu.product_select
def test_that_bugzilla_link_contain_current_site(self, mozwebqa): csp = CrashStatsHomePage(mozwebqa) path = '/invalidpath' csp.selenium.get(mozwebqa.base_url + path) Assert.contains('bug_file_loc=%s%s' % (mozwebqa.base_url, path), urllib.unquote(csp.link_to_bugzilla))
def test_search_change_column(self, base_url, selenium): csp = CrashStatsHomePage(selenium, base_url).open() cs_super = csp.header.click_super_search() cs_super.click_search() assert cs_super.are_search_results_found cs_super.click_more_options() # Delete all columns except the last one for column in cs_super.columns[:-1]: cs_super.click_crash_reports_tab() current_column = column.column_name assert current_column in cs_super.search_results_table_header.table_column_names number_of_columns = len(cs_super.columns) column.delete_column() cs_super.wait_for_column_deleted(number_of_columns - 1) assert cs_super.is_column_in_list(current_column) is not True cs_super.click_search() if len(cs_super.columns) > 1: cs_super.click_crash_reports_tab() assert cs_super.are_search_results_found assert cs_super.search_results_table_header.is_column_not_present( current_column) # advanced search defaults to the terms below, verify that these have # persisted assert 'product' == cs_super.field('0') assert 'has terms' == cs_super.operator('0') assert 'Firefox' == cs_super.match('0') assert cs_super.columns[ 0].column_name in cs_super.search_results_table_header.table_column_names
def test_that_bugzilla_link_contain_current_site(self, base_url, selenium): csp = CrashStatsHomePage(selenium, base_url).open() path = '/invalidpath' csp.selenium.get(base_url + path) assert 'bug_file_loc=%s%s' % (base_url, path) in urllib.unquote( csp.link_to_bugzilla)
def test_search_change_column(self, mozwebqa): csp = CrashStatsHomePage(mozwebqa) cs_super = csp.header.click_super_search() cs_super.select_field('product') cs_super.select_operator('has terms') cs_super.click_search() Assert.true(cs_super.are_search_results_found) cs_super.click_more_options() # Delete all columns except the last one for column in cs_super.columns[:-1]: cs_super.click_crash_reports_tab() current_column = column.column_name Assert.true(current_column in cs_super.search_results_table_header. table_column_names) number_of_columns = len(cs_super.columns) column.delete_column() cs_super.wait_for_column_deleted(number_of_columns - 1) Assert.false(cs_super.is_column_in_list(current_column)) cs_super.click_search() if len(cs_super.columns) > 1: cs_super.click_crash_reports_tab() Assert.true(cs_super.are_search_results_found) Assert.true( cs_super.search_results_table_header.is_column_not_present( current_column)) Assert.true(cs_super.columns[0].column_name in cs_super.search_results_table_header.table_column_names)
def test_search_change_column(self, base_url, selenium): csp = CrashStatsHomePage(selenium, base_url).open() cs_super = csp.header.click_super_search() cs_super.click_search() assert cs_super.are_search_results_found cs_super.click_more_options() # Delete all columns except the last one for column in cs_super.columns[:-1]: cs_super.click_crash_reports_tab() current_column = column.column_name assert current_column in cs_super.search_results_table_header.table_column_names number_of_columns = len(cs_super.columns) column.delete_column() cs_super.wait_for_column_deleted(number_of_columns - 1) assert cs_super.is_column_in_list(current_column) is not True cs_super.click_search() if len(cs_super.columns) > 1: cs_super.click_crash_reports_tab() assert cs_super.are_search_results_found assert cs_super.search_results_table_header.is_column_not_present( current_column) # verify simple search terms have persisted assert 'Firefox' == cs_super.selected_products assert cs_super.columns[ 0].column_name in cs_super.search_results_table_header.table_column_names
def test_that_exploitable_crash_report_not_displayed_for_not_logged_in_users( self, mozwebqa): """https://github.com/mozilla/Socorro-Tests/issues/214""" csp = CrashStatsHomePage(mozwebqa) Assert.true('Exploitable Crashes' not in csp.header.report_list) Assert.false(csp.header.is_exploitable_crash_report_present)
def test_search_for_valid_signature(self, mozwebqa): csp = CrashStatsHomePage(mozwebqa) report_list = csp.click_last_product_top_crashers_link() signature = report_list.first_signature_title result = csp.header.search_for_crash(signature) Assert.true(result.are_search_results_found)
def test_search_for_valid_signature(self, base_url, selenium): csp = CrashStatsHomePage(base_url, selenium) report_list = csp.click_last_product_top_crashers_link() signature = report_list.first_signature_title result = csp.header.search_for_crash(signature) assert result.are_search_results_found
def test_that_plugin_filters_result(self, mozwebqa): """ https://www.pivotaltracker.com/story/show/17769047 https://bugzilla.mozilla.org/show_bug.cgi?id=562380 """ csp = CrashStatsHomePage(mozwebqa) cs_advanced = csp.header.click_advanced_search() cs_advanced.adv_select_product('Firefox') cs_advanced.deselect_version() # Select 2nd Featured Version cs_advanced.adv_select_version_by_index(2) cs_advanced.adv_select_os('Windows') cs_advanced.select_report_process('plugin') cs_advanced.click_filter_reports() # verify the plugin icon is visible for result in cs_advanced.random_results(19): Assert.true(result.is_plugin_icon_visible) # verify ascending & descending sort cs_advanced.results_table_header.click_sort_by_plugin_filename() plugin_filename_results_list = [ row.plugin_filename.lower() for row in cs_advanced.top_results(19) ] Assert.is_sorted_ascending(plugin_filename_results_list) cs_advanced.results_table_header.click_sort_by_plugin_filename() plugin_filename_results_list = [ row.plugin_filename.lower() for row in cs_advanced.top_results(19) ] Assert.is_sorted_descending(plugin_filename_results_list)
def test_that_only_plugin_reports_have_plugin_icon(self, mozwebqa): csp = CrashStatsHomePage(mozwebqa) reports_page = csp.click_last_product_top_crashers_link() type, days, os = 'Plugin', '28', 'Windows' reports_page.click_filter_by(type) reports_page.click_filter_days_by(days) reports_page.click_filter_os_by(os) Assert.equal( (type, days, os), (reports_page.current_filter_type, reports_page.current_days_filter, reports_page.current_os_filter)) signature_list_items = reports_page.signature_items Assert.true( len(signature_list_items) > 0, "Signature list items not found") for signature_item in signature_list_items[:min( signature_list_items, 24)]: Assert.true( signature_item.is_plugin_icon_visible, "Signature %s did not have a plugin icon" % signature_item.title) Assert.false( signature_item.is_browser_icon_visible, "Signature %s unexpectedly had a browser icon" % signature_item.title)
def test_that_only_browser_reports_have_browser_icon(self, mozwebqa): """ https://www.pivotaltracker.com/story/show/17099455 """ csp = CrashStatsHomePage(mozwebqa) reports_page = csp.click_last_product_top_crashers_link() type, days, os = 'Browser', '7', 'Windows' Assert.equal(reports_page.current_filter_type, type) reports_page.click_filter_days_by(days) reports_page.click_filter_os_by(os) Assert.equal( (type, days, os), (reports_page.current_filter_type, reports_page.current_days_filter, reports_page.current_os_filter)) signature_list_items = reports_page.random_signature_items(19) Assert.true( len(signature_list_items) > 0, "Signature list items not found") for signature_item in signature_list_items: Assert.true( signature_item.is_browser_icon_visible, "Signature %s did not have a browser icon" % signature_item.title) Assert.false( signature_item.is_plugin_icon_visible, "Signature %s unexpectedly had a plugin icon" % signature_item.title)
def test_that_top_crashers_reports_links_work(self, mozwebqa, product): """ https://www.pivotaltracker.com/story/show/17086667 """ if product == 'WebappRuntime': pytest.xfail( reason= 'Bug 918297 - [dev][stage]Nonexistent WebappRuntime version displayed on homepage' ) csp = CrashStatsHomePage(mozwebqa) csp.header.select_product(product) # Because the frontpage is now largely Ajax driven, # we need to add this wait before proceeding with the # next step. top_crashers = csp.release_channels for idx in range(len(top_crashers)): top_crasher_name = top_crashers[idx].product_version_label if u'Firefox 24.0b' in top_crasher_name or \ u'WebappRuntime 24.0b' in top_crasher_name: pytest.xfail( "Bug 913126 - Advanced Search: No results returned for 24.0b" ) top_crasher_page = top_crashers[idx].click_top_crasher() Assert.contains(top_crasher_name, top_crasher_page.page_heading) top_crasher_page.return_to_previous_page() top_crashers = csp.release_channels
def test_search_for_valid_signature(self, base_url, selenium): csp = CrashStatsHomePage(selenium, base_url).open() report_list = csp.release_channels[-1].click_top_crasher() signature = report_list.first_signature_title result = csp.header.search_for_crash(signature) assert result.are_search_results_found
def test_that_server_status_page_loads(self, mozwebqa): csp = CrashStatsHomePage(mozwebqa) csstat = csp.click_server_status() assert csstat.is_at_a_glance_present, 'Server summary not found' assert csstat.are_graphs_present, '4 graphs not found' assert csstat.is_latest_raw_stats_present, 'Raw stats not found'
def test_that_7_days_is_selected_default_for_nightlies( self, base_url, selenium): csp = CrashStatsHomePage(selenium, base_url).open() top_crashers = csp.release_channels tc_page = top_crashers[1].click_top_crasher() assert '7' == tc_page.current_days_filter
def test_default_fields_for_firefox(self, mozwebqa): csp = CrashStatsHomePage(mozwebqa) cs_super = csp.header.click_super_search() cs_super.open_url('/search/?product=Firefox') Assert.equal(cs_super.field('0'), 'product') Assert.equal(cs_super.operator('0'), 'has terms') Assert.equal(cs_super.match('0'), 'Firefox')
def test_default_fields_for_firefox(self, base_url, selenium): csp = CrashStatsHomePage(selenium, base_url).open() cs_super = csp.header.click_super_search() # advanced search defaults to the terms below, verify that these are # present assert 'product' == cs_super.field('0') assert 'has terms' == cs_super.operator('0') assert 'Firefox' == cs_super.match('0')
def test_that_top_changers_data_is_available(self, mozwebqa): """ https://www.pivotaltracker.com/story/show/18059119 """ csp = CrashStatsHomePage(mozwebqa) cstc = csp.header.select_report('Top Changers') Assert.not_equal('Top changers currently unavailable', cstc.page_heading)
def test_search_for_unrealistic_data(self, base_url, selenium): csp = CrashStatsHomePage(selenium, base_url).open() cs_super = csp.header.click_super_search() cs_super.select_facet('0', 'date') cs_super.select_operator('0', '>') cs_super.select_match('0', '2000:01:01 00-00') cs_super.click_search() assert 'Enter a valid date/time.' == cs_super.error
def test_default_fields_for_firefox(self, base_url, selenium): csp = CrashStatsHomePage(base_url, selenium) cs_super = csp.header.click_super_search() cs_super.open_url('/search/?product=Firefox') assert 'product' == cs_super.field('0') assert 'has terms' == cs_super.operator('0') assert 'Firefox' == cs_super.match('0')
def test_that_current_version_selected_in_top_crashers_header( self, mozwebqa, product): csp = CrashStatsHomePage(mozwebqa) csp.header.select_product(product) cstc = csp.header.select_report('Top Crashers') Assert.equal(product, cstc.page_heading_product) Assert.equal(cstc.header.current_version, cstc.page_heading_version)
def test_that_products_are_sorted_correctly(self, mozwebqa): csp = CrashStatsHomePage(mozwebqa) product_list = [ 'Firefox', 'Thunderbird', 'Fennec', 'FennecAndroid', 'SeaMonkey', 'WebappRuntime', 'B2G', 'WebappRuntimeMobile', 'MetroFirefox' ] products = csp.header.product_list Assert.equal(product_list, products)
def test_login_logout(self, mozwebqa): csp = CrashStatsHomePage(mozwebqa) assert csp.footer.is_logged_out csp.footer.login() assert csp.footer.is_logged_in csp.footer.logout() assert csp.footer.is_logged_out
def test_that_7_days_is_selected_default_for_nightlies(self, mozwebqa): """ https://www.pivotaltracker.com/story/show/17088605 """ csp = CrashStatsHomePage(mozwebqa) top_crashers = csp.release_channels tc_page = top_crashers[1].click_top_crasher() Assert.equal(tc_page.current_days_filter, '7')
def test_that_reports_form_has_same_product(self, mozwebqa, product): csp = CrashStatsHomePage(mozwebqa) csp.header.select_product(product) Assert.contains(product, csp.page_title) crash_adu = csp.header.select_report('Crashes per User') Assert.equal(crash_adu.header.current_product, crash_adu.product_select)
def test_that_products_are_sorted_correctly(self, mozwebqa): csp = CrashStatsHomePage(mozwebqa) product_list = [ 'Firefox', 'Thunderbird', 'Fennec', 'FennecAndroid', 'SeaMonkey', 'WebappRuntime', 'B2G', 'WebappRuntimeMobile' ] products = csp.header.product_list assert product_list == products, 'Expected products not in the product dropdown'
def test_that_reports_form_has_same_product(self, base_url, selenium, product): csp = CrashStatsHomePage(base_url, selenium) csp.header.select_product(product) assert product in csp.page_title crash_per_day = csp.header.select_report('Crashes per Day') crash_per_day.is_the_current_page assert crash_per_day.header.current_product == crash_per_day.product_select
def test_that_current_version_selected_in_top_crashers_header( self, base_url, selenium, product): csp = CrashStatsHomePage(selenium, base_url).open() csp.header.select_product(product) cstc = csp.header.select_report('Top Crashers') cstc.header.select_version('Current Versions') assert product == cstc.page_heading_product assert cstc.page_heading_version == cstc.header.current_version
def test_that_reports_form_has_same_product(self, base_url, selenium, product): csp = CrashStatsHomePage(selenium, base_url).open() csp.header.select_product(product) assert product in selenium.title crash_per_day = csp.header.select_report('Crashes per Day') assert crash_per_day.page_heading == selenium.title assert crash_per_day.header.current_product == crash_per_day.product_select