本文整理汇总了Python中gaiatest.apps.calendar.app.Calendar类的典型用法代码示例。如果您正苦于以下问题:Python Calendar类的具体用法?Python Calendar怎么用?Python Calendar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Calendar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestCalendarMonthViewSelectDayAccessibility
class TestCalendarMonthViewSelectDayAccessibility(GaiaTestCase):
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()
def test_a11y_calendar_month_view_select_day(self):
WEEKDAY_MONTH_DAY_PATTERN = '%A, %b %-d'
# By default current date event list should be rendered.
self.assertEquals(self.today.strftime(WEEKDAY_MONTH_DAY_PATTERN).upper(),
self.calendar.event_list_date)
# Click on another day in the grid.
other_day = self.calendar.a11y_click_other_day(self.next_day, self.previous_day)
# Other day date's event list should be rendered.
self.assertEquals(other_day.strftime(WEEKDAY_MONTH_DAY_PATTERN).upper(),
self.calendar.event_list_date)
示例2: TestCalendarSettingsViewAccessibility
class TestCalendarSettingsViewAccessibility(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.calendar = Calendar(self.marionette)
self.calendar.launch()
self.calendar.a11y_click_settings()
def test_a11y_calendar_settings_view(self):
settings = self.calendar.settings
# Check that the local calencar is checked
self.assertTrue(self.marionette.find_element(
*settings._calendar_local_checkbox_locator).get_attribute('checked'))
self.assertTrue(self.marionette.find_element(
*settings._calendar_local_locator).get_attribute('aria-selected') == 'true')
# Uncheck the local calendar
self.accessibility.click(self.marionette.find_element(*settings._calendar_local_locator))
# Check that the local calendar is unchecked
settings.wait_for_calendar_unchecked()
settings.wait_for_a11y_calendar_unchecked()
示例3: test_check_today_date
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)
示例4: setUp
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_months_day_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)
示例5: setUp
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)
示例6: setUp
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)
示例7: setUp
def setUp(self):
GaiaTestCase.setUp(self)
self.today = datetime.date.today()
self.next_day = self.today + datetime.timedelta(days=1)
self.calendar = Calendar(self.marionette)
self.calendar.launch()
示例8: TestCardsView
class TestCardsView(GaiaTestCase):
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()
def test_that_app_can_be_launched_from_cards_view(self):
"""
https://moztrap.mozilla.org/manage/case/2462/
"""
cards_view = CardsView(self.marionette)
self.assertFalse(cards_view.is_displayed, 'Cards view not expected to be visible')
# Pull up the cards view
self.device.hold_home_button()
cards_view.wait_for_cards_view()
# Wait for first app ready
cards_view.cards[1].wait_for_centered()
self.assertIn(cards_view.cards[0].manifest_url, self.calendar.manifest_url)
self.assertTrue(cards_view.cards[0].is_displayed,
'%s app should be present in cards view' % cards_view.cards[1].title)
self.assertIn(cards_view.cards[1].manifest_url, self.clock.manifest_url)
self.assertTrue(cards_view.cards[1].is_displayed,
'%s app should be present in cards view' % cards_view.cards[1].title)
cards_view.swipe_to_previous_app()
# Wait for previous app ready
cards_view.cards[0].wait_for_centered()
cards_view.cards[0].tap()
cards_view.wait_for_cards_view_not_displayed()
self.calendar.wait_to_be_displayed()
示例9: setUp
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()
示例10: setUp
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()
示例11: TestCalendarMonthViewWheelAccessibility
class TestCalendarMonthViewWheelAccessibility(GaiaTestCase):
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()
def test_a11y_calendar_month_view_wheel(self):
MONTH_YEAR_PATTERN = '%b %Y'
# Swipe left with 2 fingers.
self.calendar.a11y_wheel_to_next_month()
# Check that the grid updated to the next month.
self.assertEquals(self.next_month_year.strftime(MONTH_YEAR_PATTERN),
self.calendar.current_month_year)
# Swipe right with 2 fingers.
self.calendar.a11y_wheel_to_previous_month()
# Check that we moved back to the current month.
self.assertEquals(self.today.strftime(MONTH_YEAR_PATTERN), self.calendar.current_month_year)
示例12: TestCalendarMonthViewSelectEventAccessibility
class TestCalendarMonthViewSelectEventAccessibility(GaiaTestCase):
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)
def test_a11y_calendar_month_view_select_event(self):
event = self.calendar.event(self.event_title)
# Make sure that the title and the location are correct
self.assertEquals(event.title, self.event_title)
self.assertEquals(event.location, self.event_location)
event_detail = event.a11y_click()
# Make sure that the title and the location correspond to the selected event.
# Note: title and location are populated asynchronously
Wait(self.marionette).until(lambda m: self.event_title == event_detail.title)
Wait(self.marionette).until(lambda m: self.event_location == event_detail.location)
示例13: test_calendar_flick_through_months
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)
示例14: setUp
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)
示例15: TestCalendarDayViewAccessibility
class TestCalendarDayViewAccessibility(GaiaTestCase):
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)
def test_a11y_calendar_day_view(self):
self.calendar.a11y_click_day_display_button()
# Click on the all day section to create an event.
element = Wait(self.marionette).until(
expected.element_present(*self.calendar._day_view_all_day_button))
Wait(self.marionette).until(expected.element_displayed(element))
self.accessibility.click(element)
# wait for new event
new_event = self.calendar.wait_for_new_event()
self.assertTrue(self.accessibility.is_visible(self.marionette.find_element(
*self.calendar._modify_event_view_locator)))
# close new event
new_event.a11y_click_close_button()
self.assertTrue(self.accessibility.is_visible(self.marionette.find_element(
*self.calendar._day_view_locator)))
# open existing event detail
event_detail = self.calendar.a11y_click_day_view_event()
self.assertTrue(self.accessibility.is_visible(self.marionette.find_element(
*self.calendar._event_view_locator)))
# Make sure that the title and the location correspond to the selected event.
self.assertEquals(event_detail.title, self.event_title)