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

Function poll_for_token

tests/integration/test_upload.py:538–554  ·  view source on GitHub ↗

Poll for the token input to be populated. Args: driver: WebDriver instance. upload_file: harness for UploadFile app. Returns: token value

(driver: WebDriver, upload_file: AppHarness)

Source from the content-addressed store, hash-verified

536
537
538def poll_for_token(driver: WebDriver, upload_file: AppHarness) -> str:
539 """Poll for the token input to be populated.
540
541 Args:
542 driver: WebDriver instance.
543 upload_file: harness for UploadFile app.
544
545 Returns:
546 token value
547 """
548 token_input = AppHarness.poll_for_or_raise_timeout(
549 lambda: driver.find_element(By.ID, "token")
550 )
551 # wait for the backend connection to send the token
552 token = upload_file.poll_for_value(token_input)
553 assert token is not None
554 return token
555
556
557def get_upload_box(driver: WebDriver, upload_root_id: str | None = None) -> WebElement:

Callers 9

test_upload_fileFunction · 0.70
test_clear_filesFunction · 0.70
test_cancel_uploadFunction · 0.70
test_upload_chunk_fileFunction · 0.70
test_on_dropFunction · 0.70

Calls 2

poll_for_valueMethod · 0.80

Tested by

no test coverage detected