Skip to content

Commit 58ed3a4

Browse files
author
hextraza
committed
Wait for search autocomplete dropdown
1 parent a77fb7f commit 58ed3a4

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

jbrowse/test/src/org/labkey/test/tests/external/labModules/JBrowseTest.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -407,14 +407,22 @@ private void testOutputFileProcessing() throws Exception
407407

408408
//Now test search:
409409
beginAt("/jbrowse/" + getContainerId() + "/search.view?session=" + sessionId);
410+
String search = "Ga";
411+
String expected = "Gag";
412+
410413
Locator searchLocator = Locator.tagWithClass("input", "MuiInputBase-input");
411414
waitForElement(searchLocator);
412415
WebElement searchBox = searchLocator.findElement(getDriver());
413-
searchBox.sendKeys("Ga"); // Test autocomplete
414-
searchBox.sendKeys(Keys.ARROW_DOWN); // Navigate and select result
416+
searchBox.sendKeys(search);
417+
418+
Locator optionLocator = Locator.tagWithText("li", expected);
419+
waitForElement(optionLocator);
420+
421+
searchBox.sendKeys(Keys.ARROW_DOWN);
415422
searchBox.sendKeys(Keys.ENTER);
416-
waitForElement(Locator.tagWithClass("input", "MuiInputBase-input"));
417-
Assert.assertEquals("Correct ID selected", searchBox.getAttribute("value"), "Gag");
423+
424+
waitForElement(searchLocator);
425+
Assert.assertEquals("Correct ID selected", expected, searchBox.getAttribute("value"));
418426
}
419427

420428
public static <T> Collector<T, ?, T> toSingleton() {

0 commit comments

Comments
 (0)