@Test
public void testInvalidInputDialog()
{
final ComponentFinder finder = BasicComponentFinder
.finderWithCurrentAwtHierarchy();
JButtonFixture btn = window.button();
JTextComponentFixture url = window.textBox();
url.enterText("not a url");
btn.click();
window.dialog().requireVisible();
window.dialog().button().click();
btn.requireEnabled();
btn.requireEnabled();
url.enterText("www.yahoo.com");
url.pressKey(KeyEvent.VK_ENTER);
final JFileChooserFixture fc = JFileChooserFinder.findFileChooser()
.withTimeout(15000).using(window.robot);
final JButtonFixture fBtn = btn;
GuiActionRunner.execute(new GuiTask() {
@Override
public void executeInEDT()
{
fc.target.setSelectedFile(Files.currentFolder());
fc.target.approveSelection();
fBtn.requireDisabled();
fBtn.requireDisabled();
}
});
JPanel panel = (JPanel) finder.findByName("Download Progress");
Assert.assertTrue(panel.getComponentCount() > 0);