Skip to content

Commit 8b63095

Browse files
committed
Utility improvements for ModuleEditorTest
1 parent f98308d commit 8b63095

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

src/org/labkey/test/TestFileUtils.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,11 @@ public static File getModulesDir()
246246
return _modulesDir;
247247
}
248248

249+
public static File getExternalModulesDir()
250+
{
251+
return FileUtil.appendName(getModulesDir().getParentFile(), "externalModules");
252+
}
253+
249254
public static File getDefaultFileRoot(String containerPath)
250255
{
251256
return FileUtil.appendPath(getBaseFileRoot(), org.labkey.api.util.Path.parse(containerPath + "/@files"));

src/org/labkey/test/components/ui/files/FileTree.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import org.openqa.selenium.WebElement;
99
import org.openqa.selenium.support.ui.FluentWait;
1010

11+
import java.time.Duration;
1112
import java.util.List;
1213
import java.util.regex.Matcher;
1314
import java.util.regex.Pattern;
@@ -153,7 +154,10 @@ public static class SubTree extends Component<Component<?>.ElementCache>
153154
// Second <div> under the <li>
154155
private final WebElement _children = Locator.xpath("./div[2]").findWhenNeeded(this);
155156

156-
private final FluentWait<Object> toggleWait = new FluentWait<>(new Object());
157+
private FluentWait<Object> toggleWait()
158+
{
159+
return new FluentWait<>(new Object()).withTimeout(Duration.ofSeconds(1));
160+
}
157161

158162
SubTree(WebElement el)
159163
{
@@ -266,7 +270,7 @@ private void expand()
266270
if (waitForToggle() != DirExpansionState.OPEN)
267271
{
268272
_toggleArrow.click();
269-
toggleWait.withMessage(() -> String.format("Waiting for '%s' to expand.", getName()))
273+
toggleWait().withMessage(() -> String.format("Waiting for '%s' to expand.", getName()))
270274
.until(o -> getState() == DirExpansionState.OPEN);
271275
}
272276
}
@@ -276,7 +280,7 @@ private void collapse()
276280
if (waitForToggle() != DirExpansionState.CLOSED)
277281
{
278282
_toggleArrow.click();
279-
toggleWait.withMessage(() -> String.format("Waiting for '%s' to collapse.", getName()))
283+
toggleWait().withMessage(() -> String.format("Waiting for '%s' to collapse.", getName()))
280284
.until(o -> getState() == DirExpansionState.CLOSED);
281285
}
282286
}
@@ -288,7 +292,7 @@ private boolean isActive()
288292

289293
private DirExpansionState waitForToggle()
290294
{
291-
return toggleWait.withMessage(() -> String.format("Waiting for '%s' to animate.", getName()))
295+
return toggleWait().withMessage(() -> String.format("Waiting for '%s' to animate.", getName()))
292296
.until(o -> {
293297
DirExpansionState state = getState();
294298
if (state == DirExpansionState.ANIMATING)

0 commit comments

Comments
 (0)