本文整理汇总了Python中gaiatest.apps.ui_tests.app.UiTests.switch_to_keyboard_page_frame方法的典型用法代码示例。如果您正苦于以下问题:Python UiTests.switch_to_keyboard_page_frame方法的具体用法?Python UiTests.switch_to_keyboard_page_frame怎么用?Python UiTests.switch_to_keyboard_page_frame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gaiatest.apps.ui_tests.app.UiTests
的用法示例。
在下文中一共展示了UiTests.switch_to_keyboard_page_frame方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestKeyboardPredictiveKey
# 需要导入模块: from gaiatest.apps.ui_tests.app import UiTests [as 别名]
# 或者: from gaiatest.apps.ui_tests.app.UiTests import switch_to_keyboard_page_frame [as 别名]
class TestKeyboardPredictiveKey(GaiaTestCase):
def test_keyboard_predictive_key(self):
self.ui_tests = UiTests(self.marionette)
self.ui_tests.launch()
# go to UI/keyboard page
self.ui_tests.tap_keyboard_option()
keyboard_page = self.ui_tests.switch_to_keyboard_page_frame()
# tap the field "input type=text"
keyboard = keyboard_page.tap_text_input()
# type first 6 letters of the expected word
keyboard.switch_to_keyboard()
expected_word = 'keyboard '
keyboard.send(expected_word[:6])
self.marionette.switch_to_frame()
self.marionette.switch_to_frame(self.ui_tests.app.frame)
keyboard_page = self.ui_tests.switch_to_keyboard_page_frame()
keyboard_page.tap_text_input()
# tap the first predictive word
keyboard.tap_first_predictive_word()
self.marionette.switch_to_frame()
self.marionette.switch_to_frame(self.ui_tests.app.frame)
keyboard_page = self.ui_tests.switch_to_keyboard_page_frame()
# check if the word in the input field is the same as the expected word
typed_word = keyboard_page.text_input
self.assertEqual(typed_word, expected_word)
示例2: TestNumberKeyboard
# 需要导入模块: from gaiatest.apps.ui_tests.app import UiTests [as 别名]
# 或者: from gaiatest.apps.ui_tests.app.UiTests import switch_to_keyboard_page_frame [as 别名]
class TestNumberKeyboard(GaiaTestCase):
def test_number_keyboard(self):
self.ui_tests = UiTests(self.marionette)
self.ui_tests.launch()
self.ui_tests.tap_keyboard_option()
keyboard_page = self.ui_tests.switch_to_keyboard_page_frame()
keyboard = keyboard_page.tap_number_input()
keyboard.switch_to_keyboard()
self.assertEqual(str(keyboard.current_keyboard), 'number')
keyboard._tap('1')
self.marionette.switch_to_frame()
self.marionette.switch_to_frame(self.ui_tests.app.frame)
keyboard_page = self.ui_tests.switch_to_keyboard_page_frame()
typed_number = keyboard_page.number_input
self.assertEqual(typed_number, u'1')