def test_that_checks_required_field_validations_on_basic_info_for_a_free_app(self, mozwebqa): """Ensure that all required fields generate warning messages and prevent form submission. Litmus link: https://litmus.mozilla.org/show_test.cgi?id=50478 """ dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") my_apps = dev_home.header.click_my_submissions() # bring up the basic info form for the first free app edit_listing = my_apps.first_free_app.click_edit() # check App URL validation basic_info_region = edit_listing.click_edit_basic_info() basic_info_region.type_url_end('') basic_info_region.click_save_changes() Assert.true(basic_info_region.is_this_form_open) Assert.contains('This field is required.', basic_info_region.url_end_error_message) basic_info_region.click_cancel() # check Summary validation basic_info_region = edit_listing.click_edit_basic_info() basic_info_region.type_description('') basic_info_region.click_save_changes() Assert.true(basic_info_region.is_this_form_open) Assert.contains('This field is required.', basic_info_region.description_error_message) basic_info_region.click_cancel()
def test_assert_that_a_app_can_be_added_and_deleted_via_the_api(self, mozwebqa_devhub_logged_in): mock_app = MockApplication() # generate mock app # init API client mk_api = MarketplaceAPI.get_client(mozwebqa_devhub_logged_in.base_url, mozwebqa_devhub_logged_in.credentials) mk_api.submit_app(mock_app) # submit app app_status = mk_api.app_status(mock_app) # get app data from API # check that app is pending Assert.equal(2, app_status['status']) # Check for app on the site dev_home = Home(mozwebqa_devhub_logged_in) app_status_page = dev_home.go_to_app_status_page(mock_app) Assert.contains(mock_app.name, app_status_page.page_title) # Delete the app mk_api.delete_app(mock_app) app_status_page = dev_home.go_to_app_status_page(mock_app) Assert.contains("We're sorry, but we can't find what you're looking for.", app_status_page.app_not_found_message)
def test_that_checks_that_summary_must_be_limited_to_1024_chars_on_basic_info_for_a_free_app(self, mozwebqa): """Ensure that the summary field cannot contain over 1024 characters. Tests: - the message showing the number of characters remaining appears with an error class if the limit is exceeded - after submission with the limit exceeded an error message is displayed - the form cannot be successfully submitted if the limit is exceeded Litmus link: https://litmus.mozilla.org/show_test.cgi?id=50478 """ dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") my_apps = dev_home.header.click_my_submissions() # bring up the basic info form for the first free app edit_listing = my_apps.first_free_app.click_edit() basic_info_region = edit_listing.click_edit_basic_info() basic_info_region.type_summary('1234567890' * 103) Assert.false(basic_info_region.is_summary_char_count_ok, 'The character count for summary should display as an error but it does not') basic_info_region.click_save_changes() Assert.contains('Ensure this value has at most 1024 characters', basic_info_region.summary_error_message) Assert.true(basic_info_region.is_this_form_open)
def test_that_cancelling_an_app_icon_update_does_not_update_the_icon(self, mozwebqa): """Upload a new app icon, then cancel and ensure that the new icon is not used. Litmus link: https://litmus.mozilla.org/show_test.cgi?id=50479 """ dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") my_apps = dev_home.header.click_my_apps() app_listing = my_apps.first_free_app before_icon_src = app_listing.icon_preview_src # bring up the media form for the first free app media = app_listing.click_edit_media() icon_64_src = media.icon_preview_64_image_src icon_32_src = media.icon_preview_32_image_src # upload a new icon media.icon_upload(self._get_resource_path('img.jpg')) # check that the preview is updated Assert.not_equal(icon_64_src, media.icon_preview_64_image_src, 'The 64x64 icon should have changed, but it did not.') Assert.not_equal(icon_32_src, media.icon_preview_32_image_src, 'The 32x32 icon should have changed, but it did not.') # cancel the changes app_listing = media.click_cancel() # check that the icon preview has been updated Assert.equal(before_icon_src, app_listing.icon_preview_src, 'The app icon preview should not have changed, but it did.')
def test_assert_that_a_app_can_be_added_by_api(self, mozwebqa): mock_app = MockApplication() # generate mock app mock_app.name = "API %s" % mock_app.name # init API client mk_api = MarketplaceAPI.get_client(mozwebqa.base_url, mozwebqa.credentials) mk_api.submit_app(mock_app) # submit app app_status = mk_api.app_status(mock_app) # get app data from API # Selenium dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") dev_submissions = dev_home.header.click_my_submissions() dev_submissions.sorter.sort_by("created") apps = dev_submissions.submitted_apps app_names = [] for app in apps: app_names.append(app.name) Assert.contains(app_status["name"], app_names)
def test_that_a_screenshot_can_be_added(self, mozwebqa): """Test the happy path for adding a screenshot for a free submitted app. Litmus link: https://litmus.mozilla.org/show_test.cgi?id=50479 """ dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") my_apps = dev_home.header.click_my_submissions() edit_listing = my_apps.first_free_app.click_edit() before_screenshots_count = len(edit_listing.screenshots_previews) # bring up the media form for the first free app media_region = edit_listing.click_edit_media() screenshots_count = len(media_region.screenshots) # upload a new screenshot media_region.screenshot_upload(self._get_resource_path('img.jpg')) # check that the screenshot list is updated new_screenshots_count = len(media_region.screenshots) Assert.equal(screenshots_count + 1, new_screenshots_count, 'Expected %s screenshots, but there are %s.' % (screenshots_count + 1, new_screenshots_count)) # save the changes media_region.click_save_changes() # check that the icon preview has been updated after_screenshots_count = len(edit_listing.screenshots_previews) Assert.equal(before_screenshots_count + 1, len(edit_listing.screenshots_previews), 'Expected %s screenshots, but there are %s.' % (before_screenshots_count + 1, after_screenshots_count))
def test_that_deletes_app(self, mozwebqa): mock_app = MockApplication() # generate mock app mock_app.name = 'API %s' % mock_app.name # init API client mk_api = MarketplaceAPI.get_client(mozwebqa.base_url, mozwebqa.credentials) mk_api.submit_app(mock_app) # submit app app_status = mk_api.app_status(mock_app) # get app data from API dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") my_apps = dev_home.header.click_my_submissions() app_name = app_status['name'] self._delete_app(mozwebqa, app_name) Assert.true(my_apps.is_notification_visible) Assert.true(my_apps.is_notification_successful, my_apps.notification_message) Assert.equal("App deleted.", my_apps.notification_message) for i in range(1, my_apps.paginator.total_page_number + 1): for app in my_apps.submitted_apps: Assert.not_equal(app.name, app_name) if my_apps.paginator.is_paginator_present: if not my_apps.paginator.is_first_page_disabled: my_apps.paginator.click_next_page()
def test_that_checks_editing_basic_info_for_a_free_app(self, mozwebqa): """Test the happy path for editing the basic information for a free submitted app. Litmus link: https://litmus.mozilla.org/show_test.cgi?id=50478 """ updated_app = MockApplication( categories=[('Entertainment', False), ('Games', True), ('Music', True)], ) dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") my_apps = dev_home.header.click_my_submissions() edit_listing = my_apps.first_free_app.click_edit() # bring up the basic info form for the first free app basic_info_region = edit_listing.click_edit_basic_info() # update the details of the app basic_info_region.type_url_end(updated_app['url_end']) basic_info_region.type_description(updated_app['description']) for category in updated_app['categories']: # check/uncheck the checkbox according to the app value basic_info_region.select_categories(*category) basic_info_region.click_save_changes() # check that the listing has been updated Assert.true(edit_listing.no_forms_are_open) Assert.contains(updated_app['url_end'], edit_listing.url_end) Assert.equal(edit_listing.description, updated_app['description']) Assert.equal(edit_listing.categories.sort(), updated_app['categories'].sort())
def test_that_checks_editing_support_information_for_a_free_app(self, mozwebqa): """ Test edit support information for a free app. Pivotal task: https://www.pivotaltracker.com/story/show/27741207 Litmus: https://litmus.mozilla.org/show_test.cgi?id=50481 """ updated_app = MockApplication() dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") my_apps = dev_home.header.click_my_submissions() edit_listing = my_apps.first_free_app.click_edit() # update fields in support information support_info_region = edit_listing.click_support_information() support_info_region.type_support_email(updated_app['support_email']) support_info_region.type_support_url(updated_app['support_website']) support_info_region.click_save_changes() # Verify the changes have been made Assert.equal(edit_listing.email, updated_app['support_email']) Assert.equal(edit_listing.website, updated_app['support_website'])
def test_hosted_app_submission(self, mozwebqa, login_new): if '-dev.allizom' in mozwebqa.base_url: env = 'dev' else: env = 'stage' app = MockApplication(env) dev_home = Home(mozwebqa) dev_agreement = dev_home.click_submit_new_app() """Agree with the developer agreement and continue if it was not accepted in a previous app submit""" manifest_validation_form = dev_agreement.click_continue() # select device type for device in app['device_type']: if device[1]: manifest_validation_form.device_type(device[0]) # submit the app manifest url and validate it manifest_validation_form.type_app_manifest_url(app['url']) manifest_validation_form.click_validate() assert manifest_validation_form.app_validation_status, manifest_validation_form.app_validation_message try: app_details = manifest_validation_form.click_continue() assert app_details.is_the_current_submission_stage, 'Expected step is: Details\nActual step is: %s' % app_details.current_step # add custom app details for every field app_details.click_change_name() app_details.type_url_end(app['url_end']) app_details.type_description(app['description']) app_details.type_privacy_policy(app['privacy_policy']) app_details.type_homepage(app['homepage']) app_details.type_support_url(app['support_website']) app_details.type_support_email(app['support_email']) for category in app['categories']: # check/uncheck the checkbox according to the app value app_details.select_categories(*category) app_details.screenshot_upload(app['screenshot_link']) next_steps = app_details.click_continue() assert 'Almost There!' == next_steps.almost_there_message content_ratings = next_steps.click_continue() assert 'Get My App Rated' == content_ratings.get_app_rated_message # insert Submission ID and Security code to get app rated content_ratings.fill_in_app_already_rated_info(app['submission_id'], app['security_code']) content_ratings.click_submit() assert 'Congratulations, your app submission is now complete and will be reviewed shortly!' == content_ratings.saved_ratings_message finally: # Clean up app edit_app = dev_home.go_to_app_status_page(app) delete_popup = edit_app.click_delete_app() delete_popup.delete_app()
def mozwebqa_devhub_logged_in(request): from pages.desktop.developer_hub.home import Home mozwebqa = request.getfuncargvalue('mozwebqa') dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") return mozwebqa
def test_app_submission(self, mozwebqa): app = MockApplication() dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") dev_agreement = dev_home.header.click_submit_app() """Agree with the developer agreement and continue if it was not accepted in a previous app submit""" manifest_form = dev_agreement.click_continue() Assert.true(manifest_form.is_the_current_submission_stage, '\n Expected step is: App Manifest \n Actual step is: %s' % manifest_form.current_step) # submit the app manifest url and validate it manifest_form.type_app_manifest_url(app['url']) manifest_form.click_validate() Assert.true(manifest_form.app_validation_status, msg=manifest_form.app_validation_message) app_details = manifest_form.click_continue() Assert.true(app_details.is_the_current_submission_stage, '\n Expected step is: Details \n Actual step is: %s' % app_details.current_step) # add custom app details for every field app_details.click_change_name() app_details.type_name(app['name']) app_details.type_url_end(app['url_end']) app_details.type_summary(app['summary']) app_details.type_descripion(app['description']) app_details.type_privacy_policy(app['privacy_policy']) app_details.type_homepage(app['homepage']) app_details.type_support_url(app['support_website']) app_details.type_support_email(app['support_email']) for device in app['device_type']: # check/uncheck the checkbox according to the app value app_details.select_device_type(*device) for category in app['categories']: # check/uncheck the checkbox according to the app value app_details.select_categories(*category) app_details.screenshot_upload(app['screenshot_link']) payments = app_details.click_continue() Assert.true(payments.is_the_current_submission_stage, '\n Expected step is: Payments \n Actual step is: %s' % payments.current_step) # select the app payment method payments.select_payment_type(app['payment_type']) finished_form = payments.click_continue() Assert.true(finished_form.is_the_current_submission_stage, '\n Expected step is: Finished! \n Actual step is: %s' % finished_form.current_step) # check that the app submission procedure finished with success Assert.equal('Success! What happens now?', finished_form.success_message)
def test_packaged_app_submission(self, mozwebqa): app = MockApplication(app_type='packaged') dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") my_apps = dev_home.header.click_my_submissions() dev_agreement = my_apps.click_submit_new_app() """Agree with the developer agreement and continue if it was not accepted in a previous app submit""" manifest_validation_form = dev_agreement.click_continue() #select device type for device in app['device_type']: if device[1]: manifest_validation_form.device_type(device[0]) #select app type manifest_validation_form.app_type(app['app_type']) # submit the hosted app and validate it manifest_validation_form.upload_file(app['app_path']) manifest_validation_form.wait_for_app_validation() Assert.true(manifest_validation_form.app_validation_status, msg=manifest_validation_form.app_validation_message) app_details = manifest_validation_form.click_continue() Assert.true(app_details.is_the_current_submission_stage, '\n Expected step is: Details \n Actual step is: %s' % app_details.current_step) # add custom app details for every field app_details.click_change_name() app_details.type_url_end(app['url_end']) app_details.type_summary(app['summary']) app_details.type_description(app['description']) app_details.type_privacy_policy(app['privacy_policy']) app_details.type_homepage(app['homepage']) app_details.type_support_url(app['support_website']) app_details.type_support_email(app['support_email']) for category in app['categories']: # check/uncheck the checkbox according to the app value app_details.select_categories(*category) app_details.screenshot_upload(app['screenshot_link']) finished_form = app_details.click_continue() Assert.true(finished_form.is_the_current_submission_stage, '\n Expected step is: Finished! \n Actual step is: %s' % finished_form.current_step) # check that the app submission procedure succeeded Assert.equal('Success! What happens now?', finished_form.success_message)
def test_that_checks_apps_are_sorted_by_name(self, mozwebqa): dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") dev_submissions = dev_home.header.click_my_submissions() dev_submissions.sorter.sort_by('Name') submitted_app_names = [app.name.lower() for app in dev_submissions.submitted_apps] Assert.is_sorted_ascending(submitted_app_names, 'Apps are not sorted ascending.\nApp names = %s' % submitted_app_names)
def test_that_checks_required_field_validations_on_device_types_for_hosted_apps(self, mozwebqa): dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") my_apps = dev_home.header.click_my_submissions() # bring up the compatibility form for the first free app compatibility_page = my_apps.first_free_hosted_app.click_compatibility_and_payments() compatibility_page.clear_device_types() compatibility_page.click_save_changes() Assert.contains('Please select a device.', compatibility_page.device_types_error_message)
def test_that_checks_that_manifest_url_cannot_be_edited_via_basic_info_for_a_free_app(self, mozwebqa): """Ensure that the manifest url cannot be edited via the basic info form.""" dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") my_apps = dev_home.header.click_my_submissions() # bring up the basic info form for the first free app edit_listing = my_apps.first_free_hosted_app.click_edit() basic_info_region = edit_listing.click_edit_basic_info() Assert.true(basic_info_region.is_manifest_url_not_editable)
def _delete_app(self, mozwebqa, app_name): from pages.desktop.developer_hub.home import Home dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() submitted_apps = dev_home.header.click_my_apps() app = submitted_apps.get_app(app_name) more_options_menu = app.click_more() manage_status = more_options_menu.click_manage_status() delete_popup = manage_status.click_delete_app() return delete_popup.delete_app()
def test_that_checks_that_manifest_url_cannot_be_edited_via_basic_info_for_a_free_app(self, mozwebqa): """Ensure that the manifest url cannot be edited via the basic info form. Litmus link: https://litmus.mozilla.org/show_test.cgi?id=50478 """ with pytest.raises(InvalidElementStateException): dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") my_apps = dev_home.header.click_my_apps() # bring up the basic info form for the first free app basic_info = my_apps.first_free_app.click_edit_basic_info() """attempting to type into the manifest_url input should raise an InvalidElementStateException""" basic_info.type_manifest_url('any value should cause an exception')
def test_that_checks_apps_are_sorted_by_date(self, mozwebqa): dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") dev_submissions = dev_home.header.click_my_submissions() dev_submissions.sorter.sort_by('Created') import time previous_app_date = time.gmtime() for i in range(1, dev_submissions.paginator.total_page_number): for app in dev_submissions.submitted_apps: Assert.greater_equal(previous_app_date, app.date, 'Apps are not sorted ascending. According to Created date.') dev_submissions.paginator.click_next_page()
def test_assert_that_an_app_can_be_added_and_deleted_via_the_api(self, api, base_url, selenium, login_existing): mock_app = MockApplication() # generate mock app api.submit_app(mock_app) # submit app app_status = api.app_status(mock_app) # get app data from API # check that app is pending assert 2 == app_status['status'] # Check for app on the site dev_home = Home(base_url, selenium) app_status_page = dev_home.go_to_app_status_page(mock_app) assert mock_app.name in app_status_page.page_title # Delete the app api.delete_app(mock_app) app_status_page = dev_home.go_to_app_status_page(mock_app) assert "We're sorry, but we can't find what you're looking for." in app_status_page.app_not_found_message
def test_that_an_icon_cannot_be_added_via_an_invalid_file_format(self, mozwebqa): """Check that a tiff cannot be successfully uploaded as an app icon.""" dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") my_apps = dev_home.header.click_my_submissions() edit_listing = my_apps.first_free_app.click_edit() # bring up the media form for the first free app media_region = edit_listing.click_edit_media() # upload a new icon with an invalid format media_region.icon_upload(self._get_resource_path('img.tiff')) # check that the expected error message is displayed Assert.contains('Images must be either PNG or JPG.', media_region.icon_upload_error_message)
def test_that_checks_required_field_validations_on_basic_info_for_a_free_app(self, mozwebqa): """Ensure that all required fields generate warning messages and prevent form submission. Litmus link: https://litmus.mozilla.org/show_test.cgi?id=50478 """ dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") my_apps = dev_home.header.click_my_apps() # bring up the basic info form for the first free app basic_info = my_apps.first_free_app.click_edit_basic_info() # check name validation basic_info.type_name('') basic_info = basic_info.click_save_changes('failure') Assert.true(basic_info.is_this_form_open) Assert.contains('This field is required.', basic_info.name_error_message) basic_info.type_name('something') # check App URL validation basic_info.type_url_end('') basic_info = basic_info.click_save_changes('failure') Assert.true(basic_info.is_this_form_open) Assert.contains('This field is required.', basic_info.url_end_error_message) basic_info.type_url_end('something') # check Summary validation basic_info.type_summary('') basic_info = basic_info.click_save_changes('failure') Assert.true(basic_info.is_this_form_open) Assert.contains('This field is required.', basic_info.summary_error_message) basic_info.type_summary('something') # check Categories validation basic_info.clear_categories() basic_info = basic_info.click_save_changes('failure') Assert.true(basic_info.is_this_form_open) Assert.contains('This field is required.', basic_info.categories_error_message) basic_info.select_categories('Music', True) # check Device Types basic_info.clear_device_types() basic_info = basic_info.click_save_changes('failure') Assert.true(basic_info.is_this_form_open) Assert.contains('This field is required.', basic_info.device_types_error_message)
def test_assert_that_an_app_can_be_added_and_deleted_via_the_api(self, api, mozwebqa, login_existing): mock_app = MockApplication() # generate mock app api.submit_app(mock_app) # submit app app_status = api.app_status(mock_app) # get app data from API # check that app is pending Assert.equal(2, app_status['status']) # Check for app on the site dev_home = Home(mozwebqa) app_status_page = dev_home.go_to_app_status_page(mock_app) Assert.contains(mock_app.name, app_status_page.page_title) # Delete the app api.delete_app(mock_app) app_status_page = dev_home.go_to_app_status_page(mock_app) Assert.contains("We're sorry, but we can't find what you're looking for.", app_status_page.app_not_found_message)
def test_that_deletes_app(self, mozwebqa): dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") my_apps = dev_home.header.click_my_apps() first_free_app = my_apps.first_free_app app_name = first_free_app.name self._delete_app(mozwebqa, app_name) Assert.true(my_apps.is_notification_visibile) Assert.true(my_apps.is_notification_succesful, my_apps.notification_message) Assert.equal("App deleted.", my_apps.notification_message) for i in range(1, my_apps.paginator.total_page_number): for app in my_apps.submitted_apps: Assert.not_equal(app.name, app_name) my_apps.paginator.click_next_page()
def test_that_a_screenshot_cannot_be_added_via_an_invalid_file_format(self, mozwebqa): """Check that a tiff cannot be successfully uploaded as a screenshot.. Litmus link: https://litmus.mozilla.org/show_test.cgi?id=50479 """ dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") my_apps = dev_home.header.click_my_submissions() edit_listing = my_apps.first_free_app.click_edit() # bring up the media form for the first free app media_region = edit_listing.click_edit_media() # upload a new screenshot media_region.screenshot_upload(self._get_resource_path('img.tiff')) # check that the expected error message is displayed screenshot_upload_error_message = media_region.screenshot_upload_error_message Assert.contains('There was an error uploading your file.', screenshot_upload_error_message) Assert.contains('Images must be either PNG or JPG.', screenshot_upload_error_message)
def test_hosted_app_submission(self, mozwebqa): app = MockApplication() dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") my_apps = dev_home.header.click_my_submissions() dev_agreement = my_apps.click_submit_new_app() """Agree with the developer agreement and continue if it was not accepted in a previous app submit""" manifest_validation_form = dev_agreement.click_continue() # select device type for device in app['device_type']: if device[1]: manifest_validation_form.device_type(device[0]) # submit the app manifest url and validate it manifest_validation_form.type_app_manifest_url(app['url']) manifest_validation_form.click_validate() Assert.true(manifest_validation_form.app_validation_status, msg=manifest_validation_form.app_validation_message) app_details = manifest_validation_form.click_continue() Assert.true(app_details.is_the_current_submission_stage, '\n Expected step is: Details \n Actual step is: %s' % app_details.current_step) # add custom app details for every field app_details.click_change_name() app_details.type_url_end(app['url_end']) app_details.type_description(app['description']) app_details.type_privacy_policy(app['privacy_policy']) app_details.type_homepage(app['homepage']) app_details.type_support_url(app['support_website']) app_details.type_support_email(app['support_email']) for category in app['categories']: # check/uncheck the checkbox according to the app value app_details.select_categories(*category) app_details.screenshot_upload(app['screenshot_link']) try: next_steps = app_details.click_continue() Assert.equal('Almost There!', next_steps.almost_there_message) content_ratings = next_steps.click_continue() Assert.equal('Get My App Rated', content_ratings.get_app_rated_message) except Exception as exception: Assert.fail(exception) finally: # Clean up app edit_app = dev_home.go_to_apps_status_page(app) delete_popup = edit_app.click_delete_app() return delete_popup.delete_app()
def test_that_checks_apps_are_sorted_by_date(self, mozwebqa): dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") dev_submissions = dev_home.header.click_my_submissions() dev_submissions.sorter.sort_by('Created') incomplete_apps = False import time previous_app_date = time.gmtime() for i in range(1, dev_submissions.paginator.total_page_number): for app in dev_submissions.submitted_apps: if app.is_incomplete: incomplete_apps = True else: if not incomplete_apps: Assert.greater_equal(previous_app_date, app.date, 'Apps are not sorted ascending. According to Created date.') else: Assert.fail('Apps with a finished submission process are found after apps with the submission process unfinished') dev_submissions.paginator.click_next_page()
def test_packaged_app_submission(self, mozwebqa): app = MockApplication(app_type='packaged') dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") dev_agreement = dev_home.click_submit_new_app() """Agree with the developer agreement and continue if it was not accepted in a previous app submit""" manifest_validation_form = dev_agreement.click_continue() # select device type for device in app['device_type']: if device[1]: manifest_validation_form.device_type(device[0]) # select app type manifest_validation_form.app_type(app['app_type']) # submit the hosted app and validate it manifest_validation_form.upload_file(app['app_path']) manifest_validation_form.wait_for_app_validation() Assert.true(manifest_validation_form.app_validation_status, msg=manifest_validation_form.app_validation_message) app_details = manifest_validation_form.click_continue() Assert.true(app_details.is_the_current_submission_stage, '\n Expected step is: Details \n Actual step is: %s' % app_details.current_step) # add custom app details for every field app_details.click_change_name() app_details.type_url_end(app['url_end']) app_details.type_description(app['description']) app_details.type_privacy_policy(app['privacy_policy']) app_details.type_homepage(app['homepage']) app_details.type_support_url(app['support_website']) app_details.type_support_email(app['support_email']) for category in app['categories']: # check/uncheck the checkbox according to the app value app_details.select_categories(*category) app_details.screenshot_upload(app['screenshot_link']) next_steps = app_details.click_continue() Assert.equal('Almost There!', next_steps.almost_there_message) content_ratings = next_steps.click_continue() Assert.equal('Get My App Rated', content_ratings.get_app_rated_message) # insert Submission ID and Security code to get app rated content_ratings.fill_in_app_already_rated_info(app['submission_id'], app['security_code']) content_ratings.click_submit() Assert.equal('Congratulations, your app submission is now complete and will be reviewed shortly!', content_ratings.saved_ratings_message)
def _go_to_edit_listing_page(self, mozwebqa, app): dev_home = Home(mozwebqa) edit_listing_page = dev_home.go_to_edit_listing_page(app) assert app.name in edit_listing_page.page_title return edit_listing_page
def login_existing(mozwebqa, existing_user): from pages.desktop.developer_hub.home import Home home_page = Home(mozwebqa) home_page.go_to_developers_homepage() home_page.login(mozwebqa, existing_user['email'], existing_user['password'])
def test_hosted_paid_app_submission(self, mozwebqa): if 'marketplace.allizom.org' in mozwebqa.base_url: pytest.xfail(reason=('Payment account has not been setup on stage.' ' https://github.com/mozilla/marketplace-tests/issues/352')) app = MockApplication() dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") my_apps = dev_home.header.click_my_submissions() dev_agreement = my_apps.click_submit_new_app() """Agree with the developer agreement and continue if it was not accepted in a previous app submit""" manifest_validation_form = dev_agreement.click_continue() # select a premium manifest_validation_form.premium_type('paid') #select device type for device in app['device_type']: if device[1]: manifest_validation_form.device_type(device[0], 'paid') # submit the app manifest url and validate it manifest_validation_form.type_app_manifest_url(app['url']) manifest_validation_form.click_validate() Assert.true(manifest_validation_form.app_validation_status, msg=manifest_validation_form.app_validation_message) app_details = manifest_validation_form.click_continue() Assert.true(app_details.is_the_current_submission_stage, '\n Expected step is: Details \n Actual step is: %s' % app_details.current_step) # add custom app details for every field app_details.click_change_name() app_details.type_url_end(app['url_end']) app_details.type_description(app['description']) app_details.type_privacy_policy(app['privacy_policy']) app_details.type_homepage(app['homepage']) app_details.type_support_url(app['support_website']) app_details.type_support_email(app['support_email']) for category in app['categories']: # check/uncheck the checkbox according to the app value app_details.select_categories(*category) app_details.screenshot_upload(app['screenshot_link']) finished_form = app_details.click_continue() Assert.true(finished_form.is_the_current_submission_stage, '\n Expected step is: Finished! \n Actual step is: %s' % finished_form.current_step) # check that the app submission procedure succeeded Assert.equal('Success! What happens now?', finished_form.success_message) # setup payments payments = finished_form.click_setup_payments() # select payment account payments.select_payment_account() # setup price tier app_price = '$0.10' payments.select_price(app_price) payments.click_payments_save_changes() Assert.equal(payments.app_price, app_price, '\n Expected price is: %s \n Actual price is: %s' % (app_price, payments.app_price))
def test_premium_app_submission(self, mozwebqa): developer_paypal_page = PayPal(mozwebqa) developer_paypal_page.go_to_page() developer_paypal_page.login_paypal(user="******") Assert.true(developer_paypal_page.is_user_logged_in) app = MockApplication(payment_type='Premium') dev_home = Home(mozwebqa) dev_home.go_to_developers_homepage() dev_home.login(user="******") dev_agreement = dev_home.header.click_submit_app() """Agree with the developer agreement and continue if it was not accepted in a previous app submit""" manifest_form = dev_agreement.click_continue() Assert.true(manifest_form.is_the_current_submission_stage, '\n Expected step is: App Manifest \n Actual step is: %s' % manifest_form.current_step) # submit the app manifest url and validate it manifest_form.type_app_manifest_url(app['url']) manifest_form.click_validate() Assert.true(manifest_form.app_validation_status, msg=manifest_form.app_validation_message) app_details = manifest_form.click_continue() Assert.true(app_details.is_the_current_submission_stage, '\n Expected step is: Details \n Actual step is: %s' % app_details.current_step) # add custom app details for every field app_details.click_change_name() app_details.type_name(app['name']) app_details.type_url_end(app['url_end']) app_details.type_summary(app['summary']) app_details.type_description(app['description']) app_details.type_privacy_policy(app['privacy_policy']) app_details.type_homepage(app['homepage']) app_details.type_support_url(app['support_website']) app_details.type_support_email(app['support_email']) for device in app['device_type']: # check/uncheck the checkbox according to the app value app_details.select_device_type(*device) for category in app['categories']: # check/uncheck the checkbox according to the app value app_details.select_categories(*category) app_details.screenshot_upload(app['screenshot_link']) payments = app_details.click_continue() # select the app payment method payments.select_payment_type(app['payment_type']) up_sell = payments.click_continue() up_sell.select_price(app['app_price']) up_sell.make_public(app['make_public']) pay_pal = up_sell.click_continue() pay_pal.select_paypal_account(app['business_account']) pay_pal.paypal_email(mozwebqa.credentials['sandbox']['email']) bounce = pay_pal.click_continue() paypall_sandbox = bounce.click_setup_permissions() paypall_sandbox.login_paypal_sandbox() contact_information = paypall_sandbox.click_grant_permission() contact_information.first_name(app['first_name']) contact_information.last_name(app['last_name']) contact_information.address_field_one(app['address']) contact_information.city(app['city']) contact_information.state(app['state']) contact_information.post_code(app['post_code']) contact_information.country(app['country']) contact_information.phone(app['phone']) finished_form = contact_information.click_continue() Assert.true(finished_form.is_the_current_submission_stage, '\n Expected step is: Finished! \n Actual step is: %s' % finished_form.current_step) # check that the app submission procedure finished with success Assert.equal('Success! What happens now?', finished_form.success_message)
def _go_to_edit_listing_page(self, mozwebqa, app): dev_home = Home(mozwebqa) edit_listing_page = dev_home.go_to_edit_listing_page(app) Assert.contains(app.name, edit_listing_page.page_title) return edit_listing_page