@Test public void should_Find_Visible_JFileChooser_By_Type_With_Timeout() { robot.showWindow(window); launchFileChooser(200); JFileChooserFixture fileChooser = fixture.fileChooser(timeout(300)); assertThat(fileChooser.target()).isSameAs(window.fileChooser()); }
@Test public void should_Find_Visible_JFileChooser_By_Name() { robot.showWindow(window); launchFileChooserNow(); JFileChooserFixture fileChooser = fixture.fileChooser("fileChooser"); assertThat(fileChooser.target()).isSameAs(window.fileChooser()); }
@Test public void should_Fail_If_Visible_JFileChooser_Not_Found_By_Type() { thrown.expect(WaitTimedOutError.class); thrown.expectMessageToContain( "Unable to find component using matcher", "type=javax.swing.JFileChooser, requireShowing=true"); fixture.fileChooser(); }
@Test public void should_Fail_If_Visible_JFileChooser_Not_Found_By_Name() { thrown.expect(ComponentLookupException.class); thrown.expectMessageToContain( "Unable to find component using matcher", "name='myFileChooser', type=javax.swing.JFileChooser, requireShowing=true"); fixture.fileChooser("myFileChooser"); }
@Test public void should_Fail_If_Visible_JFileChooser_Not_Found_By_Name_With_Timeout() { thrown.expect(WaitTimedOutError.class, "Timed out waiting for file chooser to be found"); fixture.fileChooser("fileChooser", timeout(300)); }
@Test public void should_Fail_If_Visible_JFileChooser_Not_Found_By_Matcher() { thrown.expect(WaitTimedOutError.class, "Timed out waiting for file chooser to be found"); fixture.fileChooser(new JFileChooserByTitleMatcher()); }