MCPcopy
hub / github.com/reflex-dev/reflex / tab_factory

Function tab_factory

tests/integration/test_linked_state.py:293–318  ·  view source on GitHub ↗

Get an instance of the browser open to the linked_state app. Args: linked_state: harness for LinkedStateApp Yields: WebDriver instance.

(
    linked_state: AppHarness,
)

Source from the content-addressed store, hash-verified

291
292@pytest.fixture
293def 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
321def test_linked_state(

Calls

no outgoing calls

Tested by

no test coverage detected