@RunsInEDT @Override @Nonnull public JButtonFixture button(@Nullable String name) { return new JButtonFixture(robot(), findByName(name, JButton.class)); }
public void close() { LOGGER.info("Closing tab"); final JButtonFixture button = parent.button("Tab.close"); LOGGER.info("Tab name to close is " + parent.label("Tab.name")); button.click(); } }
public void clickButton(JButtonFixture button) { await().until(button::isEnabled); button.click(); }
@RunsInEDT @Override @Nonnull public JButtonFixture button(@Nonnull GenericTypeMatcher<? extends JButton> matcher) { return new JButtonFixture(robot(), find(matcher)); }
public StartSocketListenerDialog clickStartSocketListener() { me().button("Start socket listener").click(); return new StartSocketListenerDialog(robot); }
@RunsInEDT @Override @Nonnull public JButtonFixture button() { return new JButtonFixture(robot(), findByType(JButton.class)); }
public OpenPanel addFile(File file) throws InterruptedException { me().button("OpenPanel.add more files").click(); final DialogFixture vfsBrowserDialog = WindowFinder.findDialog("VfsBrowserDialog").using(robot); openFile(file, vfsBrowserDialog); LOGGER.info("File " + file.getAbsolutePath() + " added to open list"); return this; }
/** * Finds and returns a fixture wrapping a button (this fixture's {@code JOptionPane}) matching the given text. * * @param pattern the regular expression pattern to match. * @return a fixture wrapping a button matching the given regular expression pattern. * @throws NullPointerException if the given regular expression pattern is {@code null}. * @throws org.assertj.swing.exception.ComponentLookupException if the a button with the given text cannot be found. */ @Nonnull public JButtonFixture buttonWithText(@Nonnull Pattern pattern) { return new JButtonFixture(robot(), driver().buttonWithText(target(), pattern)); }
public ParseClipboardDialog clickParseClipboard(){ me().button("Parse clipboard").click(); return new ParseClipboardDialog(robot); }
/** * Finds and returns a fixture wrapping a button (this fixture's {@code JOptionPane}) matching the given text. * * @param text the text of the button to find. It can be a regular expression. * @return a fixture wrapping a button matching the given text. * @throws org.assertj.swing.exception.ComponentLookupException if the a button with the given text cannot be found. */ @Nonnull public JButtonFixture buttonWithText(@Nullable String text) { return new JButtonFixture(robot(), driver().buttonWithText(target(), text)); }
public LogViewPanel importFiles() { LOGGER.info("Clicking import logs"); await().ignoreExceptions().until(() -> frame.button("OpenPanel.import").click()); return new LogViewPanel(frame, robot); }
/** * Returns a fixture wrapping the "Cancel" button in this fixture's {@code JOptionPane}. This method is * locale-independent and platform-independent. * * @return a fixture wrapping the "Cancel" button. * @throws org.assertj.swing.exception.ComponentLookupException if the a "Cancel" button cannot be found. */ @Nonnull public JButtonFixture cancelButton() { return new JButtonFixture(robot(), driver().cancelButton(target())); }
public OpenPanel clickMergeLogs(){ final JButtonFixture mergeLogs = me().button("Merge log files"); mergeLogs.click(); return new OpenPanel(frame,robot).waitFor(); }
/** * Returns a fixture wrapping the "No" button in this fixture's {@code JOptionPane}. This method is locale-independent * and platform-independent. * * @return a fixture wrapping the "No" button. * @throws org.assertj.swing.exception.ComponentLookupException if the a "No" button cannot be found. */ @Nonnull public JButtonFixture noButton() { return new JButtonFixture(robot(), driver().noButton(target())); }
public static void close(Robot robot) { LOGGER.info("Closing confirmation dialog"); final DialogFixture confirmDialog = WindowFinder.findDialog(new GenericTypeMatcher<Dialog>(Dialog.class) { @Override protected boolean isMatching(@Nonnull Dialog component) { return component.getTitle().equals("Are you sure?"); } }).using(robot); final JButtonFixture ok = confirmDialog.button(new GenericTypeMatcher<JButton>(JButton.class) { @Override protected boolean isMatching(@Nonnull JButton component) { return component.getText().equals("OK"); } }); ok.click(); await() .atMost(30, TimeUnit.SECONDS) .ignoreExceptions() .until(confirmDialog::requireNotVisible); LOGGER.info("Confirmation dialog is closed"); } }
/** * Finds the "Cancel" button in this fixture's {@code JFileChooser}. * * @return the found "Cancel" button. * @throws org.assertj.swing.exception.ComponentLookupException if the "Cancel" button cannot be found. */ @Nonnull public JButtonFixture cancelButton() { return new JButtonFixture(robot(), driver().cancelButton(target())); }
LOGGER.info(" opening file " + name); vfsBrowserDialog.textBox("VfsBrowser.filter").setText(name); vfsBrowserDialog.button("VfsBrowser.refresh").click(); await().ignoreExceptions().until(() -> table.cell(TableCell.row(1).column(0)).click()); vfsBrowserDialog.button("VfsBrowser.open").click(); LOGGER.info(" file " + file.getAbsolutePath() + " opened");
/** * Returns a fixture wrapping the "OK" button in this fixture's {@code JOptionPane}. This method is locale-independent * and platform-independent. * * @return a fixture wrapping the "OK" button. * @throws org.assertj.swing.exception.ComponentLookupException if the a "OK" button cannot be found. */ @Nonnull public JButtonFixture okButton() { return new JButtonFixture(robot(), driver().okButton(target())); }
public LogViewPanel importLogs() { me().button(matcherForButtonWithText("Import")).click(); return new LogViewPanel(new MainFrame(robot).me(),robot); }
/** * Returns a fixture wrapping the "Yes" button in this fixture's {@code JOptionPane}. This method is * locale-independent and platform-independent. * * @return a fixture wrapping the "Yes" button. * @throws org.assertj.swing.exception.ComponentLookupException if the a "Yes" button cannot be found. */ @Nonnull public JButtonFixture yesButton() { return new JButtonFixture(robot(), driver().yesButton(target())); }