Skip to content

Commit

Permalink
tweak rdif001 - simpler and more info
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcjohnson committed Feb 3, 2021
1 parent 416e251 commit 6200784
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tests/integration/renderer/test_iframe.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from multiprocessing import Value

import dash
from dash.dependencies import Input, Output
from dash.exceptions import PreventUpdate
Expand All @@ -9,7 +7,6 @@

def test_rdif001_sandbox_allow_scripts(dash_duo):
app = dash.Dash(__name__)
call_count = Value("i")

N_OUTPUTS = 50

Expand All @@ -26,7 +23,6 @@ def update_output(n_clicks):
if n_clicks is None:
raise PreventUpdate

call_count.value += 1
return ["{}={}".format(i, i + n_clicks) for i in range(N_OUTPUTS)]

@app.server.after_request
Expand All @@ -39,6 +35,11 @@ def apply_cors(response):

dash_duo.start_server(app)

dash_duo.find_element("#btn").click()
dash_duo.wait_for_element("#output-0").text == "0=1"

assert dash_duo.get_logs() == []

iframe = """
<!DOCTYPE html>
<html>
Expand All @@ -53,8 +54,9 @@ def apply_cors(response):

dash_duo.driver.switch_to.frame(0)

dash_duo.wait_for_element("#output-0")
dash_duo.wait_for_element_by_id("btn").click()
dash_duo.wait_for_element("#output-0").text == "0=1"
assert dash_duo.get_logs() == []

dash_duo.find_element("#btn").click()
dash_duo.wait_for_text_to_equal("#output-0", "0=1")

assert dash_duo.get_logs() == []

0 comments on commit 6200784

Please sign in to comment.