private void testCloseAll() { assertThat(ImageComponents.getNrOfOpenImages() > 1); // save for the next test runMenuCommand("Copy Composite"); runMenuCommand("Close All"); // close all warnings boolean warnings = true; while (warnings) { try { JOptionPaneFixture pane = findJOptionPane(); // click "Don't Save" pane.button( new GenericTypeMatcher<JButton>(JButton.class) { @Override protected boolean isMatching(JButton button) { return button.getText().equals("Don't Save"); } }) .click(); } catch (Exception e) { // no more JOptionPane found warnings = false; } } assertEquals(0, ImageComponents.getNrOfOpenImages()); // restore for the next test runMenuCommand("Paste as New Image"); }
private void saveWithOverwrite(String fileName) { JFileChooserFixture saveDialog = findSaveFileChooser(); saveDialog.selectFile(new File(BASE_TESTING_DIR, fileName)); saveDialog.approve(); // say OK to the overwrite question JOptionPaneFixture optionPane = findJOptionPane(); optionPane.yesButton().click(); }
private void testExportTweeningAnimation() { assertTrue(ImageComponents.getActiveComp().isPresent()); runMenuCommand("Export Tweening Animation..."); DialogFixture dialog = findDialogByTitle("Export Tweening Animation"); dialog.comboBox().selectItem("Angular Waves"); dialog.button("ok").click(); // next findButtonByText(dialog, "Randomize Settings").click(); dialog.button("ok").click(); // next findButtonByText(dialog, "Randomize Settings").click(); dialog.button("ok").click(); // next dialog.button("ok").click(); // render // say OK to the folder not empty question JOptionPaneFixture optionPane = findJOptionPane(); optionPane.yesButton().click(); waitForProgressMonitorEnd(); }