mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-24 04:42:51 -04:00
updates the gui tests
This commit is contained in:
parent
8835ddf4d2
commit
aa8c3d8a7d
@ -483,10 +483,16 @@ public class GuiTester {
|
||||
}
|
||||
|
||||
public final static class WaitFor implements Runnable {
|
||||
private Condition cond;
|
||||
private final int loops;
|
||||
private final Condition cond;
|
||||
|
||||
public WaitFor(Condition cond) {
|
||||
this(2000, cond);
|
||||
}
|
||||
|
||||
public WaitFor(int timeinMs, Condition cond) {
|
||||
this.cond = cond;
|
||||
this.loops = timeinMs / 100;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -494,7 +500,7 @@ public class GuiTester {
|
||||
int n = 0;
|
||||
while (!cond.proceed()) {
|
||||
Thread.sleep(100);
|
||||
if (n++ > 20)
|
||||
if (n++ > loops)
|
||||
throw new RuntimeException("time out!");
|
||||
}
|
||||
}
|
||||
|
@ -464,7 +464,7 @@ public class TestInGUI extends TestCase {
|
||||
.typeTempFile("test")
|
||||
.press("ENTER")
|
||||
.delay(600)
|
||||
.add(new GuiTester.WaitFor(() -> {
|
||||
.add(new GuiTester.WaitFor(4000, () -> {
|
||||
Window activeWindow = FocusManager.getCurrentManager().getActiveWindow();
|
||||
return !(activeWindow instanceof Main || activeWindow instanceof TableDialog);
|
||||
}))
|
||||
|
Loading…
x
Reference in New Issue
Block a user