Example #1
0
  private void testFilterWithDialog(
      String name, Randomize randomize, ShowOriginal showOriginal, String... extraButtonsToClick) {
    findMenuItemByText(name).click();
    DialogFixture dialog = WindowFinder.findDialog("filterDialog").using(robot);

    for (String buttonText : extraButtonsToClick) {
      findButtonByText(dialog, buttonText).click();
    }

    if (randomize == Randomize.YES) {
      findButtonByText(dialog, "Randomize Settings").click();
      findButtonByText(dialog, "Reset All").click();
      findButtonByText(dialog, "Randomize Settings").click();
    }

    if (showOriginal == ShowOriginal.YES) {
      dialog.checkBox("show original").click();
      dialog.checkBox("show original").click();
    }

    dialog.button("ok").click();

    keyboardUndoRedo();
    keyboardUndo();
  }
Example #2
0
  private void testRandomFilter() {
    findMenuItemByText("Random Filter...").click();
    DialogFixture dialog = WindowFinder.findDialog("filterDialog").using(robot);
    JButtonFixture nextRandomButton = findButtonByText(dialog, "Next Random Filter");
    JButtonFixture backButton = findButtonByText(dialog, "Back");
    JButtonFixture forwardButton = findButtonByText(dialog, "Forward");

    assertTrue(nextRandomButton.isEnabled());
    assertFalse(backButton.isEnabled());
    assertFalse(forwardButton.isEnabled());

    nextRandomButton.click();
    assertTrue(backButton.isEnabled());
    assertFalse(forwardButton.isEnabled());

    nextRandomButton.click();
    backButton.click();
    assertTrue(forwardButton.isEnabled());

    backButton.click();
    forwardButton.click();
    nextRandomButton.click();

    findButtonByText(dialog, "OK").click();
    keyboardUndoRedo();
    keyboardUndo();
  }
Example #3
0
 protected void onSetUp() {
   ApplicationLauncher.application("pixelitor.Pixelitor")
       .withArgs((new File(INPUT_DIR, "a.jpg")).getPath())
       .start();
   window = WindowFinder.findFrame("frame0").withTimeout(15, SECONDS).using(robot);
   PixelitorWindow.getInstance().setLocation(0, 0);
 }
Example #4
0
  private void testText() {
    findMenuItemByText("Text...").click();
    DialogFixture dialog = WindowFinder.findDialog("filterDialog").using(robot);

    dialog.textBox("textTF").requireEditable().enterText("testing...");
    dialog.slider("fontSize").slideTo(250);

    dialog.checkBox("boldCB").check().uncheck();
    dialog.checkBox("italicCB").check();
    //        dialog.checkBox("underlineCB").check().uncheck();
    //        dialog.checkBox("strikeThroughCB").check().uncheck();
    // TODO test the advanced settings dialog

    findButtonByText(dialog, "OK").click();
    keyboardUndoRedo();
    keyboardUndo();
  }