예제 #1
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)
예제 #2
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('firefox')

        # 2. click on happy
        feedback_pg.click_happy_feedback()

        # 3. fill out description and url
        feedback_pg.set_description(desc)

        # 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())
예제 #3
0
    def test_submit_happy_feedback(self, mozwebqa):
        timestamp = str(time.time())
        desc = 'input-tests testing happy feedback ' + timestamp
        url = 'http://happy.example.com/' + timestamp

        # 1. go to the feedback form
        feedback_pg = GenericFeedbackFormDevPage(mozwebqa)
        feedback_pg.go_to_feedback_page('firefox')

        # 2. click on happy
        feedback_pg.click_happy_feedback()

        # 3. fill out description, url, email checkbox and email
        # address
        feedback_pg.set_description(desc)
        feedback_pg.set_url(url)
        feedback_pg.check_email_checkbox()
        feedback_pg.set_email('*****@*****.**')

        # 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())
        Assert.equal(resp.locale.strip(), 'English (US)')
        Assert.equal(resp.site.strip(), 'example.com')
예제 #4
0
    def test_feedback_custom_date_filter_with_bad_dates(self, mozwebqa):
        """Verify random non-dates are ignored"""
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()

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

        def build_random_date(start, end):
            dte = random.randint(start, end)
            dte = str(dte)
            return '-'.join([dte[0:4], dte[4:6], dte[6:8]])

        data = [
            (build_random_date(10000000, 15000000), build_random_date(90000001, 99999999)),
            ('0000-00-00', '0000-00-00'),
        ]

        for start_date, end_date in data:
            dashboard_pg.date_filter.filter_by_custom_dates_using_keyboard(start_date, end_date)
            Assert.equal(dashboard_pg.date_start_from_url, str(start_date))
            Assert.equal(dashboard_pg.date_end_from_url, str(end_date))

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

            dashboard_pg.date_filter.enable_custom_dates()
            Assert.equal(dashboard_pg.date_filter.custom_start_date, self.default_start_date)
            Assert.equal(dashboard_pg.date_filter.custom_end_date, self.default_end_date)
예제 #5
0
    def test_preset_date_filters(self, mozwebqa):
        """Verify the preset date filters of 1, 7, and 30 days"""
        dashboard_pg = DashboardPage(mozwebqa)

        # Defaults to 7d.
        dashboard_pg.go_to_dashboard_page()
        Assert.equal(dashboard_pg.date_filter.current_days, '7d')

        # Last day filter
        dashboard_pg.date_filter.click_last_day()
        Assert.equal(dashboard_pg.date_filter.current_days, '1d')
        start_date = date.today() - timedelta(days=1)
        Assert.equal(dashboard_pg.date_start_from_url, start_date.strftime('%Y-%m-%d'))
        # TODO: Check results are within the expected date range,
        # possibly by navigating to the last page and checking the
        # final result is within range. Currently blocked by bug
        # 615844.

        # Last seven days filter
        dashboard_pg.date_filter.click_last_seven_days()
        Assert.equal(dashboard_pg.date_filter.current_days, '7d')
        start_date = date.today() - timedelta(days=7)
        Assert.equal(dashboard_pg.date_start_from_url, start_date.strftime('%Y-%m-%d'))
        # TODO: Check results are within the expected date range,
        # possibly by navigating to the last page and checking the
        # final result is within range. Currently blocked by bug
        # 615844.

        # Last thirty days filter
        dashboard_pg.date_filter.click_last_thirty_days()
        Assert.equal(dashboard_pg.date_filter.current_days, '30d')
        start_date = date.today() - timedelta(days=30)
        Assert.equal(dashboard_pg.date_start_from_url, start_date.strftime('%Y-%m-%d'))
예제 #6
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("firefox")

        # 2. click on happy
        feedback_pg.click_happy_feedback()

        # 3. fill out description and url
        feedback_pg.set_description(desc)

        # 4. submit
        thanks_pg = feedback_pg.submit(expect_success=True)
        assert 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 resp.type.strip() == "Happy"
        assert resp.body.strip() == desc.strip()
예제 #7
0
    def test_search_pagination(self, mozwebqa):
        dashboard_pg = DashboardPage(mozwebqa)
        dashboard_pg.go_to_dashboard_page()
        # Set the date range to 2013-01-01 -> today so that we're more
        # likely to have so many messages in the results that it
        # paginates. Otherwise it might not paginate on stage or local
        # environments.
        dashboard_pg.set_date_range('2013-01-01')
        dashboard_pg.search_for(self.SEARCH_TERM)

        # Check the total message count. If it's less than 50 (two
        # pages worth), then we will fail with a helpful message.
        Assert.greater(dashboard_pg.total_message_count, 50, "Search term didn't kick up enough messages. Please prime the server with more data!")

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

        dashboard_pg.click_older_messages()
        Assert.equal(dashboard_pg.search_term_from_url, self.SEARCH_TERM)

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

        dashboard_pg.click_newer_messages()
        Assert.equal(dashboard_pg.search_term_from_url, self.SEARCH_TERM)

        Assert.true(dashboard_pg.is_older_messages_link_visible)
        Assert.false(dashboard_pg.is_newer_messages_link_visible)
        Assert.equal(dashboard_pg.older_messages_link, 'Older Messages')
        Assert.equal(dashboard_pg.page_from_url, 1)
예제 #8
0
    def test_submit_sad_feedback(self, mozwebqa):
        timestamp = str(time.time())
        desc = 'input-tests testing sad feedback ' + timestamp
        url = 'http://sad.example.com/' + timestamp

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

        # 2. click on sad
        feedback_pg.click_sad_feedback()

        # 3. fill out description and url
        feedback_pg.set_description(desc)
        feedback_pg.set_url(url)
        feedback_pg.click_moreinfo_next()

        # 4. fill in email address
        feedback_pg.check_email_checkbox()
        feedback_pg.set_email('*****@*****.**')

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

        # 6. 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(), 'Sad')
        Assert.equal(resp.body.strip(), desc.strip())
        Assert.equal(resp.locale.strip(), 'English (US)')
        Assert.equal(resp.site.strip(), 'example.com')
예제 #9
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 dashboard_pg.date_start_from_url == start_date.strftime(
            '%Y-%m-%d')
        assert 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 dashboard_pg.date_filter.is_custom_date_filter_visible is False
            assert dashboard_pg.date_start_from_url == start_date.strftime(
                '%Y-%m-%d')
            assert dashboard_pg.date_end_from_url == self.default_end_date
예제 #10
0
    def test_submit_sad_feedback(self, mozwebqa):
        timestamp = str(time.time())
        desc = "input-tests testing sad feedback " + timestamp
        url = "http://sad.example.com/" + timestamp

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

        # 2. click on sad
        feedback_pg.click_sad_feedback()

        # 3. fill out description, url, email checkbox and email
        # address
        feedback_pg.set_description(desc)
        feedback_pg.set_url(url)
        feedback_pg.check_email_checkbox()
        feedback_pg.set_email("*****@*****.**")

        # 4. submit
        thanks_pg = feedback_pg.submit(expect_success=True)
        assert 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 resp.type.strip() == "Sad"
        assert resp.body.strip() == desc.strip()
        assert resp.locale.strip() == "English (US)"
        assert resp.site.strip() == "example.com"
예제 #11
0
    def test_feedback_custom_date_filter_with_end_date_lower_than_start_date(
            self, mozwebqa):
        """Verify start_date > end_date get switched automatically and the
        results are shown from end date to start date

        """
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()

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

        dashboard_pg.date_filter.filter_by_custom_dates_using_datepicker(
            start_date, end_date)
        assert dashboard_pg.date_start_from_url == start_date.strftime(
            '%Y-%m-%d')
        assert 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.

        # Test that the dates in the date filter are reordered chronologically
        dashboard_pg.date_filter.enable_custom_dates()
        assert dashboard_pg.date_filter.custom_start_date == end_date.strftime(
            '%Y-%m-%d')
        assert dashboard_pg.date_filter.custom_end_date == start_date.strftime(
            '%Y-%m-%d')
예제 #12
0
    def test_submit_sad_feedback(self, mozwebqa):
        timestamp = str(time.time())
        desc = 'input-tests testing sad feedback ' + timestamp
        url = 'http://sad.example.com/' + timestamp

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

        # 2. click on sad
        feedback_pg.click_sad_feedback()

        # 3. fill out description, url, email checkbox and email
        # address
        feedback_pg.set_description(desc)
        feedback_pg.set_url(url)
        feedback_pg.check_email_checkbox()
        feedback_pg.set_email('*****@*****.**')

        # 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(), 'Sad')
        Assert.equal(resp.body.strip(), desc.strip())
        Assert.equal(resp.locale.strip(), 'English (US)')
        Assert.equal(resp.site.strip(), 'example.com')
예제 #13
0
    def test_submit_sad_feedback(self, mozwebqa):
        timestamp = str(time.time())
        desc = 'input-tests testing sad fxos feedback ' + timestamp

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

        # 2. click on happy
        feedback_pg.click_sad_feedback()

        # 3. pick default country
        feedback_pg.click_country_next()

        # 4. pick default device
        feedback_pg.click_device_next()

        # 5. fill in description
        feedback_pg.set_description(desc)

        # 6. submit
        feedback_pg.submit(expect_success=True)
        self.take_a_breather()
        assert feedback_pg.current_card == 'thanks'

        # 7. verify
        dashboard_pg = DashboardPage(mozwebqa)
        dashboard_pg.go_to_dashboard_page()
        dashboard_pg.search_for(desc)
        resp = dashboard_pg.messages[0]
        assert resp.type.strip() == 'Sad'
        assert resp.body.strip() == desc.strip()
        assert resp.locale.strip() == 'English (US)'
예제 #14
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())
예제 #15
0
    def test_feedback_custom_date_filter_with_bad_dates(self, mozwebqa):
        """Verify random non-dates are ignored"""
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()

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

        def build_random_date(start, end):
            dte = random.randint(start, end)
            dte = str(dte)
            return '-'.join([dte[0:4], dte[4:6], dte[6:8]])

        data = [
            (build_random_date(10000000, 15000000),
             build_random_date(90000001, 99999999)),
            ('0000-00-00', '0000-00-00'),
        ]

        for start_date, end_date in data:
            dashboard_pg.date_filter.filter_by_custom_dates_using_keyboard(
                start_date, end_date)
            assert dashboard_pg.date_start_from_url == str(start_date)
            assert dashboard_pg.date_end_from_url == str(end_date)

            assert len(dashboard_pg.messages) == 20

            dashboard_pg.date_filter.enable_custom_dates()
            assert dashboard_pg.date_filter.custom_start_date == self.default_start_date
            assert dashboard_pg.date_filter.custom_end_date == self.default_end_date
예제 #16
0
    def test_submit_sad_feedback_using_prefill(self, mozwebqa):
        timestamp = str(time.time())
        desc = 'input-tests testing sad feedback ' + timestamp

        # 1. go to the feedback form with sad prefill
        feedback_pg = GenericFeedbackFormPage(mozwebqa)
        feedback_pg.go_to_feedback_page(
            'firefox', querystring='happy=0&url=http%3A%2F%2Fwww.mozilla.org')

        # 2. fill out description
        feedback_pg.set_description(desc)

        # 3. submit
        thanks_pg = feedback_pg.submit(expect_success=True)
        assert thanks_pg.is_the_current_page

        # 4. verify
        dashboard_pg = DashboardPage(mozwebqa)
        dashboard_pg.go_to_dashboard_page()
        dashboard_pg.search_for(desc)
        resp = dashboard_pg.messages[0]
        assert resp.type.strip() == 'Sad'
        assert resp.url.strip() == 'http://www.mozilla.org'
        assert resp.body.strip() == desc.strip()
        assert resp.locale.strip() == 'English (US)'
예제 #17
0
    def test_search_pagination(self, mozwebqa):
        dashboard_pg = DashboardPage(mozwebqa)
        dashboard_pg.go_to_dashboard_page()
        # Set the date range to 2013-01-01 -> today so that we're more
        # likely to have so many messages in the results that it
        # paginates. Otherwise it might not paginate on stage or local
        # environments.
        dashboard_pg.set_date_range('2013-01-01')
        dashboard_pg.search_for(self.SEARCH_TERM)

        # Check the total message count. If it's less than 50 (two
        # pages worth), then we will fail with a helpful message.
        assert dashboard_pg.total_message_count >= 50, 'Not enough data to test. Add more data.'

        assert dashboard_pg.is_older_messages_link_visible is True
        assert dashboard_pg.is_newer_messages_link_visible is False
        assert dashboard_pg.older_messages_link == 'Older Messages'

        dashboard_pg.click_older_messages()
        assert dashboard_pg.search_term_from_url == self.SEARCH_TERM

        assert dashboard_pg.is_older_messages_link_visible is True
        assert dashboard_pg.is_newer_messages_link_visible is True
        assert dashboard_pg.older_messages_link == 'Older Messages'
        assert dashboard_pg.newer_messages_link == 'Newer Messages'
        assert dashboard_pg.page_from_url == 2

        dashboard_pg.click_newer_messages()
        assert dashboard_pg.search_term_from_url == self.SEARCH_TERM

        assert dashboard_pg.is_older_messages_link_visible is True
        assert dashboard_pg.is_newer_messages_link_visible is False
        assert dashboard_pg.older_messages_link == 'Older Messages'
        assert dashboard_pg.page_from_url == 1
예제 #18
0
    def test_that_we_can_search_feedback_with_unicode(self, mozwebqa):
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()
        dashboard_pg.search_for(u"p\xe1gina")
        # There's no way to guarantee that the search we did finds
        # responses on the page. So we check for one of two possible
        # scenarios: existences of responses or a message count of 0.
        assert dashboard_pg.no_messages or (len(dashboard_pg.messages) > 0)
예제 #19
0
    def test_that_we_can_search_feedback_with_unicode(self, mozwebqa):
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()
        dashboard_pg.search_for(u"p\xe1gina")
        # There's no way to guarantee that the search we did finds
        # responses on the page. So we check for one of two possible
        # scenarios: existences of responses or a message count of 0.
        assert dashboard_pg.no_messages or (len(dashboard_pg.messages) > 0)
예제 #20
0
    def test_submit_happy_feedback(self, mozwebqa):
        timestamp = str(time.time())
        desc = 'input-tests testing happy fxos feedback ' + timestamp

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

        # Verify there is a privacy link
        feedback_pg.has_privacy_link

        # 2. click on happy
        feedback_pg.click_happy_feedback()

        # 3. pick default country
        feedback_pg.click_country_next()

        # 4. pick default device
        feedback_pg.click_device_next()

        # 5. fill in description
        feedback_pg.has_privacy_link
        assert feedback_pg.is_submit_enabled is False
        feedback_pg.set_description(desc)
        assert feedback_pg.is_submit_enabled is True

        # 6. fill in url
        feedback_pg.set_url('http://example.com/foo')

        # 7. fill in email address
        # FIXME: check email input disabled
        feedback_pg.check_email_checkbox()
        # FIXME: check email input enabled
        feedback_pg.set_email('*****@*****.**')

        # 8. submit
        feedback_pg.submit(expect_success=True)
        self.take_a_breather()
        assert feedback_pg.current_card == 'thanks'

        # 9. verify
        dashboard_pg = DashboardPage(mozwebqa)
        dashboard_pg.go_to_dashboard_page()
        dashboard_pg.search_for(desc)
        resp = dashboard_pg.messages[0]
        assert resp.type.strip() == 'Happy'
        assert resp.body.strip() == desc.strip()
        assert resp.locale.strip() == 'English (US)'
예제 #21
0
    def test_feedback_can_be_filtered_by_all_products_and_versions(self, mozwebqa):
        """Tests product filtering in dashboard

        1. Verify that at least one product exists
        2. Verify that filtering by product returns results
        3. Verify that versions show up when you choose a product
        4. Verify that the state of the filters are correct after being applied
        5. Verify product and version values in the URL

        NB: We don't cycle through all product/version
        combinations--only the first two of each.

        """
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()

        total_messages = dashboard_pg.total_message_count

        products = dashboard_pg.product_filter.products
        Assert.greater(len(products), 0)

        for product in products[:2]:
            if not product:
                # If it's the "unknown" product, just skip it.
                continue

            dashboard_pg.product_filter.select_product(product)
            Assert.greater(total_messages, dashboard_pg.total_message_count)
            versions = dashboard_pg.product_filter.versions
            Assert.greater(len(versions), 0)

            for version in versions[:2]:
                if not version:
                    # If it's the "unknown" version, just skip it.
                    continue

                dashboard_pg.product_filter.select_version(version)

                Assert.greater(total_messages, dashboard_pg.total_message_count)
                Assert.equal(dashboard_pg.product_filter.selected_product, product)
                Assert.equal(dashboard_pg.product_filter.selected_version, version)
                Assert.equal(dashboard_pg.product_from_url, product)
                Assert.equal(dashboard_pg.version_from_url, version)
                Assert.greater(len(dashboard_pg.messages), 0)
                dashboard_pg.product_filter.unselect_version(version)

            dashboard_pg.product_filter.unselect_product(product)
예제 #22
0
    def test_feedback_custom_date_filter_future_dates(self, mozwebqa):
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()

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

        dashboard_pg.date_filter.filter_by_custom_dates_using_keyboard(start_date, end_date)
        assert dashboard_pg.date_start_from_url == start_date
        assert dashboard_pg.date_end_from_url == end_date

        assert dashboard_pg.no_messages is True
        assert dashboard_pg.no_messages_message == 'No feedback matches that criteria.'

        dashboard_pg.date_filter.enable_custom_dates()
        assert dashboard_pg.date_filter.custom_start_date == start_date
        assert dashboard_pg.date_filter.custom_end_date == end_date
예제 #23
0
    def test_feedback_custom_date_filter_future_dates(self, mozwebqa):
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()

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

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

        Assert.true(dashboard_pg.no_messages)
        Assert.equal(dashboard_pg.no_messages_message, 'No feedback matches that criteria.')

        dashboard_pg.date_filter.enable_custom_dates()
        Assert.equal(dashboard_pg.date_filter.custom_start_date, start_date)
        Assert.equal(dashboard_pg.date_filter.custom_end_date, end_date)
예제 #24
0
    def test_submitting_same_feedback_twice(self, mozwebqa):
        """Submitting the same feedback twice ignores the second"""
        timestamp = str(time.time())
        desc = 'input-tests testing repeat feedback ' + timestamp

        # Submit the feedback the first time
        feedback_pg = GenericFeedbackFormPage(mozwebqa)
        feedback_pg.go_to_feedback_page()
        feedback_pg.click_happy_feedback()
        feedback_pg.set_description(desc)
        feedback_pg.click_moreinfo_next()
        thanks_pg = feedback_pg.submit(expect_success=True)
        Assert.true(thanks_pg.is_the_current_page)

        dashboard_pg = DashboardPage(mozwebqa)
        dashboard_pg.go_to_dashboard_page()
        dashboard_pg.search_for(desc)
        resp = dashboard_pg.messages[0]
        Assert.equal(resp.body.strip(), desc.strip())
        first_id = resp.response_id.strip()

        # Submit it a second time--we get the Thank You page again and
        # it looks identical to the first time.
        feedback_pg = GenericFeedbackFormPage(mozwebqa)
        feedback_pg.go_to_feedback_page()
        feedback_pg.click_happy_feedback()
        feedback_pg.set_description(desc)
        feedback_pg.click_moreinfo_next()
        thanks_pg = feedback_pg.submit(expect_success=True)
        Assert.true(thanks_pg.is_the_current_page)

        # Check the dashboard again and make sure the most recent
        # response has the same created time as the first time. If it
        # does, then
        dashboard_pg = DashboardPage(mozwebqa)
        dashboard_pg.go_to_dashboard_page()
        dashboard_pg.search_for(desc)
        resp = dashboard_pg.messages[0]
        Assert.equal(resp.body.strip(), desc.strip())
        second_id = resp.response_id.strip()

        # The two ids should be the same because the second response
        # didn't go through.
        Assert.equal(first_id, second_id)
예제 #25
0
    def test_feedback_custom_date_filter_future_dates(self, mozwebqa):
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()

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

        dashboard_pg.date_filter.filter_by_custom_dates_using_keyboard(
            start_date, end_date)
        assert dashboard_pg.date_start_from_url == start_date
        assert dashboard_pg.date_end_from_url == end_date

        assert dashboard_pg.no_messages is True
        assert dashboard_pg.no_messages_message == 'No feedback matches that criteria.'

        dashboard_pg.date_filter.enable_custom_dates()
        assert dashboard_pg.date_filter.custom_start_date == start_date
        assert dashboard_pg.date_filter.custom_end_date == end_date
예제 #26
0
    def test_submit_happy_feedback(self, mozwebqa):
        timestamp = str(time.time())
        desc = 'input-tests testing happy fxos feedback ' + timestamp

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

        # 2. click on happy
        feedback_pg.click_happy_feedback()

        # 3. pick default country
        feedback_pg.click_country_next()

        # 4. pick default device
        feedback_pg.click_device_next()

        # 5. fill in description
        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()

        self.take_a_breather()

        # 6. fill in email address
        feedback_pg.check_email_checkbox()
        feedback_pg.set_email('*****@*****.**')

        # 7. submit
        feedback_pg.submit(expect_success=True)
        self.take_a_breather()
        Assert.equal(feedback_pg.current_card, 'thanks')

        # 8. 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())
        Assert.equal(resp.locale.strip(), 'English (US)')
예제 #27
0
    def test_submitting_same_feedback_twice(self, mozwebqa):
        """Submitting the same feedback twice ignores the second"""
        timestamp = str(time.time())
        desc = 'input-tests testing repeat feedback ' + timestamp

        # Submit the feedback the first time
        feedback_pg = GenericFeedbackFormPage(mozwebqa)
        feedback_pg.go_to_feedback_page('firefox')
        feedback_pg.click_happy_feedback()
        feedback_pg.set_description(desc)
        thanks_pg = feedback_pg.submit(expect_success=True)
        Assert.true(thanks_pg.is_the_current_page)

        dashboard_pg = DashboardPage(mozwebqa)
        dashboard_pg.go_to_dashboard_page()
        dashboard_pg.search_for(desc)
        resp = dashboard_pg.messages[0]
        Assert.equal(resp.body.strip(), desc.strip())
        first_id = resp.response_id.strip()

        # Submit it a second time--we get the Thank You page again and
        # it looks identical to the first time.
        feedback_pg = GenericFeedbackFormPage(mozwebqa)
        feedback_pg.go_to_feedback_page('firefox')
        feedback_pg.click_happy_feedback()
        feedback_pg.set_description(desc)
        thanks_pg = feedback_pg.submit(expect_success=True)
        Assert.true(thanks_pg.is_the_current_page)

        # Check the dashboard again and make sure the most recent
        # response has the same created time as the first time. If it
        # does, then
        dashboard_pg = DashboardPage(mozwebqa)
        dashboard_pg.go_to_dashboard_page()
        dashboard_pg.search_for(desc)
        resp = dashboard_pg.messages[0]
        Assert.equal(resp.body.strip(), desc.strip())
        second_id = resp.response_id.strip()

        # The two ids should be the same because the second response
        # didn't go through.
        Assert.equal(first_id, second_id)
예제 #28
0
    def test_submit_happy_feedback(self, mozwebqa):
        timestamp = str(time.time())
        desc = 'input-tests testing happy fxos feedback ' + timestamp

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

        # 2. click on happy
        feedback_pg.click_happy_feedback()

        # 3. pick default country
        feedback_pg.click_country_next()

        # 4. pick default device
        feedback_pg.click_device_next()

        # 5. fill in description
        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()

        self.take_a_breather()

        # 6. fill in email address
        feedback_pg.check_email_checkbox()
        feedback_pg.set_email('*****@*****.**')

        # 7. submit
        feedback_pg.submit(expect_success=True)
        self.take_a_breather()
        Assert.equal(feedback_pg.current_card, 'thanks')

        # 8. 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())
        Assert.equal(resp.locale.strip(), 'English (US)')
예제 #29
0
    def test_feedback_custom_date_filter_with_random_alphabet(self, mozwebqa):
        """Verify custom date fields do not accept alphabet"""
        # FIXME: If the server is in a different time zone than the
        # machine running this test, then "today" could be different
        # than the server default and thus this test will fail.
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()

        letters = 'abcdefghijklmnopqrstuvwxyz'
        start_date = ''.join(random.sample(letters, 8))
        end_date = ''.join(random.sample(letters, 8))

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

        dashboard_pg.date_filter.enable_custom_dates()
        Assert.equal(dashboard_pg.date_filter.custom_start_date, self.default_start_date)
        Assert.equal(dashboard_pg.date_filter.custom_end_date, self.default_end_date)
예제 #30
0
    def test_feedback_custom_date_filter_future_dates(self, mozwebqa):
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()

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

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

        Assert.true(dashboard_pg.no_messages)
        Assert.equal(dashboard_pg.no_messages_message,
                     'No feedback matches that criteria.')

        dashboard_pg.date_filter.enable_custom_dates()
        Assert.equal(dashboard_pg.date_filter.custom_start_date, start_date)
        Assert.equal(dashboard_pg.date_filter.custom_end_date, end_date)
예제 #31
0
    def test_submit_sad_feedback(self, mozwebqa):
        feedback_pg = AndroidFeedbackFormPage(mozwebqa)
        timestamp = str(time.time())
        desc = 'input-tests testing sad android feedback ' + timestamp
        version = "44"
        channel = "beta"
        last_url = "http://mozilla.com"
        on_device = True

        # 1. Go to feedback page and click sad
        feedback_pg.go_to_feedback_page(version, channel, last_url, on_device)
        feedback_pg.click_sad_feedback()
        assert feedback_pg.current_sentiment == 'sad'

        # 2. Look for Support link
        assert feedback_pg.support_link_present

        # 3. Look for URL we passed
        assert feedback_pg.url_prepopulated() == last_url

        # 4. don't send the URL
        feedback_pg.uncheck_url()

        # 5. fill in description
        feedback_pg.set_description(desc)

        # 6. submit
        feedback_pg.submit(expect_success=True)
        self.take_a_breather()
        assert feedback_pg.current_card == 'thanks'

        # 7. verify
        dashboard_pg = DashboardPage(mozwebqa)
        dashboard_pg.go_to_dashboard_page()
        dashboard_pg.search_for(desc)
        resp = dashboard_pg.messages[0]
        assert resp.type.strip() == 'Sad'
        assert resp.body.strip() == desc.strip()
        assert resp.locale.strip() == 'English (US)'
        # we didn't send the url, it should not be here
        assert resp.site.strip() != last_url
예제 #32
0
    def test_feedback_custom_date_filter_with_future_start_date(self, mozwebqa):
        """Verify future start date are ignored as erroneous input and
        results for a 30 day period are returned

        """
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()

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

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

        Assert.equal(len(dashboard_pg.messages), 0)

        dashboard_pg.date_filter.enable_custom_dates()
        Assert.equal(dashboard_pg.date_filter.custom_start_date, start_date)
        Assert.equal(dashboard_pg.date_filter.custom_end_date, self.default_end_date)
예제 #33
0
    def test_feedback_custom_date_filter_with_random_alphabet(self, mozwebqa):
        """Verify custom date fields do not accept alphabet"""
        # FIXME: If the server is in a different time zone than the
        # machine running this test, then "today" could be different
        # than the server default and thus this test will fail.
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()

        letters = 'abcdefghijklmnopqrstuvwxyz'
        start_date = ''.join(random.sample(letters, 8))
        end_date = ''.join(random.sample(letters, 8))

        dashboard_pg.date_filter.filter_by_custom_dates_using_keyboard(
            start_date, end_date)
        assert dashboard_pg.date_start_from_url == ''
        assert dashboard_pg.date_end_from_url == ''

        dashboard_pg.date_filter.enable_custom_dates()
        assert dashboard_pg.date_filter.custom_start_date == self.default_start_date
        assert dashboard_pg.date_filter.custom_end_date == self.default_end_date
예제 #34
0
    def test_feedback_can_be_filtered_by_locale(self, mozwebqa):
        """Tests locale filtering in dashboard

        1. Verify we see at least one locale
        2. Select that locale
        3. Verify number of messages in locale is less than total number of messages
        4. Verify locale short code appears in the URL
        5. Verify that the locale for all messages on the first page of results is correct

        """
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()
        total_messages = dashboard_pg.total_message_count

        locales = dashboard_pg.locale_filter.locales
        locale_names = [locale.name for locale in locales]

        Assert.greater_equal(len(locales), 1)

        for name in locale_names[:2]:
            locale = dashboard_pg.locale_filter.locale(name)

            locale_name = locale.name
            locale_code = locale.code
            locale_count = locale.message_count
            Assert.greater(total_messages, locale_count)

            dashboard_pg.locale_filter.select_locale(locale_code)

            Assert.greater(total_messages, dashboard_pg.total_message_count)
            Assert.equal(len(dashboard_pg.locale_filter.locales), 1)
            Assert.equal(dashboard_pg.locale_filter.selected_locale.name,
                         locale_name)
            Assert.equal(dashboard_pg.locale_from_url, locale_code)

            for message in dashboard_pg.messages:
                Assert.equal(message.locale, locale_name)

            dashboard_pg.locale_filter.unselect_locale(locale_code)
예제 #35
0
    def test_feedback_can_be_filtered_by_platform(self, mozwebqa):
        """Tests platform filtering in dashboard

        1. Verify that the selected platform is the only one to appear in the list and is selected
        2. Verify that the number of messages is less than the total messages
        3. Verify that the platform appears in the URL
        4. Verify that the platform for all messages on the first page of results is correct

        """
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()
        total_messages = dashboard_pg.total_message_count

        platforms = dashboard_pg.platform_filter.platforms
        platform_names = [platform.name for platform in platforms]

        Assert.greater(len(platforms), 0)

        for name in platform_names[:2]:
            platform = dashboard_pg.platform_filter.platform(name)

            platform_name = platform.name
            platform_code = platform.code

            platform_count = platform.message_count
            Assert.greater(total_messages, platform_count)

            dashboard_pg.platform_filter.select_platform(platform_code)

            Assert.greater(total_messages, dashboard_pg.total_message_count)
            Assert.equal(len(dashboard_pg.platform_filter.platforms), 1)
            Assert.equal(dashboard_pg.platform_filter.selected_platform.name, platform_name)
            Assert.equal(dashboard_pg.platform_from_url, platform_code)

            for message in dashboard_pg.messages:
                Assert.equal(message.platform, platform_name)

            dashboard_pg.platform_filter.unselect_platform(platform_code)
예제 #36
0
    def test_feedback_can_be_filtered_by_locale(self, mozwebqa):
        """Tests locale filtering in dashboard

        1. Verify we see at least one locale
        2. Select that locale
        3. Verify number of messages in locale is less than total number of messages
        4. Verify locale short code appears in the URL
        5. Verify that the locale for all messages on the first page of results is correct

        """
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()
        total_messages = dashboard_pg.total_message_count

        locales = dashboard_pg.locale_filter.locales
        locale_names = [locale.name for locale in locales]

        assert len(locales) > 0

        for name in locale_names[:2]:
            locale = dashboard_pg.locale_filter.locale(name)

            locale_name = locale.name
            locale_code = locale.code
            locale_count = locale.message_count
            assert total_messages > locale_count

            dashboard_pg.locale_filter.select_locale(locale_code)

            assert total_messages > dashboard_pg.total_message_count
            assert len(dashboard_pg.locale_filter.locales) == 1
            assert dashboard_pg.locale_filter.selected_locale.name == locale_name
            assert dashboard_pg.locale_from_url == locale_code

            for message in dashboard_pg.messages:
                assert message.locale == locale_name

            dashboard_pg.locale_filter.unselect_locale(locale_code)
예제 #37
0
    def test_feedback_can_be_filtered_by_platform(self, mozwebqa):
        """Tests platform filtering in dashboard

        1. Verify that the selected platform is the only one to appear in the list and is selected
        2. Verify that the number of messages is less than the total messages
        3. Verify that the platform appears in the URL
        4. Verify that the platform for all messages on the first page of results is correct

        """
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()
        total_messages = dashboard_pg.total_message_count

        platforms = dashboard_pg.platform_filter.platforms
        platform_names = [platform.name for platform in platforms]

        assert len(platforms) > 0

        for name in platform_names[:2]:
            platform = dashboard_pg.platform_filter.platform(name)

            platform_name = platform.name
            platform_code = platform.code

            platform_count = platform.message_count
            assert total_messages > platform_count

            dashboard_pg.platform_filter.select_platform(platform_code)

            assert total_messages > dashboard_pg.total_message_count
            assert len(dashboard_pg.platform_filter.platforms) == 1
            assert dashboard_pg.platform_filter.selected_platform.name == platform_name
            assert dashboard_pg.platform_from_url == platform_code

            for message in dashboard_pg.messages:
                assert message.platform == platform_name

            dashboard_pg.platform_filter.unselect_platform(platform_code)
예제 #38
0
    def test_feedback_can_be_filtered_by_locale(self, mozwebqa):
        """Tests locale filtering in dashboard

        1. Verify we see at least one locale
        2. Select that locale
        3. Verify number of messages in locale is less than total number of messages
        4. Verify locale short code appears in the URL
        5. Verify that the locale for all messages on the first page of results is correct

        """
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()
        total_messages = dashboard_pg.total_message_count

        locales = dashboard_pg.locale_filter.locales
        locale_names = [locale.name for locale in locales]

        Assert.greater_equal(len(locales), 1)

        for name in locale_names[:2]:
            locale = dashboard_pg.locale_filter.locale(name)

            locale_name = locale.name
            locale_code = locale.code
            locale_count = locale.message_count
            Assert.greater(total_messages, locale_count)

            dashboard_pg.locale_filter.select_locale(locale_code)

            Assert.greater(total_messages, dashboard_pg.total_message_count)
            Assert.equal(len(dashboard_pg.locale_filter.locales), 1)
            Assert.equal(dashboard_pg.locale_filter.selected_locale.name, locale_name)
            Assert.equal(dashboard_pg.locale_from_url, locale_code)

            for message in dashboard_pg.messages:
                Assert.equal(message.locale, locale_name)

            dashboard_pg.locale_filter.unselect_locale(locale_code)
예제 #39
0
    def test_feedback_custom_date_filter_with_future_start_date(self, mozwebqa):
        """Future time span will bring up no messages"""
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()

        start_date = "2020-01-01"
        end_date = "2020-01-10"

        dashboard_pg.date_filter.filter_by_custom_dates_using_keyboard(start_date, end_date)

        # No messages!
        Assert.equal(dashboard_pg.total_message_count, 0)

        # Check the url bits are correct
        Assert.equal(dashboard_pg.date_start_from_url, start_date)
        Assert.equal(dashboard_pg.date_end_from_url, end_date)

        # Verify the dates
        dashboard_pg.date_filter.enable_custom_dates()
        Assert.equal(dashboard_pg.date_filter.custom_start_date, start_date)
        Assert.equal(dashboard_pg.date_filter.custom_end_date, end_date)
예제 #40
0
    def test_feedback_can_be_filtered_by_locale(self, mozwebqa):
        """Tests locale filtering in dashboard

        1. Verify we see at least one locale
        2. Select that locale
        3. Verify number of messages in locale is less than total number of messages
        4. Verify locale short code appears in the URL
        5. Verify that the locale for all messages on the first page of results is correct

        """
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()
        total_messages = dashboard_pg.total_message_count

        locales = dashboard_pg.locale_filter.locales
        locale_names = [locale.name for locale in locales]

        assert len(locales) > 0

        for name in locale_names[:2]:
            locale = dashboard_pg.locale_filter.locale(name)

            locale_name = locale.name
            locale_code = locale.code
            locale_count = locale.message_count
            assert total_messages > locale_count

            dashboard_pg.locale_filter.select_locale(locale_code)

            assert total_messages > dashboard_pg.total_message_count
            assert len(dashboard_pg.locale_filter.locales) == 1
            assert dashboard_pg.locale_filter.selected_locale.name == locale_name
            assert dashboard_pg.locale_from_url == locale_code

            for message in dashboard_pg.messages:
                assert message.locale == locale_name

            dashboard_pg.locale_filter.unselect_locale(locale_code)
예제 #41
0
파일: test_submit.py 프로젝트: lonnen/fjord
    def test_submit_sad_feedback_using_prefill(self, mozwebqa):
        timestamp = str(time.time())
        desc = 'input-tests testing sad feedback ' + timestamp

        # 1. go to the feedback form with sad prefill
        feedback_pg = GenericFeedbackFormPage(mozwebqa)
        feedback_pg.go_to_feedback_page('firefox', querystring='happy=0')

        # 2. fill out description
        feedback_pg.set_description(desc)

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

        # 4. 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(), 'Sad')
        Assert.equal(resp.body.strip(), desc.strip())
        Assert.equal(resp.locale.strip(), 'English (US)')
예제 #42
0
    def test_submit_sad_feedback_using_prefill(self, mozwebqa):
        timestamp = str(time.time())
        desc = "input-tests testing sad feedback " + timestamp

        # 1. go to the feedback form with sad prefill
        feedback_pg = GenericFeedbackFormPage(mozwebqa)
        feedback_pg.go_to_feedback_page("firefox", querystring="happy=0")

        # 2. fill out description
        feedback_pg.set_description(desc)

        # 3. submit
        thanks_pg = feedback_pg.submit(expect_success=True)
        assert thanks_pg.is_the_current_page

        # 4. verify
        dashboard_pg = DashboardPage(mozwebqa)
        dashboard_pg.go_to_dashboard_page()
        dashboard_pg.search_for(desc)
        resp = dashboard_pg.messages[0]
        assert resp.type.strip() == "Sad"
        assert resp.body.strip() == desc.strip()
        assert resp.locale.strip() == "English (US)"
예제 #43
0
    def test_feedback_custom_date_filter_with_end_date_lower_than_start_date(self, mozwebqa):
        """Verify start_date > end_date get switched automatically and the
        results are shown from end date to start date

        """
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()

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

        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.

        dashboard_pg.date_filter.enable_custom_dates()
        Assert.equal(dashboard_pg.date_filter.custom_start_date, start_date.strftime('%Y-%m-%d'))
        Assert.equal(dashboard_pg.date_filter.custom_end_date, end_date.strftime('%Y-%m-%d'))
예제 #44
0
    def test_submit_sad_feedback(self, mozwebqa):
        feedback_pg = AndroidFeedbackFormPage(mozwebqa)
        timestamp = str(time.time())
        desc = 'input-tests testing sad android feedback ' + timestamp
        version = "44"
        channel = "beta"
        on_device = True
        last_url = "mozilla.com"

        # Go to feedback page and click sad
        feedback_pg.go_to_feedback_page(version, channel, on_device)
        feedback_pg.click_sad_feedback()
        assert feedback_pg.current_sentiment == 'sad'

        # Look for Support link
        assert feedback_pg.support_link_present

        # fill in description
        feedback_pg.set_description(desc)

        # fill in the URL
        feedback_pg.set_url(last_url)

        # submit
        feedback_pg.submit(expect_success=True)
        self.take_a_breather()
        assert feedback_pg.current_card == 'thanks'

        # verify
        dashboard_pg = DashboardPage(mozwebqa)
        dashboard_pg.go_to_dashboard_page()
        dashboard_pg.search_for(desc)
        resp = dashboard_pg.messages[0]
        assert resp.type.strip() == 'Sad'
        assert resp.body.strip() == desc.strip()
        assert resp.locale.strip() == 'English (US)'
        assert resp.site.strip() == last_url
예제 #45
0
    def test_search_pagination(self, mozwebqa):
        dashboard_pg = DashboardPage(mozwebqa)
        dashboard_pg.go_to_dashboard_page()
        # Set the date range to 2013-01-01 -> today so that we're more
        # likely to have so many messages in the results that it
        # paginates. Otherwise it might not paginate on stage or local
        # environments.
        dashboard_pg.set_date_range('2013-01-01')
        dashboard_pg.search_for(self.SEARCH_TERM)

        # Check the total message count. If it's less than 50 (two
        # pages worth), then we will fail with a helpful message.
        Assert.greater(
            dashboard_pg.total_message_count, 50,
            "Search term didn't kick up enough messages. Please prime the server with more data!"
        )

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

        dashboard_pg.click_older_messages()
        Assert.equal(dashboard_pg.search_term_from_url, self.SEARCH_TERM)

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

        dashboard_pg.click_newer_messages()
        Assert.equal(dashboard_pg.search_term_from_url, self.SEARCH_TERM)

        Assert.true(dashboard_pg.is_older_messages_link_visible)
        Assert.false(dashboard_pg.is_newer_messages_link_visible)
        Assert.equal(dashboard_pg.older_messages_link, 'Older Messages')
        Assert.equal(dashboard_pg.page_from_url, 1)
예제 #46
0
    def test_preset_date_filters(self, mozwebqa):
        """Verify the preset date filters of 1, 7, and 30 days"""
        dashboard_pg = DashboardPage(mozwebqa)

        # Defaults to 7d.
        dashboard_pg.go_to_dashboard_page()
        assert dashboard_pg.date_filter.current_days == '7d'

        # Last day filter
        dashboard_pg.date_filter.click_last_day()
        assert dashboard_pg.date_filter.current_days == '1d'
        start_date = date.today() - timedelta(days=1)
        assert dashboard_pg.date_start_from_url == start_date.strftime(
            '%Y-%m-%d')
        # TODO: Check results are within the expected date range,
        # possibly by navigating to the last page and checking the
        # final result is within range. Currently blocked by bug
        # 615844.

        # Last seven days filter
        dashboard_pg.date_filter.click_last_seven_days()
        assert dashboard_pg.date_filter.current_days == '7d'
        start_date = date.today() - timedelta(days=7)
        assert dashboard_pg.date_start_from_url == start_date.strftime(
            '%Y-%m-%d')
        # TODO: Check results are within the expected date range,
        # possibly by navigating to the last page and checking the
        # final result is within range. Currently blocked by bug
        # 615844.

        # Last thirty days filter
        dashboard_pg.date_filter.click_last_thirty_days()
        assert dashboard_pg.date_filter.current_days == '30d'
        start_date = date.today() - timedelta(days=30)
        assert dashboard_pg.date_start_from_url == start_date.strftime(
            '%Y-%m-%d')
예제 #47
0
    def test_submit_happy_feedback(self, mozwebqa):
        timestamp = str(time.time())
        desc = 'input-tests testing happy feedback ' + timestamp
        url = 'http://happy.example.com/' + timestamp

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

        # Verify there is a privacy link
        feedback_pg.has_privacy_link

        # 2. click on happy
        feedback_pg.click_happy_feedback()

        # 3. fill out description, url, email checkbox and email
        # address
        feedback_pg.has_privacy_link
        feedback_pg.set_description(desc)
        feedback_pg.set_url(url)
        feedback_pg.check_email_checkbox()
        feedback_pg.set_email('*****@*****.**')

        # 4. submit
        thanks_pg = feedback_pg.submit(expect_success=True)
        assert 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 resp.type.strip() == 'Happy'
        assert resp.body.strip() == desc.strip()
        assert resp.locale.strip() == 'English (US)'
        assert resp.site.strip() == 'example.com'
예제 #48
0
    def test_feedback_custom_date_filter_with_future_start_date(
            self, mozwebqa):
        """Future time span will bring up no messages"""
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()

        start_date = "2020-01-01"
        end_date = "2020-01-10"

        dashboard_pg.date_filter.filter_by_custom_dates_using_keyboard(
            start_date, end_date)

        # No messages!
        assert dashboard_pg.total_message_count == 0

        # Check the url bits are correct
        assert dashboard_pg.date_start_from_url == start_date
        assert dashboard_pg.date_end_from_url == end_date

        # Verify the dates
        dashboard_pg.date_filter.enable_custom_dates()
        assert dashboard_pg.date_filter.custom_start_date == start_date
        assert dashboard_pg.date_filter.custom_end_date == end_date
예제 #49
0
    def test_that_empty_search_of_feedback_returns_some_data(self, mozwebqa):
        dashboard_pg = DashboardPage(mozwebqa)

        dashboard_pg.go_to_dashboard_page()
        dashboard_pg.search_for('')
        assert len(dashboard_pg.messages) > 0