Return a W3C driver which is generated by a mock response for iOS Returns: `webdriver.webdriver.WebDriver`: An instance of WebDriver
()
| 88 | |
| 89 | |
| 90 | def 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 | |
| 121 | def ios_w3c_driver_with_extensions(extensions) -> 'WebDriver': |
no test coverage detected