def test_that_plugin_filters_result(self, mozwebqa): """ 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_sorting_by_number_of_most_users(self, mozwebqa): """Litmus 24867 https://litmus.mozilla.org/show_test.cgi?id=24867""" Home(mozwebqa).header.search_for('firebug') search_page = SearchHome(mozwebqa).sort_by('Most Users') Assert.true('sort=users' in search_page.get_url_current_page()) Assert.is_sorted_descending([i.users for i in search_page.results()])
def test_the_top_rated_section(self, mozwebqa): home_page = Home(mozwebqa) themes_page = home_page.header.site_navigation_menu("Themes").click() Assert.true(themes_page.is_the_current_page) Assert.equal(6, themes_page.top_rated_count) ratings = themes_page.top_rated_ratings Assert.is_sorted_descending(ratings)
def test_the_top_rated_section(self, mozwebqa): home_page = Home(mozwebqa) themes_page = home_page.header.site_navigation_menu("Themes").click() Assert.true(themes_page.is_the_current_page) Assert.equal(6, themes_page.top_rated_count) ratings = themes_page.top_rated_ratings Assert.is_sorted_descending(ratings)
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_sorting_by_created_date(self, testsetup): """ Litmus 17343 https://litmus.mozilla.org/show_test.cgi?id=17343 """ AddonsHomePage(testsetup).header.search_for('firebug') amo_search_page = AddonsSearchHomePage(testsetup).sort_by('created') Assert.true('sort=newest' in amo_search_page.get_url_current_page()) Assert.is_sorted_descending([i.created_date for i in amo_search_page.results()])
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() cs_advanced.adv_select_version('Firefox 16.0a2') cs_advanced.adv_select_os('Windows') cs_advanced.select_report_process('Plugins') cs_advanced.click_filter_reports() cs_advanced.go_to_random_result_page() # verify the plugin icon is visible for result in cs_advanced.results: 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.results] 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.results] Assert.is_sorted_descending(plugin_filename_results_list)
def test_the_most_popular_section(self, mozwebqa): home_page = Home(mozwebqa) themes_page = home_page.header.site_navigation_menu("Themes").click() Assert.true(themes_page.is_the_current_page) Assert.equal(6, themes_page.most_popular_count) downloads = themes_page.most_popular_downloads Assert.is_sorted_descending(downloads)
def test_sorting_by_newest(self, mozwebqa): """ Litmus 17343 https://litmus.mozilla.org/show_test.cgi?id=17343 """ Home(mozwebqa).header.search_for('firebug') search_page = SearchHome(mozwebqa).sort_by('Newest') Assert.true('sort=created' in search_page.get_url_current_page()) Assert.is_sorted_descending([i.created_date for i in search_page.results()])
def test_the_most_popular_section(self, mozwebqa): home_page = Home(mozwebqa) themes_page = home_page.header.site_navigation_menu("Themes").click() Assert.true(themes_page.is_the_current_page) Assert.equal(6, themes_page.most_popular_count) downloads = themes_page.most_popular_downloads Assert.is_sorted_descending(downloads)
def test_sorting_by_downloads(self, mozwebqa): """ Litmus 17342 https://litmus.mozilla.org/show_test.cgi?id=17342 """ AddonsHomePage(mozwebqa).header.search_for('firebug') amo_search_page = AddonsSearchHomePage(mozwebqa).sort_by('downloads') Assert.true('sort=weeklydownloads' in amo_search_page.get_url_current_page()) Assert.is_sorted_descending([i.downloads for i in amo_search_page.results()])
def test_that_product_versions_are_ordered_correctly(self, mozwebqa): csp = CrashStatsHomePage(mozwebqa) Assert.is_sorted_descending(csp.header.current_versions, csp.get_url_current_page()) Assert.is_sorted_descending(csp.header.other_versions, csp.get_url_current_page())
def test_sorting_by_updated_date(self, mozwebqa): """ Litmus 17345 https://litmus.mozilla.org/show_test.cgi?id=17345 """ AddonsHomePage(mozwebqa).header.search_for('firebug') amo_search_page = AddonsSearchHomePage(mozwebqa).sort_by('updated') Assert.true('sort=updated' in amo_search_page.get_url_current_page()) Assert.is_sorted_descending([i.updated_date for i in amo_search_page.results()])
def test_that_checks_if_the_extensions_are_sorted_by_recently_updated( self, mozwebqa): """ Litmus 29727 https://litmus.mozilla.org/show_test.cgi?searchType=by_id&id=29727 """ home_page = Home(mozwebqa) featured_extensions_page = home_page.header.site_navigation_menu( "Extensions").click() featured_extensions_page.sort_by('recently updated') Assert.equal(featured_extensions_page.default_selected_tab, "Recently Updated") Assert.contains("sort=updated", featured_extensions_page.get_url_current_page()) updated_dates = [ i.updated_date for i in featured_extensions_page.extensions ] Assert.is_sorted_descending(updated_dates) featured_extensions_page.paginator.click_next_page() updated_dates.extend( [i.updated_date for i in featured_extensions_page.extensions]) Assert.is_sorted_descending(updated_dates)
def test_that_checks_if_the_extensions_are_sorted_by_most_user(self, mozwebqa): home_page = Home(mozwebqa) featured_extensions_page = home_page.header.site_navigation_menu("Extensions").click() featured_extensions_page.sorter.sort_by('most_users') Assert.contains("sort=users", featured_extensions_page.get_url_current_page()) user_counts = [extension.user_count for extension in featured_extensions_page.extensions] Assert.is_sorted_descending(user_counts)
def test_that_most_popular_section_is_ordered_by_users(self, mozwebqa): """ Test for Litmus 25808. https://litmus.mozilla.org/show_test.cgi?searchType=by_id&id=25808 """ home_page = Home(mozwebqa) most_popular_items = home_page.most_popular_items Assert.is_sorted_descending([i.users_number for i in most_popular_items])
def test_the_most_popular_section(self, mozwebqa): """ Test for Litmus 15394 https://litmus.mozilla.org/show_test.cgi?id=15394""" home_page = Home(mozwebqa) personas_page = home_page.click_personas() Assert.true(personas_page.is_the_current_page) Assert.equal(6, personas_page.most_popular_count) downloads = personas_page.most_popular_downloads Assert.is_sorted_descending(downloads)
def test_the_recently_added_section(self, mozwebqa): """ Test for Litmus 15393 https://litmus.mozilla.org/show_test.cgi?id=15393""" home_page = Home(mozwebqa) personas_page = home_page.click_personas() Assert.true(personas_page.is_the_current_page) Assert.equal(6, personas_page.recently_added_count) recently_added_dates = personas_page.recently_added_dates Assert.is_sorted_descending(recently_added_dates)
def test_sorting_by_newest(self, mozwebqa): """ Test for Litmus 17343. https://litmus.mozilla.org/show_test.cgi?id=17343 """ search_page = Home(mozwebqa).search_for('firebug') search_page.click_sort_by('Newest') Assert.true('sort=created' in search_page.get_url_current_page()) Assert.is_sorted_descending([i.created_date for i in search_page.results])
def test_sorting_by_number_of_most_users(self, mozwebqa): """ Test for Litmus 24867. https://litmus.mozilla.org/show_test.cgi?id=24867 """ search_page = Home(mozwebqa).search_for('firebug') search_page.click_sort_by('Most Users') Assert.contains('sort=users', search_page.get_url_current_page()) Assert.is_sorted_descending([i.users for i in search_page.results])
def test_sort_alphabetically_descending_should_succeed(self): home_page = HomePage(self.driver).open_home_page() TV_page = home_page.header.open_TV_page() TV_page.sort_alphabetically_descending() sleep(2) WebDriverWait(self.driver, 30).until(EC.invisibility_of_element_located(TV_page._processing_info)) TV_page.get_product_name_table() Assert.is_sorted_descending(TV_page.product_name_table)
def test_sorting_by_most_recently_updated(self, mozwebqa): search_page = Home(mozwebqa).search_for('firebug') search_page.click_sort_by('Recently Updated') Assert.contains('sort=updated', search_page.get_url_current_page()) results = [i.updated_date for i in search_page.results] Assert.is_sorted_descending(results) search_page.paginator.click_next_page() results.extend([i.updated_date for i in search_page.results]) Assert.is_sorted_descending(results)
def test_sorting_by_most_recently_updated(self, mozwebqa): search_page = Home(mozwebqa).search_for('firebug') search_page.click_sort_by('Recently Updated') Assert.contains('sort=updated', search_page.get_url_current_page()) results = [i.updated_date for i in search_page.results] Assert.is_sorted_descending(results) search_page.paginator.click_next_page() results.extend([i.updated_date for i in search_page.results]) Assert.is_sorted_descending(results)
def test_the_top_rated_section(self, mozwebqa): """ Test for Litmus 15395 https://litmus.mozilla.org/show_test.cgi?id=15395""" amo_home_page = AddonsHomePage(mozwebqa) amo_personas_page = amo_home_page.click_personas() Assert.true(amo_personas_page.is_the_current_page) Assert.equal(6, amo_personas_page.top_rated_count) ratings = amo_personas_page.top_rated_ratings Assert.is_sorted_descending(ratings)
def test_sorting_by_newest(self, mozwebqa): """ Test for Litmus 17343. https://litmus.mozilla.org/show_test.cgi?id=17343 """ search_page = Home(mozwebqa).search_for("firebug") search_page.click_sort_by("Newest") Assert.true("sort=created" in search_page.get_url_current_page()) Assert.is_sorted_descending([i.created_date for i in search_page.results])
def test_sorting_by_number_of_most_users(self, mozwebqa): """ Test for Litmus 24867. https://litmus.mozilla.org/show_test.cgi?id=24867 """ search_page = Home(mozwebqa).search_for('firebug') search_page.click_sort_by('Most Users') Assert.contains('sort=users', search_page.get_url_current_page()) Assert.is_sorted_descending([i.users for i in search_page.results])
def test_that_most_popular_section_is_ordered_by_users(self, mozwebqa): """ Litmus 25808 https://litmus.mozilla.org/show_test.cgi?searchType=by_id&id=25808 """ home_page = Home(mozwebqa) Assert.true(home_page.is_most_popular_list_visible) most_popular_items = home_page.most_popular_items Assert.is_sorted_descending([i.users_number for i in most_popular_items])
def test_the_recently_added_section(self, testsetup): """ Test for Litmus 15393 https://litmus.mozilla.org/show_test.cgi?id=15393""" amo_home_page = AddonsHomePage(testsetup) amo_personas_page = amo_home_page.click_personas() Assert.true(amo_personas_page.is_the_current_page) Assert.equal(6, amo_personas_page.recently_added_count) recently_added_dates = amo_personas_page.recently_added_dates Assert.is_sorted_descending(recently_added_dates)
def test_the_most_popular_section(self, testsetup): """ Test for Litmus 15394 https://litmus.mozilla.org/show_test.cgi?id=15394""" amo_home_page = AddonsHomePage(testsetup) amo_personas_page = amo_home_page.click_personas() Assert.true(amo_personas_page.is_the_current_page) Assert.equal(6, amo_personas_page.most_popular_count) downloads = amo_personas_page.most_popular_downloads Assert.is_sorted_descending(downloads)
def test_sorting_by_downloads(self, mozwebqa): search_page = Home(mozwebqa).search_for('firebug') search_page.click_sort_by('Weekly Downloads') Assert.true('sort=downloads' in search_page.get_url_current_page()) downloads = [i.downloads for i in search_page.results] Assert.is_sorted_descending(downloads) search_page.paginator.click_next_page() downloads.extend([i.downloads for i in search_page.results]) Assert.is_sorted_descending(downloads)
def test_sorting_by_downloads(self, mozwebqa): search_page = Home(mozwebqa).search_for('firebug') search_page.click_sort_by('Weekly Downloads') Assert.true('sort=downloads' in search_page.get_url_current_page()) downloads = [i.downloads for i in search_page.results] Assert.is_sorted_descending(downloads) search_page.paginator.click_next_page() downloads.extend([i.downloads for i in search_page.results]) Assert.is_sorted_descending(downloads)
def test_the_recently_added_section(self, mozwebqa): """ Test for Litmus Litmus 15393. https://litmus.mozilla.org/show_test.cgi?id=15393 """ home_page = Home(mozwebqa) personas_page = home_page.header.site_navigation_menu("Personas").click() Assert.true(personas_page.is_the_current_page) Assert.equal(6, personas_page.recently_added_count) recently_added_dates = personas_page.recently_added_dates Assert.is_sorted_descending(recently_added_dates)
def test_the_most_popular_section(self, mozwebqa): """ Test for Litmus 15394. https://litmus.mozilla.org/show_test.cgi?id=15394 """ home_page = Home(mozwebqa) themes_page = home_page.header.site_navigation_menu("Themes").click() Assert.true(themes_page.is_the_current_page) Assert.equal(6, themes_page.most_popular_count) downloads = themes_page.most_popular_downloads Assert.is_sorted_descending(downloads)
def test_the_top_rated_section(self, mozwebqa): """ Test for Litmus 15395. https://litmus.mozilla.org/show_test.cgi?id=15395 """ home_page = Home(mozwebqa) personas_page = home_page.header.site_navigation_menu("Personas").click() Assert.true(personas_page.is_the_current_page) Assert.equal(6, personas_page.top_rated_count) ratings = personas_page.top_rated_ratings Assert.is_sorted_descending(ratings)
def test_the_most_popular_section(self, mozwebqa): """ Test for Litmus 15394. https://litmus.mozilla.org/show_test.cgi?id=15394 """ home_page = Home(mozwebqa) themes_page = home_page.header.site_navigation_menu("Themes").click() Assert.true(themes_page.is_the_current_page) Assert.equal(6, themes_page.most_popular_count) downloads = themes_page.most_popular_downloads Assert.is_sorted_descending(downloads)
def test_the_recently_added_section(self, mozwebqa): """ Test for Litmus Litmus 15393. https://litmus.mozilla.org/show_test.cgi?id=15393 """ home_page = Home(mozwebqa) themes_page = home_page.header.site_navigation_menu("Themes").click() Assert.true(themes_page.is_the_current_page) Assert.equal(6, themes_page.recently_added_count) recently_added_dates = themes_page.recently_added_dates Assert.is_sorted_descending(recently_added_dates)
def test_the_top_rated_section(self, mozwebqa): """ Test for Litmus 15395. https://litmus.mozilla.org/show_test.cgi?id=15395 """ home_page = Home(mozwebqa) themes_page = home_page.header.site_navigation_menu("Themes").click() Assert.true(themes_page.is_the_current_page) Assert.equal(6, themes_page.top_rated_count) ratings = themes_page.top_rated_ratings Assert.is_sorted_descending(ratings)
def test_that_complete_themes_can_be_sorted_by_popularity(self, mozwebqa): home_page = Home(mozwebqa) complete_themes_page = home_page.header.click_complete_themes() complete_themes_page.click_sort_by("weekly downloads") addons = complete_themes_page.addon_names addons_set = set(addons) Assert.equal(len(addons), len(addons_set), "There are duplicates in the names") downloads = complete_themes_page.addon_download_number Assert.is_sorted_descending(downloads) complete_themes_page.paginator.click_next_page() downloads.extend(complete_themes_page.addon_download_number) Assert.is_sorted_descending(downloads)
def test_that_checks_if_the_extensions_are_sorted_by_most_user(self, mozwebqa): """ Test for Litmus 29715 https://litmus.mozilla.org/show_test.cgi?searchType=by_id&id=29715 """ home_page = Home(mozwebqa) featured_extensions_page = home_page.header.site_navigation_menu("Extensions").click() featured_extensions_page.sort_by('most_users') Assert.contains("sort=users", featured_extensions_page.get_url_current_page()) user_counts = [extension.user_count for extension in featured_extensions_page.extensions] Assert.is_sorted_descending(user_counts)
def test_that_complete_themes_can_be_sorted_by_created_date(self, mozwebqa): home_page = Home(mozwebqa) complete_themes_page = home_page.header.click_complete_themes() complete_themes_page.click_sort_by("newest") addons = complete_themes_page.addon_names addons_set = set(addons) Assert.equal(len(addons), len(addons_set), "There are duplicates in the names") created_dates = complete_themes_page.addon_created_dates Assert.is_sorted_descending(created_dates) complete_themes_page.paginator.click_next_page() created_dates.extend(complete_themes_page.addon_created_dates) Assert.is_sorted_descending(created_dates)
def test_that_complete_themes_can_be_sorted_by_created_date(self, mozwebqa): """Test for Litmus 11638.""" home_page = Home(mozwebqa) complete_themes_page = home_page.header.click_complete_themes() complete_themes_page.click_sort_by("newest") addons = complete_themes_page.addon_names addons_set = set(addons) Assert.equal(len(addons), len(addons_set), "There are duplicates in the names") created_dates = complete_themes_page.addon_created_dates Assert.is_sorted_descending(created_dates) complete_themes_page.paginator.click_next_page() created_dates.extend(complete_themes_page.addon_created_dates) Assert.is_sorted_descending(created_dates)
def test_sorting_by_most_recently_updated(self, mozwebqa): """ Test for Litmus 17345. https://litmus.mozilla.org/show_test.cgi?id=17345 """ search_page = Home(mozwebqa).header.search_for('firebug') search_page.sort_by('Recently Updated') Assert.contains('sort=updated', search_page.get_url_current_page()) results = [i.updated_date for i in search_page.results] Assert.is_sorted_descending(results) search_page.paginator.click_next_page() results.extend([i.updated_date for i in search_page.results]) Assert.is_sorted_descending(results)
def test_sorting_by_most_recently_updated(self, mozwebqa): """ Test for Litmus 17345. https://litmus.mozilla.org/show_test.cgi?id=17345 """ search_page = Home(mozwebqa).search_for('firebug') search_page.click_sort_by('Recently Updated') Assert.contains('sort=updated', search_page.get_url_current_page()) results = [i.updated_date for i in search_page.results] Assert.is_sorted_descending(results) search_page.paginator.click_next_page() results.extend([i.updated_date for i in search_page.results]) Assert.is_sorted_descending(results)
def test_that_themes_can_be_sorted_by_popularity(self, mozwebqa): """Test for Litmus 11638.""" home_page = Home(mozwebqa) themes_page = home_page.header.site_navigation_menu("Themes").click() themes_page.click_sort_by("popular") addons = themes_page.addon_names addons_set = set(addons) Assert.equal(len(addons), len(addons_set), "There are duplicates in the names") downloads = themes_page.addon_download_number Assert.is_sorted_descending(downloads) themes_page.paginator.click_next_page() downloads.extend(themes_page.addon_download_number) Assert.is_sorted_descending(downloads)
def test_that_complete_themes_can_be_sorted_by_popularity(self, mozwebqa): home_page = Home(mozwebqa) complete_themes_page = home_page.header.click_complete_themes() complete_themes_page.click_sort_by("weekly downloads") addons = complete_themes_page.addon_names addons_set = set(addons) Assert.equal(len(addons), len(addons_set), "There are duplicates in the names") downloads = complete_themes_page.addon_download_number Assert.is_sorted_descending(downloads) complete_themes_page.paginator.click_next_page() downloads.extend(complete_themes_page.addon_download_number) Assert.is_sorted_descending(downloads)
def test_that_themes_can_be_sorted_by_created_date(self, mozwebqa): """ test for litmus 11638 """ home_page = Home(mozwebqa) themes_page = home_page.click_themes() themes_page.click_sort_by("created") addons = themes_page.addon_names addons_set = set(addons) Assert.equal(len(addons), len(addons_set), "There are duplicates in the names") created_dates = themes_page.addon_created_dates Assert.is_sorted_descending(created_dates) themes_page.page_forward() created_dates.extend(themes_page.addon_created_dates) Assert.is_sorted_descending(created_dates)
def test_that_themes_can_be_sorted_by_popularity(self, mozwebqa): """ test for litmus 11638 """ home_page = Home(mozwebqa) themes_page = home_page.click_themes() themes_page.click_sort_by("popular") addons = themes_page.addon_names addons_set = set(addons) Assert.equal(len(addons), len(addons_set), "There are duplicates in the names") downloads = themes_page.addon_download_number Assert.is_sorted_descending(downloads) themes_page.page_forward() downloads.extend(themes_page.addon_download_number) Assert.is_sorted_descending(downloads)
def test_sorting_by_downloads(self, mozwebqa): """ Test for Litmus 17342. https://litmus.mozilla.org/show_test.cgi?id=17342 """ search_page = Home(mozwebqa).search_for('firebug') search_page.click_sort_by('Weekly Downloads') Assert.true('sort=downloads' in search_page.get_url_current_page()) downloads = [i.downloads for i in search_page.results] Assert.is_sorted_descending(downloads) search_page.paginator.click_next_page() downloads.extend([i.downloads for i in search_page.results]) Assert.is_sorted_descending(downloads)
def test_that_themes_can_be_sorted_by_popularity(self, mozwebqa): """Test for Litmus 11638.""" home_page = Home(mozwebqa) themes_page = home_page.header.site_navigation_menu("Themes").click() themes_page.click_sort_by("popular") addons = themes_page.addon_names addons_set = set(addons) Assert.equal(len(addons), len(addons_set), "There are duplicates in the names") downloads = themes_page.addon_download_number Assert.is_sorted_descending(downloads) themes_page.paginator.click_next_page() downloads.extend(themes_page.addon_download_number) Assert.is_sorted_descending(downloads)
def test_that_themes_can_be_sorted_by_created_date(self, mozwebqa): """Test for Litmus 11638.""" home_page = Home(mozwebqa) themes_page = home_page.header.site_navigation_menu("Themes").click() themes_page.click_sort_by("created") addons = themes_page.addon_names addons_set = set(addons) Assert.equal(len(addons), len(addons_set), "There are duplicates in the names") created_dates = themes_page.addon_created_dates Assert.is_sorted_descending(created_dates) themes_page.paginator.click_next_page() created_dates.extend(themes_page.addon_created_dates) Assert.is_sorted_descending(created_dates)
def test_that_checks_if_the_extensions_are_sorted_by_most_user( self, mozwebqa): home_page = Home(mozwebqa) featured_extensions_page = home_page.header.site_navigation_menu( "Extensions").click() featured_extensions_page.sorter.sort_by('most_users') Assert.contains("sort=users", featured_extensions_page.get_url_current_page()) user_counts = [ extension.user_count for extension in featured_extensions_page.extensions ] Assert.is_sorted_descending(user_counts)
def test_that_complete_themes_can_be_sorted_by_updated_date( self, mozwebqa): home_page = Home(mozwebqa) complete_themes_page = home_page.header.click_complete_themes() complete_themes_page.click_sort_by("recently updated") addons = complete_themes_page.addon_names addons_set = set(addons) Assert.equal(len(addons), len(addons_set), "There are duplicates in the names") updated_dates = complete_themes_page.addon_updated_dates Assert.is_sorted_descending(updated_dates) complete_themes_page.paginator.click_next_page() updated_dates.extend(complete_themes_page.addon_updated_dates) Assert.is_sorted_descending(updated_dates)
def test_that_checks_if_the_extensions_are_sorted_by_most_user( self, mozwebqa): """ Test for Litmus 29715 https://litmus.mozilla.org/show_test.cgi?searchType=by_id&id=29715 """ home_page = Home(mozwebqa) featured_extensions_page = home_page.header.site_navigation_menu( "Extensions").click() featured_extensions_page.sort_by('most_users') Assert.contains("sort=users", featured_extensions_page.get_url_current_page()) user_counts = [ extension.user_count for extension in featured_extensions_page.extensions ] Assert.is_sorted_descending(user_counts)
def test_that_checks_if_the_extensions_are_sorted_by_newest( self, mozwebqa): home_page = Home(mozwebqa) featured_extensions_page = home_page.header.site_navigation_menu( "Extensions").click() featured_extensions_page.sorter.sort_by('newest') Assert.equal(featured_extensions_page.sorter.sorted_by, "Newest") Assert.contains("sort=created", featured_extensions_page.get_url_current_page()) added_dates = [ i.added_date for i in featured_extensions_page.extensions ] Assert.is_sorted_descending(added_dates) featured_extensions_page.paginator.click_next_page() added_dates.extend( [i.added_date for i in featured_extensions_page.extensions]) Assert.is_sorted_descending(added_dates)
def test_that_checks_if_the_extensions_are_sorted_by_recently_updated( self, mozwebqa): home_page = Home(mozwebqa) featured_extensions_page = home_page.header.site_navigation_menu( "Extensions").click() featured_extensions_page.sorter.sort_by('recently updated') Assert.equal(featured_extensions_page.sorter.sorted_by, "Recently Updated") Assert.contains("sort=updated", featured_extensions_page.get_url_current_page()) updated_dates = [ i.updated_date for i in featured_extensions_page.extensions ] Assert.is_sorted_descending(updated_dates) featured_extensions_page.paginator.click_next_page() updated_dates.extend( [i.updated_date for i in featured_extensions_page.extensions]) Assert.is_sorted_descending(updated_dates)
def test_that_checks_if_the_extensions_are_sorted_by_newest( self, mozwebqa): """ Test for Litmus 29719 https://litmus.mozilla.org/show_test.cgi?searchType=by_id&id=29719 """ home_page = Home(mozwebqa) featured_extensions_page = home_page.header.site_navigation_menu( "Extensions").click() featured_extensions_page.sort_by('newest') Assert.equal(featured_extensions_page.default_selected_tab, "Newest") Assert.contains("sort=created", featured_extensions_page.get_url_current_page()) added_dates = [ i.added_date for i in featured_extensions_page.extensions ] Assert.is_sorted_descending(added_dates) featured_extensions_page.paginator.click_next_page() added_dates.extend( [i.added_date for i in featured_extensions_page.extensions]) Assert.is_sorted_descending(added_dates)
def test_that_plugin_filename_column_sorts(self, mozwebqa): """ 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.adv_select_version('All') cs_advanced.select_radio_button(2) cs_advanced.filter_reports() if cs_advanced.results_found: cs_advanced.click_plugin_filename_header() Assert.is_sorted_ascending( cs_advanced.plugin_filename_results_list()) cs_advanced.click_plugin_filename_header() Assert.is_sorted_descending( cs_advanced.plugin_filename_results_list()) else: Assert.equal(cs_advanced.query_results_text(1), "No results were found.", cs_advanced.get_url_current_page())
def test_sorting_by_newest(self, mozwebqa): search_page = Home(mozwebqa).search_for('firebug') search_page.click_sort_by('Newest') Assert.true('sort=created' in search_page.get_url_current_page()) Assert.is_sorted_descending( [i.created_date for i in search_page.results])
def test_sorting_by_number_of_most_users(self, mozwebqa): search_page = Home(mozwebqa).search_for('firebug') search_page.click_sort_by('Most Users') Assert.contains('sort=users', search_page.get_url_current_page()) Assert.is_sorted_descending([i.users for i in search_page.results])
def test_that_most_popular_section_is_ordered_by_users(self, mozwebqa): home_page = Home(mozwebqa) most_popular_items = home_page.most_popular_items Assert.is_sorted_descending( [i.users_number for i in most_popular_items])