1
- from multiprocessing import Value
2
-
3
1
import dash
4
2
from dash .dependencies import Input , Output
5
3
from dash .exceptions import PreventUpdate
9
7
10
8
def test_rdif001_sandbox_allow_scripts (dash_duo ):
11
9
app = dash .Dash (__name__ )
12
- call_count = Value ("i" )
13
10
14
11
N_OUTPUTS = 50
15
12
@@ -26,7 +23,6 @@ def update_output(n_clicks):
26
23
if n_clicks is None :
27
24
raise PreventUpdate
28
25
29
- call_count .value += 1
30
26
return ["{}={}" .format (i , i + n_clicks ) for i in range (N_OUTPUTS )]
31
27
32
28
@app .server .after_request
@@ -39,6 +35,11 @@ def apply_cors(response):
39
35
40
36
dash_duo .start_server (app )
41
37
38
+ dash_duo .find_element ("#btn" ).click ()
39
+ dash_duo .wait_for_element ("#output-0" ).text == "0=1"
40
+
41
+ assert dash_duo .get_logs () == []
42
+
42
43
iframe = """
43
44
<!DOCTYPE html>
44
45
<html>
@@ -53,8 +54,9 @@ def apply_cors(response):
53
54
54
55
dash_duo .driver .switch_to .frame (0 )
55
56
56
- dash_duo .wait_for_element ("#output-0" )
57
- dash_duo .wait_for_element_by_id ("btn" ).click ()
58
- dash_duo .wait_for_element ("#output-0" ).text == "0=1"
57
+ assert dash_duo .get_logs () == []
58
+
59
+ dash_duo .find_element ("#btn" ).click ()
60
+ dash_duo .wait_for_text_to_equal ("#output-0" , "0=1" )
59
61
60
62
assert dash_duo .get_logs () == []
0 commit comments