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

Function driver

test/functional/ios/safari_tests.py:31–51  ·  view source on GitHub ↗

Create and configure Safari driver for testing.

()

Source from the content-addressed store, hash-verified

29
30@pytest.fixture
31def 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
54def test_context(driver: 'WebDriver') -> None:

Callers

nothing calls this directly

Calls 4

AppiumClientConfigClass · 0.90
terminate_appMethod · 0.80
activate_appMethod · 0.80
make_optionsFunction · 0.50

Tested by

no test coverage detected