@@ -14,6 +14,11 @@ def test_duo001_wait_for_text_error(dash_duo):
14
14
15
15
assert err .value .args [0 ] == "text -> Invalid not found within 1.0s, found: Content"
16
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
+
17
22
with pytest .raises (TimeoutException ) as err :
18
23
dash_duo .wait_for_text_to_equal ("#none" , "None" , timeout = 1.0 )
19
24
@@ -27,10 +32,33 @@ def test_duo001_wait_for_text_error(dash_duo):
27
32
== "text -> invalid not found inside element within 1.0s, found: Content"
28
33
)
29
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
+
30
43
with pytest .raises (TimeoutException ) as err :
31
44
dash_duo .wait_for_contains_text ("#none" , "none" , timeout = 1.0 )
32
45
33
46
assert (
34
47
err .value .args [0 ]
35
48
== "text -> none not found inside element within 1.0s, #none not found"
36
49
)
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