MCPcopy
hub / github.com/appium/python-client / ios_w3c_driver

Function ios_w3c_driver

test/unit/helper/test_helper.py:90–118  ·  view source on GitHub ↗

Return a W3C driver which is generated by a mock response for iOS Returns: `webdriver.webdriver.WebDriver`: An instance of WebDriver

()

Source from the content-addressed store, hash-verified

88
89
90def ios_w3c_driver() -> 'WebDriver':
91 """Return a W3C driver which is generated by a mock response for iOS
92
93 Returns:
94 `webdriver.webdriver.WebDriver`: An instance of WebDriver
95 """
96 response_body_json = json.dumps(
97 {
98 'sessionId': '1234567890',
99 'capabilities': {
100 'device': 'iphone',
101 'browserName': 'UICatalog',
102 'sdkVersion': '11.4',
103 'CFBundleIdentifier': 'com.example.apple-samplecode.UICatalog',
104 },
105 }
106 )
107
108 httpretty.register_uri(httpretty.POST, appium_command('/session'), body=response_body_json)
109
110 desired_caps = {
111 'platformName': 'iOS',
112 'deviceName': 'iPhone Simulator',
113 'app': 'path/to/app',
114 'automationName': 'XCUITest',
115 }
116
117 driver = webdriver.Remote(SERVER_URL_BASE, options=XCUITestOptions().load_capabilities(desired_caps))
118 return driver
119
120
121def ios_w3c_driver_with_extensions(extensions) -> 'WebDriver':

Callers 15

test_get_eventsMethod · 0.90
test_get_eventsMethod · 0.90
test_get_events_argsMethod · 0.90
test_log_eventMethod · 0.90
test_get_log_typesFunction · 0.90
test_get_logFunction · 0.90
test_lockMethod · 0.90
test_lock_no_argsMethod · 0.90
test_islocked_falseMethod · 0.90

Calls 3

XCUITestOptionsClass · 0.90
appium_commandFunction · 0.85
load_capabilitiesMethod · 0.80

Tested by

no test coverage detected