(dash_duo)
| 5 | |
| 6 | |
| 7 | def test_duo001_wait_for_text_error(dash_duo): |
| 8 | app = Dash(__name__) |
| 9 | app.layout = html.Div([html.Div("Content", id="content")]) |
| 10 | dash_duo.start_server(app) |
| 11 | |
| 12 | with pytest.raises(TimeoutException) as err: |
| 13 | dash_duo.wait_for_text_to_equal("#content", "Invalid", timeout=1.0) |
| 14 | |
| 15 | assert err.value.args[0] == "text -> Invalid not found within 1.0s, found: Content" |
| 16 | |
| 17 | with pytest.raises(TimeoutException) as err: |
| 18 | dash_duo.wait_for_text_to_equal("#content", "None", timeout=1.0) |
| 19 | |
| 20 | assert err.value.args[0] == "text -> None not found within 1.0s, found: Content" |
| 21 | |
| 22 | with pytest.raises(TimeoutException) as err: |
| 23 | dash_duo.wait_for_text_to_equal("#none", "None", timeout=1.0) |
| 24 | |
| 25 | assert err.value.args[0] == "text -> None not found within 1.0s, #none not found" |
| 26 | |
| 27 | with pytest.raises(TimeoutException) as err: |
| 28 | dash_duo.wait_for_contains_text("#content", "invalid", timeout=1.0) |
| 29 | |
| 30 | assert ( |
| 31 | err.value.args[0] |
| 32 | == "text -> invalid not found inside element within 1.0s, found: Content" |
| 33 | ) |
| 34 | |
| 35 | with pytest.raises(TimeoutException) as err: |
| 36 | dash_duo.wait_for_contains_text("#content", "None", timeout=1.0) |
| 37 | |
| 38 | assert ( |
| 39 | err.value.args[0] |
| 40 | == "text -> None not found inside element within 1.0s, found: Content" |
| 41 | ) |
| 42 | |
| 43 | with pytest.raises(TimeoutException) as err: |
| 44 | dash_duo.wait_for_contains_text("#none", "none", timeout=1.0) |
| 45 | |
| 46 | assert ( |
| 47 | err.value.args[0] |
| 48 | == "text -> none not found inside element within 1.0s, #none not found" |
| 49 | ) |
| 50 | |
| 51 | |
| 52 | def test_duo002_wait_for_text_value(dash_duo): |
nothing calls this directly
no test coverage detected
searching dependent graphs…