Exemplo n.º 1
0
    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_summary('')
        basic_info_region.click_save_changes()
        Assert.true(basic_info_region.is_this_form_open)
        Assert.contains('This field is required.', basic_info_region.summary_error_message)
        basic_info_region.click_cancel()
Exemplo n.º 2
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'])
Exemplo n.º 3
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)
Exemplo n.º 4
0
    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))
Exemplo n.º 5
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)
Exemplo n.º 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())
Exemplo n.º 7
0
    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_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()
Exemplo n.º 9
0
    def test_that_checks_apps_are_sorted_by_name(self, mozwebqa_devhub_logged_in):
        dev_home = Home(mozwebqa_devhub_logged_in)

        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)
Exemplo n.º 10
0
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(mozwebqa, user="******")

    return mozwebqa
Exemplo n.º 11
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)
Exemplo n.º 12
0
 def test_that_checks_apps_are_sorted_by_name(self, mozwebqa,
                                              login_existing):
     dev_home = Home(mozwebqa)
     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 sorted(submitted_app_names) == submitted_app_names
Exemplo n.º 13
0
    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)
Exemplo n.º 14
0
    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)
Exemplo n.º 16
0
    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()
Exemplo n.º 17
0
    def test_that_checks_apps_are_sorted_by_date(self, mozwebqa,
                                                 login_existing):
        dev_home = Home(mozwebqa)
        dev_submissions = dev_home.header.click_my_submissions()
        dev_submissions.sorter.sort_by('Created')

        import time
        previous_app_date = time.gmtime()

        pages_to_test = 10 if dev_submissions.paginator.total_page_number >= 10 else dev_submissions.paginator.total_page_number
        for i in range(1, pages_to_test):
            for app in dev_submissions.submitted_apps:
                if app.has_date:
                    assert previous_app_date >= app.date
                    previous_app_date = app.date
            dev_submissions.paginator.click_next_page()
    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
            edit_listing = my_apps.first_free_app.click_edit()
            basic_info_region = edit_listing.click_edit_basic_info()
            """attempting to type into the manifest_url input should raise an
            InvalidElementStateException"""
            basic_info_region.type_manifest_url('any value should cause an exception')
    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)
Exemplo n.º 20
0
    def test_that_checks_apps_are_sorted_by_date(self, mozwebqa_devhub_logged_in):
        dev_home = Home(mozwebqa_devhub_logged_in)

        dev_submissions = dev_home.header.click_my_submissions()

        dev_submissions.sorter.sort_by('Created')

        import time
        previous_app_date = time.gmtime()

        pages_to_test = 10 if dev_submissions.paginator.total_page_number >= 10 else dev_submissions.paginator.total_page_number
        for i in range(1, pages_to_test):
            for app in dev_submissions.submitted_apps:
                if app.has_date:
                    Assert.greater_equal(previous_app_date, app.date, 'Apps are not sorted ascending. According to Created date.')
                    previous_app_date = app.date
            dev_submissions.paginator.click_next_page()
Exemplo n.º 21
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_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()
Exemplo n.º 23
0
    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_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_apps()

        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()
Exemplo n.º 25
0
 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
    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_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)
    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()
Exemplo n.º 29
0
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_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()