Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
robustify stdl001 (#891)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-Andre-Rivet authored Dec 7, 2020
1 parent 3a88ac2 commit 31c5942
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions tests/integration/store/test_data_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ def test_stdl001_data_lifecycle_with_different_condition(store_app, dash_dcc):
}, "session storage should contain the same click nums"

dash_dcc.driver.refresh()
assert dash_dcc.find_element("#output").text == '"{}"'.format(
store_app.uuid
), "a browser refresh will clear the memory type data to initial data"
dash_dcc.wait_for_text_to_equal("#output", '"{}"'.format(store_app.uuid))
assert dash_dcc.get_local_storage() == {"n_clicks": nclicks}
assert dash_dcc.get_session_storage() == {"n_clicks": nclicks}

Expand All @@ -27,9 +25,7 @@ def test_stdl001_data_lifecycle_with_different_condition(store_app, dash_dcc):
assert dash_dcc.get_local_storage() == {
"n_clicks": nclicks
}, "local storage should be persistent"
assert dash_dcc.find_element("#output").text == '"{}"'.format(
store_app.uuid
), "memory storage should contain the initial data in new tab"
dash_dcc.wait_for_text_to_equal("#output", '"{}"'.format(store_app.uuid))

dash_dcc.multiple_click("#btn", 2)
wait.until(lambda: dash_dcc.get_session_storage() == {"n_clicks": 2}, timeout=1)
Expand All @@ -40,9 +36,7 @@ def test_stdl001_data_lifecycle_with_different_condition(store_app, dash_dcc):
dash_dcc.driver.close()
dash_dcc.switch_window()
assert dash_dcc.get_local_storage() == {"n_clicks": 2}
assert dash_dcc.find_element("#output").text == '"{}"'.format(
store_app.uuid
), "memory output should be the same as after previous refresh"
dash_dcc.wait_for_text_to_equal("#output", '"{}"'.format(store_app.uuid))
assert dash_dcc.get_session_storage() == {
"n_clicks": nclicks
}, "session storage should be specific per browser tab window"

0 comments on commit 31c5942

Please sign in to comment.