Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def tap_done(self):
done = Wait(self.marionette).until(expected.element_present(*self._done_locator))
Wait(self.marionette).until(expected.element_displayed(done))
done.tap()
view = self.marionette.find_element(*self._alarm_view_locator)
Wait(self.marionette).until(lambda m: view.location['x'] == view.size['width'])
return Clock(self.marionette)
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import time
from marionette_driver import expected, By, Wait
from gaiatest.apps.clock.app import Clock
class NewAlarm(Clock):
_alarm_name_locator = (By.ID, 'alarm-name')
_new_alarm_view_locator = (By.CSS_SELECTOR, 'section[data-panel-id="alarm_edit"]')
_repeat_menu_locator = (By.ID, 'repeat-menu')
_sound_menu_locator = (By.ID, 'sound-menu')
_snooze_menu_locator = (By.ID, 'snooze-menu')
_done_locator = (By.ID, 'alarm-done')
_time_button_locator = (By.XPATH, "//li[input[@id='time-select']]")
def __init__(self, marionette):
Clock.__init__(self, marionette)
view = self.marionette.find_element(*self._new_alarm_view_locator)
Wait(self.marionette).until(lambda m: view.location['x'] == 0 and view.is_displayed())
# Bug 1032852 This is to bust intermittents caused by this bug that causes keyboard not to appear upon tap
time.sleep(1.5)
def __init__(self, marionette):
Clock.__init__(self, marionette)
view = self.marionette.find_element(*self._new_alarm_view_locator)
Wait(self.marionette).until(lambda m: view.location['x'] == 0 and view.is_displayed())
# Bug 1032852 This is to bust intermittents caused by this bug that causes keyboard not to appear upon tap
time.sleep(1.5)
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import time
from marionette_driver import expected, By, Wait
from gaiatest.apps.clock.app import Clock
class NewAlarm(Clock):
_alarm_name_locator = (By.ID, 'alarm-name')
_repeat_menu_locator = (By.ID, 'repeat-menu')
_sound_menu_locator = (By.ID, 'sound-menu')
_snooze_menu_locator = (By.ID, 'snooze-menu')
_done_locator = (By.ID, 'alarm-done')
_time_button_locator = (By.XPATH, "//li[input[@id='time-select']]")
def __init__(self, marionette):
Clock.__init__(self, marionette)
view = self.marionette.find_element(*self._alarm_view_locator)
Wait(self.marionette).until(lambda m: view.location['x'] == 0 and view.is_displayed())
# Bug 1032852 This is to bust intermittents caused by this bug that causes keyboard not to appear upon tap
time.sleep(1.5)
def type_alarm_label(self, value):
def __init__(self, marionette):
Clock.__init__(self, marionette)
view = self.marionette.find_element(*self._alarm_view_locator)
Wait(self.marionette).until(lambda m: view.location['x'] == 0 and view.is_displayed())
# Bug 1032852 This is to bust intermittents caused by this bug that causes keyboard not to appear upon tap
time.sleep(1.5)