def test_marketplace_change_user_region(self): marketplace = Marketplace(self.marionette, 'Marketplace Dev') marketplace.launch() # login to marketplace marketplace.login(self.user) settings = marketplace.tap_settings() # change region settings.select_region(self._REGION) # save changes settings.tap_save_changes() # wait for the changes to be saved marketplace.wait_for_notification_message_displayed() self.assertEqual(marketplace.notification_message, 'Settings saved') # go to home marketplace.tap_home() # go back to settings settings = marketplace.tap_settings() # check if the region is same as changed before self.assertEqual(settings.region, self._REGION)
class TestMarketplaceLogin(GaiaTestCase): MARKETPLACE_DEV_NAME = 'Marketplace Dev' # Marketplace locators _settings_button_locator = ('css selector', 'a.header-button.settings') _sign_in_button_locator = ('css selector', 'a.button.browserid') _signed_in_notification_locator = ('id', 'notification') _sign_out_button_locator = ('css selector', 'a.button.logout') _email_account_field_locator = ('id', 'email') def setUp(self): GaiaTestCase.setUp(self) self.connect_to_network() self.install_marketplace() self.user = PersonaTestUser().create_user( verified=True, env={ "browserid": "firefoxos.persona.org", "verifier": "marketplace-dev.allizom.org" }) self.marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME) self.marketplace.launch() def test_login_marketplace(self): # https://moztrap.mozilla.org/manage/case/4134/ self.marketplace.wait_for_setting_displayed() settings = self.marketplace.tap_settings() persona = settings.tap_sign_in() persona.login(self.user.email, self.user.password) # switch back to Marketplace self.marionette.switch_to_frame() self.marketplace.launch() # tap on the signed-in notification at the bottom of the screen to dismiss it self.wait_for_element_displayed(*self._signed_in_notification_locator) self.marionette.tap( self.marionette.find_element( *self._signed_in_notification_locator)) settings.wait_for_sign_out_button() # Verify that user is logged in self.assertEqual(self.user.email, settings.email) # Sign out, which should return to the Marketplace home screen settings.tap_sign_out() # Verify that user is signed out self.marketplace.wait_for_setting_displayed() settings = self.marketplace.tap_settings() settings.wait_for_sign_in_displayed()
class TestMarketplaceLogin(GaiaTestCase): MARKETPLACE_DEV_NAME = 'Marketplace Dev' # Marketplace locators _settings_button_locator = ('css selector', 'a.header-button.settings') _sign_in_button_locator = ('css selector', 'a.button.browserid') _signed_in_notification_locator = ('id', 'notification') _sign_out_button_locator = ('css selector', 'a.button.logout') _email_account_field_locator = ('id', 'email') def setUp(self): GaiaTestCase.setUp(self) self.connect_to_network() self.install_marketplace() self.user = PersonaTestUser().create_user(verified=True, env={"browserid": "firefoxos.persona.org", "verifier": "marketplace-dev.allizom.org"}) self.marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME) self.marketplace.launch() def test_login_marketplace(self): # https://moztrap.mozilla.org/manage/case/4134/ self.marketplace.wait_for_setting_displayed() settings = self.marketplace.tap_settings() persona = settings.tap_sign_in() persona.login(self.user.email, self.user.password) # switch back to Marketplace self.marionette.switch_to_frame() self.marketplace.launch() # tap on the signed-in notification at the bottom of the screen to dismiss it self.wait_for_element_displayed(*self._signed_in_notification_locator) self.marionette.tap(self.marionette.find_element(*self._signed_in_notification_locator)) settings.wait_for_sign_out_button() # Verify that user is logged in self.assertEqual(self.user.email, settings.email) # Sign out, which should return to the Marketplace home screen settings.tap_sign_out() # Verify that user is signed out self.marketplace.wait_for_setting_displayed() settings = self.marketplace.tap_settings() settings.wait_for_sign_in_displayed()
class TestMarketplaceFeedback(GaiaTestCase): MARKETPLACE_DEV_NAME = 'Marketplace Dev' feedback_submitted_message = u'Feedback submitted. Thanks!' test_comment = 'This is a test comment.' def setUp(self): GaiaTestCase.setUp(self) self.connect_to_network() self.install_marketplace() self.user = PersonaTestUser().create_user( verified=True, env={ "browserid": "firefoxos.persona.org", "verifier": "marketplace-dev.allizom.org" }) def test_marketplace_feedback_user(self): # launch marketplace dev and go to marketplace self.marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME) self.marketplace.launch() # wait for settings button to come out self.marketplace.wait_for_setting_displayed() settings = self.marketplace.tap_settings() # sign in with persona persona = settings.tap_sign_in() persona.login(self.user.email, self.user.password) # switch back to Marketplace self.marionette.switch_to_frame() self.marketplace.launch() # go to settings section in marketplace app and go to feedback tab self.marketplace.wait_for_setting_displayed() settings = self.marketplace.tap_settings() self.marketplace.select_setting_feedback() # enter and submit your feedback self.marketplace.enter_feedback(self.test_comment) self.marketplace.submit_feedback() # catch the notification self.marketplace.wait_for_notification_message_displayed() message_content = self.marketplace.notification_message # verify if the notification is right self.assertEqual(message_content, self.feedback_submitted_message)
class TestMarketplaceFeedback(GaiaTestCase): MARKETPLACE_DEV_NAME = 'Marketplace Dev' feedback_submitted_message = u'Feedback submitted. Thanks!' test_comment = 'This is a test comment.' def setUp(self): GaiaTestCase.setUp(self) self.connect_to_network() self.install_marketplace() def test_marketplace_feedback_anonymous(self): # launch marketplace dev and go to marketplace self.marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME) self.marketplace.launch() # wait for settings button to come out self.marketplace.wait_for_setting_displayed() settings = self.marketplace.tap_settings() self.marketplace.select_setting_feedback() # enter and submit your feedback self.marketplace.enter_feedback(self.test_comment) self.marketplace.submit_feedback() # catch the notification self.marketplace.wait_for_notification_message_displayed() message_content = self.marketplace.notification_message # verify if the notification is right self.assertEqual(message_content, self.feedback_submitted_message)
def test_add_review(self): marketplace = Marketplace(self.marionette, 'Marketplace dev') marketplace.launch() # Sign in settings = marketplace.tap_settings() persona = settings.tap_sign_in() persona.login(self.user.email, self.user.password) self.marionette.switch_to_frame() marketplace.launch() settings.wait_for_sign_out_button() # Search and select app results = marketplace.search('SoundCloud') self.assertGreater(len(results.search_results), 0, 'No results found.') details_page = results.search_results[0].tap_app() # Setting your default values for review current_time = str(time.time()).split('.')[0] rating = random.randint(1, 5) body = 'This is a test %s' % current_time # Adding the review review_box = details_page.tap_write_review() review_box.write_a_review(rating, body) marketplace.wait_for_notification_message_displayed() # Check if review was added correctly self.assertEqual(marketplace.notification_message, "Your review was posted") self.assertEqual(details_page.first_review_rating, rating) self.assertEqual(details_page.first_review_body, body)
class TestMarketplaceFeedback(GaiaTestCase): MARKETPLACE_DEV_NAME = 'Marketplace Dev' feedback_submitted_message = u'Feedback submitted. Thanks!' test_comment = 'This is a test comment.' def setUp(self): GaiaTestCase.setUp(self) self.connect_to_network() self.install_marketplace() self.user = PersonaTestUser().create_user(verified=True, env={"browserid": "firefoxos.persona.org", "verifier": "marketplace-dev.allizom.org"}) def test_marketplace_feedback_user(self): # launch marketplace dev and go to marketplace self.marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME) self.marketplace.launch() # wait for settings button to come out self.marketplace.wait_for_setting_displayed() settings = self.marketplace.tap_settings() # sign in with persona persona = settings.tap_sign_in() persona.login(self.user.email, self.user.password) # switch back to Marketplace self.marionette.switch_to_frame() self.marketplace.launch() # go to settings section in marketplace app and go to feedback tab self.marketplace.wait_for_setting_displayed() settings = self.marketplace.tap_settings() self.marketplace.select_setting_feedback() # enter and submit your feedback self.marketplace.enter_feedback(self.test_comment) self.marketplace.submit_feedback() # catch the notification self.marketplace.wait_for_notification_message_displayed() message_content = self.marketplace.notification_message # verify if the notification is right self.assertEqual(message_content, self.feedback_submitted_message)
class TestMarketplaceLogin(GaiaTestCase): MARKETPLACE_DEV_NAME = 'Marketplace Dev' def setUp(self): GaiaTestCase.setUp(self) self.connect_to_network() self.install_marketplace() self.user = PersonaTestUser().create_user( verified=True, env={ "browserid": "firefoxos.persona.org", "verifier": "marketplace-dev.allizom.org" }) self.marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME) self.marketplace.launch() def test_login_marketplace(self): # https://moztrap.mozilla.org/manage/case/4134/ self.marketplace.wait_for_setting_displayed() settings = self.marketplace.tap_settings() persona = settings.tap_sign_in() persona.login(self.user.email, self.user.password) # switch back to Marketplace self.marionette.switch_to_frame() self.marketplace.launch() # wait for signed-in notification at the bottom of the screen to clear self.marketplace.wait_for_notification_message_not_displayed() # Verify that user is logged in self.assertEqual(self.user.email, settings.email) # Sign out, which should return to the Marketplace home screen settings.tap_sign_out() # Verify that user is signed out settings.wait_for_sign_in_displayed()
class TestMarketplaceLogin(GaiaTestCase): MARKETPLACE_DEV_NAME = 'Marketplace Dev' def setUp(self): GaiaTestCase.setUp(self) self.connect_to_network() self.install_marketplace() self.user = PersonaTestUser().create_user(verified=True, env={"browserid": "firefoxos.persona.org", "verifier": "marketplace-dev.allizom.org"}) self.marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME) self.marketplace.launch() def test_login_marketplace(self): # https://moztrap.mozilla.org/manage/case/4134/ self.marketplace.wait_for_setting_displayed() settings = self.marketplace.tap_settings() persona = settings.tap_sign_in() persona.login(self.user.email, self.user.password) # switch back to Marketplace self.marionette.switch_to_frame() self.marketplace.launch() # wait for signed-in notification at the bottom of the screen to clear self.marketplace.wait_for_notification_message_not_displayed() # Verify that user is logged in self.assertEqual(self.user.email, settings.email) # Sign out, which should return to the Marketplace home screen settings.tap_sign_out() # Verify that user is signed out settings.wait_for_sign_in_displayed()