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

Function assert_token

tests/integration/test_call_script.py:398–412  ·  view source on GitHub ↗

Get the token associated with backend state. Args: driver: WebDriver instance. Returns: The token visible in the driver browser.

(driver: WebDriver)

Source from the content-addressed store, hash-verified

396
397
398def assert_token(driver: WebDriver) -> str:
399 """Get the token associated with backend state.
400
401 Args:
402 driver: WebDriver instance.
403
404 Returns:
405 The token visible in the driver browser.
406 """
407 ss = SessionStorage(driver)
408 assert AppHarness._poll_for(lambda: ss.get("token") is not None), "token not found"
409 assert AppHarness._poll_for(
410 lambda: driver.execute_script("return typeof external4 !== 'undefined'")
411 ), "scripts not loaded"
412 return ss.get("token")
413
414
415@pytest.mark.parametrize("script", ["inline", "external"])

Callers 2

test_call_scriptFunction · 0.70
test_call_script_w_varFunction · 0.70

Calls 3

_poll_forMethod · 0.80
SessionStorageClass · 0.70
getMethod · 0.45

Tested by

no test coverage detected