Create and configure Safari driver for testing.
()
| 29 | |
| 30 | @pytest.fixture |
| 31 | def driver() -> Generator['WebDriver', None, None]: |
| 32 | """Create and configure Safari driver for testing.""" |
| 33 | options = make_options() |
| 34 | options.bundle_id = 'com.apple.mobilesafari' |
| 35 | options.native_web_tap = True |
| 36 | options.safari_ignore_fraud_warning = True |
| 37 | options.webview_connect_timeout = 100000 |
| 38 | |
| 39 | client_config = AppiumClientConfig(remote_server_addr=SERVER_URL_BASE) |
| 40 | client_config.timeout = 600 |
| 41 | driver = webdriver.Remote(options=options, client_config=client_config) |
| 42 | |
| 43 | # Fresh iOS 17.4 simulator may not show up the webview context with "safari" |
| 44 | # after a fresh simlator instance creation. |
| 45 | # Re-launch the process could be a workaround in my debugging. |
| 46 | driver.terminate_app('com.apple.mobilesafari') |
| 47 | driver.activate_app('com.apple.mobilesafari') |
| 48 | |
| 49 | yield driver |
| 50 | |
| 51 | driver.quit() |
| 52 | |
| 53 | |
| 54 | def test_context(driver: 'WebDriver') -> None: |
nothing calls this directly
no test coverage detected