本文整理汇总了Python中gaiatest.apps.calendar.app.Calendar.launch方法的典型用法代码示例。如果您正苦于以下问题:Python Calendar.launch方法的具体用法?Python Calendar.launch怎么用?Python Calendar.launch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gaiatest.apps.calendar.app.Calendar
的用法示例。
在下文中一共展示了Calendar.launch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestCalendarMonthViewSelectEventAccessibility
# 需要导入模块: from gaiatest.apps.calendar.app import Calendar [as 别名]
# 或者: from gaiatest.apps.calendar.app.Calendar import launch [as 别名]
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)
示例2: TestCalendarMonthViewSelectDayAccessibility
# 需要导入模块: from gaiatest.apps.calendar.app import Calendar [as 别名]
# 或者: from gaiatest.apps.calendar.app.Calendar import launch [as 别名]
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)
示例3: test_that_new_event_appears_on_all_calendar_views
# 需要导入模块: from gaiatest.apps.calendar.app import Calendar [as 别名]
# 或者: from gaiatest.apps.calendar.app.Calendar import launch [as 别名]
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))
示例4: test_that_new_event_appears_on_all_calendar_views
# 需要导入模块: from gaiatest.apps.calendar.app import Calendar [as 别名]
# 或者: from gaiatest.apps.calendar.app.Calendar import launch [as 别名]
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))
示例5: TestCalendarMonthViewWheelAccessibility
# 需要导入模块: from gaiatest.apps.calendar.app import Calendar [as 别名]
# 或者: from gaiatest.apps.calendar.app.Calendar import launch [as 别名]
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)
示例6: TestCalendarSettingsViewAccessibility
# 需要导入模块: from gaiatest.apps.calendar.app import Calendar [as 别名]
# 或者: from gaiatest.apps.calendar.app.Calendar import launch [as 别名]
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()
示例7: test_that_new_event_appears_on_all_calendar_views
# 需要导入模块: from gaiatest.apps.calendar.app import Calendar [as 别名]
# 或者: from gaiatest.apps.calendar.app.Calendar import launch [as 别名]
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))
示例8: test_calendar_flick
# 需要导入模块: from gaiatest.apps.calendar.app import Calendar [as 别名]
# 或者: from gaiatest.apps.calendar.app.Calendar import launch [as 别名]
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()
示例9: test_check_today_date
# 需要导入模块: from gaiatest.apps.calendar.app import Calendar [as 别名]
# 或者: from gaiatest.apps.calendar.app.Calendar import launch [as 别名]
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)
示例10: test_calendar_flick_through_months
# 需要导入模块: from gaiatest.apps.calendar.app import Calendar [as 别名]
# 或者: from gaiatest.apps.calendar.app.Calendar import launch [as 别名]
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)
示例11: test_calendar_flick
# 需要导入模块: from gaiatest.apps.calendar.app import Calendar [as 别名]
# 或者: from gaiatest.apps.calendar.app.Calendar import launch [as 别名]
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()
示例12: TestCardsView
# 需要导入模块: from gaiatest.apps.calendar.app import Calendar [as 别名]
# 或者: from gaiatest.apps.calendar.app.Calendar import launch [as 别名]
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()
示例13: TestCalendarDayViewAccessibility
# 需要导入模块: from gaiatest.apps.calendar.app import Calendar [as 别名]
# 或者: from gaiatest.apps.calendar.app.Calendar import launch [as 别名]
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)
示例14: test_check_today_date
# 需要导入模块: from gaiatest.apps.calendar.app import Calendar [as 别名]
# 或者: from gaiatest.apps.calendar.app.Calendar import launch [as 别名]
def test_check_today_date(self):
calendar = Calendar(self.marionette)
calendar.launch()
self.assertEquals(self.today.strftime('%B %Y'), calendar.current_month_year)
self.assertIn(self.today.strftime('%a %b %d %Y'), calendar.current_month_day)
示例15: TestCalendarViewsVisibilityAccessibility
# 需要导入模块: from gaiatest.apps.calendar.app import Calendar [as 别名]
# 或者: from gaiatest.apps.calendar.app.Calendar import launch [as 别名]
class TestCalendarViewsVisibilityAccessibility(GaiaTestCase):
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)
def test_a11y_calendar_views_visibility(self):
def test_a11y_visible(*visible):
for key, view in self.views.iteritems():
if key in visible:
self.assertTrue(self.accessibility.is_visible(view))
else:
self.assertTrue(self.accessibility.is_hidden(view))
# Default
test_a11y_visible('time_views', 'current_day', 'month')
# Settings
self.calendar.a11y_click_settings()
test_a11y_visible('settings')
# Advanced settings
self.accessibility.click(self.marionette.find_element(
*self.calendar.settings._advanced_settings_button_locator))
test_a11y_visible('advanced_settings')
# Create account
self.accessibility.click(self.marionette.find_element(
*self.calendar._create_account_button_locator))
test_a11y_visible('create_account')
# Modify account
self.accessibility.click(self.calendar.account('caldav'))
test_a11y_visible('modify_account')
# Create account
self.calendar.a11y_click_modify_account_back()
test_a11y_visible('create_account')
# Advanced settings
self.calendar.a11y_click_create_account_back()
test_a11y_visible('advanced_settings')
# Settings
self.accessibility.click(self.marionette.find_element(
*self.calendar._advanced_settings_done_button_locator))
test_a11y_visible('settings')
# Default
self.calendar.a11y_click_close_settings()
test_a11y_visible('time_views', 'current_day', 'month')
# Week
self.calendar.a11y_click_week_display_button()
test_a11y_visible('time_views', 'week')
# Day
self.calendar.a11y_click_day_display_button()
test_a11y_visible('time_views', 'day')
# Month
self.calendar.a11y_click_month_display_button()
test_a11y_visible('time_views', 'current_day', 'month')
# New event
new_event = self.calendar.a11y_click_add_event_button()
test_a11y_visible('modify_event')
# Month
new_event.a11y_click_close_button()
test_a11y_visible('time_views', 'current_day', 'month')
#.........这里部分代码省略.........