Example #1
0
  private void testHandTool() {
    window.toggleButton("Hand Tool Button").click();
    randomAltClick();

    moveRandom();
    dragRandom();
  }
Example #2
0
  private void testShapesTool() {
    window.toggleButton("Shapes Tool Button").click();
    randomAltClick();

    setupEffectsDialog();
    boolean stokeSettingsSetup = false;

    for (ShapeType shapeType : ShapeType.values()) {
      window.comboBox("shapeTypeCB").selectItem(shapeType.toString());
      for (ShapesAction shapesAction : ShapesAction.values()) {
        window.comboBox("actionCB").selectItem(shapesAction.toString());
        window.pressAndReleaseKeys(KeyEvent.VK_R);

        if (shapesAction == ShapesAction.STROKE) { // stroke settings will be enabled here
          if (!stokeSettingsSetup) {
            setupStrokeSettingsDialog();
            stokeSettingsSetup = true;
          }
        }

        moveRandom();
        dragRandom();

        if (shapesAction == ShapesAction.SELECTION
            || shapesAction == ShapesAction.SELECTION_FROM_STROKE) {
          keyboardDeselect();
        }
      }
    }

    keyboardUndoRedo();
    keyboardUndo();
  }
Example #3
0
  private void testCloneTool() {
    window.toggleButton("Clone Stamp Tool Button").click();

    testClone(false, false, 100);
    testClone(false, true, 200);
    testClone(true, false, 300);
    testClone(true, true, 400);
  }
Example #4
0
  private void testColorPickerTool() {
    window.toggleButton("Color Picker Tool Button").click();
    randomAltClick();

    move(300, 300);
    window.click();
    drag(400, 400);
  }
Example #5
0
  private void testMoveTool() {
    window.toggleButton("Move Tool Button").click();
    testMoveToolImpl(false);
    testMoveToolImpl(true);

    keyboardNudge();
    keyboardUndo();
  }
Example #6
0
  private void testPaintBucketTool() {
    window.toggleButton("Paint Bucket Tool Button").click();
    randomAltClick();

    move(300, 300);
    window.click();

    keyboardUndoRedo();
    keyboardUndo();
  }
Example #7
0
  private void testSmudgeTool() {
    window.toggleButton("Smudge Tool Button").click();
    randomAltClick();

    for (int i = 0; i < 3; i++) {
      randomClick();
      shiftMoveClickRandom();
      moveRandom();
      dragRandom();
    }
  }
Example #8
0
  private void testZoomTool() {
    window.toggleButton("Zoom Tool Button").click();
    move(300, 300);

    click();
    click();
    altClick();
    altClick();

    testMouseWheelZooming();
    testControlPlusMinusZooming();
  }
Example #9
0
  private void testSelectionModifyMenu() {
    window.toggleButton("Selection Tool Button").click();
    randomAltClick();

    move(200, 200);
    drag(400, 400);

    runMenuCommand("Modify...");
    DialogFixture dialog = findDialogByTitle("Modify Selection");

    findButtonByText(dialog, "Change!").click();
    findButtonByText(dialog, "Change!").click();
    findButtonByText(dialog, "Close").click();

    keyboardUndoRedo();
    keyboardUndo();
  }
Example #10
0
  private void testCropTool() {
    window.toggleButton("Crop Tool Button").click();
    move(200, 200);
    drag(400, 400);
    drag(450, 450);
    move(200, 200);
    drag(150, 150);
    sleep(1, SECONDS);

    keyboardNudge();
    keyboardUndo();

    randomAltClick(); // must be at the end, otherwise it tries to start a rectangle

    findButtonByText(window, "Crop").click();

    keyboardUndoRedo();
    keyboardUndo();
  }
Example #11
0
  private void testSelectionToolAndMenus() {
    window.toggleButton("Selection Tool Button").click();
    randomAltClick();

    move(200, 200);
    drag(400, 400);
    keyboardNudge();
    keyboardUndo();

    // window.button("brushTraceButton").click();
    findButtonByText(window, "Stroke with Current Brush").click();

    keyboardDeselect();
    keyboardUndo(); // keyboardUndo deselection
    keyboardUndo(); // keyboardUndo tracing
    window.comboBox("selectionTypeCombo").selectItem("Ellipse");
    move(200, 200);
    drag(400, 400);
    window.comboBox("selectionInteractionCombo").selectItem("Add");
    move(400, 200);
    drag(500, 300);

    // window.button("eraserTraceButton").click();
    findButtonByText(window, "Stroke with Current Eraser").click();

    // crop from this selection tool
    findButtonByText(window, "Crop").click();
    keyboardUndo();

    // crop from the menu
    runMenuCommand("Crop");
    keyboardUndo();

    testSelectionModifyMenu();

    runMenuCommand("Invert Selection");
    runMenuCommand("Stroke with Current Brush");
    runMenuCommand("Stroke with Current Eraser");
    runMenuCommand("Deselect");
  }
Example #12
0
  private void testGradientTool() {
    window.toggleButton("Gradient Tool Button").click();
    randomAltClick();

    for (GradientType gradientType : GradientType.values()) {
      window.comboBox("gradientTypeSelector").selectItem(gradientType.toString());
      for (String cycleMethod : GradientTool.CYCLE_METHODS) {
        window.comboBox("gradientCycleMethodSelector").selectItem(cycleMethod);
        GradientColorType[] gradientColorTypes = GradientColorType.values();
        for (GradientColorType colorType : gradientColorTypes) {
          window.comboBox("gradientColorTypeSelector").selectItem(colorType.toString());
          window.checkBox("gradientInvert").uncheck();
          move(200, 200);
          drag(400, 400);
          window.checkBox("gradientInvert").check();
          move(200, 200);
          drag(400, 400);
        }
      }
    }
    keyboardUndoRedo();
  }
Example #13
0
  private void testEditMenu() {
    keyboardInvert();
    runMenuCommand("Repeat Invert");
    runMenuCommand("Undo Invert");
    runMenuCommand("Redo Invert");
    testFilterWithDialog("Fade Invert", Randomize.NO, ShowOriginal.YES);

    // select for crop
    window.toggleButton("Selection Tool Button").click();
    move(200, 200);
    drag(400, 400);
    runMenuCommand("Crop");
    keyboardUndo();
    keyboardDeselect();

    testCopyPaste();

    testResize();
    testRotateFlip();

    testFilterWithDialog("Transform Layer...", Randomize.YES, ShowOriginal.YES);

    testPreferences();
  }
Example #14
0
 private void testBrushTool() {
   window.toggleButton("Brush Tool Button").click();
   testBrushStrokes();
 }