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

Method poll_for_value

reflex/testing.py:718–746  ·  view source on GitHub ↗

Poll element.get_attribute("value") for change. Args: element: selenium webdriver element to check timeout: how long to poll element value attribute exp_not_equal: exit the polling loop when the value does not match Returns: The eleme

(
        self,
        element: WebElement,
        timeout: TimeoutType = None,
        exp_not_equal: str | Sequence[str] = "",
    )

Source from the content-addressed store, hash-verified

716 return element.text
717
718 def poll_for_value(
719 self,
720 element: WebElement,
721 timeout: TimeoutType = None,
722 exp_not_equal: str | Sequence[str] = "",
723 ) -> str | None:
724 """Poll element.get_attribute("value") for change.
725
726 Args:
727 element: selenium webdriver element to check
728 timeout: how long to poll element value attribute
729 exp_not_equal: exit the polling loop when the value does not match
730
731 Returns:
732 The element value when the polling loop exited
733
734 Raises:
735 TimeoutError: when the timeout expires before value changes
736 """
737 exp_not_equal = (
738 (exp_not_equal,) if isinstance(exp_not_equal, str) else exp_not_equal
739 )
740 if not self._poll_for(
741 target=lambda: element.get_attribute("value") not in exp_not_equal,
742 timeout=timeout,
743 ):
744 msg = f"{element} content remains {exp_not_equal!r} while polling."
745 raise TimeoutError(msg)
746 return element.get_attribute("value")
747
748 @staticmethod
749 def poll_for_or_raise_timeout(

Callers 15

test_call_scriptFunction · 0.80
test_call_script_w_varFunction · 0.80
poll_for_tokenFunction · 0.80
test_upload_fileFunction · 0.80
test_upload_chunk_fileFunction · 0.80
test_on_dropFunction · 0.80
tokenFunction · 0.80
driverFunction · 0.80

Calls 1

_poll_forMethod · 0.95

Tested by

no test coverage detected