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

Commit 31c5942

Browse files
robustify stdl001 (#891)
1 parent 3a88ac2 commit 31c5942

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

tests/integration/store/test_data_lifecycle.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ def test_stdl001_data_lifecycle_with_different_condition(store_app, dash_dcc):
1616
}, "session storage should contain the same click nums"
1717

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

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

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

0 commit comments

Comments
 (0)