Skip to content

Commit 0ce0230

Browse files
committed
Handle staleness concern
1 parent fc3d49e commit 0ce0230

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/vws_web_tools/__init__.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,20 @@ def get_database_details(
195195
)
196196

197197
search_input_element = driver.find_element(By.ID, "table_search")
198+
original_first_database_cell_element = ten_second_wait.until(
199+
expected_conditions.element_to_be_clickable(
200+
(By.ID, "table_row_0_project_name"),
201+
),
202+
)
198203
search_input_element.send_keys(database_name)
199204
search_input_element.send_keys(Keys.RETURN)
200-
201-
# We assume that searching for the database name will return one result.
205+
# The search has competed when the original first database cell element is
206+
# "stale".
202207
ten_second_wait.until(
203-
expected_conditions.presence_of_element_located(
204-
(By.ID, "table_row_0_project_name"),
205-
),
208+
expected_conditions.staleness_of(original_first_database_cell_element),
206209
)
207210

211+
# We assume that searching for the database name will return one result.
208212
database_cell_element = ten_second_wait.until(
209213
expected_conditions.element_to_be_clickable(
210214
(By.ID, "table_row_0_project_name"),

0 commit comments

Comments
 (0)