本文整理汇总了Python中marionette.Wait.tap方法的典型用法代码示例。如果您正苦于以下问题:Python Wait.tap方法的具体用法?Python Wait.tap怎么用?Python Wait.tap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类marionette.Wait
的用法示例。
在下文中一共展示了Wait.tap方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tap_done
# 需要导入模块: from marionette import Wait [as 别名]
# 或者: from marionette.Wait import tap [as 别名]
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)
示例2: connect_to_network
# 需要导入模块: from marionette import Wait [as 别名]
# 或者: from marionette.Wait import tap [as 别名]
def connect_to_network(self, network_info):
# Wait for the networks to be found
this_network_locator = ('xpath', "//li/a/span[text()='%s']" % network_info['ssid'])
this_network = Wait(self.marionette).until(expected.element_present(*this_network_locator))
this_network.tap()
if network_info.get('keyManagement'):
password = network_info.get('psk') or network_info.get('wep')
if not password:
raise Exception('No psk or wep key found in testvars for secured wifi network.')
screen_width = int(self.marionette.execute_script('return window.innerWidth'))
ok_button = self.marionette.find_element(*self._password_ok_button_locator)
Wait(self.marionette).until(lambda m: (ok_button.location['x'] + ok_button.size['width']) == screen_width)
password_input = self.marionette.find_element(*self._password_input_locator)
Wait(self.marionette).until(expected.element_displayed(password_input))
password_input.send_keys(password)
ok_button.tap()
connected_message = self.marionette.find_element(*self._connected_message_locator)
self.marionette.execute_script("arguments[0].scrollIntoView(false);", [connected_message])
timeout = max(self.marionette.timeout and self.marionette.timeout / 1000, 60)
Wait(self.marionette, timeout, ignored_exceptions=StaleElementException).until(
lambda m: m.find_element(*self._connected_message_locator).text == "Connected")
示例3: tap_share_to_messages
# 需要导入模块: from marionette import Wait [as 别名]
# 或者: from marionette.Wait import tap [as 别名]
def tap_share_to_messages(self):
element = Wait(self.marionette).until(
expected.element_present(*self._share_to_messages_button_locator))
Wait(self.marionette).until(expected.element_displayed(element))
element.tap()
from gaiatest.apps.messages.regions.new_message import NewMessage
return NewMessage(self.marionette)
示例4: tap_settings
# 需要导入模块: from marionette import Wait [as 别名]
# 或者: from marionette.Wait import tap [as 别名]
def tap_settings(self):
settings = Wait(self.marionette).until(
expected.element_present(*self._settings_button_locator))
Wait(self.marionette).until(expected.element_displayed(settings))
settings.tap()
from gaiatest.apps.cost_control.regions.settings import Settings
return Settings(self.marionette)
示例5: tap_call_button
# 需要导入模块: from marionette import Wait [as 别名]
# 或者: from marionette.Wait import tap [as 别名]
def tap_call_button(self, switch_to_call_screen=True):
element = Wait(self.marionette).until(
expected.element_present(*self._call_bar_locator))
Wait(self.marionette).until(expected.element_enabled(element))
element.tap()
if switch_to_call_screen:
return CallScreen(self.marionette)
示例6: tap_export_to_sim
# 需要导入模块: from marionette import Wait [as 别名]
# 或者: from marionette.Wait import tap [as 别名]
def tap_export_to_sim(self):
export_to_sim = Wait(self.marionette).until(
expected.element_present(*self._export_to_sim_button_locator))
Wait(self.marionette).until(expected.element_displayed(export_to_sim))
export_to_sim.tap()
select_contacts = self.marionette.find_element(*self._select_contacts_locator)
Wait(self.marionette).until(lambda m: select_contacts.location['y'] == 0)
示例7: go_back
# 需要导入模块: from marionette import Wait [as 别名]
# 或者: from marionette.Wait import tap [as 别名]
def go_back(self):
element = Wait(self.marionette).until(expected.element_present(*self._header_locator))
Wait(self.marionette).until(expected.element_displayed(element))
# TODO: replace this hard coded value with tap on the back button, after Bug 1061698 is fixed
element.tap(x=10)
Wait(self.marionette).until(lambda m: m.execute_script(
"return window.wrappedJSObject.Settings && window.wrappedJSObject.Settings._currentPanel === '#root'"))
示例8: tap_done
# 需要导入模块: from marionette import Wait [as 别名]
# 或者: from marionette.Wait import tap [as 别名]
def tap_done(self):
done = Wait(self.marionette, timeout=60).until(
expected.element_present(*self._done_locator))
Wait(self.marionette).until(expected.element_displayed(done))
done.tap()
#Switch back to the settings app
self.apps.switch_to_displayed_app()
示例9: tap_delete_contacts
# 需要导入模块: from marionette import Wait [as 别名]
# 或者: from marionette.Wait import tap [as 别名]
def tap_delete_contacts(self):
delete_contacts = Wait(self.marionette).until(
expected.element_present(*self._delete_contacts_locator))
Wait(self.marionette).until(expected.element_displayed(delete_contacts))
delete_contacts.tap()
select_contacts = self.marionette.find_element(*self._select_contacts_locator)
Wait(self.marionette).until(lambda m: select_contacts.location['y'] == 0)
示例10: tap_import_from_gmail
# 需要导入模块: from marionette import Wait [as 别名]
# 或者: from marionette.Wait import tap [as 别名]
def tap_import_from_gmail(self):
import_from_gmail = Wait(self.marionette).until(
expected.element_present(*self._import_from_gmail_button_locator))
Wait(self.marionette).until(expected.element_displayed(import_from_gmail))
import_from_gmail.tap()
from gaiatest.apps.contacts.regions.gmail import GmailLogin
return GmailLogin(self.marionette)
示例11: tap_share_button
# 需要导入模块: from marionette import Wait [as 别名]
# 或者: from marionette.Wait import tap [as 别名]
def tap_share_button(self):
share_button = Wait(self.marionette).until(expected.element_present(*self._share_thumbnail_locator))
Wait(self.marionette).until(expected.element_displayed(share_button))
share_button.tap()
from gaiatest.apps.system.regions.activities import Activities
return Activities(self.marionette)
示例12: select_sim
# 需要导入模块: from marionette import Wait [as 别名]
# 或者: from marionette.Wait import tap [as 别名]
def select_sim(self, sim):
locators = [self._menuItem_carrier_sim1_locator,
self._menuItem_carrier_sim2_locator]
element = Wait(self.marionette).until(
expected.element_present(*locators[sim]))
Wait(self.marionette).until(expected.element_dispayed(element))
element.tap()
示例13: tap_export_contacts
# 需要导入模块: from marionette import Wait [as 别名]
# 或者: from marionette.Wait import tap [as 别名]
def tap_export_contacts(self):
export_contacts = Wait(self.marionette).until(
expected.element_present(*self._export_contacts_locator))
Wait(self.marionette).until(expected.element_displayed(export_contacts))
export_contacts.tap()
import_settings = self.marionette.find_element(*self._import_settings_locator)
Wait(self.marionette).until(lambda m: import_settings.location['x'] == 0)
示例14: tap_done
# 需要导入模块: from marionette import Wait [as 别名]
# 或者: from marionette.Wait import tap [as 别名]
def tap_done(self):
done_button = Wait(self.marionette).until(
expected.element_present(*self._done_button_locator))
Wait(self.marionette).until(expected.element_displayed(done_button))
done_button.tap()
# Switch back to Cost Control app frame
self.apps.switch_to_displayed_app()
示例15: enable_passcode_lock
# 需要导入模块: from marionette import Wait [as 别名]
# 或者: from marionette.Wait import tap [as 别名]
def enable_passcode_lock(self):
# This wait would be in __init__ but lockscreen could be disabled meaning init would timeout
element = Wait(self.marionette).until(expected.element_present(*self._passcode_enable_locator))
Wait(self.marionette).until(expected.element_displayed(element))
element.tap()
section = self.marionette.find_element(*self._screen_lock_passcode_section_locator)
Wait(self.marionette).until(lambda m: section.location['x'] == 0)