Get an instance of the browser open to the background_task app. Args: background_task: harness for BackgroundTask app Yields: WebDriver instance.
(background_task: AppHarness)
| 240 | |
| 241 | @pytest.fixture |
| 242 | def driver(background_task: AppHarness) -> Generator[WebDriver, None, None]: |
| 243 | """Get an instance of the browser open to the background_task app. |
| 244 | |
| 245 | Args: |
| 246 | background_task: harness for BackgroundTask app |
| 247 | |
| 248 | Yields: |
| 249 | WebDriver instance. |
| 250 | """ |
| 251 | assert background_task.app_instance is not None, "app is not running" |
| 252 | driver = background_task.frontend() |
| 253 | try: |
| 254 | yield driver |
| 255 | finally: |
| 256 | driver.quit() |
| 257 | |
| 258 | |
| 259 | @pytest.fixture |