MCPcopy Index your code
hub / github.com/reflex-dev/reflex / assert_token

Function assert_token

tests/integration/test_event_chain.py:383–403  ·  view source on GitHub ↗

Get the token associated with backend state. Args: event_chain: harness for EventChain app. driver: WebDriver instance. Returns: The token visible in the driver browser.

(event_chain: AppHarness, driver: WebDriver)

Source from the content-addressed store, hash-verified

381
382
383def assert_token(event_chain: AppHarness, driver: WebDriver) -> str:
384 """Get the token associated with backend state.
385
386 Args:
387 event_chain: harness for EventChain app.
388 driver: WebDriver instance.
389
390 Returns:
391 The token visible in the driver browser.
392 """
393 assert event_chain.app_instance is not None
394 token_input = AppHarness.poll_for_or_raise_timeout(
395 lambda: driver.find_element(By.ID, "token")
396 )
397
398 # wait for the backend connection to send the token
399 token = event_chain.poll_for_value(token_input)
400 assert token is not None
401
402 state_name = event_chain.get_full_state_name(["_state"])
403 return f"{token}_{state_name}"
404
405
406@pytest.mark.parametrize(

Callers 5

test_event_chain_clickFunction · 0.70
test_event_chain_on_loadFunction · 0.70
test_yield_state_updateFunction · 0.70

Calls 3

poll_for_valueMethod · 0.80
get_full_state_nameMethod · 0.80

Tested by

no test coverage detected