dash icon indicating copy to clipboard operation
dash copied to clipboard

[BUG] Flaky Selenium `send_keys` Tests

Open BSd3v opened this issue 4 months ago • 0 comments

When trying to get clean PRs to dash, there are flaky tests due to Selenium send_keys with typing and counting the # of times a callback was triggered.

Is this necessary as the end result is what matters? If so, we should introduce a util function to type as a real user instead of the quickness that the system types.

eg: test_async_cbsc008_wildcard_prop_callbacks

    for key in "hello world":
        with lock:
            input1.send_keys(key)
            time.sleep(0.05)  # allow some time for debounced callback to be sent

    dash_duo.wait_for_text_to_equal("#output-1", "hello world")
    assert dash_duo.find_element("#output-1").get_attribute("data-cb") == "hello world"

    # an initial call, one for clearing the input
    # and one for each hello world character
    assert input_call_count.value == 2 + len("hello world")

BSd3v avatar Sep 10 '25 14:09 BSd3v