def test_footer_links_are_valid(self, base_url, selenium): page = HomePage(base_url, selenium).open() bad_urls = [] for link in HomePage.Footer.footer_links_list: url = page.link_destination(link.get('locator')) response_code = 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 [] == bad_urls
def test_sign_up_form_link_urls_are_valid(self, mozwebqa): home_page = HomePage(mozwebqa) home_page.go_to_page() bad_urls = [] for link in home_page.sign_up_form_link_list: url = home_page.link_destination(link.get('locator')) response_code = home_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_footer_links_are_valid(self, mozwebqa): home_page = HomePage(mozwebqa) home_page.go_to_page() bad_urls = [] for link in HomePage.Footer.footer_links_list: url = home_page.link_destination(link.get('locator')) response_code = home_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 [] == bad_urls
def test_promo_links_are_valid(self, mozwebqa): home_page = HomePage(mozwebqa) home_page.go_to_page() bad_urls = [] for link in home_page.promo_links_list: url = home_page.link_destination(link.get('locator')) response_code = home_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_sign_up_form_links(self, base_url, selenium): page = HomePage(base_url, selenium).open() for link in page.sign_up_form_link_list: url = page.link_destination(link.get('locator')) assert url.endswith(link.get('url_suffix')) assert requests.codes.ok == page.get_response_code(url)