Beispiel #1
0
    def _developer_page_login_to_paypal(self, mozwebqa):
        """login to PayPal developer pages"""

        from pages.desktop.paypal.paypal import PayPal
        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)
        return developer_paypal_page
    def test_that_user_can_remove_prepapproval_on_payment_settings_page(self, mozwebqa):
        # We have to first login to paypal developer to access the paypal sandbox
        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)

        # Now we start to test the marketplace pages
        home_page = Home(mozwebqa)
        home_page.go_to_homepage()
        home_page.login(user="******")

        Assert.true(home_page.is_the_current_page)
        Assert.true(home_page.footer.is_user_logged_in)

        # go to Payment Settings page
        settings_page = home_page.footer.click_account_settings()
        Assert.true(settings_page.is_the_current_page)

        payment_settings_page = settings_page.click_payment_menu()
        Assert.true(payment_settings_page.is_the_current_page)
        Assert.equal('Payment Settings', payment_settings_page.header_title)

        try:
            # verify that pre-approval is active
            Assert.true(payment_settings_page.is_remove_pre_approval_button_visible, "Remove pre-approval button is not available. Pre-approval might be off")

            # remove pre-approval
            payment_settings_page.click_remove_pre_approval()
            Assert.false(payment_settings_page.is_remove_pre_approval_button_visible, "Remove pre-approval button is visible after click_remove_pre_approval")
            Assert.false(payment_settings_page.is_pre_approval_enabled, "Pre-approval is still enabled")
            Assert.true(payment_settings_page.is_success_message_visible, "Success message is not visible")

        except Exception as exception:
            Assert.fail(exception)

        finally:
            # restore the account to the initial state
            # logging in to paypal sandbox
            paypal_sandbox = payment_settings_page.click_set_up_pre_approval()
            paypal_sandbox.click_login_tab()
            Assert.true(paypal_sandbox.is_login_box_visible, "sandbox login form is not visible")
            paypal_sandbox.login_paypal_sandbox(user="******")
            Assert.true(paypal_sandbox.is_user_logged_in)

            # From this point on we have set up the pre-approval and need to remove this option after we check it
            paypal_sandbox.click_approve_button()

            Assert.true(payment_settings_page.is_pre_approval_enabled)
            Assert.true(payment_settings_page.is_success_message_visible)
    def test_that_user_can_set_up_pre_approval_on_payment_settings_page(self, mozwebqa):
        """
        Test for Litmus 58172.
        https://litmus.mozilla.org/show_test.cgi?id=58172
        """

        # We have to first login to paypal developer to access the paypal sandbox
        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)

        # Now we start to test the marketplace pages
        home_page = Home(mozwebqa)
        home_page.go_to_homepage()
        home_page.login(user="******")

        Assert.true(home_page.is_the_current_page)
        Assert.true(home_page.footer.is_user_logged_in)

        # go to Payment Settings page
        settings_page = home_page.footer.click_account_settings()
        Assert.true(settings_page.is_the_current_page)

        payment_settings_page = settings_page.click_payment_menu()
        Assert.equal('Payment Settings', payment_settings_page.header_title)

        # logging in to paypal sandbox
        paypal_sandbox = payment_settings_page.click_set_up_pre_approval()
        paypal_sandbox.click_login_tab()

        Assert.true(paypal_sandbox.is_login_box_visible, "sandbox login form is not visible")
        paypal_sandbox.login_paypal_sandbox(user="******")
        Assert.true(paypal_sandbox.is_user_logged_in)

        try:
            # From this point on we have set up the pre-approval and need to remove this option after we check it
            paypal_sandbox.click_approve_button()

            Assert.true(payment_settings_page.is_pre_approval_enabled)
            Assert.true(payment_settings_page.is_success_message_visible)

        except Exception as exception:
            Assert.fail(exception)

        finally:
            if payment_settings_page.is_remove_pre_approval_button_visible:
                payment_settings_page.click_remove_pre_approval()
            Assert.false(payment_settings_page.is_remove_pre_approval_button_visible)
Beispiel #4
0
    def _developer_page_login_to_paypal(self, mozwebqa):
        """login to PayPal developer pages"""

        from pages.desktop.paypal.paypal import PayPal
        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)
        return developer_paypal_page
 def _developer_page_login_to_paypal(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)
     return developer_paypal_page
Beispiel #6
0
 def _developer_page_login_to_paypal(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)
     return developer_paypal_page
    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)