Get an instance of the browser open to the linked_state app. Args: linked_state: harness for LinkedStateApp Yields: WebDriver instance.
(
linked_state: AppHarness,
)
| 291 | |
| 292 | @pytest.fixture |
| 293 | def tab_factory( |
| 294 | linked_state: AppHarness, |
| 295 | ) -> Generator[Callable[[], WebDriver], None, None]: |
| 296 | """Get an instance of the browser open to the linked_state app. |
| 297 | |
| 298 | Args: |
| 299 | linked_state: harness for LinkedStateApp |
| 300 | |
| 301 | Yields: |
| 302 | WebDriver instance. |
| 303 | |
| 304 | """ |
| 305 | assert linked_state.app_instance is not None, "app is not running" |
| 306 | |
| 307 | drivers = [] |
| 308 | |
| 309 | def driver() -> WebDriver: |
| 310 | d = linked_state.frontend() |
| 311 | drivers.append(d) |
| 312 | return d |
| 313 | |
| 314 | try: |
| 315 | yield driver |
| 316 | finally: |
| 317 | for d in drivers: |
| 318 | d.quit() |
| 319 | |
| 320 | |
| 321 | def test_linked_state( |
no outgoing calls
no test coverage detected