def test_products_links_are_visible(self, mozwebqa): products_page = ProductsPage(mozwebqa) products_page.go_to_page() bad_links = [] for link in products_page.products_links_list: if not products_page.is_element_visible(*link.get('locator')): bad_links.append('The link at %s is not visible' % link.get('locator')[1:]) Assert.equal(0, len(bad_links), '%s bad links found: ' % len(bad_links) + ', '.join(bad_links))
def test_images_are_visible(self, mozwebqa): products_page = ProductsPage(mozwebqa) products_page.go_to_page() bad_images = [] for image in products_page.images_list: if not products_page.is_element_visible(*image.get('locator')): bad_images.append('The image at %s is not visible' % image.get('locator')[1:]) Assert.equal(0, len(bad_images), '%s bad images found: ' % len(bad_images) + ', '.join(bad_images))
def test_firefox_links_are_visible(self, mozwebqa): products_page = ProductsPage(mozwebqa) products_page.go_to_page() bad_links = [] for link in products_page.firefox_links_list: if not products_page.is_element_visible(*link.get('locator')): bad_links.append('The link at %s is not visible' % link.get('locator')[1:]) Assert.equal(0, len(bad_links), '%s bad links found: ' % len(bad_links) + ', '.join(bad_links))
def test_product_nav_links_are_visible(self, mozwebqa): products_page = ProductsPage(mozwebqa) products_page.go_to_page() bad_links = [] for link in products_page.product_nav_links_list: if not products_page.is_element_visible(*link.get("locator")): bad_links.append("The link at %s is not visible" % link.get("locator")[1:]) Assert.equal(0, len(bad_links), "%s bad links found: " % len(bad_links) + ", ".join(bad_links))