本文整理汇总了Python中test.unit.helper.test_helper.appium_command函数的典型用法代码示例。如果您正苦于以下问题:Python appium_command函数的具体用法?Python appium_command怎么用?Python appium_command使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了appium_command函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_start_activity_with_opts
def test_start_activity_with_opts(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/appium/device/start_activity'),
body='{"value": ""}'
)
driver.start_activity(
app_package='com.example.myapp',
app_activity='.ExampleActivity',
app_wait_package='com.example.waitapp',
intent_action='android.intent.action.MAIN',
intent_category='android.intent.category.LAUNCHER',
intent_flags='0x10200000',
optional_intent_arguments='--es "activity" ".ExampleActivity"',
dont_stop_app_on_reset=True
)
d = get_httpretty_request_body(httpretty.last_request())
assert d['appPackage'] == 'com.example.myapp'
assert d['appActivity'] == '.ExampleActivity'
assert d['appWaitPackage'] == 'com.example.waitapp'
assert d['intentAction'] == 'android.intent.action.MAIN'
assert d['intentCategory'] == 'android.intent.category.LAUNCHER'
assert d['intentFlags'] == '0x10200000'
assert d['optionalIntentArguments'] == '--es "activity" ".ExampleActivity"'
assert d['dontStopAppOnReset'] is True
示例2: test_toggle_wifi
def test_toggle_wifi(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/appium/device/toggle_wifi'),
)
assert isinstance(driver.toggle_wifi(), WebDriver)
示例3: test_hide_keyboard
def test_hide_keyboard(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/appium/device/hide_keyboard')
)
assert isinstance(driver.hide_keyboard(), WebDriver)
示例4: test_islocked_false
def test_islocked_false(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/appium/device/is_locked'),
body='{"value": false}'
)
assert driver.is_locked() is False
示例5: test_get_contexts
def test_get_contexts(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.GET,
appium_command('/session/1234567890/context'),
body='{"value": "NATIVE"}'
)
assert driver.current_context == 'NATIVE'
示例6: test_wait_activity
def test_wait_activity(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.GET,
appium_command('/session/1234567890/appium/device/current_activity'),
body='{"value": ".ExampleActivity"}'
)
assert driver.wait_activity('.ExampleActivity', 1) is True
示例7: test_get_device_time
def test_get_device_time(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.GET,
appium_command('/session/1234567890/appium/device/system_time'),
body='{"value": "2019-01-05T14:46:44+09:00"}'
)
assert driver.get_device_time() == '2019-01-05T14:46:44+09:00'
示例8: test_network_connection
def test_network_connection(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.GET,
appium_command('/session/1234567890/network_connection'),
body='{"value": 2}'
)
assert driver.network_connection == 2
示例9: test_get_settings_string
def test_get_settings_string(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.GET,
appium_command('/session/1234567890/appium/settings'),
body='{"value": {"sample": "string"}}'
)
assert driver.get_settings()['sample'] == 'string'
示例10: test_clipboard_with_subsubclass
def test_clipboard_with_subsubclass(self):
driver = self.android_w3c_driver(SubSubWebDriver)
httpretty.register_uri(
httpretty.GET,
appium_command('/session/1234567890/context'),
body='{"value": "NATIVE"}'
)
assert driver.current_context == 'NATIVE'
示例11: test_set_network_speed
def test_set_network_speed(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/appium/device/network_speed'),
)
assert isinstance(driver.set_network_speed(NetSpeed.LTE), WebDriver)
d = get_httpretty_request_body(httpretty.last_request())
assert d['netspeed'] == NetSpeed.LTE
示例12: test_set_power_capacity
def test_set_power_capacity(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/appium/device/power_capacity'),
)
assert isinstance(driver.set_power_capacity(50), WebDriver)
d = get_httpretty_request_body(httpretty.last_request())
assert d['percent'] == 50
示例13: test_set_power_ac
def test_set_power_ac(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/appium/device/power_ac'),
)
assert isinstance(driver.set_power_ac(Power.AC_ON), WebDriver)
d = get_httpretty_request_body(httpretty.last_request())
assert d['state'] == Power.AC_ON
示例14: test_set_gsm_voice
def test_set_gsm_voice(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/appium/device/gsm_voice'),
)
assert isinstance(driver.set_gsm_voice(GsmVoiceState.ROAMING), WebDriver)
d = get_httpretty_request_body(httpretty.last_request())
assert d['state'] == GsmVoiceState.ROAMING
示例15: test_update_settings_string
def test_update_settings_string(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/appium/settings'),
)
assert isinstance(driver.update_settings({"sample": 'string'}), WebDriver)
d = get_httpretty_request_body(httpretty.last_request())
assert d['settings']['sample'] == 'string'