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

Function raises_alert

tests/integration/test_state_inheritance.py:29–41  ·  view source on GitHub ↗

Click an element and check that an alert is raised. Args: driver: WebDriver instance. element: The element to click.

(driver: WebDriver, element: str)

Source from the content-addressed store, hash-verified

27
28
29def raises_alert(driver: WebDriver, element: str) -> None:
30 """Click an element and check that an alert is raised.
31
32 Args:
33 driver: WebDriver instance.
34 element: The element to click.
35 """
36 btn = driver.find_element(By.ID, element)
37 btn.click()
38 alert = AppHarness.poll_for_or_raise_timeout(lambda: get_alert_or_none(driver))
39 assert isinstance(alert, Alert)
40 assert alert.text == "clicked"
41 alert.accept()
42
43
44def StateInheritance():

Callers 1

test_state_inheritanceFunction · 0.85

Calls 2

get_alert_or_noneFunction · 0.85

Tested by

no test coverage detected