Skip to content

[BUG] Flaky Selenium send_keys Tests #3431

@BSd3v

Description

@BSd3v

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions