def test_that_user_can_purchase_an_app(self, mozwebqa, new_user): if '-dev' not in mozwebqa.base_url: pytest.skip("Payments can only be tested on dev.") else: pytest.xfail("Bug 1212152 - App purchases are failing on dev") home_page = Home(mozwebqa) home_page.go_to_homepage() home_page.header.click_sign_in() home_page.login(new_user['email'], new_user['password']) assert home_page.is_the_current_page home_page.set_region('us') # Use the first paid app app = home_page.header.search(':paid').results[0] app_name = app.name details_page = app.click_name() assert 'free' not in details_page.price_text assert 'paid' in details_page.app_status payment = details_page.click_install_button() payment.create_pin(self.PIN) payment.wait_for_buy_app_section_displayed() assert app_name == payment.app_name payment.click_buy_button() # We are not able to interact with the doorhanger that appears to install the app # using Selenium # We can check for the `purchased` attribute on the price button though details_page.wait_for_app_purchased()
def test_that_user_can_purchase_an_app(self, base_url, selenium, new_user): if '-dev' not in base_url: pytest.skip("Payments can only be tested on dev.") else: pytest.xfail("Bug 1212152 - App purchases are failing on dev") home_page = Home(base_url, selenium) home_page.go_to_homepage() home_page.header.click_sign_in() home_page.login(new_user['email'], new_user['password']) assert home_page.is_the_current_page home_page.set_region('us') # Use the first paid app app = home_page.header.search(':paid').results[0] app_name = app.name details_page = app.click_name() assert 'free' not in details_page.price_text assert 'paid' in details_page.app_status payment = details_page.click_install_button() payment.create_pin(self.PIN) payment.wait_for_buy_app_section_displayed() assert app_name == payment.app_name payment.click_buy_button() # We are not able to interact with the doorhanger that appears to install the app # using Selenium # We can check for the `purchased` attribute on the price button though details_page.wait_for_app_purchased()
def test_that_user_can_purchase_an_app(self, mozwebqa, new_user): if '-dev' not in mozwebqa.base_url: pytest.skip("Payments can only be tested on dev.") home_page = Home(mozwebqa) home_page.go_to_homepage() home_page.header.click_sign_in() home_page.login(new_user['email'], new_user['password']) Assert.true(home_page.is_the_current_page) home_page.set_region('us') # Use the first paid app app = home_page.header.search(':paid').results[0] app_name = app.name details_page = app.click_name() Assert.false('free' in details_page.price_text) Assert.true('paid' in details_page.app_status) payment = details_page.click_install_button() payment.create_pin(self.PIN) payment.wait_for_buy_app_section_displayed() Assert.equal(app_name, payment.app_name) payment.click_buy_button() # We are not able to interact with the doorhanger that appears to install the app # using Selenium # We can check for the `purchased` attribute on the price button though details_page.wait_for_app_purchased()
def test_that_user_can_purchase_an_app(self, mozwebqa): if '-dev' not in mozwebqa.base_url: pytest.skip("Payments can only be tested on dev.") home_page = Home(mozwebqa) home_page.go_to_homepage() acct = self.create_new_user(mozwebqa) home_page.header.click_sign_in() home_page.login(acct) Assert.true(home_page.is_the_current_page) home_page.set_region('us') details_page = home_page.header.search_and_click_on_app(self._app_name) Assert.not_equal('Free', details_page.price_text) Assert.true('paid' in details_page.app_status) payment = details_page.click_install_button() payment.create_pin(self.PIN) payment.wait_for_buy_app_section_displayed() Assert.equal(self._app_name, payment.app_name) payment.click_buy_button() # We are not able to interact with the doorhanger that appears to install the app # using Selenium # We can check for the `purchased` attribute on the price button though details_page.wait_for_app_purchased()
def test_clicking_on_content_rating(self, mozwebqa): home_page = Home(mozwebqa) home_page.go_to_homepage() assert home_page.is_the_current_page home_page.set_region("restofworld") search_term = self._take_first_free_app_name(mozwebqa) details_page = home_page.header.search_and_click_on_app(search_term) assert details_page.is_the_current_page details_page.wait_for_ratings_image_visible() content_ratings_page = details_page.click_content_ratings_button() assert content_ratings_page.is_the_current_page assert content_ratings_page.is_ratings_table_visible
def test_clicking_on_content_rating(self, mozwebqa): home_page = Home(mozwebqa) home_page.go_to_homepage() Assert.true(home_page.is_the_current_page) home_page.set_region("restofworld") search_term = self._take_first_new_app_name(mozwebqa) details_page = home_page.header.search_and_click_on_app(search_term) Assert.true(details_page.is_the_current_page) Assert.true(details_page.is_ratings_image_visible) # Click on Content Ratings button content_ratings_page = details_page.click_content_ratings_button() Assert.true(content_ratings_page.is_the_current_page) Assert.true(content_ratings_page.is_ratings_table_visible)