Create a ScriptBrowserEnv instance for testing. It is automatically closed after the test session. This is helpful when the test failed and the browser is still open.
()
| 11 | |
| 12 | @pytest.fixture(scope="function") |
| 13 | def script_browser_env() -> Generator[ScriptBrowserEnv, None, None]: |
| 14 | """Create a ScriptBrowserEnv instance for testing. |
| 15 | It is automatically closed after the test session. |
| 16 | This is helpful when the test failed and the browser is still open. |
| 17 | """ |
| 18 | env = ScriptBrowserEnv( |
| 19 | headless=HEADLESS, |
| 20 | slow_mo=SLOW_MO, |
| 21 | ) |
| 22 | yield env |
| 23 | env.close() |
| 24 | |
| 25 | |
| 26 | @pytest.fixture(scope="function") |
nothing calls this directly
no test coverage detected