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

Robustify test stdl001 #891

Merged
merged 2 commits into from
Dec 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"