Skip to content

Commit c87a6fd

Browse files
committed
Add ComplianceSettingsUpgradeTest for login settings
1 parent 4beec3b commit c87a6fd

1 file changed

Lines changed: 23 additions & 7 deletions

File tree

src/org/labkey/test/pages/core/login/LoginConfigurePage.java

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
import org.labkey.test.Locator;
44
import org.labkey.test.WebDriverWrapper;
55
import org.labkey.test.WebTestHelper;
6+
import org.labkey.test.components.html.BootstrapMenu;
67
import org.labkey.test.components.html.Checkbox;
8+
import org.labkey.test.components.html.SelectWrapper;
79
import org.labkey.test.components.react.MultiMenu;
8-
import org.labkey.test.components.html.BootstrapMenu;
910
import org.labkey.test.components.react.Tabs;
1011
import org.labkey.test.pages.LabKeyPage;
1112
import org.labkey.test.pages.core.admin.ShowAdminPage;
@@ -156,22 +157,37 @@ public boolean getLoginAttemptEnabled()
156157

157158
public LoginConfigurePage setLoginAttemptLimit(String value)
158159
{
159-
new Select(elementCache().loginAttemptLimitSelect).selectByValue(value);
160+
elementCache().loginAttemptLimitSelect.selectByValue(value);
160161
return this;
161162
}
162163

164+
public String getLoginAttemptLimit()
165+
{
166+
return elementCache().loginAttemptLimitSelect.getFirstSelectedOption().getAttribute("value");
167+
}
168+
163169
public LoginConfigurePage setLoginAttemptPeriod(String value)
164170
{
165-
new Select(elementCache().loginAttemptPeriodSelect).selectByValue(value);
171+
elementCache().loginAttemptPeriodSelect.selectByValue(value);
166172
return this;
167173
}
168174

175+
public String getLoginAttemptPeriod()
176+
{
177+
return elementCache().loginAttemptPeriodSelect.getFirstSelectedOption().getAttribute("value");
178+
}
179+
169180
public LoginConfigurePage setLoginAttemptResetTime(String value)
170181
{
171-
new Select(elementCache().loginAttemptResetTimeSelect).selectByValue(value);
182+
elementCache().loginAttemptResetTimeSelect.selectByValue(value);
172183
return this;
173184
}
174185

186+
public String getLoginAttemptResetTime()
187+
{
188+
return elementCache().loginAttemptResetTimeSelect.getFirstSelectedOption().getAttribute("value");
189+
}
190+
175191
public ShowAdminPage clickSaveAndFinish()
176192
{
177193
shortWait().until(ExpectedConditions.elementToBeClickable(elementCache().saveAndFinishBtn()));
@@ -199,9 +215,9 @@ protected class ElementCache extends LabKeyPage<?>.ElementCache
199215
MultiMenu addSecondaryMenu = secondaryMenuFinder.findWhenNeeded(this);
200216

201217
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);
205221

206222
WebElement globalSettingsPanel()
207223
{

0 commit comments

Comments
 (0)