当前位置: 首页>>代码示例>>Python>>正文


Python test_helper.appium_command函数代码示例

本文整理汇总了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
开发者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


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