Skip to content

Commit 71726c0

Browse files
committed
address test flakiness
1 parent c02cd74 commit 71726c0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/test_sizing_buttons.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import pytest
12
import dash_ag_grid as dag
23
from dash import Dash, html, dcc, Output, Input, no_update, ctx, State
34
import requests
@@ -118,6 +119,7 @@ def selected(state, oldState, opts):
118119
oldValue = dash_duo.find_element("#columnState").text
119120

120121

122+
@pytest.mark.flaky(max_runs=5, min_passes=1)
121123
def test_sb002_sizing_buttons(dash_duo):
122124
app = Dash(__name__)
123125

@@ -204,6 +206,7 @@ def selected(state):
204206
for x in columnDefs:
205207
assert x["field"] in oldValue
206208

209+
time.sleep(.5) # allow window size to change
207210
for x in ["sizeToFit", "responsiveSizeToFit"]:
208211
dash_duo.find_element(f"#{x}").click()
209212
if x != "responsiveSizeToFit":
@@ -339,7 +342,7 @@ def selected(state, oldState, opts):
339342
)
340343
oldValue = dash_duo.find_element("#columnState").text
341344

342-
345+
@pytest.mark.flaky(max_runs=5, min_passes=1)
343346
def test_sb004_sizing_buttons(dash_duo):
344347
app = Dash(__name__)
345348

@@ -427,6 +430,7 @@ def selected(state):
427430
oldValue = dash_duo.find_element("#columnState").text
428431
for x in columnDefs:
429432
assert x["field"] in oldValue
433+
time.sleep(.5)
430434

431435
for x in ["sizeToFit", "responsiveSizeToFit"]:
432436
dash_duo.find_element(f"#{x}").click()
@@ -448,7 +452,7 @@ def selected(state):
448452
assert oldValue == dash_duo.find_element("#columnState").get_attribute(
449453
"innerText"
450454
)
451-
time.sleep(.2) # allow window size to change
455+
time.sleep(.5) # allow window size to change
452456
dash_duo.find_element(f"#{x}").click()
453457
until(
454458
lambda: oldValue

0 commit comments

Comments
 (0)