def test_search_pagination(self, mozwebqa):
        """Litmus 13636 - Input: Verify Search results have pagination."""
        feedback_pg = FeedbackPage(mozwebqa)
        feedback_pg.go_to_feedback_page()
        feedback_pg.search_for("facebook")

        Assert.true(feedback_pg.is_older_messages_link_visible)
        Assert.false(feedback_pg.is_newer_messages_link_visible)
        Assert.equal(feedback_pg.older_messages_link, 'Older Messages')

        feedback_pg.click_older_messages()
        Assert.equal(feedback_pg.search_term_from_url, "facebook")

        Assert.true(feedback_pg.is_older_messages_link_visible)
        Assert.true(feedback_pg.is_newer_messages_link_visible)
        Assert.equal(feedback_pg.older_messages_link, 'Older Messages')
        Assert.equal(feedback_pg.newer_messages_link, 'Newer Messages')
        Assert.equal(feedback_pg.page_from_url, 2)

        feedback_pg.click_newer_messages()
        Assert.equal(feedback_pg.search_term_from_url, "facebook")

        Assert.true(feedback_pg.is_older_messages_link_visible)
        Assert.false(feedback_pg.is_newer_messages_link_visible)
        Assert.equal(feedback_pg.older_messages_link, 'Older Messages')
        Assert.equal(feedback_pg.page_from_url, 1)
    def test_that_reports_abuse_as_anonymous_user(self, mozwebqa):

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        Assert.true(home_page.is_the_current_page)

        search_term = self._take_first_new_app_name(mozwebqa)
        details_page = home_page.header.search_and_click_on_app(search_term)

        Assert.true(details_page.is_the_current_page)

        Assert.true(details_page.is_report_abuse_button_visible)
        report_abuse_box = details_page.click_report_abuse_button()

        Assert.true(report_abuse_box.is_visible)
        Assert.false(report_abuse_box.is_report_button_enabled)

        report_abuse_box.insert_text('This is an automatically generated report.')
        Assert.true(report_abuse_box.is_report_button_enabled)

        report_abuse_box.click_report_button()

        details_page.wait_notification_box_visible()
        Assert.equal(details_page.notification_message, "Abuse reported")
Example #3
0
 def test_sign_out(self, mozwebqa):
     home_page = HomePage(mozwebqa)
     home_page.go_to_page()
     home_page.sign_in()
     Assert.true(home_page.is_signed_in)
     home_page.sign_out()
     Assert.false(home_page.is_signed_in)
Example #4
0
    def test_that_only_browser_reports_have_browser_icon(self, mozwebqa):
        """
        https://www.pivotaltracker.com/story/show/17099455
        """
        csp = CrashStatsHomePage(mozwebqa)
        reports_page = csp.click_last_product_top_crashers_link()
        type, days, os = 'Browser', '7', 'Windows'
        Assert.equal(reports_page.current_filter_type, type)
        reports_page.click_filter_days_by(days)
        reports_page.click_filter_os_by(os)
        Assert.equal(
            (type, days, os),
            (reports_page.current_filter_type,
             reports_page.current_days_filter, reports_page.current_os_filter))
        signature_list_items = reports_page.random_signature_items(19)
        Assert.true(
            len(signature_list_items) > 0, "Signature list items not found")

        for signature_item in signature_list_items:
            Assert.true(
                signature_item.is_browser_icon_visible,
                "Signature %s did not have a browser icon" %
                signature_item.title)
            Assert.false(
                signature_item.is_plugin_icon_visible,
                "Signature %s unexpectedly had a plugin icon" %
                signature_item.title)
Example #5
0
    def test_feedback_custom_date_filter(self, mozwebqa):
        """

        This testcase covers # 13605, 13606 & 13715 in Litmus
        1. Verifies the calendar is displayed when filtering on custom dates
        2. Verifies date-start=<date> and end-date=<date> in the url

        """
        feedback_pg = feedback_page.FeedbackPage(mozwebqa)

        feedback_pg.go_to_feedback_page()
        Assert.equal(feedback_pg.date_filter.custom_dates_tooltip, "Custom")

        start_date = date.today() - timedelta(days=3)
        end_date = date.today() - timedelta(days=1)

        feedback_pg.date_filter.filter_by_custom_dates_using_datepicker(start_date, end_date)
        Assert.equal(feedback_pg.date_start_from_url, start_date.strftime("%Y-%m-%d"))
        Assert.equal(feedback_pg.date_end_from_url, end_date.strftime("%Y-%m-%d"))
        # TODO: Check results are within the expected date range, possibly by navigating to the first/last pages and checking the final result is within range. Currently blocked by bug 615844.

        # Check that the relevant days preset link is highlighted when the applied custom date filter matches it
        day_filters = ((1, "1d"), (7, "7d"), (30, "30d"))
        for days in day_filters:
            start_date = date.today() - timedelta(days=days[0])
            feedback_pg.date_filter.filter_by_custom_dates_using_datepicker(start_date, date.today())
            Assert.false(feedback_pg.date_filter.is_custom_date_filter_visible)
            Assert.equal(feedback_pg.date_start_from_url, start_date.strftime("%Y-%m-%d"))
            Assert.equal(feedback_pg.date_end_from_url, date.today().strftime("%Y-%m-%d"))
            Assert.equal(feedback_pg.date_filter.current_days, days[1])
    def test_that_header_menu_has_expected_items(self, mozwebqa):
        """
        Verify the menu opens & closes.  Verify menu item names
        """

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        Assert.false(home_page.header.menu.is_menu_visible,
                     "Menu open at page open")

        # open menu and verify visibility
        home_page.header.menu.open_menu()
        Assert.true(home_page.header.menu.is_menu_visible, "Menu is not open")

        # verify menu item names
        expected_menu = [
            "Home", "Popular", "Top Free", "Top Paid", "Categories"
        ]
        Assert.equal(expected_menu,
                     [item.name for item in home_page.header.menu.items],
                     "Unexpected menu item")

        # close menu and verify
        home_page.header.menu.close_menu()
        Assert.false(home_page.header.menu.is_menu_visible,
                     "Menu did not close")
Example #7
0
 def test_my_analysis_tab(self, cnf_tasks_pg):
     ''' Test the my analysis tab components '''
     page = cnf_tasks_pg.current_subtab.load_my_vm_analysis_tasks_tab()
     Assert.false(page.current_subtab.task_buttons.is_cancel_button_present)
     self.check_common_tab(page)
     page.filter_for_zone('<All Zones>')
     page.filter_for_task_state('Aborting')
Example #8
0
    def test_search_pagination(self, mozwebqa):
        """
        Litmus 13636 - Input: Verify Search results have pagination
        """
        feedback_pg = feedback_page.FeedbackPage(mozwebqa)
        feedback_pg.go_to_feedback_page()
        feedback_pg.search_for("facebook")

        Assert.true(feedback_pg.is_next_page_visible)
        Assert.true(feedback_pg.is_previous_page_visible)
        Assert.false(feedback_pg.is_previous_page_enabled)

        Assert.equal(feedback_pg.previous_link, u"\xab Newer Messages")
        Assert.equal(feedback_pg.next_link, u"Older Messages \xbb")

        for var in range(2, 12):
            feedback_pg.click_next_page()
            Assert.equal(feedback_pg.product_from_url, "firefox")
            Assert.equal(feedback_pg.search_term_from_url, "facebook")

            Assert.true(feedback_pg.is_next_page_visible)
            Assert.true(feedback_pg.is_previous_page_visible)

            Assert.true(feedback_pg.is_previous_page_enabled)
            Assert.true(feedback_pg.is_next_page_enabled)

            Assert.equal(feedback_pg.previous_link, u"\xab Newer Messages")
            Assert.equal(feedback_pg.next_link, u"Older Messages \xbb")

            Assert.equal(int(feedback_pg.page_from_url), var)
    def test_that_exploitable_crash_report_not_displayed_for_not_logged_in_users(
            self, mozwebqa):
        """https://github.com/mozilla/Socorro-Tests/issues/214"""

        csp = CrashStatsHomePage(mozwebqa)
        Assert.true('Exploitable Crashes' not in csp.header.report_list)
        Assert.false(csp.header.is_exploitable_crash_report_present)
    def test_that_reports_abuse_as_anonymous_user(self, mozwebqa):

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        Assert.true(home_page.is_the_current_page)
        search_page = home_page.header.search(self.search_term)

        # Select the first application link in the list
        details_page = search_page.results[0].click_name()
        Assert.true(details_page.is_the_current_page)

        Assert.true(details_page.is_report_abuse_button_visible)
        report_abuse_box = details_page.click_report_abuse_button()

        Assert.true(report_abuse_box.is_visible)
        Assert.false(report_abuse_box.is_report_button_enabled)

        report_abuse_box.insert_text('This is an automatically generated report.')
        Assert.true(report_abuse_box.is_report_button_enabled)

        report_abuse_box.click_report_button()

        details_page.wait_notification_box_visible()
        Assert.equal(details_page.notification_message, "Abuse reported")
Example #11
0
    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 log in to PayPal developer to access the PayPal sandbox
        self._developer_page_login_to_paypal(mozwebqa)

        # get to payment settings page as 'add_preapproval' user
        payment_settings_page = self._payment_settings_page_as_user(
            mozwebqa, 'add_preapproval')

        try:
            # set up non-pre-approval precondition
            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)

            # do test
            payment_settings_page = self._set_up_pre_approval(
                payment_settings_page)

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

        finally:
            # clean up
            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)
 def test_logout(self, mozwebqa):
     home_pg = HomePage(mozwebqa)
     home_pg.go_to_home_page()
     home_pg.login_region.login()
     Assert.true(home_pg.is_logged_in)
     home_pg.login_region.logout()
     Assert.false(home_pg.is_logged_in)
Example #13
0
    def test_that_user_can_purchase_an_app(self, mozwebqa, new_user):
        if '-dev' not in mozwebqa.base_url:
            pytest.skip("Payments can only be tested on dev.")

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()
        home_page.header.click_sign_in()
        home_page.login(new_user['email'], new_user['password'])
        Assert.true(home_page.is_the_current_page)
        home_page.set_region('us')

        # Use the first paid app
        app = home_page.header.search(':paid').results[0]
        app_name = app.name
        details_page = app.click_name()
        Assert.false('free' in details_page.price_text)
        Assert.true('paid' in details_page.app_status)

        payment = details_page.click_install_button()
        payment.create_pin(self.PIN)
        payment.wait_for_buy_app_section_displayed()
        Assert.equal(app_name, payment.app_name)

        payment.click_buy_button()
        # We are not able to interact with the doorhanger that appears to install the app
        # using Selenium
        # We can check for the `purchased` attribute on the price button though
        details_page.wait_for_app_purchased()
Example #14
0
    def test_that_reports_abuse_as_signed_in_user(self, mozwebqa):

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        Assert.true(home_page.is_the_current_page)
        home_page.login(user="******")
        Assert.true(home_page.header.is_user_logged_in)

        search_term = self._take_first_new_app_name(mozwebqa)
        details_page = home_page.header.search_and_click_on_app(search_term)

        Assert.true(details_page.is_the_current_page)

        Assert.true(details_page.is_report_abuse_button_visible)
        report_abuse_box = details_page.click_report_abuse_button()

        Assert.true(report_abuse_box.is_visible)
        Assert.false(report_abuse_box.is_report_button_enabled)

        report_abuse_box.insert_text('This is an automatically generated report.')
        Assert.true(report_abuse_box.is_report_button_enabled)

        report_abuse_box.click_report_button()

        details_page.wait_notification_box_visible()
        Assert.equal(details_page.notification_message, "Abuse reported")
Example #15
0
    def test_that_extensions_page_contains_addons_and_the_pagination_works(
            self, mozwebqa):
        home_page = Home(mozwebqa)
        featured_extensions_page = home_page.header.site_navigation_menu(
            "Extensions").click()

        # Assert that at least one addon is displayed
        Assert.greater(len(featured_extensions_page.extensions), 0)

        if len(featured_extensions_page.extensions) < 20:
            # Assert that the paginator is not present if fewer than 20 extensions are displayed
            Assert.false(featured_extensions_page.is_paginator_present)
        else:
            # Assert that the paginator is present if 20 extensions are displayed
            Assert.true(featured_extensions_page.is_paginator_present)
            Assert.true(
                featured_extensions_page.paginator.is_prev_page_disabled)
            Assert.false(
                featured_extensions_page.paginator.is_next_page_disabled)

            featured_extensions_page.paginator.click_next_page()

            Assert.false(
                featured_extensions_page.paginator.is_prev_page_disabled)
            Assert.false(
                featured_extensions_page.paginator.is_next_page_disabled)

            featured_extensions_page.paginator.click_prev_page()

            Assert.equal(len(featured_extensions_page.extensions), 20)
            Assert.true(
                featured_extensions_page.paginator.is_prev_page_disabled)
            Assert.false(
                featured_extensions_page.paginator.is_next_page_disabled)
Example #16
0
    def test_feedback_custom_date_filter(self, mozwebqa):
        """

        1. Verifies the calendar is displayed when filtering on custom dates
        2. Verifies date-start=<date> and end-date=<date> in the url

        """
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()

        start_date = date.today() - timedelta(days=3)
        end_date = date.today() - timedelta(days=1)

        dashboard_pg.date_filter.filter_by_custom_dates_using_datepicker(start_date, end_date)
        Assert.equal(dashboard_pg.date_start_from_url, start_date.strftime('%Y-%m-%d'))
        Assert.equal(dashboard_pg.date_end_from_url, end_date.strftime('%Y-%m-%d'))

        # TODO: Check results are within the expected date range,
        # possibly by navigating to the first/last pages and checking
        # the final result is within range. Currently blocked by bug
        # 615844.

        day_filters = ((1, "1d"), (7, "7d"), (30, "30d"))
        for days in day_filters:
            start_date = date.today() - timedelta(days=days[0])
            dashboard_pg.date_filter.filter_by_custom_dates_using_datepicker(start_date, date.today())
            Assert.false(dashboard_pg.date_filter.is_custom_date_filter_visible)
            Assert.equal(dashboard_pg.date_start_from_url, start_date.strftime('%Y-%m-%d'))
            Assert.equal(dashboard_pg.date_end_from_url, self.default_end_date)
Example #17
0
    def test_feedback_custom_date_filter(self, mozwebqa):
        """This testcase covers # 13605, 13606 & 13715 in Litmus.

        1. Verifies the calendar is displayed when filtering on custom dates
        2. Verifies date-start=<date> and end-date=<date> in the url

        """
        feedback_pg = FeedbackPage(mozwebqa)

        feedback_pg.go_to_feedback_page()
        Assert.equal(feedback_pg.date_filter.custom_dates_tooltip, "Custom")

        start_date = date.today() - timedelta(days=3)
        end_date = date.today() - timedelta(days=1)

        feedback_pg.date_filter.filter_by_custom_dates_using_datepicker(start_date, end_date)
        Assert.equal(feedback_pg.date_start_from_url, start_date.strftime('%Y-%m-%d'))
        Assert.equal(feedback_pg.date_end_from_url, end_date.strftime('%Y-%m-%d'))
        # TODO: Check results are within the expected date range, possibly by navigating to the first/last pages and checking the final result is within range. Currently blocked by bug 615844.

        # Check that the relevant days preset link is highlighted when the applied custom date filter matches it
        day_filters = ((1, "1d"), (7, "7d"), (30, "30d"))
        for days in day_filters:
            start_date = date.today() - timedelta(days=days[0])
            feedback_pg.date_filter.filter_by_custom_dates_using_datepicker(start_date, date.today())
            Assert.false(feedback_pg.date_filter.is_custom_date_filter_visible)
            Assert.equal(feedback_pg.date_start_from_url, start_date.strftime('%Y-%m-%d'))
            Assert.equal(feedback_pg.date_end_from_url, date.today().strftime('%Y-%m-%d'))
            Assert.equal(feedback_pg.date_filter.current_days, days[1])
Example #18
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_editing_of_existing_suite_that_has_no_included_cases(self, mozwebqa_logged_in, product):
        #create suite and cases
        suite = self.create_suite(mozwebqa_logged_in, product, use_API=True)
        cases = self.create_bulk_cases(mozwebqa_logged_in, product, use_API=True, cases_amount=3)

        # simulate random order of cases
        case_list = [cases[i]['name'] for i in (2, 0, 1)]

        manage_suites_pg = MozTrapManageSuitesPage(mozwebqa_logged_in)
        manage_suites_pg.go_to_manage_suites_page()
        manage_suites_pg.filter_form.filter_by(lookup='name', value=suite['name'])
        edit_suite_pg = manage_suites_pg.edit_suite(name=suite['name'])

        # product field should not be read-only.
        Assert.false(
            edit_suite_pg.is_product_field_readonly,
            u'product version field should be editable')

        edit_suite_pg.include_cases_to_suite(case_list)
        manage_suites_pg.filter_form.filter_by(lookup='name', value=suite['name'])
        edit_suite_pg = manage_suites_pg.edit_suite(name=suite['name'])

        Assert.true(
            edit_suite_pg.is_product_field_readonly,
            u'product version field should be read-only')

        Assert.equal(
            [item.name for item in edit_suite_pg.included_cases], case_list,
            u'items are listed in wrong order')
    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
        self._developer_page_login_to_paypal(mozwebqa)

        # Login to consumer pages
        home_page, user = self._login_to_consumer_pages(mozwebqa, 'remove_preapproval')

        # get to payment settings page
        payment_settings_page = self._open_payment_settings_page(home_page)

        try:
            # set up pre-approval precondition
            if not payment_settings_page.is_pre_approval_enabled:
                payment_settings_page = self._set_up_pre_approval(payment_settings_page)
                Assert.true(payment_settings_page.is_remove_pre_approval_button_visible,
                    "Remove pre-approval button is not available. Pre-approval might be off")

            # do test
            payment_settings_page.click_remove_pre_approval()

            # verify
            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")

        finally:
            # restore the account to the initial state
            payment_settings_page = self._set_up_pre_approval(payment_settings_page)
            Assert.true(payment_settings_page.is_pre_approval_enabled)
            Assert.true(payment_settings_page.is_success_message_visible)
Example #21
0
    def test_private_groups_field_when_not_logged_in(self, base_url, selenium,
                                                     private_user):
        home_page = Home(base_url, selenium)
        profile_page = home_page.open_user_profile(private_user['name'])

        Assert.false(profile_page.is_groups_present,
                     u'Profile: ' + profile_page.get_url_current_page())
    def test_that_checks_the_deletion_of_a_review(self, mozwebqa):
        """
        https://moztrap.mozilla.org/manage/case/648/
        """
        # Step 1 - Login into Marketplace
        mock_review = MockReview()
        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        home_page.login()
        Assert.true(home_page.is_the_current_page)

        # Step 2 - Search for the test app and go to its details page
        search_page = home_page.header.search(self.test_app)
        details_page = search_page.results[0].click_name()
        Assert.true(details_page.is_the_current_page)
        Assert.true(details_page.is_write_review_link_visible)

        # Step 3 - Write a review
        add_review_box = details_page.click_write_review()
        reviews_page = add_review_box.write_a_review(mock_review['rating'], mock_review['body'])

        # Step 4 - Check review
        Assert.true(reviews_page.is_success_message_visible)

        # Step 5 - Delete review
        reviews = reviews_page.reviews[0]
        reviews.delete()
        Assert.true(reviews_page.is_success_message_visible)
        Assert.equal(reviews_page.success_message, "Your review was successfully deleted!")
        Assert.false(reviews.is_review_visible)
Example #23
0
    def test_private_groups_field_when_not_logged_in(self, mozwebqa):
        credentials = mozwebqa.credentials['vouched_with_private_fields']
        home_page = Home(mozwebqa)
        profile_page = home_page.open_user_profile(credentials['name'])

        Assert.false(profile_page.is_groups_present,
                     u'Profile: ' + profile_page.get_url_current_page())
Example #24
0
    def test_that_all_reviews_hyperlink_works(self, mozwebqa):
        """
        Test for Litmus 4843.
        https://litmus.mozilla.org/show_test.cgi?id=4843
        """
        #Open details page for Adblock Plus
        details_page = Details(mozwebqa, 'Adblock Plus')
        Assert.true(details_page.has_reviews)

        details_page.click_all_reviews_link()
        Assert.equal(details_page.review_count, 20)

        #Go to the last page and check that the next button is not present
        details_page.paginator.click_last_page()
        Assert.true(details_page.paginator.is_next_page_disabled)

        #Go one page back, check that it has 20 reviews
        #that the page number decreases and that the next link is visible
        page_number = details_page.paginator.page_number
        details_page.paginator.click_prev_page()
        Assert.false(details_page.paginator.is_next_page_disabled)
        Assert.equal(details_page.review_count, 20)
        Assert.equal(details_page.paginator.page_number, page_number - 1)

        #Go to the first page and check that the prev button is not present
        details_page.paginator.click_first_page()
        Assert.true(details_page.paginator.is_prev_page_disabled)

        #Go one page forward, check that it has 20 reviews,
        #that the page number increases and that the prev link is visible
        page_number = details_page.paginator.page_number
        details_page.paginator.click_next_page()
        Assert.false(details_page.paginator.is_prev_page_disabled)
        Assert.equal(details_page.review_count, 20)
        Assert.equal(details_page.paginator.page_number, page_number + 1)
    def test_for_edit_active_run_that_includes_suites_to_be_sure_they_are_listed(self, mozwebqa_logged_in, product):
        # create version
        version = product["version"]
        # create two test suites
        suite_a = self.create_suite(mozwebqa_logged_in, product=product, use_API=True, name="suite A")
        suite_b = self.create_suite(mozwebqa_logged_in, product=product, use_API=True, name="suite B")
        # create test run
        suite_order = [suite_b["name"], suite_a["name"]]
        test_run = self.create_run(mozwebqa_logged_in, product=product, version=version, suite_name_list=suite_order)

        manage_runs_pg = MozTrapManageRunsPage(mozwebqa_logged_in)
        manage_runs_pg.go_to_manage_runs_page()
        manage_runs_pg.filter_form.filter_by(lookup="name", value=test_run["name"])
        manage_runs_pg.activate_run(name=test_run["name"])
        edit_run_pg = manage_runs_pg.go_to_edit_run_page(test_run["name"])

        # assert that multiselect widget is not present thus suites list is readonly
        Assert.false(edit_run_pg.is_multiselect_widget_present, u"multiselect widget should not be present")
        # assert that order of suites is correct
        Assert.equal(suite_order, edit_run_pg.readonly_included_suites, u"suites are listed in wrong order")

        edit_run_pg.save_run()
        test_run = manage_runs_pg.test_runs[0]
        test_run.show_details()

        # assert that order of suites is still correct
        Assert.equal(suite_order, test_run.included_suites, u"suites are listed in wrong order")
    def test_the_middle_section_page(self, mozwebqa):
        """
        Litmus 13596 - input:Verify the layout of Latest Feedback section
        Litmus 13721 - input:Verify the layout of Feedback page(Feedback tab)
        """
        feedback_pg = feedback_page.FeedbackPage(mozwebqa)
        feedback_pg.go_to_feedback_page()

        Assert.equal(feedback_pg.search_box_placeholder, "Search by keyword")
        Assert.true(feedback_pg.message_count > 0)

        Assert.true(feedback_pg.is_chart_visible)

        Assert.true(feedback_pg.is_next_page_enabled)
        Assert.false(feedback_pg.is_previous_page_enabled)

        #the first click only applies the filters and add messages until the message count reaches 20
        #the second click goes to the next page
        #this is discussed in bug https://bugzilla.mozilla.org/show_bug.cgi?id=640007

        feedback_pg.click_next_page()
        feedback_pg.click_next_page()

        Assert.true(feedback_pg.is_next_page_enabled)
        Assert.true(feedback_pg.is_previous_page_enabled)

        feedback_pg.click_previous_page()

        Assert.true(feedback_pg.is_next_page_visible)
        Assert.false(feedback_pg.is_previous_page_enabled)
Example #27
0
    def test_that_user_can_logout(self, mozwebqa):
        home_pg = HomePage(mozwebqa)
        home_pg.go_to_home_page()
        home_pg.sign_in()

        home_pg.logout()
        Assert.false(home_pg.is_logged_in)
Example #28
0
    def test_search_change_column(self, mozwebqa):
        csp = CrashStatsHomePage(mozwebqa)
        cs_super = csp.header.click_super_search()
        cs_super.select_field('product')
        cs_super.select_operator('has terms')

        cs_super.click_search()
        Assert.true(cs_super.are_search_results_found)
        cs_super.click_more_options()

        # Delete all columns except the last one
        for column in cs_super.columns[:-1]:
            cs_super.click_crash_reports_tab()
            current_column = column.column_name
            Assert.true(current_column in cs_super.search_results_table_header.
                        table_column_names)

            number_of_columns = len(cs_super.columns)
            column.delete_column()
            cs_super.wait_for_column_deleted(number_of_columns - 1)
            Assert.false(cs_super.is_column_in_list(current_column))

            cs_super.click_search()
            if len(cs_super.columns) > 1:
                cs_super.click_crash_reports_tab()
                Assert.true(cs_super.are_search_results_found)
                Assert.true(
                    cs_super.search_results_table_header.is_column_not_present(
                        current_column))

        Assert.true(cs_super.columns[0].column_name in
                    cs_super.search_results_table_header.table_column_names)
    def test_that_checks_the_deletion_of_a_review(self, mozwebqa):
        """
        https://moztrap.mozilla.org/manage/case/648/
        """

        # Step 1 - Create new review
        mock_review = MockReview()
        mk_api = MarketplaceAPI(credentials=mozwebqa.credentials['api'])
        app = mk_api.get_app(self.test_app)
        review_id = mk_api.submit_app_review(app['id'], mock_review.body, mock_review.rating)

        # Step 2 - Login into Marketplace
        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        home_page.login(user="******")
        home_page.wait_notification_box_not_visible()
        Assert.true(home_page.is_the_current_page)

        # Step 3 - Search for the test app and go to its details page
        search_page = home_page.header.search(self.test_app)
        details_page = search_page.results[0].click_name()
        Assert.true(details_page.is_the_current_page)

        # Step 4 - Go to reviews page
        reviews_page = details_page.click_reviews_button()

        # Step 5 - Delete review
        reviews = reviews_page.reviews[0]
        reviews.delete()
        Assert.true(reviews_page.notification_visible)
        Assert.equal(reviews_page.notification_message, "Review deleted")
        Assert.false(reviews.is_review_visible)
    def test_visitor_can_watch_page(self, mozwebqa):
        home_pg = HomePage(mozwebqa)
        home_pg.go_to_home_page()
        home_pg.personal_tools_region.click_log_in_or_create_account()

        log_in_or_create_account_pg = LogInOrCreateAccountPage(mozwebqa)
        log_in_or_create_account_pg.log_in()

        Assert.false(home_pg.personal_tools_region.is_log_in_or_create_account_visible)
        Assert.true(home_pg.personal_tools_region.is_log_out_visible)

        if home_pg.header_region.is_watch_visible:
                watch_pg = home_pg.header_region.click_watch()
                Assert.true(watch_pg.is_the_current_page)
                Assert.equal(watch_pg.page_title, "Added to watchlist")
                watch_pg.click_return_to_page()
                Assert.true(home_pg.header_region.is_unwatch_visible)
                unwatch_pg = home_pg.header_region.click_unwatch()
                Assert.equal(watch_pg.page_title, "Removed from watchlist")
                unwatch_pg.click_return_to_page()
                Assert.true(home_pg.header_region.is_watch_visible)
        else:
                unwatch_pg = home_pg.header_region.click_unwatch()
                Assert.equal(watch_pg.page_title, "Removed from watchlist")
                unwatch_pg.click_return_to_page()
                Assert.true(home_pg.header_region.is_watch_visible)
                watch_pg = home_pg.header_region.click_watch()
                Assert.true(watch_pg.is_the_current_page)
                Assert.equal(watch_pg.page_title, "Added to watchlist")
                watch_pg.click_return_to_page()
                Assert.true(home_pg.header_region.is_unwatch_visible)
    def test_back_and_forth(self, mozwebqa):
        """Test next and back buttons"""
        desc = 'input-tests testing'

        # 1. go to the feedback form
        feedback_pg = GenericFeedbackFormPage(mozwebqa)
        feedback_pg.go_to_feedback_page()

        # 2. click on happy
        feedback_pg.click_happy_feedback()

        # 3. click back and happy again
        feedback_pg.click_moreinfo_back()
        feedback_pg.click_happy_feedback()

        # 4. check next button is disabled, fill out description,
        # check next button is enabled and move on
        Assert.false(feedback_pg.is_moreinfo_next_enabled)
        feedback_pg.set_description(desc)
        Assert.true(feedback_pg.is_moreinfo_next_enabled)
        feedback_pg.click_moreinfo_next()

        # 5. click back and next again
        feedback_pg.click_email_back()
        feedback_pg.click_moreinfo_next()
    def test_the_middle_section_page(self, mozwebqa):
        """This testcase covers # 13599 & 13721 in Litmus.

        Litmus 13596 - input:Verify the layout of Latest Feedback section
        Litmus 13721 - input:Verify the layout of Feedback page (feedback tab)

        """
        feedback_pg = FeedbackPage(mozwebqa)
        feedback_pg.go_to_feedback_page()

        Assert.equal(feedback_pg.search_box_placeholder, "Search by keyword")
        Assert.greater(len(feedback_pg.messages), 0)

        Assert.true(feedback_pg.is_chart_visible)

        Assert.true(feedback_pg.is_older_messages_link_enabled)
        Assert.false(feedback_pg.is_newer_messages_link_enabled)

        feedback_pg.click_older_messages()
        Assert.true(feedback_pg.is_older_messages_link_enabled)
        Assert.true(feedback_pg.is_newer_messages_link_enabled)

        feedback_pg.click_newer_messages()
        Assert.true(feedback_pg.is_older_messages_link_enabled)
        Assert.false(feedback_pg.is_newer_messages_link_enabled)
    def test_the_left_panel_layout(self, mozwebqa):
        """This testcase covers # 13595 & 13600 in Litmus.

        Litmus 13595 - input:Verify the layout of the left hand side section containing various filtering options
        Litmus 13600 - input:Verify the applications drop down in Product

        """
        feedback_pg = FeedbackPage(mozwebqa)
        feedback_pg.go_to_feedback_page()

        Assert.equal(feedback_pg.product_filter.selected_product, 'firefox')
        Assert.equal(feedback_pg.product_filter.selected_version, '7.0')
        Assert.false(feedback_pg.date_filter.is_date_filter_applied)

        Assert.false(feedback_pg.date_filter.is_custom_date_filter_visible)

        feedback_pg.date_filter.click_custom_dates()

        Assert.greater(len(feedback_pg.platform_filter.platforms), 0)
        Assert.equal(feedback_pg.product_filter.products, ['firefox', 'mobile'])
        feedback_pg.product_filter.select_version('--')
        types = [type.name for type in feedback_pg.type_filter.types]
        Assert.equal(types, ['Praise', 'Issues', 'Ideas'])

        platforms = [platform.name for platform in feedback_pg.platform_filter.platforms]
        Assert.equal(platforms, ['Windows 7', 'Windows XP', 'Windows Vista', 'Mac OS X', 'Linux'])

        Assert.greater(len(feedback_pg.locale_filter.locales), 0)

        locales = [locale.name for locale in feedback_pg.locale_filter.locales]
        Assert.true(set(['English (US)', 'German', 'Spanish', 'French']).issubset(set(locales)))
Example #34
0
    def test_that_all_reviews_hyperlink_works(self, mozwebqa):
        # Open details page for MemChaser
        details_page = Details(mozwebqa, "Firebug")
        Assert.true(details_page.has_reviews)

        view_reviews = details_page.click_all_reviews_link()
        Assert.equal(len(view_reviews.reviews), 20)

        # Go to the last page and check that the next button is not present
        view_reviews.paginator.click_last_page()
        Assert.true(view_reviews.paginator.is_next_page_disabled)

        # Go one page back, check that it has 20 reviews
        # that the page number decreases and that the next link is visible
        page_number = view_reviews.paginator.page_number
        view_reviews.paginator.click_prev_page()
        Assert.false(view_reviews.paginator.is_next_page_disabled)
        Assert.equal(len(view_reviews.reviews), 20)
        Assert.equal(view_reviews.paginator.page_number, page_number - 1)

        # Go to the first page and check that the prev button is not present
        view_reviews.paginator.click_first_page()
        Assert.true(view_reviews.paginator.is_prev_page_disabled)

        # Go one page forward, check that it has 20 reviews,
        # that the page number increases and that the prev link is visible
        page_number = view_reviews.paginator.page_number
        view_reviews.paginator.click_next_page()
        Assert.false(view_reviews.paginator.is_prev_page_disabled)
        Assert.equal(len(view_reviews.reviews), 20)
        Assert.equal(view_reviews.paginator.page_number, page_number + 1)
    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 log in to PayPal developer to access the PayPal sandbox
        self._developer_page_login_to_paypal(mozwebqa)

        # Login to consumer pages
        home_page, user = self._login_to_consumer_pages(mozwebqa, 'add_preapproval')

        # get to payment settings page
        payment_settings_page = self._open_payment_settings_page(home_page)

        try:
            # set up non-pre-approval precondition
            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)

            # do test
            payment_settings_page = self._set_up_pre_approval(payment_settings_page)

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

        finally:
            # clean up
            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)
Example #36
0
    def test_that_all_reviews_hyperlink_works(self, mozwebqa):
        """
        Test for Litmus 4843.
        https://litmus.mozilla.org/show_test.cgi?id=4843
        """
        #Open details page for MemChaser
        details_page = Details(mozwebqa, "Firebug")
        Assert.true(details_page.has_reviews)

        view_reviews = details_page.click_all_reviews_link()
        Assert.equal(len(view_reviews.reviews), 20)

        #Go to the last page and check that the next button is not present
        view_reviews.paginator.click_last_page()
        Assert.true(view_reviews.paginator.is_next_page_disabled)

        #Go one page back, check that it has 20 reviews
        #that the page number decreases and that the next link is visible
        page_number = view_reviews.paginator.page_number
        view_reviews.paginator.click_prev_page()
        Assert.false(view_reviews.paginator.is_next_page_disabled)
        Assert.equal(len(view_reviews.reviews), 20)
        Assert.equal(view_reviews.paginator.page_number, page_number - 1)

        #Go to the first page and check that the prev button is not present
        view_reviews.paginator.click_first_page()
        Assert.true(view_reviews.paginator.is_prev_page_disabled)

        #Go one page forward, check that it has 20 reviews,
        #that the page number increases and that the prev link is visible
        page_number = view_reviews.paginator.page_number
        view_reviews.paginator.click_next_page()
        Assert.false(view_reviews.paginator.is_prev_page_disabled)
        Assert.equal(len(view_reviews.reviews), 20)
        Assert.equal(view_reviews.paginator.page_number, page_number + 1)
    def test_that_checks_the_deletion_of_a_review(self, mozwebqa):
        """
        https://moztrap.mozilla.org/manage/case/648/
        """
        # Step 1 - Login into Marketplace
        user = MockUser()
        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        home_page.create_new_user(user)
        home_page.login(user)
        Assert.true(home_page.is_the_current_page)

        # Step 2 - Search for the test app and go to its details page
        search_page = home_page.header.search(self.test_app)
        details_page = search_page.results[0].click_name()
        Assert.true(details_page.is_the_current_page)

        Assert.true(details_page.is_submit_review_link_visible)

        # Step 3 - Write a review
        body = 'Automatic app review by Selenium tests %s' % datetime.now()
        rating = random.randint(1, 5)
        add_review_page = details_page.click_submit_review()
        reviews_page = add_review_page.write_a_review(rating, body)

        # Step 4 - Check review
        Assert.true(reviews_page.is_success_message_visible)

        # Step 5 - Delete review
        review = reviews_page.reviews[0]
        review.delete()
        Assert.true(reviews_page.is_success_message_visible)
        Assert.equal(reviews_page.success_message, "Your review was successfully deleted!")
        Assert.false(review.is_review_visible)
Example #38
0
    def test_valid_user_can_log_in(self, mozwebqa):
        home_pg = HomePage(mozwebqa)
        home_pg.go_to_home_page()

        home_pg.personal_tools_region.click_log_in_or_create_account()
        log_in_or_create_account_pg = LogInOrCreateAccountPage(mozwebqa)
        log_in_or_create_account_pg.log_in()

        Assert.true(home_pg.is_the_current_page)
        Assert.false(home_pg.personal_tools_region.is_log_in_or_create_account_visible,
                    "Log in is still visible")
        Assert.true(home_pg.personal_tools_region.is_user_page_visible,
                    "User page is not visible")
        Assert.true(home_pg.personal_tools_region.is_my_talk_visible,
                    "Talk is not visible")
        Assert.true(home_pg.personal_tools_region.is_my_prefs_visible,
                    "Preferences are not visible")
        Assert.true(home_pg.personal_tools_region.is_my_watchlist_visible,
                    "Watchlist is not visible")
        Assert.true(home_pg.personal_tools_region.is_semantic_wl_visible,
                    "Semantic wl is not visible")
        Assert.true(home_pg.personal_tools_region.is_my_contribs_visible,
                    "My contributions are not visible")
        Assert.true(home_pg.personal_tools_region.is_log_out_visible,
                    "Log out is not visible")
Example #39
0
    def test_that_user_can_edit_profile(self, mozwebqa, existing_user):
        home_page = HomePage(mozwebqa)
        home_page.go_to_page()
        Assert.false(home_page.is_user_logged_in)

        logged_in_home_page = home_page.login(existing_user, 'home_page')
        Assert.true(logged_in_home_page.is_the_current_page)
        Assert.true(logged_in_home_page.is_user_logged_in)

        # click user profile details link
        user_profile_details_page = logged_in_home_page.header.click_user_profile_details()
        Assert.true(user_profile_details_page.is_the_current_page)

        # click edit profile button
        user_profile_edit_page = user_profile_details_page.click_edit_profile_button()
        Assert.true(user_profile_edit_page.is_the_current_page)
        Assert.equal(existing_user['profile']['name'], user_profile_edit_page.display_name)
        Assert.equal(existing_user['profile']['username'], user_profile_edit_page.username)

        # change display name and username
        new_display_name = re.sub(r'[\W_]+', '', existing_user['profile']['name'] + str(time.time()))
        new_username = re.sub(r'[\W_]+', '', existing_user['profile']['username'] + str(time.time()))
        user_profile_edit_page.enter_name(new_display_name)
        user_profile_edit_page.enter_username(new_username)
        user_profile_details_page = user_profile_edit_page.click_save_button('user_profile_details')

        Assert.true(user_profile_details_page.is_the_current_page)
        Assert.equal(new_display_name, user_profile_details_page.user_profile_name)

        # edit profile again
        user_profile_edit_page = user_profile_details_page.click_edit_profile_button()
        Assert.equal(new_display_name, user_profile_edit_page.display_name)
        Assert.equal(new_username, user_profile_edit_page.username)
    def test_that_checks_the_deletion_of_a_review(self, mozwebqa):
        """
        https://moztrap.mozilla.org/manage/case/648/
        """

        self._reviews_setup(mozwebqa)

        # Step 1 - Login into Marketplace
        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        home_page.login(user="******")
        Assert.true(home_page.is_the_current_page)

        # Step 3 - Search for the test app and go to its details page
        search_page = home_page.header.search(self.app_name)
        details_page = search_page.results[0].click_name()
        Assert.true(details_page.is_the_current_page)

        # Step 4 - Go to reviews page
        reviews_page = details_page.click_reviews_button()

        # Step 5 - Delete review
        reviews = reviews_page.reviews[0]
        reviews.delete()

        reviews_page.wait_notification_box_visible()
        Assert.equal(reviews_page.notification_message, "Review deleted")
        Assert.false(reviews.is_review_visible)
Example #41
0
    def test_that_only_plugin_reports_have_plugin_icon(self, mozwebqa):
        csp = CrashStatsHomePage(mozwebqa)
        reports_page = csp.click_last_product_top_crashers_link()
        type, days, os = 'Plugin', '28', 'Windows'
        reports_page.click_filter_by(type)
        reports_page.click_filter_days_by(days)
        reports_page.click_filter_os_by(os)
        Assert.equal(
            (type, days, os),
            (reports_page.current_filter_type,
             reports_page.current_days_filter, reports_page.current_os_filter))
        signature_list_items = reports_page.signature_items
        Assert.true(
            len(signature_list_items) > 0, "Signature list items not found")

        for signature_item in signature_list_items[:min(
                signature_list_items, 24)]:
            Assert.true(
                signature_item.is_plugin_icon_visible,
                "Signature %s did not have a plugin icon" %
                signature_item.title)
            Assert.false(
                signature_item.is_browser_icon_visible,
                "Signature %s unexpectedly had a browser icon" %
                signature_item.title)
    def test_the_left_panel_layout(self, mozwebqa):
        """
        Litmus 13595 - input:Verify the layout of the left hand side section containing various
        filtering options
        Litmus 13600 - input:Verify the applications drop down in Product
        """

        feedback_pg = feedback_page.FeedbackPage(mozwebqa)
        feedback_pg.go_to_feedback_page()

        Assert.true(feedback_pg.product_filter.default_values("firefox", "7.0"))
        Assert.false(feedback_pg.date_filter.is_date_filter_applied)

        Assert.false(feedback_pg.date_filter.is_custom_date_filter_visible)

        feedback_pg.date_filter.click_custom_dates()

        Assert.true(feedback_pg.platform_filter.platform_count > 0)
        Assert.equal(feedback_pg.product_filter.products, ['Firefox', 'Mobile'])
        feedback_pg.product_filter.select_version('--')
        types = [type.name for type in feedback_pg.type_filter.types()]
        Assert.equal(types, ['Praise', 'Issues', 'Ideas'])

        platforms = [platform.name for platform in feedback_pg.platform_filter.platforms()]
        Assert.equal(platforms, ['Windows 7', 'Windows XP', 'Windows Vista', 'Mac OS X', 'Linux'])

        Assert.true(feedback_pg.locale_filter.locale_count > 0)

        locales = [locale.name for locale in feedback_pg.locale_filter.locales()]
        Assert.true(set(['English (US)', 'German', 'Spanish', 'French']).issubset(set(locales)))
Example #43
0
    def test_that_extensions_page_contains_addons_and_the_pagination_works(self, mozwebqa):
        """
        Litmus 29729
        https://litmus.mozilla.org/show_test.cgi?searchType=by_id&id=29729
        """
        home_page = Home(mozwebqa)
        featured_extensions_page = home_page.header.site_navigation_menu("Extensions").click()

        # Assert that at least one addon is displayed
        Assert.greater(len(featured_extensions_page.extensions), 0)

        if len(featured_extensions_page.extensions) < 20:
            # Assert that the paginator is not present if fewer than 20 extensions are displayed
            Assert.false(featured_extensions_page.is_paginator_present)
        else:
            # Assert that the paginator is present if 20 extensions are displayed
            Assert.true(featured_extensions_page.is_paginator_present)
            Assert.true(featured_extensions_page.paginator.is_prev_page_disabled)
            Assert.false(featured_extensions_page.paginator.is_next_page_disabled)

            featured_extensions_page.paginator.click_next_page()

            Assert.false(featured_extensions_page.paginator.is_prev_page_disabled)
            Assert.false(featured_extensions_page.paginator.is_next_page_disabled)

            featured_extensions_page.paginator.click_prev_page()

            Assert.equal(len(featured_extensions_page.extensions), 20)
            Assert.true(featured_extensions_page.paginator.is_prev_page_disabled)
            Assert.false(featured_extensions_page.paginator.is_next_page_disabled)
    def test_that_user_can_purchase_an_app(self, mozwebqa, new_user):
        if '-dev' not in mozwebqa.base_url:
            pytest.skip("Payments can only be tested on dev.")

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()
        home_page.header.click_sign_in()
        home_page.login(new_user['email'], new_user['password'])
        Assert.true(home_page.is_the_current_page)
        home_page.set_region('us')

        # Use the first paid app
        app = home_page.header.search(':paid').results[0]
        app_name = app.name
        details_page = app.click_name()
        Assert.false('free' in details_page.price_text)
        Assert.true('paid' in details_page.app_status)

        payment = details_page.click_install_button()
        payment.create_pin(self.PIN)
        payment.wait_for_buy_app_section_displayed()
        Assert.equal(app_name, payment.app_name)

        payment.click_buy_button()
        # We are not able to interact with the doorhanger that appears to install the app
        # using Selenium
        # We can check for the `purchased` attribute on the price button though
        details_page.wait_for_app_purchased()
Example #45
0
    def test_url_verification(self, mozwebqa):
        feedback_pg = GenericFeedbackFormPage(mozwebqa)
        feedback_pg.go_to_feedback_page()

        feedback_pg.click_happy_feedback()
        feedback_pg.set_description('ou812')

        valid = [
            '',
            'example.com',
            'ftp://example.com',
            'http://example.com',
            'https://example.com',
            'https://foo.example.com:8000/blah/blah/?foo=bar#baz',
            u'http://mozilla.org/\u2713'
        ]
        for url in valid:
            feedback_pg.set_url(url)
            Assert.true(feedback_pg.is_url_valid)

        invalid = [
            'a',
            'about:start',
            'chrome://somepage',
            'http://example'
        ]
        for url in invalid:
            feedback_pg.set_url(url)
            Assert.false(feedback_pg.is_url_valid)
Example #46
0
    def test_that_user_can_create_and_delete_group(self, base_url, selenium,
                                                   vouched_user):
        group_name = (time.strftime('%x-%X'))

        home_page = Home(base_url, selenium)
        home_page.login(vouched_user['email'], vouched_user['password'])
        settings = home_page.header.click_settings_menu_item()
        groups = settings.groups.click_find_group_link()
        create_group = groups.click_create_group_main_button()
        create_group.create_group_name(group_name)
        create_group.click_create_group_submit()

        search_listings = create_group.header.search_for(group_name)

        Assert.true(
            search_listings.is_element_present(By.LINK_TEXT, group_name))

        group_info = search_listings.open_group(group_name)
        groups_page = group_info.delete_group()
        groups_page.wait_for_alert_message()

        home_page.header.click_settings_menu_item()

        Assert.false(
            search_listings.is_element_present(By.LINK_TEXT, group_name))
Example #47
0
    def test_email_verification(self, mozwebqa):
        feedback_pg = GenericFeedbackFormPage(mozwebqa)
        feedback_pg.go_to_feedback_page()

        feedback_pg.click_happy_feedback()
        feedback_pg.set_description('ou812')
        feedback_pg.click_moreinfo_next()

        feedback_pg.check_email_checkbox()

        valid = [
            '',
            '*****@*****.**',
            '*****@*****.**',
            '*****@*****.**'
        ]
        for email in valid:
            feedback_pg.set_email(email)
            Assert.true(feedback_pg.is_email_valid)

        invalid = [
            'foo@',
            'foo@example',
        ]
        for email in invalid:
            feedback_pg.set_email(email)
            Assert.false(feedback_pg.is_email_valid)
    def test_feedback_custom_date_filter(self, testsetup):
        """

        This testcase covers # 13605, 13606 & 13715 in Litmus
        1. Verifies the calendar is displayed when filtering on custom dates
        2. Verifies date-start=<date> and end-date=<date> in the url

        """
        feedback_pg = feedback_page.FeedbackPage(testsetup)

        feedback_pg.go_to_feedback_page()
        Assert.equal(feedback_pg.get_custom_dates_tooltip(), "Custom")

        start_date = date.today() - timedelta(days=3)
        end_date = date.today() - timedelta(days=1)

        feedback_pg.filter_by_custom_dates(start_date, end_date)
        # The format for a date when using preset filters is different to using the custom search. See bug 616306 for details.
        Assert.equal(feedback_pg.date_start_from_url, start_date.strftime('%m%%2F%d%%2F%Y'))
        Assert.equal(feedback_pg.date_end_from_url, end_date.strftime('%m%%2F%d%%2F%Y'))
        # TODO: Check results are within the expected date range, possibly by navigating to the first/last pages and checking the final result is within range. Currently blocked by bug 615844.

        # Check that the relevant days preset link is highlighted when the applied custom date filter matches it
        day_filters = ((1, "1d"), (7, "7d"), (30, "30d"))
        for days in day_filters:
            start_date = date.today() - timedelta(days=days[0])
            feedback_pg.filter_by_custom_dates(start_date, date.today())
            Assert.false(feedback_pg.is_custom_date_filter_visible())
            # The format for a date when using preset filters is different to using the custom search. See bug 616306 for details.
            Assert.equal(feedback_pg.date_start_from_url, start_date.strftime('%m%%2F%d%%2F%Y'))
            Assert.equal(feedback_pg.date_end_from_url, date.today().strftime('%m%%2F%d%%2F%Y'))
            Assert.equal(feedback_pg.get_current_days(), days[1])
Example #49
0
    def test_editing_of_existing_suite_that_has_no_included_cases(
            self, mozwebqa_logged_in, product):
        #create suite and cases
        suite = self.create_suite(mozwebqa_logged_in, product, use_API=True)
        cases = self.create_bulk_cases(mozwebqa_logged_in,
                                       product,
                                       use_API=True,
                                       cases_amount=3)

        # simulate random order of cases
        case_list = [cases[i]['name'] for i in (2, 0, 1)]

        manage_suites_pg = MozTrapManageSuitesPage(mozwebqa_logged_in)
        manage_suites_pg.go_to_manage_suites_page()
        manage_suites_pg.filter_form.filter_by(lookup='name',
                                               value=suite['name'])
        edit_suite_pg = manage_suites_pg.edit_suite(name=suite['name'])

        # product field should not be read-only.
        Assert.false(edit_suite_pg.is_product_field_readonly,
                     u'product version field should be editable')

        edit_suite_pg.include_cases_to_suite(case_list)

        manage_suites_pg.filter_form.filter_by(lookup='name',
                                               value=suite['name'])
        edit_suite_pg = manage_suites_pg.edit_suite(name=suite['name'])

        Assert.true(edit_suite_pg.is_product_field_readonly,
                    u'product version field should be read-only')

        Assert.equal([item.name for item in edit_suite_pg.included_cases],
                     case_list, u'items are listed in wrong order')
    def test_that_reports_abuse_as_signed_in_user(self, mozwebqa):

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        Assert.true(home_page.is_the_current_page)
        home_page.login(user="******")
        Assert.true(home_page.header.is_user_logged_in)

        search_page = home_page.header.search(self.search_term)

        # Select the first application link in the list
        details_page = search_page.results[0].click_name()
        Assert.true(details_page.is_the_current_page)

        Assert.true(details_page.is_report_abuse_button_visible)
        report_abuse_box = details_page.click_report_abuse_button()

        Assert.true(report_abuse_box.is_visible)
        Assert.false(report_abuse_box.is_report_button_enabled)

        report_abuse_box.insert_text('This is an automatically generated report.')
        Assert.true(report_abuse_box.is_report_button_enabled)

        report_abuse_box.click_report_button()

        details_page.wait_notification_box_visible()
        Assert.equal(details_page.notification_message, "Abuse reported")
Example #51
0
    def test_open_close_functionality_for_image_viewer(self, mozwebqa):

        detail_page = Details(mozwebqa, 'firebug')

        image_viewer = detail_page.previewer.click_image()
        Assert.true(image_viewer.is_visible)
        image_viewer.close()
        Assert.false(image_viewer.is_visible)
Example #52
0
 def test_login_logout_works_properly(self, mozwebqa):
     start_page = StartPage(mozwebqa)
     home_page = start_page.login()
     Assert.true(home_page.is_user_logged_in, 'User not logged in')
     Assert.equal(home_page.header, 'Follow these easy steps to get started:')
     home_page.click_logout()
     Assert.false(home_page.is_user_logged_in, 'User logged in')
     Assert.equal(start_page.header, 'Become a Firefox Affiliate Today!')
 def test_login_logout_works_properly(self, mozwebqa):
     start_page = StartPage(mozwebqa)
     home_page = start_page.login()
     Assert.true(home_page.is_user_logged_in, 'User not logged in')
     Assert.equal(home_page.header, 'Dashboard')
     home_page.logout()
     Assert.false(home_page.is_user_logged_in, 'User logged in')
     Assert.equal(start_page.header, 'Become a Firefox Affiliate today!')
Example #54
0
    def test_sign_in_and_sign_out(self, mozwebqa):
        home_page = HomePage(mozwebqa)
        home_page.go_to_page()

        home_page.sign_in(user="******")
        Assert.true(home_page.is_signed_in)

        home_page.header.click_sign_out()
        Assert.false(home_page.is_signed_in)
Example #55
0
    def test_user_can_login_and_logout_using_browser_id(self, mozwebqa):

        home_page = Home(mozwebqa)
        home_page.login("browserID")
        Assert.true(home_page.is_the_current_page)
        Assert.true(home_page.header.is_user_logged_in)

        home_page.header.click_logout()
        Assert.false(home_page.header.is_user_logged_in)