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()
示例#2
0
    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_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)
示例#4
0
    def test_that_checks_editing_basic_info_for_a_free_app(self, mozwebqa_devhub_logged_in, free_app):
        """Test the happy path for editing the basic information for a free submitted app."""

        updated_app = MockApplication(
            categories=[('Entertainment', False), ('Games', True), ('Music', True)],
        )

        edit_listing = self._go_to_edit_listing_page(mozwebqa_devhub_logged_in, free_app)

        # 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())
示例#5
0
    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'])
示例#6
0
    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_name(updated_app['name'])
        basic_info_region.type_url_end(updated_app['url_end'])
        basic_info_region.type_summary(updated_app['summary'])

        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.equal(edit_listing.name, updated_app['name'])
        Assert.contains(updated_app['url_end'], edit_listing.url_end)
        Assert.equal(edit_listing.summary, updated_app['summary'])
        Assert.equal(edit_listing.categories.sort(), updated_app['categories'].sort())
示例#7
0
    def test_assert_that_a_app_can_be_added_and_deleted_via_the_api(self, mozwebqa):
        mock_app = MockApplication()  # generate mock app

        # 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

        # check that app is pending
        Assert.equal(2, app_status['status'])

        # Check for app on the site
        dev_home = Home(mozwebqa)
        dev_home.go_to_developers_homepage()
        dev_home.login(user="******")

        mock_app['url_end'] = app_status['slug']
        app_status_page = dev_home.go_to_apps_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_apps_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_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()
示例#9
0
    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'])

        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)
示例#10
0
def free_app(request, api):
    """Return a free app created via the Marketplace API, and automatically delete the app after the test."""
    app = MockApplication()
    api.submit_app(app)

    def fin():
        if app['id'] > 0:
            api.delete_app(app)

    request.addfinalizer(fin)
    return app
示例#11
0
def free_app(request):
    """Return a free app created via the Marketplace API, and automatically delete the app after the test."""
    mozwebqa = request.getfuncargvalue('mozwebqa')
    request.app = MockApplication()
    api = MarketplaceAPI.get_client(mozwebqa.base_url, mozwebqa.credentials)
    api.submit_app(request.app)

    # This acts like a tearDown, running after each test function
    def fin():
        # If the app is being deleted by the test, set the id to 0
        if hasattr(request, 'app') and request.app['id'] > 0:
            api.delete_app(request.app)

    request.addfinalizer(fin)
    return request.app
    def test_that_checks_editing_support_information_for_a_free_app(
            self, mozwebqa, login, free_app):
        updated_app = MockApplication()
        edit_listing = self._go_to_edit_listing_page(mozwebqa, free_app)

        # 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'])
示例#13
0
    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 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 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_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 test_new_version_submission_for_awaiting_review_app(self, mozwebqa, login_new):
        if '-dev.allizom' in mozwebqa.base_url:
            env = 'dev'
        else:
            env = 'stage'

        app = MockApplication(env, app_type='packaged')

        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])

        # select app type
        manifest_validation_form.app_type(app['app_type'])

        # submit the packaged app and validate it
        manifest_validation_form.upload_file(app['app_path'])
        manifest_validation_form.wait_for_app_validation()

        assert manifest_validation_form.app_validation_status, manifest_validation_form.app_validation_message
        app_details = manifest_validation_form.click_continue()
        try:
            # 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()
            next_steps.click_continue()

            # Go to the Edit Page and add a new version
            manage_status = dev_home.go_to_app_status_page(app)
            new_version = MockApplication(app_type='new_version')

            manage_status.upload_file(new_version['app_path'])
            manage_status.wait_for_app_validation()
            manage_status.click_continue()
            assert 'New version successfully added.' == manage_status.notification_message
            manage_status.type_release_notes(new_version['description'])

            manage_status.click_save_changes()
            assert 'Version successfully edited.' == manage_status.notification_message
            assert '2.0' == manage_status.new_packaged_version
            assert 'Pending approval' == manage_status.new_version_status_message
            assert 'Obsolete' == manage_status.previous_version_status_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()
示例#16
0
    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_hosted_paid_app_submission(self, mozwebqa_devhub_logged_in):
        if '-dev.allizom' in mozwebqa_devhub_logged_in.base_url:
            env = 'dev'
        else:
            env = 'stage'

        app = MockApplication(env)

        dev_home = Home(mozwebqa_devhub_logged_in)

        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 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)
        try:
            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('Content ratings successfully saved.',
                         content_ratings.saved_ratings_message)

            # setup payments
            payments = content_ratings.click_setup_payments()

            # select payment account
            payments.select_payment_account()

            # setup price tier
            app_price = '0.99 USD'
            payments.select_price(app_price)

            payments.click_payments_save_changes()
            Assert.true(payments.is_update_notification_visible)
            Assert.equal(payments.app_price, app_price, '\n Expected price is: %s \n Actual price is: %s' % (app_price, payments.app_price))

        except Exception as exception:
            Assert.fail(exception)
        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 test_check_submission_of_an_app_with_XSS_in_its_app_name(self, mozwebqa_devhub_logged_in):
        if '-dev.allizom' in mozwebqa_devhub_logged_in.base_url:
            env = 'dev'
        else:
            env = 'stage'

        app = MockApplication(env, app_type='xss_app')

        dev_home = Home(mozwebqa_devhub_logged_in)

        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])

        manifest_validation_form.app_type(app['app_type'])

        # 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)
        try:
            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)

            # check that xss is in app name
            edit_listing_page = dev_home.go_to_edit_listing_page(app)
            Assert.contains(u"<script>alert(‘XSS')</script>", edit_listing_page.page_title)

            # check that xss name is in my submissions
            dev_submissions = edit_listing_page.left_nav_menu.click_my_submissions_menu()
            submitted_app_names = [first_app.name.lower() for first_app in dev_submissions.submitted_apps]
            Assert.equal(u"<script>alert(‘xss')</script>", submitted_app_names[0])

        except Exception as exception:
            Assert.fail(exception)
        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 test_packaged_app_submission(self, mozwebqa):
        if '-dev.allizom' in mozwebqa.base_url:
            env = 'dev'
        else:
            env = 'stage'

        app = MockApplication(env, 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)