def test_footer_section(self, mozwebqa): dnt_page = DoNotTrack(mozwebqa) dnt_page.go_to_page() bad_links = [] for link in DoNotTrack.Footer.footer_links_list: url = dnt_page.link_destination(link.get('locator')) if not url.endswith(link.get('url_suffix')): bad_links.append('%s does not end with %s' % (url, link.get('url_suffix'))) Assert.equal(0, len(bad_links), '%s bad links found: ' % len(bad_links) + ', '.join(bad_links))
def test_status_section(self, base_url, selenium): page = DoNotTrack(base_url, selenium).open() bad_links = [] for link in page.tracking_protection_links_list: url = page.link_destination(link.get('locator')) if not fnmatchcase(url, '*/' + link.get('url_suffix')): bad_links.append('%s does not match %s' % (url, link.get('url_suffix'))) assert [] == bad_links
def test_footer_section(self, base_url, selenium): page = DoNotTrack(base_url, selenium).open() bad_links = [] for link in DoNotTrack.Footer.footer_links_list: url = page.link_destination(link.get('locator')) if not url.endswith(link.get('url_suffix')): bad_links.append('%s does not end with %s' % (url, link.get('url_suffix'))) assert [] == bad_links
def test_footer_section(self, mozwebqa): dnt_page = DoNotTrack(mozwebqa) dnt_page.go_to_page() bad_links = [] for link in DoNotTrack.Footer.footer_links_list: url = dnt_page.link_destination(link.get('locator')) if not url.endswith(link.get('url_suffix')): bad_links.append('%s does not end with %s' % (url, link.get('url_suffix'))) assert [] == bad_links
def test_tabzilla_links_are_correct(self, mozwebqa): dnt_page = DoNotTrack(mozwebqa) dnt_page.go_to_page() Assert.true(dnt_page.header.is_tabzilla_panel_visible) dnt_page.header.toggle_tabzilla_dropdown() bad_links = [] for link in DoNotTrack.Header.tabzilla_links_list: url = dnt_page.link_destination(link.get('locator')) if url.find(link.get('url_suffix')) < 1: bad_links.append('%s does not end with %s' % (url, link.get('url_suffix'))) Assert.equal(0, len(bad_links), '%s bad links found: ' % len(bad_links) + ', '.join(bad_links))
def test_status_section(self, mozwebqa): dnt_page = DoNotTrack(mozwebqa) dnt_page.go_to_page() Assert.true(dnt_page.is_status_wrapper_visible) Assert.true(dnt_page.is_status_text_visible) Assert.true(dnt_page.is_enable_dnt_image_visible) Assert.true(dnt_page.is_enable_dnt_text_visible) bad_links = [] for link in dnt_page.tracking_protection_links_list: url = dnt_page.link_destination(link.get('locator')) if not fnmatchcase(url, '*/' + link.get('url_suffix')): bad_links.append('%s does not match %s' % (url, link.get('url_suffix'))) Assert.equal(0, len(bad_links), '%s bad links found: ' % len(bad_links) + ', '.join(bad_links))
def test_status_section(self, mozwebqa): dnt_page = DoNotTrack(mozwebqa) dnt_page.go_to_page() assert dnt_page.is_status_wrapper_visible assert dnt_page.is_status_text_visible assert dnt_page.is_enable_dnt_image_visible assert dnt_page.is_enable_dnt_text_visible bad_links = [] for link in dnt_page.tracking_protection_links_list: url = dnt_page.link_destination(link.get('locator')) if not fnmatchcase(url, '*/' + link.get('url_suffix')): bad_links.append('%s does not match %s' % (url, link.get('url_suffix'))) assert [] == bad_links