def test_themes_subcategory_page_breadcrumb(self, mozwebqa): home_page = Home(mozwebqa) themes_page = home_page.click_themes() selected_category = themes_page.themes_category amo_category_page = themes_page.click_on_first_category() expected_breadcrumb = "Add-ons for Firefox Themes %s" % selected_category Assert.equal(expected_breadcrumb, amo_category_page.breadcrumb)
def test_that_clicking_on_a_subcategory_loads_expected_page(self, mozwebqa): """test for litmus 15949""" home_page = Home(mozwebqa) themes_page = home_page.click_themes() selected_category = themes_page.themes_category amo_category_page = themes_page.click_on_first_category() Assert.equal(selected_category, amo_category_page.title)
def test_that_clicking_on_theme_name_loads_its_detail_page(self, mozwebqa): """test for litmus 15363""" home_page = Home(mozwebqa) themes_page = home_page.click_themes() theme_name = themes_page.addon_name(1) theme_page = themes_page.click_on_first_addon() Assert.contains(theme_name, theme_page.addon_title)
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_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_categories_are_listed_on_left_hand_side(self, mozwebqa): """ test for litmus 15342""" home_page = Home(mozwebqa) themes_page = home_page.click_themes() current_page_url = home_page.get_url_current_page() Assert.true(current_page_url.endswith("/themes/")) default_categories = ["Animals", "Compact", "Large", "Miscellaneous", "Modern", "Nature", "OS Integration", "Retro", "Sports"] Assert.equal(themes_page.categories_count, len(default_categories)) count = 0 for category in default_categories: count += 1 current_category = themes_page.get_category(count) Assert.equal(category, current_category)
def test_that_themes_can_be_sorted_by_name(self, mozwebqa): """ Test for Litmus 11727, 4839 """ home_page = Home(mozwebqa) themes_page = home_page.click_themes() themes_page.click_sort_by("name") addons = themes_page.addon_names addons_set = set(addons) Assert.equal(len(addons), len(addons_set), "There are duplicates in the names") addons_orig = addons addons.sort() [Assert.equal(addons_orig[i], addons[i]) for i in xrange(len(addons))] themes_page.page_forward() addons = themes_page.addon_names addons_set = set(addons) Assert.equal(len(addons), len(addons_set), "There are duplicates in the names") addons_orig = addons addons.sort() [Assert.equal(addons_orig[i], addons[i]) for i in xrange(len(addons))]
def test_themes_page_breadcrumb(self, mozwebqa): """test for litmus 15344""" home_page = Home(mozwebqa) themes_page = home_page.click_themes() expected_breadcrumb = "Themes" Assert.equal(expected_breadcrumb, themes_page.breadcrumb_name)
def test_that_themes_page_has_correct_title(self, mozwebqa): """test for litmus 15340""" home_page = Home(mozwebqa) themes_page = home_page.click_themes() expected_title = "Most Popular Themes :: Add-ons for Firefox" Assert.equal(expected_title, themes_page.page_title)
def test_that_themes_loads_themes_landing_page(self, mozwebqa): """test for litmus 15339""" home_page = Home(mozwebqa) themes_page = home_page.click_themes() url_current_page = themes_page.get_url_current_page() Assert.true(url_current_page.endswith("/themes/"))