• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python test_helper.appium_command函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中test.unit.helper.test_helper.appium_command函数的典型用法代码示例。如果您正苦于以下问题:Python appium_command函数的具体用法?Python appium_command怎么用?Python appium_command使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了appium_command函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
开发者ID:appium,项目名称:python-client,代码行数:27,代码来源:activities_test.py


示例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)
开发者ID:appium,项目名称:python-client,代码行数:7,代码来源:network_test.py


示例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)
开发者ID:appium,项目名称:python-client,代码行数:7,代码来源:keyboard_test.py


示例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
开发者ID:Jonahss,项目名称:python-client,代码行数:8,代码来源:lock_test.py


示例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'
开发者ID:Jonahss,项目名称:python-client,代码行数:8,代码来源:context_test.py


示例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
开发者ID:appium,项目名称:python-client,代码行数:8,代码来源:activities_test.py


示例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'
开发者ID:appium,项目名称:python-client,代码行数:8,代码来源:device_time_test.py


示例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
开发者ID:appium,项目名称:python-client,代码行数:8,代码来源:network_test.py


示例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'
开发者ID:appium,项目名称:python-client,代码行数:8,代码来源:settings_test.py


示例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'
开发者ID:Jonahss,项目名称:python-client,代码行数:8,代码来源:webdriver_test.py


示例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
开发者ID:appium,项目名称:python-client,代码行数:10,代码来源:network_test.py


示例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
开发者ID:Jonahss,项目名称:python-client,代码行数:10,代码来源:power_test.py


示例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
开发者ID:Jonahss,项目名称:python-client,代码行数:10,代码来源:power_test.py


示例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
开发者ID:appium,项目名称:python-client,代码行数:10,代码来源:gsm_test.py


示例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'
开发者ID:appium,项目名称:python-client,代码行数:10,代码来源:settings_test.py


示例16: test_get_formatted_device_time

    def test_get_formatted_device_time(self):
        driver = android_w3c_driver()
        httpretty.register_uri(
            httpretty.POST,
            appium_command('/session/1234567890/appium/device/system_time'),
            body='{"value": "2019-01-08"}'
        )
        assert driver.get_device_time('YYYY-MM-DD') == '2019-01-08'

        d = get_httpretty_request_body(httpretty.last_request())
        assert d['format'] == 'YYYY-MM-DD'
开发者ID:appium,项目名称:python-client,代码行数:11,代码来源:device_time_test.py


示例17: test_set_network_connection

    def test_set_network_connection(self):
        driver = android_w3c_driver()
        httpretty.register_uri(
            httpretty.POST,
            appium_command('/session/1234567890/network_connection'),
            body='{"value": ""}'
        )
        driver.set_network_connection(2)

        d = get_httpretty_request_body(httpretty.last_request())
        assert d['parameters']['type'] == 2
开发者ID:appium,项目名称:python-client,代码行数:11,代码来源:network_test.py


示例18: test_set_gsm_signal

    def test_set_gsm_signal(self):
        driver = android_w3c_driver()
        httpretty.register_uri(
            httpretty.POST,
            appium_command('/session/1234567890/appium/device/gsm_signal'),
        )
        assert isinstance(driver.set_gsm_signal(GsmSignalStrength.GREAT), WebDriver)

        d = get_httpretty_request_body(httpretty.last_request())
        assert d['signalStrength'] == GsmSignalStrength.GREAT
        assert d['signalStrengh'] == GsmSignalStrength.GREAT
开发者ID:appium,项目名称:python-client,代码行数:11,代码来源:gsm_test.py


示例19: test_make_gsm_call

    def test_make_gsm_call(self):
        driver = android_w3c_driver()
        httpretty.register_uri(
            httpretty.POST,
            appium_command('/session/1234567890/appium/device/gsm_call'),
        )
        assert isinstance(driver.make_gsm_call('5551234567', GsmCallActions.CALL), WebDriver)

        d = get_httpretty_request_body(httpretty.last_request())
        assert d['phoneNumber'] == '5551234567'
        assert d['action'] == GsmCallActions.CALL
开发者ID:appium,项目名称:python-client,代码行数:11,代码来源:gsm_test.py


示例20: test_reset

    def test_reset(self):
        driver = android_w3c_driver()
        httpretty.register_uri(
            httpretty.POST,
            appium_command('/session/1234567890/appium/app/reset'),
            body='{"value": ""}'
        )
        result = driver.reset()

        assert {'sessionId': '1234567890'}, get_httpretty_request_body(httpretty.last_request())
        assert isinstance(result, WebDriver)
开发者ID:Jonahss,项目名称:python-client,代码行数:11,代码来源:app_test.py



注:本文中的test.unit.helper.test_helper.appium_command函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.set_module_args函数代码示例发布时间:2022-05-27
下一篇:
Python test_helper.android_w3c_driver函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap