Example #1
0
 def test_region_dropdown_link(self, mozwebqa):
     communities_page = Communities(mozwebqa)
     communities_page.go_to_page()
     click_regions = [
         communities_page.click_north_america,
         communities_page.click_latin_america,
         communities_page.click_europe,
         communities_page.click_asia_south_pacific,
         communities_page.click_africa_middle_east
     ]
     region_communities = [
         communities_page.north_america_communities,
         communities_page.latin_america_communities,
         communities_page.europe_communities,
         communities_page.asia_south_pacific_communities,
         communities_page.africa_middle_east_communities,
         communities_page.balkans_communities
     ]
     bad_communities = []
     for index, action in enumerate(click_regions):
         action()
         for community in region_communities[index]:
             communities_page.wait_until_element_visible(community)
             if not community.is_displayed():
                 bad_communities.append('%s is not displayed.' % community.text)
     Assert.equal(0, len(bad_communities), '%s communities not displayed: '
                  % len(bad_communities) + ', '.join(bad_communities))
    def test_assert_that_a_app_can_be_added_and_deleted_via_the_api(self, mozwebqa_devhub_logged_in):
        mock_app = MockApplication()  # generate mock app

        # init API client
        mk_api = MarketplaceAPI.get_client(mozwebqa_devhub_logged_in.base_url,
                                           mozwebqa_devhub_logged_in.credentials)

        mk_api.submit_app(mock_app)  # submit app

        app_status = mk_api.app_status(mock_app)  # get app data from API

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

        # Check for app on the site
        dev_home = Home(mozwebqa_devhub_logged_in)

        app_status_page = dev_home.go_to_app_status_page(mock_app)
        Assert.contains(mock_app.name, app_status_page.page_title)

        # Delete the app
        mk_api.delete_app(mock_app)

        app_status_page = dev_home.go_to_app_status_page(mock_app)
        Assert.contains("We're sorry, but we can't find what you're looking for.",
                        app_status_page.app_not_found_message)
    def test_that_one_star_rating_increments(self, mozwebqa):
        """
        Test for Litmus 22916.
        https://litmus.mozilla.org/show_test.cgi?id=22916
        """
        # Step 1 - Login into AMO
        home_page = Home(mozwebqa)
        home_page.login("browserID")
        Assert.true(home_page.header.is_user_logged_in)

        # Step 2 - Go to add-ons listing page sorted by rating
        extensions_home_page = home_page.click_to_explore('Top Rated')

        # Step 3 - Pick an addon with no reviews
        extensions_home_page.paginator.click_last_page()
        addon = extensions_home_page.extensions[-1]  # the last one is without rating
        details_page = addon.click()

        # Step 4 - Click on the "Write review" button
        write_review_block = details_page.click_to_write_review()

        # Step 5 - Add review with 1-star rating
        body = 'Automatic addon review by Selenium tests'
        write_review_block.enter_review_with_text(body)
        write_review_block.set_review_rating(1)
        view_reviews = write_review_block.click_to_save_review()

        # Step 6 - Ensure rating increased by one
        view_reviews.breadcrumbs[2].click()
        details_page = Details(mozwebqa)
        new_rating_counter = details_page.get_rating_counter(1)
        Assert.equal(new_rating_counter, 1)
Example #4
0
 def test_view_the_source_in_the_version_information(self, mozwebqa):
     details_page = Details(mozwebqa, "Firebug")
     Assert.equal(details_page.version_information_heading, "Version Information")
     details_page.expand_version_information()
     Assert.equal("View the source", details_page.view_source_code_text)
     view_source = details_page.click_view_source_code()
     Assert.contains('/files/browse/', view_source.get_url_current_page())
    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 is_the_current_page(self):
        if self._page_title:
            WebDriverWait(self.selenium, 10).until(lambda s: self.selenium.title)

        Assert.equal(self.selenium.title, self._page_title,
            "Expected page title: %s. Actual page title: %s" % (self._page_title, self.selenium.title))
        return True
Example #7
0
    def test_that_search_results_return_20_results_per_page(self, mozwebqa):
        """
        Test for Litmus 17346.
        https://litmus.mozilla.org/show_test.cgi?id=17346
        """
        home_page = Home(mozwebqa)
        search_page = home_page.header.search_for('deutsch')

        first_expected = 1
        second_expected = 20

        while not search_page.paginator.is_next_page_disabled:
            first_count = search_page.paginator.start_item
            second_count = search_page.paginator.end_item

            Assert.equal(first_expected, first_count)
            Assert.equal(second_expected, second_count)
            Assert.equal(search_page.result_count, 20)

            search_page.paginator.click_next_page()

            first_expected += 20
            second_expected += 20

        number = search_page.paginator.total_items % 20

        if number == 0:
            Assert.equal(search_page.result_count, 20)
        else:
            Assert.equal(search_page.result_count, number)
Example #8
0
 def test_that_clicking_on_a_subcategory_loads_expected_page(self, mozwebqa):
     """Test for Litmus 15949."""
     home_page = Home(mozwebqa)
     themes_page = home_page.header.site_navigation_menu("Themes").click()
     selected_category = themes_page.themes_category
     amo_category_page = themes_page.click_on_first_category()
     Assert.equal(selected_category, amo_category_page.title)
    def test_creating_profile_without_checking_privacy_policy_checkbox(self, mozwebqa):
        user = self.get_new_user()

        home_page = Home(mozwebqa)

        profile = home_page.create_new_user(user)

        profile.set_full_name("User that doesn't like policy")
        profile.set_bio("Hello, I'm new here and trying stuff out. Oh, and by the way: I'm a robot, run in a cronjob, and will not check accept the privacy policy")

        skills = profile.click_next_button()
        skills.add_skill('test')
        skills.add_language('english')

        location = skills.click_next_button()
        location.select_country('us')
        location.set_state('California')
        location.set_city('Mountain View')

        location.click_create_profile_button()

        profile = ProfileTab(mozwebqa)

        Assert.equal('new error message', profile.error_message)
        location = profile.go_to_tab('location')
        Assert.equal('This field is required.', location.privacy_error_message)
Example #10
0
    def test_that_search_results_return_20_results_per_page(self, mozwebqa):
        """
        Litmus 17346
        https://litmus.mozilla.org/show_test.cgi?id=17346
        """
        amo_home_page = AddonsHomePage(mozwebqa)
        amo_search_page = amo_home_page.header.search_for("deutsch")

        first_expected = 1
        second_expected = 20

        while(amo_search_page.is_forword_present):
            results_summary = amo_search_page.results_displayed
            results = re.split("\W+", results_summary)
            first_count = results[1]
            second_count = results[2]

            Assert.equal(str(first_expected), first_count)
            Assert.equal(str(second_expected), second_count)
            Assert.equal(amo_search_page.result_count, 20)

            amo_search_page.page_forward()
            first_expected += 20
            second_expected += 20

        number = int(re.split("\W+", results_summary)[4]) % 20

        if number == 0:
            Assert.equal(amo_search_page.result_count, 20)
        else:
            Assert.equal(amo_search_page.result_count, number)
 def _verify_reports_form_have_same_product(self, mozwebqa, product_name):
     csp = CrashStatsHomePage(mozwebqa)
     csp.header.select_product(product_name)
     Assert.contains(product_name, csp.page_title)
     if csp.results_found:
         crash_adu = csp.header.select_report("Crashes per User")
         Assert.equal(csp.header.current_product, crash_adu.product_select)
Example #12
0
 def test_themes_subcategory_page_breadcrumb(self, mozwebqa):
     home_page = Home(mozwebqa)
     themes_page = home_page.click_themes()
     selected_category = themes_page.themes_category
     amo_category_page = themes_page.click_on_first_category()
     expected_breadcrumb = "Add-ons for Firefox Themes %s" % selected_category
     Assert.equal(expected_breadcrumb, amo_category_page.breadcrumb)
 def _verify_current_version_selected_in_top_crashers_by_domain_header(self, mozwebqa, product_name):
     csp = CrashStatsHomePage(mozwebqa)
     csp.header.select_product(product_name)
     if csp.results_found:
         product = csp.header.current_product
         cstc = csp.header.select_report('Top Crashers by Domain')
         Assert.equal(product, cstc.product_header)
Example #14
0
 def test_sorted_by_most_users_is_default(self, mozwebqa):
     """Test for Litmus 15346."""
     home_page = Home(mozwebqa)
     themes_page = home_page.header.site_navigation_menu("Themes").click()
     url_current_page = themes_page.get_url_current_page()
     Assert.true(url_current_page.endswith("/themes/"))
     Assert.equal(themes_page.sorted_by, 'Most Users')
    def test_hide_email_checkbox_works(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)

        view_profile_page = home_page.header.click_view_profile()
        initial_state = view_profile_page.is_email_field_present

        edit_profile_page = home_page.header.click_edit_profile()
        edit_profile_page.change_hide_email_state()
        edit_profile_page.click_update_account()

        view_profile_page = home_page.header.click_view_profile()
        final_state = view_profile_page.is_email_field_present

        try:
            Assert.not_equal(initial_state, final_state, 'The initial and final states are the same. The profile change failed.')
            if final_state is True:
                credentials = mozwebqa.credentials['default']
                Assert.equal(credentials['email'], view_profile_page.email_value, 'Actual value is not equal with the expected one.')

        except Exception as exception:
            Assert.fail(exception.msg)

        finally:
            if initial_state != final_state:
                edit_profile_page = home_page.header.click_edit_profile()
                edit_profile_page.change_hide_email_state()
                edit_profile_page.click_update_account()
                view_profile_page = home_page.header.click_view_profile()

            Assert.equal(view_profile_page.is_email_field_present, initial_state, 'Could not restore profile to initial state.')
 def test_that_verifies_the_tooltip_for_Other_Applications(self, mozwebqa):
     """
     Litmus 22925
     https://litmus.mozilla.org/show_test.cgi?id=22925
     """
     amo_home_page = AddonsHomePage(mozwebqa)
     Assert.equal(amo_home_page.header.other_applications_tooltip, 'Find add-ons for other applications')
    def test_that_checks_editing_support_information_for_a_free_app(self, mozwebqa):
        """
        Test edit support information for a free app.

        Pivotal task: https://www.pivotaltracker.com/story/show/27741207
        Litmus: https://litmus.mozilla.org/show_test.cgi?id=50481
        """
        updated_app = MockApplication()

        dev_home = Home(mozwebqa)
        dev_home.go_to_developers_homepage()
        dev_home.login(user="******")
        my_apps = dev_home.header.click_my_submissions()
        edit_listing = my_apps.first_free_app.click_edit()

        # update fields in support information
        support_info_region = edit_listing.click_support_information()
        support_info_region.type_support_email(updated_app['support_email'])
        support_info_region.type_support_url(updated_app['support_website'])

        support_info_region.click_save_changes()

        # Verify the changes have been made
        Assert.equal(edit_listing.email, updated_app['support_email'])
        Assert.equal(edit_listing.website, updated_app['support_website'])
    def test_that_checks_editing_basic_info_for_a_free_app(self, mozwebqa):
        """Test the happy path for editing the basic information for a free submitted app.

        Litmus link: https://litmus.mozilla.org/show_test.cgi?id=50478
        """
        updated_app = MockApplication(
            categories=[('Entertainment', False), ('Games', True), ('Music', True)],
        )
        dev_home = Home(mozwebqa)
        dev_home.go_to_developers_homepage()
        dev_home.login(user="******")
        my_apps = dev_home.header.click_my_submissions()
        edit_listing = my_apps.first_free_app.click_edit()

        # bring up the basic info form for the first free app
        basic_info_region = edit_listing.click_edit_basic_info()

        # update the details of the app
        basic_info_region.type_url_end(updated_app['url_end'])
        basic_info_region.type_description(updated_app['description'])

        for category in updated_app['categories']:
            # check/uncheck the checkbox according to the app value
            basic_info_region.select_categories(*category)

        basic_info_region.click_save_changes()

        # check that the listing has been updated
        Assert.true(edit_listing.no_forms_are_open)
        Assert.contains(updated_app['url_end'], edit_listing.url_end)
        Assert.equal(edit_listing.description, updated_app['description'])
        Assert.equal(edit_listing.categories.sort(), updated_app['categories'].sort())
Example #19
0
 def test_that_clicking_on_a_subcategory_loads_expected_page(self, mozwebqa):
     """test for litmus 15949"""
     home_page = Home(mozwebqa)
     themes_page = home_page.click_themes()
     selected_category = themes_page.themes_category
     amo_category_page = themes_page.click_on_first_category()
     Assert.equal(selected_category, amo_category_page.title)
    def test_that_a_screenshot_can_be_added(self, mozwebqa):
        """Test the happy path for adding a screenshot for a free submitted app.

        Litmus link: https://litmus.mozilla.org/show_test.cgi?id=50479
        """
        dev_home = Home(mozwebqa)
        dev_home.go_to_developers_homepage()
        dev_home.login(user="******")
        my_apps = dev_home.header.click_my_submissions()
        edit_listing = my_apps.first_free_app.click_edit()
        before_screenshots_count = len(edit_listing.screenshots_previews)

        # bring up the media form for the first free app
        media_region = edit_listing.click_edit_media()
        screenshots_count = len(media_region.screenshots)

        # upload a new screenshot
        media_region.screenshot_upload(self._get_resource_path('img.jpg'))

        # check that the screenshot list is updated
        new_screenshots_count = len(media_region.screenshots)
        Assert.equal(screenshots_count + 1, new_screenshots_count,
                     'Expected %s screenshots, but there are %s.' % (screenshots_count + 1, new_screenshots_count))

        # save the changes
        media_region.click_save_changes()

        # check that the icon preview has been updated
        after_screenshots_count = len(edit_listing.screenshots_previews)
        Assert.equal(before_screenshots_count + 1, len(edit_listing.screenshots_previews),
                     'Expected %s screenshots, but there are %s.' % (before_screenshots_count + 1, after_screenshots_count))
 def test_that_reviews_are_displayed(self, mozwebqa):
     """Test for Litmus 9890."""
     details_page = Details(mozwebqa, "Firebug")
     Assert.equal(details_page.review_title, "Reviews")
     Assert.true(details_page.has_reviews)
     for review in details_page.review_details:
         Assert.not_none(review)
Example #22
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)
Example #23
0
 def test_that_most_popular_link_is_default(self, mozwebqa):
     """Test for Litmus 15348"""
     home_page = Home(mozwebqa)
     themes_page = home_page.header.site_navigation_menu("Themes").click()
     url_current_page = themes_page.get_url_current_page()
     Assert.true(url_current_page.endswith("/themes/"))
     Assert.equal(themes_page.selected_explore_filter, 'Most Popular')
    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)
    def update_app_data(self, mock_app):
        # update the default app data with the custom mock app information

        data = {
            'name': mock_app.name,
            'summary': mock_app.summary,
            'categories': [],
            'support_email': mock_app.support_email,
            'device_types': [],
            'payment_type': mock_app.payment_type,
            'premium_type': 'free',
            'privacy_policy': mock_app.privacy_policy,
            'description': mock_app.description,
            'homepage': mock_app.homepage,
            'support_url': mock_app.support_website
        }

        # device_types: a list of the device types at least one of: 'desktop', 'android-tablet', 'android-mobile', 'firefoxos'
        data['device_types'] = [device[0] for device in mock_app['device_type'] if device[1]]

        Assert.true(data['device_types'],  'insufficient data added device_types')

        # categories: a list of the categories, at least two of the category ids provided from the category api
        data['categories'] = [category['id'] for category in self._categories
                              if category['name'] in [mock_category[0] for mock_category in mock_app.categories]]

        Assert.greater_equal(len(data['categories']), 2,
                             'Insufficient data added categories == %s\n Minimum 2 categories required' % data['categories'])

        response = self._client.update(mock_app.id, data)

        Assert.equal(response.status_code, 202, "Update app data failed.\n Status code %s" % response.status_code)
Example #26
0
 def test_the_featured_personas_section(self, testsetup):
     """ Test for Litmus 15392
         https://litmus.mozilla.org/show_test.cgi?id=15392"""
     amo_home_page = AddonsHomePage(testsetup)
     amo_personas_page = amo_home_page.click_personas()
     Assert.true(amo_personas_page.is_the_current_page)
     Assert.equal(6, amo_personas_page.featured_personas_count)
Example #27
0
    def test_filter_results_by_owner(self, mozwebqa):
        query = u"John Giannelos"
        home_page = Home(mozwebqa)

        events_page = home_page.header.click_events_link()
        events_page.filter_for(query)
        Assert.equal(u"John Giannelos", events_page.event_profile_owner_text)
Example #28
0
    def test_submit_happy_feedback_with_unicode(self, mozwebqa):
        """Fill out happy feedback with unicode description"""
        timestamp = unicode(time.time())
        desc = u'input-tests testing happy feedback with unicode \u2603'
        desc = desc + u' ' + timestamp

        # 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. fill out description and url
        feedback_pg.set_description(desc)
        feedback_pg.click_moreinfo_next()

        # 4. submit
        thanks_pg = feedback_pg.submit(expect_success=True)
        Assert.true(thanks_pg.is_the_current_page)

        # 5. verify
        dashboard_pg = DashboardPage(mozwebqa)
        dashboard_pg.go_to_dashboard_page()
        dashboard_pg.search_for(desc)
        resp = dashboard_pg.messages[0]
        Assert.equal(resp.type.strip(), 'Happy')
        Assert.equal(resp.body.strip(), desc.strip())
Example #29
0
 def test_the_search_field_placeholder(self, mozwebqa):
     """
     Litmus 4826
     https://litmus.mozilla.org/show_test.cgi?id=4826
     """
     amo_home_page = AddonsHomePage(mozwebqa)
     Assert.equal(amo_home_page.header.search_field_placeholder, 'search for add-ons')
    def test_editing_user_profile(self, mozwebqa):
        """Test for https://www.pivotaltracker.com/story/show/33709085"""

        user = PersonaTestUser().create_user()

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()
        home_page.login(user)

        profile_page = home_page.header.click_edit_account_settings()
        _username = user['email'].split('@')[0]

        # Initial check
        Assert.equal(profile_page.browser_id_email, user['email'])
        Assert.equal(profile_page.display_name, _username)
        Assert.equal(profile_page.user_region, 'Worldwide')

        # Data to submit. Username should be unique
        name = 'Napoleon'

        profile_page.edit_display_name(name)
        profile_page.save_changes()
        Assert.true(profile_page.notification_visible)

        # Refresh page and then inspect saved settings
        profile_page.refresh_page()

        Assert.equal(profile_page.display_name, name)
        Assert.equal(profile_page.user_region, 'Worldwide')
Example #31
0
    def test_redirect_for_firefox_aliases(self, testsetup, product_alias):
        url = testsetup.base_url
        param = {
            'product': product_alias['product_name'],
            'os': 'win',
            'lang': product_alias['lang']
        }

        response = self._head_request(url, params=param)

        parsed_url = urlparse(response.url)

        if not (product_alias['product_name'] == 'firefox-latest-euballot'
                and "download.allizom.org" in testsetup.base_url):
            Assert.equal(response.status_code, requests.codes.ok,
                'Redirect failed with HTTP status %s on %s \n \
                For %s\n \
                Redirected to %s'                                  % \
                (response.status_code, url, param, response.url))
            Assert.equal(parsed_url.scheme, 'http',
                         'Failed on %s \nUsing %s' % (url, param))
            Assert.equal(parsed_url.netloc, 'download.cdn.mozilla.net',
                         'Failed on %s \nUsing %s' % (url, param))
            if (product_alias['product_name'] != 'firefox-nightly-latest' and
                    product_alias['product_name'] != 'firefox-aurora-latest'
                    and product_alias['product_name'] !=
                    'firefox-latest-euballot'):
                Assert.contains('/%s/' % 'win32', parsed_url.path)
Example #32
0
    def test_create_collection(self, mozwebqa):

        home_page = Home(mozwebqa)
        collections_page = home_page.header.site_navigation_menu(
            'Collections').click()
        create_collection_page = collections_page.click_create_collection_button(
        )
        home_page.login('browserID')

        collection_name = 'collection timestamp %s' % time.time()

        create_collection_page.type_name(collection_name)
        create_collection_page.type_description(collection_name)
        collection = create_collection_page.click_create_collection()

        Assert.equal(collection.notification, 'Collection created!')
        Assert.equal(collection.collection_name, collection_name)
        collection.delete()
        user_collections = collection.delete_confirmation()
        if len(user_collections.collections) > 0:
            for collection_element in range(
                    len(user_collections.collections)
            ):  # If the condition is satisfied, iterate through the collections items on the page
                Assert.true(
                    collection_name not in
                    user_collections.collections[collection_element].text
                )  # Check for each collection that the name is not the same as the deleted collections name
        else:
            Assert.equal(
                user_collections.collection_text, 'No collections found.'
            )  # It means the collection has been deleted and we test for that
Example #33
0
    def test_that_article_can_be_edited(self, mozwebqa, variables):
        """
           Creates a new knowledge base article.
           Verifies creation.
           Edits the article, verifies the edition.
           Deletes the article
        """
        user = variables['users']['admin']
        kb_new_article = PageProvider(mozwebqa).new_kb_article_page(
            user['username'], user['password'])

        # create a new article
        mock_article = MockArticle()
        kb_new_article.set_article(mock_article)
        kb_new_article.submit_article()
        kb_article_history = kb_new_article.set_article_comment_box(
            mock_article['comment'])

        # edit that same article (keep the title the same as original)
        mock_article_edited = MockArticle(suffix="_edited",
                                          title=mock_article['title'])

        kb_edit_article = kb_article_history.navigation.click_edit_article()
        kb_article_history = kb_edit_article.edit_article(mock_article_edited)

        kb_edit_article = kb_article_history.navigation.click_edit_article()

        # verify the contents of the edited article
        actual_page_title = kb_edit_article.page_title
        Assert.contains(mock_article_edited['title'], actual_page_title)

        actual_summary_text = kb_edit_article.article_summary_text
        Assert.equal(mock_article_edited['summary'], actual_summary_text)

        actual_content_text = kb_edit_article.article_contents_text
        Assert.equal(mock_article_edited['content'], actual_content_text)

        # delete the same article
        kb_article_history = kb_edit_article.navigation.click_show_history()
        kb_article_history.delete_entire_article_document()
Example #34
0
    def test_edit_profile_information(self, mozwebqa):
        home_page = Home(mozwebqa)

        home_page.login()

        profile_page = home_page.header.click_view_profile_menu_item()
        edit_profile_page = home_page.header.click_edit_profile_menu_item()
        Assert.true(edit_profile_page.is_csrf_token_present)
        current_time = str(time.time()).split('.')[0]

        # New profile data
        new_full_name = "Updated Mozillians User %s" % current_time
        new_biography = "Hello, I'm new here and trying stuff out. Oh, and by the way: I'm a robot, run in a cronjob, most likely, run at %s" % current_time
        new_website = "http://%s.com/" % current_time

        # Update the profile fields
        edit_profile_page.set_full_name(new_full_name)
        edit_profile_page.set_website(new_website)
        edit_profile_page.set_bio(new_biography)
        edit_profile_page.click_update_button()

        # Get the current data of profile fields
        name = profile_page.name
        biography = profile_page.biography
        website = profile_page.website

        # Check that everything was updated
        Assert.equal(name, new_full_name)
        Assert.equal(biography, new_biography)
        Assert.equal(website, new_website)
Example #35
0
    def test_that_breadcrumb_links_in_details_page_work(self, mozwebqa):
        """
        Test for Litmus 11923.
        https://litmus.mozilla.org/show_test.cgi?searchType=by_id&id=11923
        """
        home_page = Home(mozwebqa)
        detail_page = Details(mozwebqa, 'firebug')

        Assert.equal(detail_page.breadcrumbs[0].text, 'Add-ons for Firefox')
        link = detail_page.breadcrumbs[0].href_value
        detail_page.breadcrumbs[0].click()

        Assert.true(home_page.is_the_current_page)
        Assert.true(home_page.get_url_current_page().endswith(link))

        home_page.return_to_previous_page()

        Assert.equal(detail_page.breadcrumbs[1].text, 'Extensions')
        link = detail_page.breadcrumbs[1].href_value
        detail_page.breadcrumbs[1].click()

        amo_extenstions_page = ExtensionsHome(mozwebqa)
        Assert.true(amo_extenstions_page.is_the_current_page)
        Assert.true(amo_extenstions_page.get_url_current_page().endswith(link))

        home_page.return_to_previous_page()

        Assert.equal(detail_page.breadcrumbs[2].text, 'Firebug')
Example #36
0
    def test_can_add_another_email(self, mozwebqa):
        user = MockUser()
        home_pg = HomePage(mozwebqa)

        home_pg.go_to_home_page()
        bid_login = home_pg.click_sign_in()
        bid_login.sign_in_new_user(user['email'], user['password'])

        # Open restmail inbox, find the email
        inbox = RestmailInbox(user['email'])
        email = inbox.find_by_index(0)

        # Load the BrowserID link from the email in the browser
        mozwebqa.selenium.get(email.verify_user_link)
        from browserid.pages.webdriver.complete_registration import CompleteRegistration
        complete_registration = CompleteRegistration(mozwebqa.selenium,
                                                     mozwebqa.timeout)

        # Check the message on the registration page reflects a successful registration!
        Assert.contains("Thank you for signing up with Persona.",
                        complete_registration.thank_you)

        home_pg.wait_for_user_login()
        Assert.equal(home_pg.logged_in_user_email, user['email'])

        home_pg.click_logout()

        second_user = MockUser()
        bid_login = home_pg.click_sign_in(expect='returning')
        bid_login.sign_in_add_another_email(second_user['email'])

        # Open restmail inbox, find the email
        inbox = RestmailInbox(second_user['email'])
        email = inbox.find_by_index(0)

        # Load the BrowserID link from the email in the browser
        mozwebqa.selenium.get(email.add_email_address_link)
        from browserid.pages.webdriver.complete_registration import CompleteRegistration
        complete_registration = CompleteRegistration(mozwebqa.selenium,
                                                     mozwebqa.timeout)

        home_pg.wait_for_user_login()
        Assert.equal(home_pg.logged_in_user_email, second_user['email'])
        home_pg.click_logout()

        bid_login = home_pg.click_sign_in(expect='returning')

        expected_emails = [user['email'], second_user['email']]
        Assert.equal(expected_emails, bid_login.emails)
        Assert.equal(second_user['email'], bid_login.selected_email)
Example #37
0
    def test_that_checks_header_text_and_page_title(self, mozwebqa):
        home = Home(mozwebqa)
        Assert.true(home.is_the_current_page)

        Assert.equal('ADD-ONS', home.header_text)
        Assert.equal('Return to the Firefox Add-ons homepage', home.header_title)
        Assert.equal('Easy ways to personalize.', home.header_statement_text)
Example #38
0
    def _create_review(self, mozwebqa, user):
        # Step 1 - Login into Marketplace
        mock_review = MockReview()
        home_page = Home(mozwebqa)
        home_page.go_to_homepage()
        home_page.header.click_sign_in()
        home_page.login(user['email'], user['password'])
        Assert.true(home_page.is_the_current_page)

        # Step 2 - Search for the test app and go to its details page
        app_name = self._take_first_free_app_name(mozwebqa)
        details_page = home_page.header.search_and_click_on_app(app_name)
        Assert.true(details_page.is_the_current_page)

        details_page.wait_for_review_button_visible()
        Assert.equal(details_page.review_button_text, "Write a review")

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

        # Step 4 - Check review
        Assert.equal(details_page.first_review_rating, mock_review['rating'])
        Assert.equal(details_page.first_review_body, mock_review['body'])

        return app_name
Example #39
0
    def test_that_checks_redirect_using_locales_and_os(self, testsetup, lang,
                                                       os):

        url = testsetup.base_url

        # Ja locale has a special code for mac
        if lang == 'ja' and os == 'osx':
            lang = 'ja-JP-mac'

        param = {'product': 'firefox-16.0b6', 'lang': lang, 'os': os}

        response = self._head_request(url, params=param)

        parsed_url = urlparse(response.url)

        Assert.equal(response.status_code, requests.codes.ok,
            'Redirect failed with HTTP status %s on %s \n \
            For %s\n \
            Redirected to %s'                              % \
            (response.status_code, url, param, response.url))
        Assert.equal(parsed_url.scheme, 'http',
                     'Failed on %s \nUsing %s' % (url, param))
Example #40
0
    def test_feedback_custom_date_filter_with_random_numbers(self, mozwebqa):
        """This testcase covers # 13608 in Litmus.

        1.Verifies random numbers show all recent feedback

        """
        feedback_pg = FeedbackPage(mozwebqa)

        feedback_pg.go_to_feedback_page()

        start_date = random.randint(10000000, 50000000)
        end_date = random.randint(50000001, 99999999)

        feedback_pg.date_filter.filter_by_custom_dates_using_keyboard(start_date, end_date)
        Assert.equal(feedback_pg.date_start_from_url, str(start_date))
        Assert.equal(feedback_pg.date_end_from_url, str(end_date))

        Assert.equal(len(feedback_pg.messages), 20)

        feedback_pg.date_filter.click_custom_dates()
        Assert.equal(feedback_pg.date_filter.custom_start_date, str(start_date))
        Assert.equal(feedback_pg.date_filter.custom_end_date, str(end_date))
Example #41
0
    def test_feedback_custom_date_filter_with_invalid_dates(self, mozwebqa):
        """This testcase covers # 13609 & 13725 in Litmus.

        1.Verifies invalid dates show all recent feedback

        """
        feedback_pg = FeedbackPage(mozwebqa)

        feedback_pg.go_to_feedback_page()

        start_date = "0000-00-00"
        end_date = "0000-00-00"

        feedback_pg.date_filter.filter_by_custom_dates_using_keyboard(start_date, end_date)
        Assert.equal(feedback_pg.date_start_from_url, start_date)
        Assert.equal(feedback_pg.date_end_from_url, end_date)

        Assert.equal(len(feedback_pg.messages), 20)

        feedback_pg.date_filter.click_custom_dates()
        Assert.equal(feedback_pg.date_filter.custom_start_date, start_date)
        Assert.equal(feedback_pg.date_filter.custom_end_date, end_date)
Example #42
0
    def test_user_can_update_profile_information_in_account_settings_page(self, mozwebqa):
        home_page = Home(mozwebqa)
        home_page.login(user="******")

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

        user_edit_page = home_page.header.click_edit_profile()
        Assert.true(user_edit_page.is_the_current_page)

        # save initial values to restore them after the test is finished
        fields_no = len(user_edit_page.profile_fields) - 1
        initial_value = [None] * fields_no
        random_name = "test%s" % random.randrange(1, 100)

        # enter new values
        for i in range(0, fields_no):
            initial_value[i] = deepcopy(user_edit_page.profile_fields[i].field_value)
            user_edit_page.profile_fields[i].clear_field()
            user_edit_page.profile_fields[i].type_value(random_name)

        user_edit_page.click_update_account()
        Assert.equal(user_edit_page.update_message, "Profile Updated")

        # using try finally to ensure that the initial values are restore even if the Asserts fail.
        try:
            for i in range(0, fields_no):
                Assert.contains(random_name, user_edit_page.profile_fields[i].field_value)

        except Exception as exception:
            Assert.fail(exception.msg)

        finally:
            # restore initial values
            for i in range(0, fields_no):
                user_edit_page.profile_fields[i].clear_field()
                user_edit_page.profile_fields[i].type_value(initial_value[i])

            user_edit_page.click_update_account()
Example #43
0
    def test_remaining_character_count(self, mozwebqa):
        """This testcase covers # 15029 in Litmus.

        1. Verifies the remaining character count decreases
        2. Verifies that the remaining character count style changes at certain thresholds
        3. Verified that the 'Submit Feedback' button is disabled when character limit is exceeded

        """
        submit_idea_pg = SubmitIdeaPage(mozwebqa)

        submit_idea_pg.go_to_submit_idea_page()
        Assert.equal(submit_idea_pg.remaining_character_count, 250)
        Assert.false(submit_idea_pg.is_remaining_character_count_limited)
        Assert.false(submit_idea_pg.is_remaining_character_count_negative)
        Assert.false(submit_idea_pg.is_submit_feedback_enabled)

        submit_idea_pg.type_feedback("a" * 199)
        Assert.equal(submit_idea_pg.remaining_character_count, 51)
        Assert.false(submit_idea_pg.is_remaining_character_count_limited)
        Assert.false(submit_idea_pg.is_remaining_character_count_negative)
        Assert.true(submit_idea_pg.is_submit_feedback_enabled)

        submit_idea_pg.type_feedback("b")
        Assert.equal(submit_idea_pg.remaining_character_count, 50)
        Assert.true(submit_idea_pg.is_remaining_character_count_limited)
        Assert.false(submit_idea_pg.is_remaining_character_count_negative)
        Assert.true(submit_idea_pg.is_submit_feedback_enabled)

        submit_idea_pg.type_feedback("c" * 50)
        Assert.equal(submit_idea_pg.remaining_character_count, 0)
        Assert.true(submit_idea_pg.is_remaining_character_count_limited)
        Assert.false(submit_idea_pg.is_remaining_character_count_negative)
        Assert.true(submit_idea_pg.is_submit_feedback_enabled)

        submit_idea_pg.type_feedback("d")
        Assert.equal(submit_idea_pg.remaining_character_count, -1)
        Assert.false(submit_idea_pg.is_remaining_character_count_limited)
        Assert.true(submit_idea_pg.is_remaining_character_count_negative)
        Assert.false(submit_idea_pg.is_submit_feedback_enabled)
Example #44
0
    def test_user_can_create_banner(self, mozwebqa):
        start_page = StartPage(mozwebqa)
        home_page = start_page.login()

        create_banner_page = home_page.click_create_banner()
        create_banner_page.choose_category()
        create_banner_page.choose_banner()
        create_banner_page.select_language('English (US)')
        create_banner_page.select_size()
        create_banner_page.select_color()
        create_banner_page.click_save()
        Assert.true(create_banner_page.is_embeded_code_generated)

        # Get the id of the new banner from the page url
        new_banner_id = create_banner_page.get_url_current_page.split('/')[-2]
        create_banner_page.go_to_dashboard_page()

        # Get the id of the last created banner in the list
        last_banner_id = home_page.banners[len(home_page.banners) - 1].banner_link.split('/')[-2]

        #Check that the new banner is the last on the list of banners
        Assert.equal(new_banner_id, last_banner_id)
Example #45
0
    def test_that_filter_by_county_works(self, mozwebqa):
        home_page = Home(mozwebqa)
        home_page.login()

        profile_page = home_page.open_user_profile(u'Mozillians.User')
        country = profile_page.country
        search_results_page = profile_page.click_country_name(country=country)
        expected_results_title = u'Mozillians in %s' % country
        actual_results_title = search_results_page.title

        Assert.true(search_results_page.is_the_current_page)
        Assert.equal(
            expected_results_title, actual_results_title,
            u'''Search results title is incorrect.
                Expected: %s, but got: %s''' % (expected_results_title, actual_results_title))

        random_profile = search_results_page.get_random_profile()
        random_profile_country = random_profile.country

        Assert.equal(
            country, random_profile_country,
            u'Expected country: %s, but got: %s' % (country, random_profile_country))
Example #46
0
    def test_that_user_can_login_and_logout(self, mozwebqa):
        from pages.login_page import MozTrapLoginPage
        login_pg = MozTrapLoginPage(mozwebqa)
        home_pg = MozTrapHomePage(mozwebqa)

        home_pg.get_relative_path('/')

        Assert.false(home_pg.header.is_user_logged_in)

        login_pg.go_to_login_page()
        login_pg.login()

        user = home_pg.testsetup.credentials['default']
        users_name = user['name']

        Assert.true(home_pg.header.is_user_logged_in)
        Assert.equal(home_pg.header.username_text, users_name)

        home_pg.header.click_logout()
        home_pg.get_relative_path('/')

        Assert.false(home_pg.header.is_user_logged_in)
    def test_that_filter_by_region_works(self, mozwebqa, vouched_user):
        home_page = Home(mozwebqa)
        home_page.login(vouched_user['email'], vouched_user['password'])

        profile_page = home_page.open_user_profile(u'Mozillians.User')
        region = profile_page.region
        country = profile_page.country
        search_results_page = profile_page.click_profile_region_filter()
        expected_results_title = u'Mozillians in %s, %s' % (region, country)
        actual_results_title = search_results_page.title

        Assert.equal(
            expected_results_title, actual_results_title,
            u'''Search results title is incorrect.
                Expected: %s, but got: %s''' % (expected_results_title, actual_results_title))

        random_profile = search_results_page.get_random_profile()
        random_profile_region = random_profile.region

        Assert.equal(
            region, random_profile_region,
            u'Expected region: %s, but got: %s' % (region, random_profile_region))
Example #48
0
    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_submissions()

        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_visible)
        Assert.true(my_apps.is_notification_successful, my_apps.notification_message)
        Assert.equal("App deleted.", my_apps.notification_message)

        for i in range(1, my_apps.paginator.total_page_number + 1):
            for app in my_apps.submitted_apps:
                Assert.not_equal(app.name, app_name)
            if my_apps.paginator.is_paginator_present:
                if not my_apps.paginator.is_first_page_disabled:
                    my_apps.paginator.click_next_page()
Example #49
0
def test_check_request_status(soap_client):
    global vm_guid
    Assert.not_none(request_id)

    start_time = time()
    while (time() - start_time < 300):  # Give EVM 5 mins to change status
        result = soap_client.service.GetVmProvisionRequest(request_id)
        if result.approval_state == 'approved':
            if result.status == 'Error':
                pytest.fail(result.message)

            Assert.equal(result.status, 'Ok')

            try:
                global vm_guid
                vm_guid = result.vms[0].guid
            except IndexError:
                # So result.vms was []
                logging.info('Result from provision request \
                    did not have any VM associated with it: %s' % result.vms)
            break
        sleep(30)  # 30s nap
Example #50
0
    def test_start_from_suspend(self, load_vm_details, provider, vm_name,
                                verify_vm_suspended, mgmt_sys_api_clients):
        """Test power_on operation on a suspended vm.

        Verify vm transitions to running."""

        vm_details = load_vm_details
        vm_details.wait_for_vm_state_change('suspended', 10)
        last_boot_time = vm_details.last_boot_time
        state_chg_time = vm_details.last_pwr_state_change
        vm_details.power_button.power_on()
        vm_details.wait_for_vm_state_change('on', 15)
        Assert.equal(vm_details.power_state, 'on', "power state incorrect")
        self._wait_for_last_boot_timestamp_refresh(vm_details,
                                                   last_boot_time,
                                                   timeout_in_minutes=5)
        Assert.not_equal(vm_details.last_boot_time, last_boot_time,
                         "last boot time updated")
        Assert.not_equal(vm_details.last_pwr_state_change, state_chg_time,
                         "last state chg time failed to update")
        Assert.true(mgmt_sys_api_clients[provider].is_vm_running(vm_name),
                    "vm not running")
Example #51
0
    def test_that_article_can_be_translated(self, mozwebqa):
        """
           Creates a new knowledge base article.
           Translate article
        """
        kb_new_article = PageProvider(mozwebqa).new_kb_article_page()

        # create a new article
        mock_article = MockArticle()
        kb_new_article.set_article(mock_article)
        kb_new_article.submit_article()
        kb_article_history = kb_new_article.set_article_comment_box(
            mock_article['comment'])

        # translating
        kb_translate_pg = kb_article_history.navigation.click_translate_article(
        )
        kb_translate_pg.click_translate_language('Esperanto (eo)')

        #enter the tranlation
        mock_article_esperanto = MockArticle(suffix="_esperanto")
        kb_translate_pg.type_title(mock_article_esperanto['title'])
        kb_translate_pg.type_slug(mock_article_esperanto['slug'])
        kb_translate_pg.type_search_result_summary(
            mock_article_esperanto['summary'])
        kb_translate_pg.click_submit_review()

        change_comment = mock_article_esperanto['comment']
        kb_translate_pg.type_modal_describe_changes(change_comment)
        kb_article_history = kb_translate_pg.click_modal_submit_changes_button(
        )

        # verifying
        Assert.equal(change_comment,
                     kb_article_history.most_recent_revision_comment)
        Assert.contains('Esperanto', kb_article_history.revision_history)

        # deleting
        kb_article_history.delete_entire_article_document()
    def test_that_verifies_the_search_suggestions_list_under_the_search_field(self, mozwebqa):

        home_page = Home(mozwebqa)
        home_page.go_to_homepage()

        home_page.scroll_down
        Assert.true(home_page.header.is_search_visible)

        for letter in self.search_term[:2]:
            home_page.header.type_in_search_field(letter)
            Assert.false(home_page.header.is_search_suggestions_visible)

        home_page.header.type_in_search_field(self.search_term[2])
        home_page.header.wait_for_suggestions()
        Assert.true(home_page.header.is_search_suggestions_visible)

        Assert.equal(home_page.header.search_suggestions_title, 'Search apps for "%s"' % self.search_term[:3])
        Assert.greater_equal(len(home_page.header.search_suggestions), 0)

        for suggestion in home_page.header.search_suggestions:
            Assert.contains(self.search_term[:3], suggestion.name)
            Assert.true(suggestion.is_icon_visible)
Example #53
0
    def test_creating_profile_without_checking_privacy_policy_checkbox(self, mozwebqa):
        user = self.get_new_user()

        home_page = Home(mozwebqa)

        profile = home_page.create_new_user(user)

        profile.set_full_name("User that doesn't like policy")
        profile.set_bio("Hello, I'm new here and trying stuff out. Oh, and by the way: I'm a robot, run in a cronjob, and will not check accept the privacy policy")

        # Skills
        profile.add_skill('test')
        profile.add_language('english')

        # Location
        profile.select_country('us')
        profile.set_state('California')
        profile.set_city('Mountain View')

        profile.click_create_profile_button()

        Assert.equal('Please correct the errors below.', profile.error_message)
Example #54
0
    def test_feedback_custom_date_filter_with_mdy_format(self, mozwebqa):
        """This testcase covers # 13614 in Litmus.

        1.Verifies custom date fields show all recent feedback

        """
        feedback_pg = FeedbackPage(mozwebqa)

        feedback_pg.go_to_feedback_page()

        start_date = '04-22-2011'
        end_date = ''

        feedback_pg.date_filter.filter_by_custom_dates_using_keyboard(start_date, end_date)
        Assert.equal(feedback_pg.date_start_from_url, start_date)
        Assert.equal(feedback_pg.date_end_from_url, '')

        Assert.equal(len(feedback_pg.messages), 20)

        feedback_pg.date_filter.click_custom_dates()
        Assert.equal(feedback_pg.date_filter.custom_start_date, start_date)
        Assert.equal(feedback_pg.date_filter.custom_end_date, '')
Example #55
0
 def test_add_customization_template(self, infra_pxe_pg, pxe_templates,
                                     pxe_template_type):
     Assert.true(infra_pxe_pg.is_the_current_page)
     error_text = "There should be 4 accordion items instead of %s" % len(
         infra_pxe_pg.accordion_region.accordion_items)
     Assert.equal(len(infra_pxe_pg.accordion_region.accordion_items), 4,
                  error_text)
     infra_pxe_pg.accordion_region.accordion_by_name(
         "Customization Templates").click()
     infra_pxe_pg.center_buttons.configuration_button.click()
     add_pg = infra_pxe_pg.click_on_add_template()
     temp_pg = add_pg.new_pxe_template_select_type(pxe_template_type)
     temp_pg.new_pxe_template_fill_data(**pxe_templates)
     #This needs to be here. Add button is displayed only after a short time
     #after selecting the image type.
     #And: 'Element must be displayed to click'
     time.sleep(1)
     added_pg = temp_pg.click_on_add()
     flash_message = 'Customization Template "%s" was added' % pxe_templates[
         "name"]
     Assert.equal(added_pg.flash.message, flash_message,
                  FLASH_MESSAGE_NOT_MATCHED)
Example #56
0
    def test_feedback_custom_date_filter_with_future_end_date(self, mozwebqa):
        """This testcase covers # 13611 in Litmus.

        1. Verifies future end date filter data until current day

        """
        feedback_pg = FeedbackPage(mozwebqa)

        feedback_pg.go_to_feedback_page()

        start_date = ""
        end_date = "2900-01-01"

        feedback_pg.date_filter.filter_by_custom_dates_using_keyboard(start_date, end_date)
        Assert.equal(feedback_pg.date_start_from_url, start_date)
        Assert.equal(feedback_pg.date_end_from_url, end_date)

        Assert.equal(feedback_pg.message_column_heading, 'SEARCH RESULTS')

        feedback_pg.date_filter.click_custom_dates()
        Assert.equal(feedback_pg.date_filter.custom_start_date, start_date)
        Assert.equal(feedback_pg.date_filter.custom_end_date, end_date)
Example #57
0
    def test_that_posting_question_works(self, mozwebqa, variables):
        """Posts a question to /questions"""
        user = variables['users']['default']
        timestamp = datetime.datetime.today()
        q_to_ask = "automation test question %s" % (timestamp)
        q_details = "This is a test. %s" % (timestamp)

        # go to the /questions/new page and log in
        ask_new_questions_page = PageProvider(mozwebqa).new_question_page(
            user['username'], user['password'])

        # post a question
        ask_new_questions_page.click_firefox_product_link()
        ask_new_questions_page.click_category_problem_link()
        ask_new_questions_page.type_question(q_to_ask)
        ask_new_questions_page.close_stage_site_banner()
        ask_new_questions_page.click_none_of_these_solve_my_problem_button()
        view_question_pg = ask_new_questions_page.fill_up_questions_form(
            q_to_ask, q_details)

        Assert.equal(view_question_pg.question, q_to_ask)
        Assert.equal(view_question_pg.question_detail, q_details)
Example #58
0
    def test_feedback_custom_date_filter_with_future_start_date(self, mozwebqa):
        """This testcase covers # 13610 in Litmus.

        1.Verifies future start date are ignored as erroneous input and results for a 30 day period are returned

        """
        feedback_pg = FeedbackPage(mozwebqa)

        feedback_pg.go_to_feedback_page()

        start_date = "2900-01-01"
        end_date = ""

        feedback_pg.date_filter.filter_by_custom_dates_using_keyboard(start_date, end_date)
        Assert.equal(feedback_pg.date_start_from_url, start_date)
        Assert.equal(feedback_pg.date_end_from_url, end_date)

        Assert.equal(len(feedback_pg.messages), 20)

        feedback_pg.date_filter.click_custom_dates()
        Assert.equal(feedback_pg.date_filter.custom_start_date, start_date)
        Assert.equal(feedback_pg.date_filter.custom_end_date, end_date)
Example #59
0
    def test_feedback_custom_date_filter_with_future_dates(self, mozwebqa):
        """This testcase covers # 13612 in Litmus.

        1.Verifies future dates generate an error

        """
        feedback_pg = FeedbackPage(mozwebqa)

        feedback_pg.go_to_feedback_page()

        start_date = "2021-01-01"
        end_date = "2031-01-01"

        feedback_pg.date_filter.filter_by_custom_dates_using_keyboard(start_date, end_date)
        Assert.equal(feedback_pg.date_start_from_url, start_date)
        Assert.equal(feedback_pg.date_end_from_url, end_date)

        Assert.equal(feedback_pg.warning_heading, 'NO SEARCH RESULTS FOUND.')

        feedback_pg.date_filter.click_custom_dates()
        Assert.equal(feedback_pg.date_filter.custom_start_date, start_date)
        Assert.equal(feedback_pg.date_filter.custom_end_date, end_date)
    def test_that_verifies_the_search_suggestions_list_under_the_search_field(
            self, mozwebqa):
        """
        Test for Litmus 66531
        https://litmus.mozilla.org/show_test.cgi?id=66531
        """

        home_page = Home(mozwebqa)

        home_page.go_to_homepage()

        Assert.true(home_page.is_the_current_page)

        home_page.header.type_search_term_in_search_field(self.search_term)
        Assert.true(home_page.header.is_search_suggestion_list_visible)
        Assert.equal(home_page.header.search_suggestion_title,
                     'Search apps for "%s"' % self.search_term)
        Assert.greater_equal(len(home_page.header.search_suggestions), 0)

        for suggestion in home_page.header.search_suggestions:
            Assert.contains(self.search_term, suggestion.app_name)
            Assert.true(suggestion.is_app_icon_displayed)