我是基于 FEST 的 GUI 测试的新手。
MyFrame 是我的应用程序的根类。
@Before
public void onSetUp() {
MyFrame frame = GuiActionRunner.execute(new GuiQuery<MyFrame>() {
protected MyFrame executeInEDT() {
return new MyFrame();
}
});
frame2 = new FrameFixture(robot(), frame);
frame2.show(); // shows the frame to test
}
当我运行测试用例时,
@Test public void testGui()
{
String rs = frame2.label("hl").text().toString();
assertTrue(rs.equals("First"));
}
上述方法不打印标签中存在的实际字符串。
我认为 FEST API 没有等待应用程序加载。
是否有任何方法可以推迟 GUI 元素查找?
最佳答案
也许您可以使用 org.fest.swing.timing 中的暂停方法。
看这里http://fest.easytesting.org/swing/apidocs/org/fest/swing/timing/Pause.html
关于java - 使 FEST 等待应用程序加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8803471/