|
3 | 3 | import org.labkey.test.Locator; |
4 | 4 | import org.labkey.test.WebDriverWrapper; |
5 | 5 | import org.labkey.test.WebTestHelper; |
| 6 | +import org.labkey.test.components.html.BootstrapMenu; |
6 | 7 | import org.labkey.test.components.html.Checkbox; |
| 8 | +import org.labkey.test.components.html.SelectWrapper; |
7 | 9 | import org.labkey.test.components.react.MultiMenu; |
8 | | -import org.labkey.test.components.html.BootstrapMenu; |
9 | 10 | import org.labkey.test.components.react.Tabs; |
10 | 11 | import org.labkey.test.pages.LabKeyPage; |
11 | 12 | import org.labkey.test.pages.core.admin.ShowAdminPage; |
@@ -156,22 +157,37 @@ public boolean getLoginAttemptEnabled() |
156 | 157 |
|
157 | 158 | public LoginConfigurePage setLoginAttemptLimit(String value) |
158 | 159 | { |
159 | | - new Select(elementCache().loginAttemptLimitSelect).selectByValue(value); |
| 160 | + elementCache().loginAttemptLimitSelect.selectByValue(value); |
160 | 161 | return this; |
161 | 162 | } |
162 | 163 |
|
| 164 | + public String getLoginAttemptLimit() |
| 165 | + { |
| 166 | + return elementCache().loginAttemptLimitSelect.getFirstSelectedOption().getAttribute("value"); |
| 167 | + } |
| 168 | + |
163 | 169 | public LoginConfigurePage setLoginAttemptPeriod(String value) |
164 | 170 | { |
165 | | - new Select(elementCache().loginAttemptPeriodSelect).selectByValue(value); |
| 171 | + elementCache().loginAttemptPeriodSelect.selectByValue(value); |
166 | 172 | return this; |
167 | 173 | } |
168 | 174 |
|
| 175 | + public String getLoginAttemptPeriod() |
| 176 | + { |
| 177 | + return elementCache().loginAttemptPeriodSelect.getFirstSelectedOption().getAttribute("value"); |
| 178 | + } |
| 179 | + |
169 | 180 | public LoginConfigurePage setLoginAttemptResetTime(String value) |
170 | 181 | { |
171 | | - new Select(elementCache().loginAttemptResetTimeSelect).selectByValue(value); |
| 182 | + elementCache().loginAttemptResetTimeSelect.selectByValue(value); |
172 | 183 | return this; |
173 | 184 | } |
174 | 185 |
|
| 186 | + public String getLoginAttemptResetTime() |
| 187 | + { |
| 188 | + return elementCache().loginAttemptResetTimeSelect.getFirstSelectedOption().getAttribute("value"); |
| 189 | + } |
| 190 | + |
175 | 191 | public ShowAdminPage clickSaveAndFinish() |
176 | 192 | { |
177 | 193 | shortWait().until(ExpectedConditions.elementToBeClickable(elementCache().saveAndFinishBtn())); |
@@ -199,9 +215,9 @@ protected class ElementCache extends LabKeyPage<?>.ElementCache |
199 | 215 | MultiMenu addSecondaryMenu = secondaryMenuFinder.findWhenNeeded(this); |
200 | 216 |
|
201 | 217 | Checkbox loginAttemptEnabledCheckbox = new Checkbox(this, "Limit unsuccessful login attempts"); |
202 | | - WebElement loginAttemptLimitSelect = Locator.css("select[name='LoginAttemptLimit']").findWhenNeeded(this); |
203 | | - WebElement loginAttemptPeriodSelect = Locator.css("select[name='LoginAttemptPeriod']").findWhenNeeded(this); |
204 | | - WebElement loginAttemptResetTimeSelect = Locator.css("select[name='LoginAttemptResetTime']").findWhenNeeded(this); |
| 218 | + Select loginAttemptLimitSelect = SelectWrapper.Select(Locator.css("select[name='LoginAttemptLimit']")).findWhenNeeded(this); |
| 219 | + Select loginAttemptPeriodSelect = SelectWrapper.Select(Locator.css("select[name='LoginAttemptPeriod']")).findWhenNeeded(this); |
| 220 | + Select loginAttemptResetTimeSelect = SelectWrapper.Select(Locator.css("select[name='LoginAttemptResetTime']")).findWhenNeeded(this); |
205 | 221 |
|
206 | 222 | WebElement globalSettingsPanel() |
207 | 223 | { |
|
0 commit comments