Skip to content

Commit a3b4ef1

Browse files
committed
fix flakey hook test
1 parent 7f12586 commit a3b4ef1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/test_core/test_hooks.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,22 +119,22 @@ async def on_click(event):
119119
inner = driver.find_element_by_id("inner")
120120
count = driver.find_element_by_id("count-view")
121121

122-
assert constructor_call_count.current == 1
122+
driver_wait.until(lambda d: constructor_call_count.current == 1)
123123
assert count.get_attribute("innerHTML") == "0"
124124

125125
inner.click()
126126

127-
assert constructor_call_count.current == 1
127+
driver_wait.until(lambda d: constructor_call_count.current == 1)
128128
assert count.get_attribute("innerHTML") == "1"
129129

130130
outer.click()
131131

132-
assert constructor_call_count.current == 2
132+
driver_wait.until(lambda d: constructor_call_count.current == 2)
133133
assert count.get_attribute("innerHTML") == "0"
134134

135135
inner.click()
136136

137-
assert constructor_call_count.current == 2
137+
driver_wait.until(lambda d: constructor_call_count.current == 2)
138138
assert count.get_attribute("innerHTML") == "1"
139139

140140

0 commit comments

Comments
 (0)