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))
Exemplo n.º 2
0
    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()
    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 = 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())
        self.assertIn(event_location, calendar.displayed_events_in_month_view())

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

        # switch to the day display
        calendar.tap_day_display_button()
        self.assertIn(event_title, calendar.displayed_events_in_day_view(event_start_date))
        self.assertIn(event_location, calendar.displayed_events_in_day_view(event_start_date))
    def test_that_new_event_appears_on_all_calendar_views(self):

        event_title = 'Event Title %s' % str(self.today.time())
        event_location = 'Event Location %s' % str(self.today.time())
        event_start_date_time = self.today.replace(hour=1, minute=0, second=0)
        event_end_date_time = self.today.replace(hour=2, minute=0, second=0)
        EVENT_DATE_TIME_TO_STRING_PATTERN = '%H:%M:%S'

        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.fill_event_start_time(event_start_date_time.strftime(EVENT_DATE_TIME_TO_STRING_PATTERN))
        new_event.fill_event_end_time(event_end_date_time.strftime(EVENT_DATE_TIME_TO_STRING_PATTERN))
        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.click_week_display_button()
        self.assertIn(event_title, calendar.displayed_events_in_week_view(event_start_date_time))

        # switch to the day display
        calendar.click_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()
Exemplo n.º 6
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_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))