@@ -14,6 +14,11 @@ def test_duo001_wait_for_text_error(dash_duo):
1414
1515 assert err .value .args [0 ] == "text -> Invalid not found within 1.0s, found: Content"
1616
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+
1722 with pytest .raises (TimeoutException ) as err :
1823 dash_duo .wait_for_text_to_equal ("#none" , "None" , timeout = 1.0 )
1924
@@ -27,10 +32,33 @@ def test_duo001_wait_for_text_error(dash_duo):
2732 == "text -> invalid not found inside element within 1.0s, found: Content"
2833 )
2934
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+
3043 with pytest .raises (TimeoutException ) as err :
3144 dash_duo .wait_for_contains_text ("#none" , "none" , timeout = 1.0 )
3245
3346 assert (
3447 err .value .args [0 ]
3548 == "text -> none not found inside element within 1.0s, #none not found"
3649 )
50+
51+
52+ def test_duo002_wait_for_text_value (dash_duo ):
53+ app = Dash (__name__ )
54+ app .layout = html .Div ([html .Ol ([html .Li ("Item" , id = "value-item" , value = "100" )])])
55+ dash_duo .start_server (app )
56+
57+ dash_duo .wait_for_text_to_equal ("#value-item" , "100" )
58+ with pytest .raises (TimeoutException ) as err :
59+ dash_duo .wait_for_contains_text ("#value-item" , "None" , timeout = 1.0 )
60+
61+ assert (
62+ err .value .args [0 ]
63+ == "text -> None not found inside element within 1.0s, found: Item"
64+ )
0 commit comments