Пример #1
0
 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();
 }
Пример #2
0
  private void testFileOpen() {
    findMenuItemByText("Open...").click();
    JFileChooserFixture openDialog = JFileChooserFinder.findFileChooser("open").using(robot);
    openDialog.cancel();

    findMenuItemByText("Open...").click();
    openDialog = JFileChooserFinder.findFileChooser("open").using(robot);
    openDialog.selectFile(new File(INPUT_DIR, "b.jpg"));
    openDialog.approve();
  }
Пример #3
0
  private void testSaveUnnamed() {
    // new unsaved image, will be saved as save as
    runMenuCommand("Save");
    JFileChooserFixture saveDialog = findSaveFileChooser();
    // due to an assertj bug, the file must exist - TODO investigate, report
    saveDialog.selectFile(new File(BASE_TESTING_DIR, "saved.png"));
    saveDialog.approve();
    // say OK to the overwrite question
    findJOptionPane().yesButton().click();

    // TODO test save as menuitem and simple save (without file chooser)
  }