コード例 #1
0
    def test_that_new_event_appears_on_all_calendar_views(self):
        """
        https://moztrap.mozilla.org/manage/case/6118/
        """

        # We get the actual time of the device
        _seconds_since_epoch = self.marionette.execute_script("return Date.now();")
        now = datetime.fromtimestamp(_seconds_since_epoch / 1000)

        event_title = 'Event Title %s' % str(now.time())
        event_location = 'Event Location %s' % str(now.time())

        calendar = Calendar(self.marionette)
        calendar.launch()
        new_event = calendar.tap_add_event_button()

        # create a new event
        new_event.fill_event_title(event_title)
        new_event.fill_event_location(event_location)

        event_start_date_time = new_event.tap_save_event()

        # assert that the event is displayed as expected in month view
        self.assertIn(event_title, calendar.displayed_events_in_month_view(event_start_date_time))
        self.assertIn(event_location, calendar.displayed_events_in_month_view(event_start_date_time))

        # switch to the week display
        calendar.tap_week_display_button()
        self.assertIn(event_title, calendar.displayed_events_in_week_view(event_start_date_time))

        # switch to the day display
        calendar.tap_day_display_button()
        self.assertIn(event_title, calendar.displayed_events_in_day_view(event_start_date_time))
        self.assertIn(event_location, calendar.displayed_events_in_day_view(event_start_date_time))
    def test_calendar_new_event_appears_on_all_calendar_views(self):
        """https://moztrap.mozilla.org/manage/case/6118/"""

        event_title = 'Event Title Goes here'
        event_location = 'Event Location Goes here'

        calendar = Calendar(self.marionette)
        calendar.launch()
        new_event = calendar.tap_add_event_button()
        self.take_screenshot()

        # create a new event
        new_event.fill_event_title(event_title)
        new_event.fill_event_location(event_location)
        self.take_screenshot()

        event_start_date_time = new_event.tap_save_event()

        # assert that the event is displayed as expected in month view
        self.assertIn(event_title, calendar.displayed_events_in_month_view(event_start_date_time))
        self.assertIn(event_location, calendar.displayed_events_in_month_view(event_start_date_time))
        self.take_screenshot()

        # switch to the week display
        calendar.tap_week_display_button()

        self.assertIn(event_title, calendar.displayed_events_in_week_view(event_start_date_time))
        Wait(self.marionette).until(lambda m: self.is_element_displayed(*self._created_event_locator))
        self.take_screenshot()

        # switch to the day display
        calendar.tap_day_display_button()
        self.assertIn(event_title, calendar.displayed_events_in_day_view(event_start_date_time))
        self.assertIn(event_location, calendar.displayed_events_in_day_view(event_start_date_time))
        self.take_screenshot()
コード例 #3
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.calendar = Calendar(self.marionette)
        self.calendar.launch()

        self.event_title = 'title'
        self.calendar.a11y_create_event(self.event_title)
コード例 #4
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.today = datetime.date.today()
        self.previous_day = self.today - datetime.timedelta(days=1)
        self.next_day = self.today + datetime.timedelta(days=1)

        self.calendar = Calendar(self.marionette)
        self.calendar.launch()
コード例 #5
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.today = datetime.date.today()
        # Determine the name and the year of the next month
        self.next_month_year = self.today.replace(day=1) + datetime.timedelta(days=32)

        self.calendar = Calendar(self.marionette)
        self.calendar.launch()
コード例 #6
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.calendar = Calendar(self.marionette)
        self.calendar.launch()
        self.clock = Clock(self.marionette)
        self.clock.launch()

        # Switch to top level frame before starting the test
        self.marionette.switch_to_frame()
コード例 #7
0
    def test_check_today_date(self):

        # We get the actual time of the device
        _seconds_since_epoch = self.marionette.execute_script(
            "return Date.now();")
        now = datetime.fromtimestamp(_seconds_since_epoch / 1000)

        calendar = Calendar(self.marionette)
        calendar.launch()

        self.assertEquals(now.strftime('%B %Y'), calendar.current_month_year)
        self.assertIn(now.strftime('%a %b %d %Y'), calendar.current_month_day)
コード例 #8
0
    def test_calendar_flick_through_months(self):
        # https://bugzilla.mozilla.org/show_bug.cgi?id=937085

        MONTH_YEAR_PATTERN = '%B %Y'

        calendar = Calendar(self.marionette)
        calendar.launch()

        calendar.flick_to_next_month()
        self.assertEquals(self.next_month_year.strftime(MONTH_YEAR_PATTERN),
                          calendar.current_month_year)

        calendar.flick_to_previous_month()
        self.assertEquals(self.today.strftime(MONTH_YEAR_PATTERN),
                          calendar.current_month_year)
コード例 #9
0
    def test_calendar_flick(self):
        """https://bugzilla.mozilla.org/show_bug.cgi?id=937085"""

        calendar = Calendar(self.marionette)
        calendar.launch()

        calendar.flick_to_next_month()
        self.take_screenshot()

        calendar.flick_to_previous_month()
        self.take_screenshot()

        calendar.flick_to_previous_month()
        self.take_screenshot()

        calendar.tap_week_display_button()
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                        300, locator=calendar._week_view_locator)
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'up',
                                        300, locator=calendar._week_view_locator)
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'right',
                                        100, locator=calendar._week_view_locator)
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'left',
                                        100, locator=calendar._week_view_locator)
        self.take_screenshot()

        calendar.tap_day_display_button()
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                        300, locator=calendar._day_view_locator)
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'up',
                                        300, locator=calendar._day_view_locator)
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'right',
                                        100, locator=calendar._day_view_locator)
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'left',
                                        100, locator=calendar._day_view_locator)
        GaiaImageCompareTestCase.scroll(self.marionette, 'left',
                                        100, locator=calendar._day_view_locator)
        self.take_screenshot()
    def test_that_new_event_appears_on_all_calendar_views(self):

        # We get the actual time of the device
        _seconds_since_epoch = self.marionette.execute_script(
            "return Date.now();")
        now = datetime.fromtimestamp(_seconds_since_epoch / 1000)

        # We know that the default event time will be rounded up 1 hour
        event_start_date_time = now + timedelta(hours=1)

        event_title = 'Event Title %s' % str(event_start_date_time.time())
        event_location = 'Event Location %s' % str(
            event_start_date_time.time())

        calendar = Calendar(self.marionette)
        calendar.launch()
        new_event = calendar.tap_add_event_button()

        # create a new event
        new_event.fill_event_title(event_title)
        new_event.fill_event_location(event_location)

        new_event.tap_save_event()

        # assert that the event is displayed as expected in month view
        self.assertIn(
            event_title,
            calendar.displayed_events_in_month_view(event_start_date_time))
        self.assertIn(
            event_location,
            calendar.displayed_events_in_month_view(event_start_date_time))

        # switch to the week display
        calendar.tap_week_display_button()
        self.assertIn(
            event_title,
            calendar.displayed_events_in_week_view(event_start_date_time))

        # switch to the day display
        calendar.tap_day_display_button()
        self.assertIn(
            event_title,
            calendar.displayed_events_in_day_view(event_start_date_time))
        self.assertIn(
            event_location,
            calendar.displayed_events_in_day_view(event_start_date_time))
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.event_title = 'title'
        self.event_location = 'location'

        self.calendar = Calendar(self.marionette)
        self.calendar.launch()

        new_event = self.calendar.a11y_click_add_event_button()

        # create a new event
        new_event.a11y_fill_event_title(self.event_title)
        new_event.a11y_fill_event_location(self.event_location)

        new_event.a11y_click_save_event()

        self.calendar.wait_for_events(1)
コード例 #12
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.calendar = Calendar(self.marionette)
        self.calendar.launch()

        self.views = {
            'time_views':
            self.marionette.find_element(*self.calendar._time_views_locator),
            'current_day':
            self.marionette.find_element(
                *self.calendar._current_month_day_agenda_locator),
            'month':
            self.marionette.find_element(
                *self.calendar._current_monthly_calendar_locator),
            'day':
            self.marionette.find_element(*self.calendar._day_view_locator),
            'week':
            self.marionette.find_element(*self.calendar._week_view_locator),
            'settings':
            self.marionette.find_element(*self.calendar._settings_locator),
            'advanced_settings':
            self.marionette.find_element(
                *self.calendar._advanced_settings_view_locator),
            'modify_event':
            self.marionette.find_element(
                *self.calendar._modify_event_view_locator),
            'event':
            self.marionette.find_element(*self.calendar._event_view_locator),
            'create_account':
            self.marionette.find_element(
                *self.calendar._create_account_view_locator),
            'modify_account':
            self.marionette.find_element(
                *self.calendar._modify_account_view_locator)
        }

        self.event_title = 'title'
        new_event = self.calendar.a11y_click_add_event_button()
        # create a new event
        new_event.a11y_fill_event_title(self.event_title)
        new_event.a11y_click_save_event()
        self.calendar.wait_for_events(1)
コード例 #13
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.calendar = Calendar(self.marionette)
        self.calendar.launch()

        self.views = {
            'time_views':
            self.marionette.find_element(*self.calendar._time_views_locator),
            'current_day':
            self.marionette.find_element(
                *self.calendar._current_month_day_agenda_locator),
            'month':
            self.marionette.find_element(
                *self.calendar._current_monthly_calendar_locator),
            'day':
            self.marionette.find_element(*self.calendar._day_view_locator),
            'week':
            self.marionette.find_element(*self.calendar._week_view_locator),
            'settings':
            self.marionette.find_element(*self.calendar._settings_locator),
            'advanced_settings':
            self.marionette.find_element(
                *self.calendar._advanced_settings_view_locator),
            'modify_event':
            self.marionette.find_element(
                *self.calendar._modify_event_view_locator),
            'event':
            self.marionette.find_element(*self.calendar._event_view_locator),
            'create_account':
            self.marionette.find_element(
                *self.calendar._create_account_view_locator),
            'modify_account':
            self.marionette.find_element(
                *self.calendar._modify_account_view_locator)
        }

        self.event_title = 'title'
        self.calendar.a11y_create_event(self.event_title)
コード例 #14
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.calendar = Calendar(self.marionette)
        self.calendar.launch()
        self.calendar.a11y_click_settings()
コード例 #15
0
    def test_calendar_flick(self):
        """https://bugzilla.mozilla.org/show_bug.cgi?id=937085"""

        calendar = Calendar(self.marionette)
        calendar.launch()

        calendar.flick_to_next_month()
        self.take_screenshot()

        calendar.flick_to_previous_month()
        self.take_screenshot()

        calendar.flick_to_previous_month()
        self.take_screenshot()

        calendar.tap_week_display_button()
        time.sleep(
            3
        )  # auto-scrolls when week view is entered, wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'down',
                                        300,
                                        locator=calendar._week_view_locator)
        time.sleep(1)  # wait until scroll bar disappears

        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'up',
                                        300,
                                        locator=calendar._week_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'right',
                                        100,
                                        locator=calendar._week_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'left',
                                        100,
                                        locator=calendar._week_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()

        calendar.tap_day_display_button()
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'down',
                                        300,
                                        locator=calendar._day_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'up',
                                        300,
                                        locator=calendar._day_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'right',
                                        100,
                                        locator=calendar._day_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'left',
                                        100,
                                        locator=calendar._day_view_locator)
        GaiaImageCompareTestCase.scroll(self.marionette,
                                        'left',
                                        100,
                                        locator=calendar._day_view_locator)
        time.sleep(1)  # wait until scroll bar disappears
        self.take_screenshot()