def test_that_featured_personas_go_to_their_landing_page_when_clicked(self): """ TestCase for Litmus 15081 """ discovery_pane= DiscoveryPane(self.selenium, self.basepath) first_persona = discovery_pane.first_persona first_persona_url = first_persona.lower().replace(" ","-") persona = discovery_pane.click_on_first_persona() self.assertTrue(first_persona_url in discovery_pane.get_url_current_page()) self.assertEqual(first_persona, persona.persona_title)
def test_that_featured_personas_go_to_their_landing_page_when_clicked(self, testsetup): """ TestCase for Litmus 15081 """ discovery_pane = DiscoveryPane(testsetup, self.basepath) first_persona = discovery_pane.first_persona first_persona_url = first_persona.lower().replace(" ", "-") persona = discovery_pane.click_on_first_persona() Assert.true(first_persona_url in discovery_pane.get_url_current_page()) Assert.equal(first_persona, persona.persona_title)
def test_that_mission_statement_is_on_addons_home_page(self, testsetup): """ TestCase for Litmus 15065 """ discovery_pane = DiscoveryPane(testsetup, self.basepath) discovery_pane.wait_for_mission_visible Assert.true(discovery_pane.is_mission_section_visible()) expected_text = "Thanks for using Firefox and supporting Mozilla's mission!" mission_text = discovery_pane.mission_section Assert.true(expected_text in mission_text) Assert.true(discovery_pane.mozilla_org_link_visible()) download_count_regex = "Add-ons downloaded: (.+)" Assert.true(re.search(download_count_regex, discovery_pane.download_count) != None)
def test_that_mission_statement_is_on_addons_home_page(self): """ TestCase for Litmus 15065 """ discovery_pane = DiscoveryPane(self.selenium, self.basepath) self.assertTrue(discovery_pane.is_mission_section_visible()) expected_text = "Thanks for using Firefox and supporting Mozilla's mission!" mission_text = discovery_pane.mission_section self.assertTrue(expected_text in mission_text) self.assertTrue(discovery_pane.mozilla_org_link_visible()) download_count_regex = "Add-ons downloaded: (.+)" self.assertTrue(re.search(download_count_regex, discovery_pane.download_count) != None)
def test_that_addons_count_are_equal_between_amo_and_discovery(self): """ TestCase for Litmus 15066 """ amo_home_page = AddonsHomePage(self.selenium) amo_download_count = amo_home_page.download_count.replace(",","") discovery_pane = DiscoveryPane(self.selenium, self.basepath) discovery_download_count_text = discovery_pane.download_count download_count = re.search("Add-ons downloaded: (.+)", discovery_download_count_text).group(1) download_count = download_count.replace(",","") self.assertEquals(amo_download_count, download_count)
def test_that_users_with_less_than_3_addons_get_what_are_addons(self): """ Test case for litmus 15063 - Since Selenium starts with a clean profile all the time this will always have less than 3 addons """ discovery_pane = DiscoveryPane(self.selenium, self.basepath) what_are_addons_expected = "Add-ons are applications that let you personalize " what_are_addons_expected += "Firefox with extra functionality or style. Try a time-saving" what_are_addons_expected += " sidebar, a weather notifier, or a themed look to make " what_are_addons_expected += "Firefox your own. Learn More" self.assertEquals(what_are_addons_expected, discovery_pane.what_are_addons_text)
def test_that_featured_personas_is_present_and_has_5_item(self, testsetup): """ TestCase for Litmus 15079, 15080 """ discovery_pane = DiscoveryPane(testsetup, self.basepath) Assert.true(discovery_pane.is_personas_section_visible()) Assert.equal(5, discovery_pane.personas_count) Assert.true(discovery_pane.is_personas_see_all_link_visible())
def test_that_up_and_coming_is_present_and_had_5_items(self, testsetup): """ TestCase for Litmus 15074 """ discovery_pane = DiscoveryPane(testsetup, self.basepath) Assert.true(discovery_pane.up_and_coming_visible()) Assert.equal(5, discovery_pane.up_and_coming_item_count)
def test_that_More_Ways_To_Customize_section_is_available(self, testsetup): " TestCase for Litmus 15082 " "" discovery_pane = DiscoveryPane(testsetup, self.basepath) Assert.true(discovery_pane.more_ways_section_visible()) Assert.equal("Browse all add-ons", discovery_pane.more_ways_addons) Assert.equal("See all themes and Personas", discovery_pane.more_ways_personas)
def test_that_up_and_coming_is_present_and_had_5_items(self): """ TestCase for Litmus 15074 """ discovery_pane = DiscoveryPane(self.selenium, self.basepath) self.assertTrue(discovery_pane.up_and_coming_visible()) self.assertEqual(5, discovery_pane.up_and_coming_item_count)
def test_that_More_Ways_To_Customize_section_is_available(self): " TestCase for Litmus 15082 """ discovery_pane = DiscoveryPane(self.selenium, self.basepath) self.assertTrue(discovery_pane.more_ways_section_visible()) self.assertEqual("Browse all add-ons", discovery_pane.more_ways_addons) self.assertEqual("See all themes and Personas", discovery_pane.more_ways_personas)
def test_that_featured_personas_is_present_and_has_5_item(self): """ TestCase for Litmus 15079, 15080 """ discovery_pane= DiscoveryPane(self.selenium, self.basepath) self.assertTrue(discovery_pane.is_personas_section_visible()) self.assertEqual(5, discovery_pane.personas_count) self.assertTrue(discovery_pane.is_personas_see_all_link_visible())