def test_details_page_for_an_app(self, mozwebqa): """https://moztrap.mozilla.org/runtests/run/243/env/112/ - Verify details page for an app""" home_page = Home(mozwebqa) home_page.go_to_homepage() app_name = home_page.home_page_apps[0].name # click first app and load its Details Page details_page = home_page.click_first_home_page_app() details_page.click_more_button() # The verifications required by the testcase Assert.true(details_page.header.is_back_button_visible) Assert.true(app_name in details_page.title) Assert.true(details_page.is_author_visible) Assert.true(details_page.is_app_icon_present) Assert.true(details_page.is_rating_visible) Assert.true(details_page.is_product_details_visible) Assert.true(details_page.is_description_visible)
def test_reviews_section(self, mozwebqa): """https://moztrap.mozilla.org/runtests/run/243/env/112/ - Verify details page for an app - Reviews section""" home_page = Home(mozwebqa) home_page.go_to_homepage() # click first app and load its Details Page details_page = home_page.click_first_home_page_app() # This takes the number of reviews on the details page and based on that number it treats 3 different scenarios: # when the app has reviews, when it has 1 review and when the app isn't rated. if details_page.is_app_rated: if details_page.reviews_count >= 2: if len(details_page.reviews) == 2: for review in details_page.reviews: Assert.true(review.is_visible) elif details_page.reviews_count == 1: Assert.true(details_page.reviews[0].is_visible) else: Assert.equal(details_page.app_not_rated_text, 'App not yet rated') Assert.true(details_page.is_write_a_review_button_visible) for support_button in details_page.support_buttons: Assert.true(support_button.is_visible)