Skip to content

Instantly share code, notes, and snippets.

@bobsilverberg
Created January 14, 2013 00:49
Show Gist options
  • Select an option

  • Save bobsilverberg/4527047 to your computer and use it in GitHub Desktop.

Select an option

Save bobsilverberg/4527047 to your computer and use it in GitHub Desktop.
# 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/.
from gaiatest import GaiaTestCase
from gaiatest.tests.clock import clock_object
class TestSendKeys(GaiaTestCase):
def test_send_keys(self):
""" Reduced test case for send_keys with Clock app"""
for iter in range(1, 100):
# launch the Clock app
print iter
self.app = self.apps.launch('Clock')
self.wait_for_element_displayed(*clock_object._alarm_create_new_locator)
# create a new alarm
alarm_create_new = self.marionette.find_element(*clock_object._alarm_create_new_locator)
self.marionette.tap(alarm_create_new)
# set label
alarm_label = self.marionette.find_element(*clock_object._new_alarm_label)
alarm_label.send_keys("\b\b\b\b\btest4321")
self.assertEqual("test4321", alarm_label.get_attribute('value'))
# kill the Clock app
self.apps.kill(self.app)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment