|
4 | 4 | */ |
5 | 5 | package org.labkey.test.components.react; |
6 | 6 |
|
| 7 | +import org.jetbrains.annotations.Nullable; |
7 | 8 | import org.labkey.test.Locator; |
8 | 9 | import org.labkey.test.WebDriverWrapper; |
9 | 10 | import org.openqa.selenium.NoSuchElementException; |
10 | | -import org.openqa.selenium.SearchContext; |
11 | 11 | import org.openqa.selenium.StaleElementReferenceException; |
12 | 12 | import org.openqa.selenium.WebDriver; |
13 | 13 | import org.openqa.selenium.WebElement; |
14 | 14 | import org.openqa.selenium.support.ui.ExpectedConditions; |
15 | | -import org.openqa.selenium.support.ui.FluentWait; |
16 | 15 |
|
17 | | -import java.time.Duration; |
18 | 16 | import java.util.List; |
19 | 17 |
|
20 | 18 | import static org.labkey.test.BaseWebDriverTest.WAIT_FOR_JAVASCRIPT; |
@@ -117,7 +115,7 @@ public FilteringReactSelect filterSelect(String value) // adds text for usage in |
117 | 115 |
|
118 | 116 | /* for use with editable instances of a reactSelect, where the options aren't shown |
119 | 117 | unless type-ahead filter information is keyed in first */ |
120 | | - public FilteringReactSelect filterSelect(String value, Locator elementToWaitFor) |
| 118 | + public FilteringReactSelect filterSelect(String value, @Nullable Locator elementToWaitFor) |
121 | 119 | { |
122 | 120 | waitForReady(); |
123 | 121 | scrollIntoView(); |
@@ -148,7 +146,8 @@ public FilteringReactSelect filterSelect(String value, Locator elementToWaitFor) |
148 | 146 | } |
149 | 147 | }, "failed to select item " + elemToClick.getAttribute("class") + " by clicking", WAIT_FOR_JAVASCRIPT); |
150 | 148 |
|
151 | | - elementToWaitFor.findElement(getComponentElement()); |
| 149 | + if (elementToWaitFor != null) |
| 150 | + elementToWaitFor.findElement(getComponentElement()); |
152 | 151 |
|
153 | 152 | close(); |
154 | 153 | return this; |
|
0 commit comments