Esempio n. 1
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)
Esempio n. 2
0
def test_dashboard(base_url, selenium):
    page = DashboardPage(selenium, base_url).open()
    first_row = page.first_row
    # ip toggle not present
    assert not page.is_ip_toggle_present
    # ip ban not present
    assert not first_row.is_ip_ban_present
    # spam ham button not present
    assert not first_row.is_spam_ham_button_present
    # no dashboard-details
    assert page.details_items_length is 0
    # click first cell
    page.open_first_details()
    # dashboard-details exist and are visible
    assert page.details_items_length is 1
    assert page.is_first_details_displayed
    # contains a diff
    assert page.is_first_details_diff_displayed
    # does not overflow page
    assert page.dashboard_not_overflowing
    # save id of first revision on page one
    first_row_id = page.first_row_id
    # click on page two link
    page.click_page_two()
    # save id of first revision on page tw0
    new_first_row_id = page.first_row_id
    # check first revison on page one is not on page two
    assert first_row_id is not new_first_row_id
Esempio n. 3
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
Esempio n. 4
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')
Esempio n. 5
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')
Esempio n. 6
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)
Esempio n. 7
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"
Esempio n. 8
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()
Esempio n. 9
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
Esempio n. 10
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'))
Esempio n. 11
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')
Esempio n. 12
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())
Esempio n. 13
0
def test_dashboard_overflow(base_url, selenium):
    """
    The revision detail diff stays in page boundaries

    bug 1405690 - some content causes overflows
    """
    page = DashboardPage(selenium, base_url).open()
    page.open_first_details()
    assert page.scrollWidth < page.clientWidth
Esempio n. 14
0
def test_dashboard_overflow(base_url, selenium):
    """
    The revision detail diff stays in page boundaries

    bug 1405690 - some content causes overflows
    """
    page = DashboardPage(selenium, base_url).open()
    page.open_first_details()
    assert page.scroll_width <= page.client_width
Esempio n. 15
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)
Esempio n. 16
0
def test_dashboard_load_page_two(base_url, selenium):
    page = DashboardPage(selenium, base_url).open()
    # save id of first revision on page one
    first_row_id = page.first_row_id
    # click on page two link
    page.click_page_two()
    # save id of first revision on page tw0
    new_first_row_id = page.first_row_id
    # check first revison on page one is not on page two
    assert first_row_id is not new_first_row_id
Esempio n. 17
0
def test_dashboard_load_page_two(base_url, selenium):
    page = DashboardPage(selenium, base_url).open()
    # save id of first revision on page one
    first_row_id = page.first_row_id
    # click on page two link
    page.click_page_two()
    # save id of first revision on page tw0
    new_first_row_id = page.first_row_id
    # check first revison on page one is not on page two
    assert first_row_id is not new_first_row_id
Esempio n. 18
0
def test_dashboard_open_details(base_url, selenium):
    page = DashboardPage(selenium, base_url).open()
    # no dashboard-details
    assert page.details_items_length is 0
    # click first cell
    page.open_first_details()
    # dashboard-details exist and are visible
    assert page.details_items_length is 1
    assert page.is_first_details_displayed
    # contains a diff
    page.wait_for_first_details_diff_displayed()
Esempio n. 19
0
def testing_with_correct_data(browser, user_name, pass_word):
    login_page = LoginPage(browser)
    login_page.load(url=data.LOGIN_URL)
    login_page.fill_username(user_name)
    login_page.fill_password(pass_word)
    login_page.click_login()

    dashboard_page = DashboardPage(browser)
    title_has_part = dashboard_page.check_title()

    assert title_has_part is True
Esempio n. 20
0
def test_dashboard_overflow(base_url, selenium):
    """
    The revision detail diff stays in page boundaries

    bug 1405690 - some content causes overflows
    """
    admin = AdminLogin(selenium, base_url).open()
    admin.login_new_user()
    page = DashboardPage(selenium, base_url).open()
    page.open_first_details()
    assert page.scroll_width <= page.client_width
Esempio n. 21
0
def test_dashboard_open_details(base_url, selenium):
    admin = AdminLogin(selenium, base_url).open()
    admin.login_new_user()
    page = DashboardPage(selenium, base_url).open()
    # no dashboard-details
    assert page.details_items_length == 0
    # click first cell
    page.open_first_details()
    # dashboard-details exist and are visible
    assert page.details_items_length == 1
    assert page.is_first_details_displayed
    # contains a diff
    page.wait_for_first_details_diff_displayed()
Esempio n. 22
0
def test_dashboard(base_url, selenium):
    page = DashboardPage(selenium, base_url).open()
    first_row = page.first_row
    # ip toggle not present
    assert not page.is_ip_toggle_present
    # ip ban not present
    assert not first_row.is_ip_ban_present
    # spam ham button not present
    assert not first_row.is_spam_ham_button_present
    # no dashboard-details
    assert page.details_items_length is 0
    # click first cell
    page.open_first_details()
    # dashboard-details exist and are visible
    assert page.details_items_length is 1
    assert page.is_first_details_displayed
    # contains a diff
    page.wait_for_first_details_diff_displayed()
    # save id of first revision on page one
    first_row_id = page.first_row_id
    # click on page two link
    page.click_page_two()
    # save id of first revision on page tw0
    new_first_row_id = page.first_row_id
    # check first revison on page one is not on page two
    assert first_row_id is not new_first_row_id
Esempio n. 23
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)
Esempio n. 24
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)'
Esempio n. 25
0
def start_page(browser):
    login_page = LoginPage(browser)
    login_page.load(url=data.LOGIN_URL)
    login_page.fill_username(data.LOGIN_EMAIL)
    login_page.fill_password(data.LOGIN_PASSWORD)
    login_page.click_login()
    time.sleep(3)
    dashboard_page = DashboardPage(browser)
    dashboard_page.click_staff()
    time.sleep(3)
    staff_page = StaffPage(browser)
    staff_page.click_add_employee()
    time.sleep(3)
    add_employees_page = AddEmployeesPage(browser)

    return add_employees_page
Esempio n. 26
0
    def _do_login(self,
                  continue_function,
                  user='******',
                  force_dashboard=True):
        self._set_login_fields(user)
        # TODO: Remove once bug is fixed
        time.sleep(1.25)
        continue_function()
        try:
            self._wait_for_results_refresh()
        except:
            self._wait_for_results_refresh()

        from pages.dashboard import DashboardPage
        page = DashboardPage(self.testsetup)
        try:
            page.is_the_current_page
        except AssertionError:
            if force_dashboard:
                from fixtures.navigation import intel_dashboard_pg
                page = intel_dashboard_pg()
            else:
                # Not the dashboard page and not forcing dashboard page
                # return a generic Base page
                page = Base(self.testsetup)
        return page
Esempio n. 27
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
Esempio n. 28
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)
Esempio n. 29
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)
Esempio n. 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 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
Esempio n. 31
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)')
Esempio n. 32
0
def test_dashboard(base_url, selenium):
    page = DashboardPage(selenium, base_url).open()
    first_row = page.first_row
    # ip toggle not present
    assert not page.is_ip_toggle_present
    # ip ban not present
    assert not first_row.is_ip_ban_present
    # spam ham button not present
    assert not first_row.is_spam_ham_button_present
    # no dashboard-details
    assert page.details_items_length is 0
Esempio n. 33
0
 def __do_login(self, continue_function, user='******'):
     self.__set_login_fields(user)
     # TODO: Remove once bug is fixed
     time.sleep(1.25)
     continue_function()
     try:
         self._wait_for_results_refresh()
     except:
         self._wait_for_results_refresh()
     from pages.dashboard import DashboardPage
     return DashboardPage(self.testsetup)
Esempio n. 34
0
def test_dashboard_super(base_url, selenium):
    admin = AdminLogin(selenium, base_url).open()
    admin.login_super_user()
    page = DashboardPage(selenium, base_url).open()
    first_row = page.first_row
    # ip toggle present
    assert page.is_ip_toggle_present
    # ip ban present
    assert first_row.is_ip_ban_present
    # spam ham button present
    assert first_row.is_spam_ham_button_present
Esempio n. 35
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)
Esempio n. 36
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)
Esempio n. 37
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
Esempio n. 38
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)
Esempio n. 39
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
Esempio n. 40
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)'
Esempio n. 41
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)'
Esempio n. 42
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)
Esempio n. 43
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())
Esempio n. 44
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')
Esempio n. 45
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)
Esempio n. 46
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)
Esempio n. 47
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)
Esempio n. 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.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)
Esempio n. 49
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)
Esempio n. 50
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)
Esempio n. 51
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)
Esempio n. 52
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
Esempio n. 53
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')
Esempio n. 54
0
class EdxLogin(unittest.TestCase):

    def setUp(self):
        #Initialize webdriver
        self.driver = webdriver.Chrome("C:\Shehroz\Softwares\Dev Tools\chromedriver_win32\chromedriver.exe")
        self.login = LoginPage(self.driver)
        self.dashboard = DashboardPage(self.driver)

    def test_login(self):
        # Open the target page
        self.driver.get('https://stage.edx.org')
        # Click login link
        self.login.click_login_link()
        # Assert that 'edX' is present in browser title
        self.assertTrue(self.login.is_browser_on_the_page())
        # Find and fill the email field
        self.login.fill_form()
        # Find and click the submit button
        self.login.submit_form()
        # Assert that 'Dashboard' is present in target pages browser title
        self.dashboard.is_browser_on_the_page()

    # def tearDown(self):
        self.driver.close()
Esempio n. 55
0
def test_dashboard_open_details(base_url, selenium):
    page = DashboardPage(selenium, base_url).open()
    # no dashboard-details
    assert page.details_items_length is 0
    # click first cell
    page.open_first_details()
    # dashboard-details exist and are visible
    assert page.details_items_length is 1
    assert page.is_first_details_displayed
    # contains a diff
    page.wait_for_first_details_diff_displayed()
Esempio n. 56
0
class Register(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Firefox()
        self.register = RegisterPage(self.driver)
        self.dashboard = DashboardPage(self.driver)

    def test_register(self):
        self.driver.get('http://stage.edx.org/')
        self.assertTrue(self.register.is_register_visible())
        self.register.click_register()
        self.assertTrue(self.register.is_browser_on_the_page())
        self.register.fill_form()
        self.register.submit_form()
        self.assertTrue(self.dashboard.check_dashboard())

    def tearDown(self):
        self.driver.close()