diff --git a/tests/system/src/test/java/test/robot/javafx/scene/RobotTest.java b/tests/system/src/test/java/test/robot/javafx/scene/RobotTest.java index 315dad682a..f78656594a 100644 --- a/tests/system/src/test/java/test/robot/javafx/scene/RobotTest.java +++ b/tests/system/src/test/java/test/robot/javafx/scene/RobotTest.java @@ -349,7 +349,7 @@ private static void testMouseAction(MouseAction mouseAction, MouseButton mouseBu InvalidationListener invalidationListener = observable -> setSceneLatch.countDown(); String expectedText = mouseAction + " " + mouseButton; Util.runAndWait(() -> { - MouseActionHandler mouseActionHandler = new MouseActionHandler(button, mouseAction, mouseButton, onClickLatch); + MouseActionHandler mouseActionHandler = new MouseActionHandler(button, mouseAction, mouseButton, onClickLatch); switch (mouseAction) { case PRESSED: button.setOnMousePressed(mouseActionHandler); @@ -474,12 +474,10 @@ private static void testMouseWheel(int amount) { InvalidationListener invalidationListener = observable -> setSceneLatch.countDown(); int[] totalScroll = new int[]{0}; long[] firstScrollMillis = new long[]{0}; + int scrollMultiplier = System.getProperty("os.name").toLowerCase().startsWith("mac") ? -1 : 40; Util.runAndWait(() -> { button.setOnScroll(event -> { - System.out.println("event: " + event); - System.out.println("total scroll before: " + totalScroll[0]); totalScroll[0] += event.getDeltaY(); - System.out.println("total scroll after: " + totalScroll[0]); if (firstScrollMillis[0] == 0) { firstScrollMillis[0] = System.currentTimeMillis(); } else { @@ -488,9 +486,8 @@ private static void testMouseWheel(int amount) { onScrollLatch.countDown(); } } - if (Math.abs(totalScroll[0]) / 40 >= Math.abs(amount)) { - System.out.println("total scroll is greater than or equal to amount"); - button.setText("Scrolled " + -(totalScroll[0] / 40)); + if (Math.abs(totalScroll[0] / scrollMultiplier) >= Math.abs(amount)) { + button.setText("Scrolled " + -(totalScroll[0] / scrollMultiplier)); onScrollLatch.countDown(); } }); @@ -747,4 +744,4 @@ private static String colorToString(Color c) { private static String capFirst(String str) { return Character.toUpperCase(str.charAt(0)) + str.substring(1).toLowerCase(); } -} +} \ No newline at end of file