def test_showcased_apps_link_urls_are_valid(self, mozwebqa): apps_page = Apps(mozwebqa) apps_page.go_to_page() bad_urls = [] for link in apps_page.showcased_apps_links: url = link.get_attribute('href') response_code = apps_page.get_response_code(url) if response_code != requests.codes.ok: bad_urls.append('%s is not a valid url - status code: %s.' % (url, response_code)) Assert.equal(0, len(bad_urls), '%s bad urls found: ' % len(bad_urls) + ', '.join(bad_urls))
def test_page_link_urls_are_valid(self, mozwebqa): apps_page = Apps(mozwebqa) apps_page.go_to_page() bad_urls = [] for link in apps_page.page_links_list: url = apps_page.link_destination(link.get('locator')) response_code = apps_page.get_response_code(url) if response_code != requests.codes.ok: bad_urls.append('%s is not a valid url - status code: %s.' % (url, response_code)) Assert.equal(0, len(bad_urls), '%s bad urls found: ' % len(bad_urls) + ', '.join(bad_urls))
def test_showcased_apps_link_urls_are_valid(self, mozwebqa): apps_page = Apps(mozwebqa) apps_page.go_to_page() bad_urls = [] for link in apps_page.showcased_apps_links: url = link.get_attribute('href') response_code = apps_page.get_response_code(url) if response_code != requests.codes.ok: bad_urls.append('%s is not a valid url - status code: %s.' % (url, response_code)) Assert.equal( 0, len(bad_urls), '%s bad urls found: ' % len(bad_urls) + ', '.join(bad_urls))
def test_page_link_urls_are_valid(self, mozwebqa): apps_page = Apps(mozwebqa) apps_page.go_to_page() bad_urls = [] for link in apps_page.page_links_list: url = apps_page.link_destination(link.get('locator')) response_code = apps_page.get_response_code(url) if response_code != requests.codes.ok: bad_urls.append('%s is not a valid url - status code: %s.' % (url, response_code)) Assert.equal( 0, len(bad_urls), '%s bad urls found: ' % len(bad_urls) + ', '.join(bad_urls))