@Test
public void should_find_JOptionPane_before_given_timeout_in_ms_expires() {
window.launchDelay(200);
clickMessageButton();
JOptionPaneFixture found = JOptionPaneFinder.findOptionPane(matcher).withTimeout(500).using(robot);
assertThat(found.target()).isNotNull();
}
@Test(expected = WaitTimedOutError.class)
public void should_fail_if_JOptionPane_not_found() {
JOptionPaneFinder.findOptionPane(matcher).using(robot);