MCPcopy Index your code
hub / github.com/appium/python-client / flutter_w3c_driver

Function flutter_w3c_driver

test/unit/helper/test_helper.py:153–199  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

151
152
153def flutter_w3c_driver() -> 'WebDriver':
154 """Return a W3C driver which is generated by a mock response for Flutter
155
156 Returns:
157 `webdriver.webdriver.WebDriver`: An instance of WebDriver
158 """
159
160 response_body_json = json.dumps(
161 {
162 'sessionId': '1234567890',
163 'capabilities': {
164 'platform': 'LINUX',
165 'desired': {
166 'platformName': 'Android',
167 'autoGrantPermissions': True,
168 'flutterSystemPort': 9999,
169 'flutterElementWaitTimeout': 10000,
170 'flutterEnableMockCamera': True,
171 'flutterServerLaunchTimeout': 120000,
172 'automationName': 'FlutterIntegration',
173 'platformVersion': '7.1.1',
174 'deviceName': 'Android Emulator',
175 'app': '/test/apps/ApiDemos-debug.apk',
176 },
177 'platformName': 'Android',
178 'automationName': 'FlutterIntegration',
179 'platformVersion': '7.1.1',
180 'deviceName': 'emulator-5554',
181 'app': '/test/apps/ApiDemos-debug.apk',
182 'deviceUDID': 'emulator-5554',
183 'appPackage': 'io.appium.android.apis',
184 'appWaitPackage': 'io.appium.android.apis',
185 },
186 }
187 )
188
189 httpretty.register_uri(httpretty.POST, appium_command('/session'), body=response_body_json)
190
191 desired_caps = {
192 'platformName': 'Android',
193 'deviceName': 'Android Emulator',
194 'app': 'path/to/app',
195 'automationName': 'FlutterIntegration',
196 }
197
198 driver = webdriver.Remote(SERVER_URL_BASE, options=UiAutomator2Options().load_capabilities(desired_caps))
199 return driver
200
201
202def get_httpretty_request_body(request: 'HTTPrettyRequestEmpty') -> Dict[str, Any]:

Calls 3

UiAutomator2OptionsClass · 0.90
appium_commandFunction · 0.85
load_capabilitiesMethod · 0.80

Tested by

no test coverage detected