Get an instance of the browser open to the test_app app. Args: test_app: harness for TestApp app Yields: WebDriver instance.
(test_app: AppHarness)
| 95 | |
| 96 | @pytest.fixture |
| 97 | def driver(test_app: AppHarness) -> Generator[WebDriver, None, None]: |
| 98 | """Get an instance of the browser open to the test_app app. |
| 99 | |
| 100 | Args: |
| 101 | test_app: harness for TestApp app |
| 102 | |
| 103 | Yields: |
| 104 | WebDriver instance. |
| 105 | |
| 106 | """ |
| 107 | assert test_app.app_instance is not None, "app is not running" |
| 108 | driver = test_app.frontend() |
| 109 | try: |
| 110 | yield driver |
| 111 | finally: |
| 112 | driver.quit() |
| 113 | |
| 114 | |
| 115 | def test_frontend_exception_handler_during_runtime( |