Get Flutter options configured for testing with parallel execution support.
()
| 34 | |
| 35 | |
| 36 | def make_options() -> FlutterOptions: |
| 37 | """Get Flutter options configured for testing with parallel execution support.""" |
| 38 | options = FlutterOptions() |
| 39 | |
| 40 | # Set Flutter-specific capabilities |
| 41 | options.flutter_system_port = get_flutter_system_port() |
| 42 | options.flutter_enable_mock_camera = True |
| 43 | options.flutter_element_wait_timeout = 10000 |
| 44 | options.flutter_server_launch_timeout = 120000 |
| 45 | |
| 46 | caps: Dict[str, Any] = ( |
| 47 | { |
| 48 | 'platformName': 'Android', |
| 49 | 'deviceName': device_name(), |
| 50 | 'newCommandTimeout': 120, |
| 51 | 'uiautomator2ServerInstallTimeout': 120000, |
| 52 | 'adbExecTimeout': 120000, |
| 53 | 'app': os.environ['FLUTTER_ANDROID_APP'], |
| 54 | 'autoGrantPermissions': True, |
| 55 | } |
| 56 | if is_platform_android() |
| 57 | else { |
| 58 | 'deviceName': device_name(), |
| 59 | 'platformName': 'iOS', |
| 60 | 'platformVersion': os.environ['IOS_VERSION'], |
| 61 | 'allowTouchIdEnroll': True, |
| 62 | 'wdaLaunchTimeout': 240000, |
| 63 | 'wdaLocalPort': get_wda_port(), |
| 64 | 'eventTimings': True, |
| 65 | 'app': os.environ['FLUTTER_IOS_APP'], |
| 66 | } |
| 67 | ) |
| 68 | |
| 69 | if local_prebuilt_wda := os.getenv('LOCAL_PREBUILT_WDA'): |
| 70 | caps.update( |
| 71 | { |
| 72 | 'usePreinstalledWDA': True, |
| 73 | 'prebuiltWDAPath': local_prebuilt_wda, |
| 74 | } |
| 75 | ) |
| 76 | |
| 77 | return options.load_capabilities(caps) |
| 78 | |
| 79 | |
| 80 | def device_name() -> str: |