本文整理汇总了Python中gaiatest.apps.clock.app.Clock.wait_for_banner_not_visible方法的典型用法代码示例。如果您正苦于以下问题:Python Clock.wait_for_banner_not_visible方法的具体用法?Python Clock.wait_for_banner_not_visible怎么用?Python Clock.wait_for_banner_not_visible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gaiatest.apps.clock.app.Clock
的用法示例。
在下文中一共展示了Clock.wait_for_banner_not_visible方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestClockSetAlarmSound
# 需要导入模块: from gaiatest.apps.clock.app import Clock [as 别名]
# 或者: from gaiatest.apps.clock.app.Clock import wait_for_banner_not_visible [as 别名]
class TestClockSetAlarmSound(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.clock = Clock(self.marionette)
self.clock.launch()
def test_clock_set_alarm_sound(self):
""" Modify the alarm sound
[Clock][Alarm] Change the alarm sound
https://moztrap.mozilla.org/manage/case/1787/
"""
new_alarm = self.clock.tap_new_alarm()
# set label &sound
new_alarm.type_alarm_label("TestSetAlarmSound")
new_alarm.select_sound('Gem Echoes')
self.assertEqual('Gem Echoes', new_alarm.alarm_sound)
# Save the alarm
new_alarm.tap_done()
self.clock.wait_for_banner_not_visible()
# Tap to Edit alarm
edit_alarm = self.clock.alarms[0].tap()
self.assertEqual('Gem Echoes', new_alarm.alarm_sound)
# Close alarm
edit_alarm.tap_done()
self.clock.wait_for_banner_not_visible()
示例2: TestClockTurnOnOffAlarm
# 需要导入模块: from gaiatest.apps.clock.app import Clock [as 别名]
# 或者: from gaiatest.apps.clock.app.Clock import wait_for_banner_not_visible [as 别名]
class TestClockTurnOnOffAlarm(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.clock = Clock(self.marionette)
self.clock.launch()
# create a new alarm with the default values that are available
new_alarm = self.clock.tap_new_alarm()
self.clock = new_alarm.tap_done()
self.clock.wait_for_banner_not_visible()
def test_clock_turn_on_off_alarm(self):
""" Turn on/off the alarm
https://moztrap.mozilla.org/manage/case/1779/
"""
alarm = self.clock.alarms[0]
# turn on the alarm
origin_alarm_checked = alarm.is_alarm_active
alarm.tap_checkbox()
alarm.wait_for_alarm_to_uncheck()
self.assertTrue(origin_alarm_checked != alarm.is_alarm_active, 'user should be able to turn on the alarm.')
origin_alarm_checked = alarm.is_alarm_active
alarm.tap_checkbox()
alarm.wait_for_banner_not_displayed()
self.assertTrue(origin_alarm_checked != alarm.is_alarm_active, 'user should be able to turn off the alarm.')
示例3: TestClockDeleteAlarm
# 需要导入模块: from gaiatest.apps.clock.app import Clock [as 别名]
# 或者: from gaiatest.apps.clock.app.Clock import wait_for_banner_not_visible [as 别名]
class TestClockDeleteAlarm(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.clock = Clock(self.marionette)
self.clock.launch()
# create a new alarm with the default values that are available
new_alarm = self.clock.tap_new_alarm()
self.clock = new_alarm.tap_done()
self.clock.wait_for_banner_not_visible()
def test_clock_delete_alarm(self):
""" Delete alarm
https://moztrap.mozilla.org/manage/case/1783/
"""
# find the origin alarms' number
initial_alarms_count = len(self.clock.alarms)
# edit alarm
edit_alarm = self.clock.alarms[0].tap()
# delete alarm
self.clock = edit_alarm.tap_delete()
# wait alarm item not displayed
self.clock.wait_for_new_alarm_button()
self.wait_for_condition(lambda m: len(self.clock.alarms) != initial_alarms_count)
self.assertEqual(len(self.clock.alarms), initial_alarms_count - 1, "delete alarm failed.")
示例4: TestClockAddAlarmMultipleTimes
# 需要导入模块: from gaiatest.apps.clock.app import Clock [as 别名]
# 或者: from gaiatest.apps.clock.app.Clock import wait_for_banner_not_visible [as 别名]
class TestClockAddAlarmMultipleTimes(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.clock = Clock(self.marionette)
self.clock.launch()
def test_clock_add_alarm_multiple_times(self):
""" Add multiple alarm
https://moztrap.mozilla.org/manage/case/1773/
"""
count = 3
for i in range(1, count + 1):
# create a new alarm with the default values that are available
new_alarm = self.clock.tap_new_alarm()
new_alarm.tap_done()
# verify the banner-countdown message appears
alarm_msg = self.clock.banner_countdown_notification
self.assertIn('The alarm is set for', alarm_msg)
self.clock.wait_for_banner_not_visible()
# Ensure the new alarm has been added and is displayed
self.assertEqual(i, len(self.clock.alarms))
示例5: TestClockSetAlarm
# 需要导入模块: from gaiatest.apps.clock.app import Clock [as 别名]
# 或者: from gaiatest.apps.clock.app.Clock import wait_for_banner_not_visible [as 别名]
class TestClockSetAlarm(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.clock = Clock(self.marionette)
self.clock.launch()
def test_clock_set_alarm(self):
new_alarm = self.clock.tap_new_alarm()
# Ensure repeat has the default value
self.assertEquals(new_alarm.alarm_repeat, 'Never')
# Set label
new_alarm.type_alarm_label("TestSetAlarmRepeat")
# Loop the options and select the ones in match list
for option in ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday']:
new_alarm.select_repeat(option)
self.assertEqual('Weekdays', new_alarm.alarm_repeat)
# Check select Sunday twice
new_alarm.select_repeat('Sunday')
self.assertEqual('Mon, Tue, Wed, Thu, Fri, Sun', new_alarm.alarm_repeat)
new_alarm.select_repeat('Sunday')
self.assertEqual('Weekdays', new_alarm.alarm_repeat)
# Ensure sound has the default value
self.assertEquals(new_alarm.alarm_sound, 'Classic Buzz')
# Set sound
new_alarm.select_sound('Gem Echoes')
self.assertEqual('Gem Echoes', new_alarm.alarm_sound)
# Ensure snooze has the default value
self.assertEquals(new_alarm.alarm_snooze, '5 minutes')
# Set snooze
new_alarm.select_snooze('15 minutes')
self.assertEqual('15 minutes', new_alarm.alarm_snooze)
# Save the alarm
new_alarm.tap_done()
self.clock.wait_for_banner_not_visible()
# Tap to Edit alarm
edit_alarm = self.clock.alarms[0].tap()
# Verify selected options
self.assertEqual('Weekdays', edit_alarm.alarm_repeat)
self.assertEqual('Gem Echoes', new_alarm.alarm_sound)
self.assertEqual('15 minutes', new_alarm.alarm_snooze)
edit_alarm.tap_done()
self.clock.wait_for_banner_not_visible()
示例6: TestClockCreateNewAlarm
# 需要导入模块: from gaiatest.apps.clock.app import Clock [as 别名]
# 或者: from gaiatest.apps.clock.app.Clock import wait_for_banner_not_visible [as 别名]
class TestClockCreateNewAlarm(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.clock = Clock(self.marionette)
self.clock.launch()
def test_clock_create_new_alarm(self):
""" Add an alarm
https://moztrap.mozilla.org/manage/case/1772/
"""
# Get the number of alarms set, before adding the new alarm
initial_alarms_count = len(self.clock.alarms)
# create a new alarm with the default values that are available
new_alarm = self.clock.tap_new_alarm()
self.clock = new_alarm.tap_done()
# verify the banner-countdown message appears
alarm_msg = self.clock.banner_countdown_notification
self.assertTrue('The alarm is set for' in alarm_msg, 'Actual banner message was: "' + alarm_msg + '"')
# Get the number of alarms set after the new alarm was added
# Ensure the new alarm has been added and is displayed
self.assertTrue(initial_alarms_count < len(self.clock.alarms),
'Alarms count did not increment')
def test_clock_set_alarm_label(self):
""" Set label of the new alarm
https://moztrap.mozilla.org/manage/case/1775/
"""
alarm_label_text = "test4321"
# create a new alarm with the default values that are available
new_alarm = self.clock.tap_new_alarm()
# set label
new_alarm.type_alarm_label(alarm_label_text)
# save the alarm
self.clock = new_alarm.tap_done()
self.clock.wait_for_banner_not_visible()
# verify the label of alarm
alarms = self.clock.alarms
self.assertEqual(len(alarms), 1)
self.assertEqual(alarms[0].label, alarm_label_text)
def tearDown(self):
# delete any existing alarms
self.data_layer.delete_all_alarms()
GaiaTestCase.tearDown(self)
示例7: TestClockSetAlarmTime
# 需要导入模块: from gaiatest.apps.clock.app import Clock [as 别名]
# 或者: from gaiatest.apps.clock.app.Clock import wait_for_banner_not_visible [as 别名]
class TestClockSetAlarmTime(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.clock = Clock(self.marionette)
self.clock.launch()
def test_clock_set_alarm_time(self):
""" Modify the alarm time
https://moztrap.mozilla.org/manage/case/1784/
"""
new_alarm = self.clock.tap_new_alarm()
# set label
new_alarm.type_alarm_label("TestSetAlarmTime")
# Save the alarm
new_alarm.tap_done()
self.clock.wait_for_banner_not_visible()
old_alarm_text = self.clock.alarms[0].time
# Tap to Edit alarm
edit_alarm = self.clock.alarms[0].tap()
# Set alarm time
edit_alarm.spin_hour()
edit_alarm.spin_minute()
edit_alarm.spin_hour24()
edit_alarm.tap_done()
self.clock.wait_for_banner_not_visible()
# Verify Result
# Get the number of alarms set after the new alarm was added
# Ensure that there is only one alarm
self.assertEqual(1, len(self.clock.alarms))
# Verify label
self.assertEqual("TestSetAlarmTime", self.clock.alarms[0].label)
# Verify that alarm time has been changed
new_alarm_text = self.clock.alarms[0].time
self.assertNotEqual(old_alarm_text, new_alarm_text)
def tearDown(self):
# delete any existing alarms
self.data_layer.delete_all_alarms()
GaiaTestCase.tearDown(self)
示例8: TestClockSetAlarmRepeat
# 需要导入模块: from gaiatest.apps.clock.app import Clock [as 别名]
# 或者: from gaiatest.apps.clock.app.Clock import wait_for_banner_not_visible [as 别名]
class TestClockSetAlarmRepeat(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.clock = Clock(self.marionette)
self.clock.launch()
def test_clock_set_alarm_repeat(self):
""" Modify the alarm repeat
https://moztrap.mozilla.org/manage/case/1786/
Test that [Clock][Alarm] Change the repeat state
"""
new_alarm = self.clock.tap_new_alarm()
# Set label
new_alarm.type_alarm_label("TestSetAlarmRepeat")
# loop the options and select the ones in match list
for option in ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday']:
new_alarm.select_repeat(option)
self.assertEqual('Weekdays', new_alarm.alarm_repeat)
# check select Sunday twice
new_alarm.select_repeat('Sunday')
self.assertEqual('Mon, Tue, Wed, Thu, Fri Sun', new_alarm.alarm_repeat)
new_alarm.select_repeat('Sunday')
self.assertEqual('Weekdays', new_alarm.alarm_repeat)
# Save the alarm
new_alarm.tap_done()
self.clock.wait_for_banner_not_visible()
# Tap to Edit alarm
edit_alarm = self.clock.alarms[0].tap()
# To verify the select list.
self.assertEqual('Weekdays', edit_alarm.alarm_repeat)
# Close alarm
edit_alarm.tap_done()
self.clock.wait_for_banner_not_visible()
def tearDown(self):
# delete any existing alarms
self.data_layer.delete_all_alarms()
GaiaTestCase.tearDown(self)
示例9: TestClockSetAlarmSnooze
# 需要导入模块: from gaiatest.apps.clock.app import Clock [as 别名]
# 或者: from gaiatest.apps.clock.app.Clock import wait_for_banner_not_visible [as 别名]
class TestClockSetAlarmSnooze(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.clock = Clock(self.marionette)
self.clock.launch()
def test_clock_set_alarm_snooze(self):
""" Modify the alarm snooze
Test that [Clock][Alarm] Change the snooze time
https://moztrap.mozilla.org/manage/case/1788/
"""
new_alarm = self.clock.tap_new_alarm()
# Set label & snooze
new_alarm.type_alarm_label("TestSetAlarmSnooze")
new_alarm.select_snooze("15 minutes")
self.assertEqual("15 minutes", new_alarm.alarm_snooze)
# Save the alarm
new_alarm.tap_done()
self.clock.wait_for_banner_not_visible()
# Tap to Edit alarm
edit_alarm = self.clock.alarms[0].tap()
# to verify the select list.
self.assertEqual("15 minutes", new_alarm.alarm_snooze)
# Close alarm
edit_alarm.tap_done()
self.clock.wait_for_banner_not_visible()
def tearDown(self):
# delete any existing alarms
self.data_layer.delete_all_alarms()
GaiaTestCase.tearDown(self)
示例10: TestClockTurnOnOffAlarm
# 需要导入模块: from gaiatest.apps.clock.app import Clock [as 别名]
# 或者: from gaiatest.apps.clock.app.Clock import wait_for_banner_not_visible [as 别名]
class TestClockTurnOnOffAlarm(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.clock = Clock(self.marionette)
self.clock.launch()
# create a new alarm with the default values that are available
new_alarm = self.clock.tap_new_alarm()
self.clock = new_alarm.tap_done()
self.clock.wait_for_banner_not_visible()
def test_clock_turn_on_off_alarm(self):
""" Turn on/off the alarm
https://moztrap.mozilla.org/manage/case/1779/
"""
alarm = self.clock.alarms[0]
# turn on the alarm
origin_alarm_checked = alarm.is_alarm_active
alarm.tap_checkbox()
time.sleep(2) # TODO: Remove the sleep and add a wait_for_checkbox_state_to_change (one day)
self.assertTrue(origin_alarm_checked != alarm.is_alarm_active, 'user should be able to turn on the alarm.')
origin_alarm_checked = alarm.is_alarm_active
alarm.tap_checkbox()
time.sleep(2) # TODO: Remove the sleep and add a wait_for_checkbox_state_to_change (one day)
self.assertTrue(origin_alarm_checked != alarm.is_alarm_active, 'user should be able to turn off the alarm.')
def tearDown(self):
# delete any existing alarms
self.data_layer.delete_all_alarms()
GaiaTestCase.tearDown(self)
示例11: TestClockCreateNewAlarm
# 需要导入模块: from gaiatest.apps.clock.app import Clock [as 别名]
# 或者: from gaiatest.apps.clock.app.Clock import wait_for_banner_not_visible [as 别名]
class TestClockCreateNewAlarm(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.clock = Clock(self.marionette)
self.clock.launch()
def test_clock_create_new_alarm(self):
""" Add an alarm and set label of the new alarm
https://moztrap.mozilla.org/manage/case/1772/
https://moztrap.mozilla.org/manage/case/1775/
"""
alarm_label_text = "test4321"
# get the number of alarms set, before adding the new alarm
initial_alarms_count = len(self.clock.alarms)
# create a new alarm with the default values that are available
new_alarm = self.clock.tap_new_alarm()
# Ensure label has the default placeholder and text
self.assertEquals(new_alarm.alarm_label_placeholder, 'Alarm name')
# set label
new_alarm.type_alarm_label(alarm_label_text)
self.clock = new_alarm.tap_done()
# verify the banner-countdown message appears
alarm_msg = self.clock.banner_countdown_notification
self.assertTrue('The alarm is set for' in alarm_msg, 'Actual banner message was: "' + alarm_msg + '"')
# ensure the new alarm has been added and is displayed
self.assertTrue(initial_alarms_count < len(self.clock.alarms),
'Alarms count did not increment')
# verify the label of alarm
self.clock.wait_for_banner_not_visible()
alarms = self.clock.alarms
self.assertEqual(len(alarms), 1)
self.assertEqual(alarms[0].label, alarm_label_text)
# Tap to Edit alarm
edit_alarm = alarms[0].tap()
# TODO: change alarm time after Bug 946130 is fixed
# edit_alarm.tap_time()
# self.marionette.switch_to_frame()
# edit_alarm.spin_hour()
# edit_alarm.spin_minute()
# edit_alarm.spin_hour24()
edit_alarm.tap_done()
self.clock.wait_for_banner_not_visible()
# TODO: assert that alarm time has changed after Bug 946130 is fixed
# turn off the alarm
self.clock.alarms[0].tap_checkbox()
self.assertFalse(self.clock.alarms[0].is_alarm_active, 'user should be able to turn on the alarm.')
# turn on the alarm
self.clock.alarms[0].tap_checkbox()
self.clock.wait_for_banner_not_visible()
self.assertTrue(self.clock.alarms[0].is_alarm_active, 'user should be able to turn off the alarm.')