< prev index next >

functional/ControlsTests/test/javafx/scene/control/test/ListView/NewListViewTest.java

Print this page

        

*** 237,248 **** selectionHelper = new MultipleSelectionHelper(1, DATA_ITEMS_NUM); selectionHelper.setMultiple(true); requestFocusOnControl(testedControl); - testedControl.keyboard().pushKey(KeyboardButtons.DOWN); - testedControl.keyboard().pressKey(KeyboardButtons.SHIFT); try { for (int i = 1; i < 5; i++) { testedControl.keyboard().pushKey(KeyboardButtons.DOWN); selectionHelper.push(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); --- 237,246 ----
*** 312,325 **** checkScrollingState(0, true, false, size, orientation); } } private void checkScrollingState(final double scrollValue, boolean beginVisible, boolean endVisible, int size, final Orientation orientation) { ! //assertEquals(findScrollBar(testedControl.as(Parent.class, Node.class), orientation, true).getControl().getValue(), scrollValue, 0.01); testedControl.waitState(new State() { public Object reached() { ! Wrap<? extends ScrollBar> sb = findScrollBar(testedControl.as(Parent.class, Node.class), orientation, true); if (Math.abs(sb.getControl().getValue() - scrollValue) < 0.01) { return true; } else { return null; } --- 310,323 ---- checkScrollingState(0, true, false, size, orientation); } } private void checkScrollingState(final double scrollValue, boolean beginVisible, boolean endVisible, int size, final Orientation orientation) { ! //assertEquals(findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), orientation, true).getControl().getValue(), scrollValue, 0.01); testedControl.waitState(new State() { public Object reached() { ! Wrap<? extends ScrollBar> sb = findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), orientation, true); if (Math.abs(sb.getControl().getValue() - scrollValue) < 0.01) { return true; } else { return null; }
*** 368,402 **** @Smoke @Test(timeout = 300000) public void verticalScrollBarBehaviorOnAddingDeletingTest() throws InterruptedException { setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefHeight, 50); ! assertFalse(findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, false) == null); addElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); ! assertFalse(findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true) == null); setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefHeight, 500); ! assertFalse(findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, false) == null); setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefHeight, 50); for (int i = 0; i < 10; i++) { removeFromPos(0); } ! assertFalse(findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, false) == null); } //Test//RT-17538//Test removed, as non actual (bug - is not a bug). public void steadyScrollingTest() throws InterruptedException { setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefHeight, 150); addRectangleAtPos(0); addTextFieldAtPos(1); addRectangleAtPos(2); ! Wrap<? extends ScrollBar> sb = findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true); ScrollingChecker sc = new ScrollingChecker(sb.getControl().valueProperty()); testedControl.mouse().move(); for (int i = 0; i < 8; i++) { ! findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+1); sc.checkChanging(+1); } } @Smoke --- 366,400 ---- @Smoke @Test(timeout = 300000) public void verticalScrollBarBehaviorOnAddingDeletingTest() throws InterruptedException { setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefHeight, 50); ! assertFalse(findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, false) == null); addElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); ! assertFalse(findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true) == null); setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefHeight, 500); ! assertFalse(findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, false) == null); setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefHeight, 50); for (int i = 0; i < 10; i++) { removeFromPos(0); } ! assertFalse(findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, false) == null); } //Test//RT-17538//Test removed, as non actual (bug - is not a bug). public void steadyScrollingTest() throws InterruptedException { setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefHeight, 150); addRectangleAtPos(0); addTextFieldAtPos(1); addRectangleAtPos(2); ! Wrap<? extends ScrollBar> sb = findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true); ScrollingChecker sc = new ScrollingChecker(sb.getControl().valueProperty()); testedControl.mouse().move(); for (int i = 0; i < 8; i++) { ! findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+1); sc.checkChanging(+1); } } @Smoke
*** 458,469 **** addRectangleAtPos(0); addTextFieldAtPos(1); setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); ! checkScreenshot("ListView_scrollBarSize1Test_HorizontalScroll_1", findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true)); ! checkScreenshot("ListView_scrollBarSize1Test_VerticalScroll_1", findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true)); throwScreenshotError(); } @ScreenshotCheck @Test(timeout = 300000) //RT-17460 --- 456,467 ---- addRectangleAtPos(0); addTextFieldAtPos(1); setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); ! checkScreenshot("ListView_scrollBarSize1Test_HorizontalScroll_1", findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true)); ! checkScreenshot("ListView_scrollBarSize1Test_VerticalScroll_1", findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true)); throwScreenshotError(); } @ScreenshotCheck @Test(timeout = 300000) //RT-17460
*** 471,481 **** setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); setSize(200, 210); addRectangleAtPos(0); addRectangleAtPos(0); ! checkScreenshot("ListView_HorizontalScroll_2", findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true)); throwScreenshotError(); } @Smoke @Test(timeout = 300000) //RT-17462 --- 469,479 ---- setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); setSize(200, 210); addRectangleAtPos(0); addRectangleAtPos(0); ! checkScreenshot("ListView_HorizontalScroll_2", findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true)); throwScreenshotError(); } @Smoke @Test(timeout = 300000) //RT-17462
*** 485,498 **** addRectangleAtPos(0); addRectangleAtPos(0); for (int i = 0; i < 100; i++) { ! findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true).mouse().turnWheel(+1); } ! assertFalse(findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true) == null); } @ScreenshotCheck @Smoke @Test(timeout = 300000)//RT-17465 --- 483,496 ---- addRectangleAtPos(0); addRectangleAtPos(0); for (int i = 0; i < 100; i++) { ! findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true).mouse().turnWheel(+1); } ! assertFalse(findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true) == null); } @ScreenshotCheck @Smoke @Test(timeout = 300000)//RT-17465
*** 515,527 **** @Test(timeout = 300000)//RT-17705 public void scrollingConfused1Test() throws InterruptedException, Throwable { setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); setSize(150, 150); addRectangleAtPos(0); ! findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true).mouse().turnWheel(+20); ! findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+20); checkScreenshot("ListView_ScrollingIssue_1", testedControl); throwScreenshotError(); } --- 513,526 ---- @Test(timeout = 300000)//RT-17705 public void scrollingConfused1Test() throws InterruptedException, Throwable { setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); setSize(150, 150); addRectangleAtPos(0); ! int scroll_value = Utils.isMacOS() ? -20 : +20; ! findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true).mouse().turnWheel(scroll_value); ! findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(scroll_value); checkScreenshot("ListView_ScrollingIssue_1", testedControl); throwScreenshotError(); }
*** 532,550 **** setSize(150, 150); addRectangleAtPos(0); Thread.sleep(500); for (int i = 0; i < 20; i++) { ! findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true).mouse().turnWheel(+1); } for (int i = 0; i < 20; i++) { ! findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+1); } setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); ! findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true).mouse().turnWheel(+20); checkScreenshot("ListView_ScrollingIssue_2", testedControl); throwScreenshotError(); } @ScreenshotCheck --- 531,549 ---- setSize(150, 150); addRectangleAtPos(0); Thread.sleep(500); for (int i = 0; i < 20; i++) { ! findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true).mouse().turnWheel(+1); } for (int i = 0; i < 20; i++) { ! findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+1); } setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); ! findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true).mouse().turnWheel(+20); checkScreenshot("ListView_ScrollingIssue_2", testedControl); throwScreenshotError(); } @ScreenshotCheck
*** 552,563 **** public void scrollingConfused3Test() throws Throwable { setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.VERTICAL, Properties.orientation); setSize(150, 150); addRectangleAtPos(0); ! findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true).mouse().turnWheel(+20); ! findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+20); checkScreenshot("ListView_ScrollingIssue_3", testedControl); throwScreenshotError(); } @Smoke --- 551,562 ---- public void scrollingConfused3Test() throws Throwable { setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.VERTICAL, Properties.orientation); setSize(150, 150); addRectangleAtPos(0); ! findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true).mouse().turnWheel(+20); ! findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+20); checkScreenshot("ListView_ScrollingIssue_3", testedControl); throwScreenshotError(); } @Smoke
*** 567,583 **** testedControl.mouse().click(); testedControl.keyboard().pushKey(KeyboardButtons.DOWN); testedControl.keyboard().pushKey(KeyboardButtons.DOWN); - checkListener(Listeners.focusedIndex, 1); - addElement("0", 0); checkListener(Listeners.focusedIndex, 2); ! addElement("0", 2); checkListener(Listeners.focusedIndex, 3); addElement("0", 4); ! checkListener(Listeners.focusedIndex, 3); } //Test//RT-17539//Test removed because developers don't count size of content. public void knobSizeChangingTest() throws InterruptedException, Throwable { setSize(150, 150); --- 566,582 ---- testedControl.mouse().click(); testedControl.keyboard().pushKey(KeyboardButtons.DOWN); testedControl.keyboard().pushKey(KeyboardButtons.DOWN); checkListener(Listeners.focusedIndex, 2); ! addElement("0", 0); checkListener(Listeners.focusedIndex, 3); + addElement("0", 2); + checkListener(Listeners.focusedIndex, 4); addElement("0", 4); ! checkListener(Listeners.focusedIndex, 5); } //Test//RT-17539//Test removed because developers don't count size of content. public void knobSizeChangingTest() throws InterruptedException, Throwable { setSize(150, 150);
*** 587,602 **** addElement("0", 2); checkScreenshot("ListView_ScrollBarKnobSizeIssue_1", testedControl); for (int i = 0; i < 20; i++) { ! findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+1); } checkScreenshot("ListView_ScrollBarKnobSizeIssue_2", testedControl); ! findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+10); checkScreenshot("ListView_ScrollBarKnobSizeIssue_3", testedControl); throwScreenshotError(); } --- 586,601 ---- addElement("0", 2); checkScreenshot("ListView_ScrollBarKnobSizeIssue_1", testedControl); for (int i = 0; i < 20; i++) { ! findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+1); } checkScreenshot("ListView_ScrollBarKnobSizeIssue_2", testedControl); ! findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+10); checkScreenshot("ListView_ScrollBarKnobSizeIssue_3", testedControl); throwScreenshotError(); }
*** 612,627 **** selectionHelper.setSingleCell(false); selectionHelper.setMultiple(false); requestFocusOnControl(testedControl); - Thread.sleep(SLEEP); - - testedControl.keyboard().pushKey(KeyboardButtons.DOWN); - - Thread.sleep(SLEEP); - //Testing section try { for (int i = 0; i < 5; i++) { testedControl.keyboard().pushKey(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); selectionHelper.push(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); --- 611,620 ----
*** 650,671 **** addElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.SINGLE, Properties.selectionMode); setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.MULTIPLE, Properties.selectionMode); setSize(130, 130); ! selectionHelper = new MultipleSelectionHelper(1, DATA_ITEMS_NUM); selectionHelper.setSingleCell(false); selectionHelper.setMultiple(true); requestFocusOnControl(testedControl); - Thread.sleep(SLEEP); - - testedControl.keyboard().pushKey(KeyboardButtons.DOWN); - - Thread.sleep(SLEEP); - //Testing section try { for (int i = 0; i < 2; i++) { testedControl.keyboard().pushKey(KeyboardButtons.DOWN); selectionHelper.push(KeyboardButtons.DOWN); --- 643,658 ---- addElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.SINGLE, Properties.selectionMode); setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.MULTIPLE, Properties.selectionMode); setSize(130, 130); ! selectionHelper = new MultipleSelectionHelper(1, 10); selectionHelper.setSingleCell(false); selectionHelper.setMultiple(true); requestFocusOnControl(testedControl); //Testing section try { for (int i = 0; i < 2; i++) { testedControl.keyboard().pushKey(KeyboardButtons.DOWN); selectionHelper.push(KeyboardButtons.DOWN);
*** 731,746 **** selectionHelper.setSingleCell(false); selectionHelper.setMultiple(false); requestFocusOnControl(testedControl); - Thread.sleep(SLEEP); - - testedControl.keyboard().pushKey(KeyboardButtons.DOWN); - - Thread.sleep(SLEEP); - //Testing section try { for (int i = 0; i < 2; i++) { testedControl.keyboard().pushKey(KeyboardButtons.DOWN); selectionHelper.push(KeyboardButtons.DOWN); --- 718,727 ----
*** 784,799 **** selectionHelper.setSingleCell(false); selectionHelper.setMultiple(true); requestFocusOnControl(testedControl); - Thread.sleep(SLEEP); - - testedControl.keyboard().pushKey(KeyboardButtons.DOWN); - - Thread.sleep(SLEEP); - //Testing section try { for (int i = 0; i < 2; i++) { testedControl.keyboard().pushKey(KeyboardButtons.DOWN); selectionHelper.push(KeyboardButtons.DOWN); --- 765,774 ----
*** 897,906 **** --- 872,882 ---- */ public void complexSelectionScreenShotTest() throws InterruptedException, Throwable { setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefHeight, 200); setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefWidth, 200); setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.MULTIPLE, Properties.selectionMode); + selectionHelper.setMultiple(true); setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); final int elementsCount = 50; addAndSelectElements(elementsCount); final int step = 5;
*** 908,917 **** --- 884,895 ---- for (Orientation orientation : Orientation.values()) { setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, orientation, Properties.orientation); Wrap<Text> cellWrap = getCellWrap((Integer) (0)); //mouse will be over the second item. cellWrap.as(Showable.class).shower().show(); cellWrap.mouse().click(1, cellWrap.getClickPoint(), Mouse.MouseButtons.BUTTON1, CTRL_DOWN_MASK_OS); + selectionHelper.click(0, 0, KeyboardButtons.CONTROL); + checkSelection(); KeyboardButtons lessKey = (orientation == Orientation.HORIZONTAL ? KeyboardButtons.LEFT : KeyboardButtons.UP); KeyboardButtons moreKey = (orientation == Orientation.HORIZONTAL ? KeyboardButtons.RIGHT : KeyboardButtons.DOWN); applyKeysPushing(2, KeyboardButtons.PAGE_DOWN, KeyboardModifiers.SHIFT_DOWN_MASK);
< prev index next >