222 setPropertyBySlider(SettingType.UNIDIRECTIONAL, Properties.prefWidth, 150); 223 checkTextFieldValue(Properties.prefWidth, 150); 224 225 setPropertyBySlider(SettingType.UNIDIRECTIONAL, Properties.prefWidth, 50); 226 checkTextFieldValue(Properties.prefWidth, 50); 227 } 228 229 // SITUATIONAL TESTS 230 @Smoke 231 @Test(timeout = 300000) 232 public void keyboardRangeMultipleSelection2Test() throws Throwable { 233 addElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); 234 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.MULTIPLE, Properties.selectionMode); 235 KeyboardButtons CTRL_OS = Utils.isMacOS() ? KeyboardButtons.META : KeyboardButtons.CONTROL; 236 237 selectionHelper = new MultipleSelectionHelper(1, DATA_ITEMS_NUM); 238 selectionHelper.setMultiple(true); 239 240 requestFocusOnControl(testedControl); 241 242 testedControl.keyboard().pushKey(KeyboardButtons.DOWN); 243 244 testedControl.keyboard().pressKey(KeyboardButtons.SHIFT); 245 try { 246 for (int i = 1; i < 5; i++) { 247 testedControl.keyboard().pushKey(KeyboardButtons.DOWN); 248 selectionHelper.push(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 249 checkSelection(); 250 } 251 } finally { 252 testedControl.keyboard().releaseKey(KeyboardButtons.SHIFT); 253 } 254 255 testedControl.keyboard().pressKey(CTRL_OS); 256 try { 257 for (int i = 1; i < 5; i++) { 258 testedControl.keyboard().pushKey(KeyboardButtons.DOWN); 259 selectionHelper.push(KeyboardButtons.DOWN, CTRL_DOWN_MASK_OS); 260 checkSelection(); 261 } 262 } finally { 263 testedControl.keyboard().releaseKey(CTRL_OS); 297 298 setSize(50, 50); 299 for (Orientation orientation : Orientation.values()) { 300 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, orientation, Properties.orientation); 301 302 scrollTo(size); 303 checkScrollingState(1, false, true, size, orientation); 304 305 scrollTo(0); 306 checkScrollingState(0, true, false, size, orientation); 307 308 scrollTo(size * 2); 309 checkScrollingState(1, false, true, size, orientation); 310 311 scrollTo(-size); 312 checkScrollingState(0, true, false, size, orientation); 313 } 314 } 315 316 private void checkScrollingState(final double scrollValue, boolean beginVisible, boolean endVisible, int size, final Orientation orientation) { 317 //assertEquals(findScrollBar(testedControl.as(Parent.class, Node.class), orientation, true).getControl().getValue(), scrollValue, 0.01); 318 testedControl.waitState(new State() { 319 public Object reached() { 320 Wrap<? extends ScrollBar> sb = findScrollBar(testedControl.as(Parent.class, Node.class), orientation, true); 321 if (Math.abs(sb.getControl().getValue() - scrollValue) < 0.01) { 322 return true; 323 } else { 324 return null; 325 } 326 } 327 }); 328 329 if (beginVisible) { 330 assertTrue(isCellShown(0, orientation)); 331 } 332 if (endVisible) { 333 assertTrue(isCellShown(size, orientation)); 334 } 335 } 336 337 private boolean isCellShown(final int item, Orientation orientation) { 338 Wrap<Text> cellWrap = getCellWrap(item); 339 Rectangle cellRect = cellWrap.getScreenBounds(); 340 Rectangle control = testedControl.getScreenBounds(); 353 } 354 355 @Smoke 356 @Test(timeout = 30000) 357 public void fixedCellSizePropertyTest() throws InterruptedException { 358 adjustControl(); 359 fixedCellSizePropertyTestCommon(testedControl, Properties.fixedCellSize, Utils.isCaspian() ? 19.4 : 21); 360 } 361 362 @Smoke 363 @Test(timeout = 30000) 364 public void fixedCellSizePropertyCSSTest() { 365 adjustControl(); 366 fixedCellSizePropertyCSSTestCommon(testedControl, Properties.fixedCellSize, Utils.isCaspian() ? 19.4 : 21); 367 } 368 369 @Smoke 370 @Test(timeout = 300000) 371 public void verticalScrollBarBehaviorOnAddingDeletingTest() throws InterruptedException { 372 setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefHeight, 50); 373 assertFalse(findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, false) == null); 374 addElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); 375 assertFalse(findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true) == null); 376 setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefHeight, 500); 377 assertFalse(findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, false) == null); 378 setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefHeight, 50); 379 for (int i = 0; i < 10; i++) { 380 removeFromPos(0); 381 } 382 assertFalse(findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, false) == null); 383 } 384 385 //Test//RT-17538//Test removed, as non actual (bug - is not a bug). 386 public void steadyScrollingTest() throws InterruptedException { 387 setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefHeight, 150); 388 389 addRectangleAtPos(0); 390 addTextFieldAtPos(1); 391 addRectangleAtPos(2); 392 393 Wrap<? extends ScrollBar> sb = findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true); 394 ScrollingChecker sc = new ScrollingChecker(sb.getControl().valueProperty()); 395 testedControl.mouse().move(); 396 for (int i = 0; i < 8; i++) { 397 findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+1); 398 sc.checkChanging(+1); 399 } 400 } 401 402 @Smoke 403 @Test(timeout = 300000) 404 public void scrollAppearingOnResizingTest() throws InterruptedException { 405 setSize(50, 50); 406 checkScrollbarsStates(false, false); 407 408 addRectangleAtPos(0); 409 410 checkScrollbarsStates(true, true); 411 412 setSize(230, 50); 413 checkScrollbarsStates(false, true); 414 415 setSize(50, 225); 416 checkScrollbarsStates(true, false); 417 443 public void eventsCommingTest() throws InterruptedException { 444 addFormAtPos(0); 445 446 setSize(200, 200); 447 448 clickFormButton(); 449 checkFormClickCounter(1); 450 scrollFormScrollBar(-1); 451 checkFormScrollCounter(1); 452 } 453 454 //Test//RT-17701// Test removed, because developers don't want to count size of content, to evaluate scrollBar size propertly. 455 public void scrollBarSize1Test() throws InterruptedException, Throwable { 456 setSize(150, 150); 457 addRectangleAtPos(0); 458 addRectangleAtPos(0); 459 addTextFieldAtPos(1); 460 461 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); 462 463 checkScreenshot("ListView_scrollBarSize1Test_HorizontalScroll_1", findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true)); 464 checkScreenshot("ListView_scrollBarSize1Test_VerticalScroll_1", findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true)); 465 throwScreenshotError(); 466 } 467 468 @ScreenshotCheck 469 @Test(timeout = 300000) //RT-17460 470 public void scrollBarSize2Test() throws InterruptedException, Throwable { 471 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); 472 setSize(200, 210); 473 474 addRectangleAtPos(0); 475 addRectangleAtPos(0); 476 checkScreenshot("ListView_HorizontalScroll_2", findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true)); 477 throwScreenshotError(); 478 } 479 480 @Smoke 481 @Test(timeout = 300000) //RT-17462 482 public void scrollBarDisappearTest() throws InterruptedException { 483 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); 484 setSize(210, 210); 485 486 addRectangleAtPos(0); 487 addRectangleAtPos(0); 488 489 for (int i = 0; i < 100; i++) { 490 findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true).mouse().turnWheel(+1); 491 } 492 493 assertFalse(findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true) == null); 494 } 495 496 @ScreenshotCheck 497 @Smoke 498 @Test(timeout = 300000)//RT-17465 499 public void selectionSavingTest() throws InterruptedException, Throwable { 500 setSize(100, 100); 501 addRectangleAtPos(0); 502 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); 503 testedControl.mouse().click(); 504 505 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.VERTICAL, Properties.orientation); 506 checkScreenshot("ListView_SelectionSavingChecking", testedControl); 507 508 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); 509 checkScreenshot("ListView_SelectionSavingChecking", testedControl); 510 511 throwScreenshotError(); 512 } 513 514 @ScreenshotCheck 515 @Test(timeout = 300000)//RT-17705 516 public void scrollingConfused1Test() throws InterruptedException, Throwable { 517 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); 518 setSize(150, 150); 519 addRectangleAtPos(0); 520 findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true).mouse().turnWheel(+20); 521 522 findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+20); 523 524 checkScreenshot("ListView_ScrollingIssue_1", testedControl); 525 throwScreenshotError(); 526 } 527 528 @ScreenshotCheck 529 @Test(timeout = 300000)//RT-17730 530 public void scrollingConfused2Test() throws InterruptedException, Throwable { 531 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.VERTICAL, Properties.orientation); 532 setSize(150, 150); 533 addRectangleAtPos(0); 534 Thread.sleep(500); 535 536 for (int i = 0; i < 20; i++) { 537 findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true).mouse().turnWheel(+1); 538 } 539 540 for (int i = 0; i < 20; i++) { 541 findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+1); 542 } 543 544 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); 545 findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true).mouse().turnWheel(+20); 546 checkScreenshot("ListView_ScrollingIssue_2", testedControl); 547 throwScreenshotError(); 548 } 549 550 @ScreenshotCheck 551 @Test(timeout = 300000)//RT-17733 552 public void scrollingConfused3Test() throws Throwable { 553 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.VERTICAL, Properties.orientation); 554 setSize(150, 150); 555 addRectangleAtPos(0); 556 557 findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true).mouse().turnWheel(+20); 558 findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+20); 559 checkScreenshot("ListView_ScrollingIssue_3", testedControl); 560 throwScreenshotError(); 561 } 562 563 @Smoke 564 @Test(timeout = 300000)//RT-17522 565 public void addingElementOnFocusPositionTest() { 566 addElements(1, 2, 3, 4, 5, 6, 7); 567 testedControl.mouse().click(); 568 569 testedControl.keyboard().pushKey(KeyboardButtons.DOWN); 570 testedControl.keyboard().pushKey(KeyboardButtons.DOWN); 571 572 checkListener(Listeners.focusedIndex, 1); 573 addElement("0", 0); 574 checkListener(Listeners.focusedIndex, 2); 575 addElement("0", 2); 576 checkListener(Listeners.focusedIndex, 3); 577 addElement("0", 4); 578 checkListener(Listeners.focusedIndex, 3); 579 } 580 581 //Test//RT-17539//Test removed because developers don't count size of content. 582 public void knobSizeChangingTest() throws InterruptedException, Throwable { 583 setSize(150, 150); 584 585 addTextFieldAtPos(0); 586 addRectangleAtPos(1); 587 addElement("0", 2); 588 589 checkScreenshot("ListView_ScrollBarKnobSizeIssue_1", testedControl); 590 591 for (int i = 0; i < 20; i++) { 592 findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+1); 593 } 594 595 checkScreenshot("ListView_ScrollBarKnobSizeIssue_2", testedControl); 596 597 findScrollBar(testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+10); 598 599 checkScreenshot("ListView_ScrollBarKnobSizeIssue_3", testedControl); 600 throwScreenshotError(); 601 } 602 603 @Smoke 604 @Test(timeout = 300000)//RT-18234 - possible 605 public void singleSelectionOnKeyBoardTest() throws InterruptedException, Throwable { 606 addElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); 607 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.MULTIPLE, Properties.selectionMode); 608 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.SINGLE, Properties.selectionMode); 609 setSize(130, 130); 610 611 selectionHelper = new MultipleSelectionHelper(1, DATA_ITEMS_NUM); 612 selectionHelper.setSingleCell(false); 613 selectionHelper.setMultiple(false); 614 615 requestFocusOnControl(testedControl); 616 617 Thread.sleep(SLEEP); 618 619 testedControl.keyboard().pushKey(KeyboardButtons.DOWN); 620 621 Thread.sleep(SLEEP); 622 623 //Testing section 624 try { 625 for (int i = 0; i < 5; i++) { 626 testedControl.keyboard().pushKey(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 627 selectionHelper.push(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 628 checkSelection(); 629 } 630 631 for (int i = 0; i < 3; i++) { 632 testedControl.keyboard().pushKey(KeyboardButtons.UP, CTRL_DOWN_MASK_OS); 633 selectionHelper.push(KeyboardButtons.UP, CTRL_DOWN_MASK_OS); 634 checkSelection(); 635 } 636 637 testedControl.keyboard().pushKey(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 638 testedControl.keyboard().releaseKey(KeyboardButtons.SHIFT); 639 selectionHelper.push(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 640 checkSelection(); 641 // End of testing section 642 } catch (Throwable error) { 643 throw error; 644 } 645 } 646 647 @Smoke 648 @Test(timeout = 300000) 649 public void multipleSelectionCommonLogicOnKeyBoardTest() throws InterruptedException, Throwable { 650 addElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); 651 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.SINGLE, Properties.selectionMode); 652 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.MULTIPLE, Properties.selectionMode); 653 setSize(130, 130); 654 655 selectionHelper = new MultipleSelectionHelper(1, DATA_ITEMS_NUM); 656 selectionHelper.setSingleCell(false); 657 selectionHelper.setMultiple(true); 658 659 requestFocusOnControl(testedControl); 660 661 Thread.sleep(SLEEP); 662 663 testedControl.keyboard().pushKey(KeyboardButtons.DOWN); 664 665 Thread.sleep(SLEEP); 666 667 //Testing section 668 try { 669 for (int i = 0; i < 2; i++) { 670 testedControl.keyboard().pushKey(KeyboardButtons.DOWN); 671 selectionHelper.push(KeyboardButtons.DOWN); 672 } 673 674 for (int i = 0; i < 5; i++) { 675 testedControl.keyboard().pushKey(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 676 selectionHelper.push(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 677 checkSelection(); 678 } 679 //Elements from 2 to 7 are selected 680 681 for (int i = 0; i < 2; i++) { 682 testedControl.keyboard().pushKey(KeyboardButtons.DOWN, CTRL_DOWN_MASK_OS); 683 selectionHelper.push(KeyboardButtons.DOWN, CTRL_DOWN_MASK_OS); 684 checkSelection(); 685 } 686 716 // End of testing section 717 } catch (Throwable error) { 718 throw error; 719 } 720 } 721 722 @Smoke 723 @Test(timeout = 300000) 724 public void ctrlAClickSingleTest() throws InterruptedException, Throwable { 725 addElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); 726 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.MULTIPLE, Properties.selectionMode); 727 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.SINGLE, Properties.selectionMode); 728 setSize(130, 130); 729 730 selectionHelper = new MultipleSelectionHelper(1, DATA_ITEMS_NUM); 731 selectionHelper.setSingleCell(false); 732 selectionHelper.setMultiple(false); 733 734 requestFocusOnControl(testedControl); 735 736 Thread.sleep(SLEEP); 737 738 testedControl.keyboard().pushKey(KeyboardButtons.DOWN); 739 740 Thread.sleep(SLEEP); 741 742 //Testing section 743 try { 744 for (int i = 0; i < 2; i++) { 745 testedControl.keyboard().pushKey(KeyboardButtons.DOWN); 746 selectionHelper.push(KeyboardButtons.DOWN); 747 } 748 749 for (int i = 0; i < 4; i++) { 750 testedControl.keyboard().pushKey(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 751 selectionHelper.push(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 752 checkSelection(); 753 } 754 //Elements from 2 to 6 are selected 755 756 for (int i = 0; i < 2; i++) { 757 testedControl.keyboard().pushKey(KeyboardButtons.DOWN, CTRL_DOWN_MASK_OS); 758 selectionHelper.push(KeyboardButtons.DOWN, CTRL_DOWN_MASK_OS); 759 checkSelection(); 760 } 761 769 // End of testing section 770 } catch (Throwable error) { 771 throw error; 772 } 773 } 774 775 @Smoke 776 @Test(timeout = 300000) 777 public void ctrlAClickMultipleTest() throws InterruptedException, Throwable { 778 addElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); 779 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.SINGLE, Properties.selectionMode); 780 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.MULTIPLE, Properties.selectionMode); 781 setSize(130, 130); 782 783 selectionHelper = new MultipleSelectionHelper(1, 10); 784 selectionHelper.setSingleCell(false); 785 selectionHelper.setMultiple(true); 786 787 requestFocusOnControl(testedControl); 788 789 Thread.sleep(SLEEP); 790 791 testedControl.keyboard().pushKey(KeyboardButtons.DOWN); 792 793 Thread.sleep(SLEEP); 794 795 //Testing section 796 try { 797 for (int i = 0; i < 2; i++) { 798 testedControl.keyboard().pushKey(KeyboardButtons.DOWN); 799 selectionHelper.push(KeyboardButtons.DOWN); 800 } 801 802 for (int i = 0; i < 4; i++) { 803 testedControl.keyboard().pushKey(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 804 selectionHelper.push(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 805 checkSelection(); 806 } 807 //Elements from 2 to 6 are selected 808 809 for (int i = 0; i < 2; i++) { 810 testedControl.keyboard().pushKey(KeyboardButtons.DOWN, CTRL_DOWN_MASK_OS); 811 selectionHelper.push(KeyboardButtons.DOWN, CTRL_DOWN_MASK_OS); 812 checkSelection(); 813 } 814 882 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.MULTIPLE, Properties.selectionMode); 883 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); 884 885 final int elementsCount = 15; 886 addAndSelectElements(elementsCount); 887 888 final int step = 6; 889 checkScreenshotsWithStep("SimpleTest", elementsCount, step); 890 } 891 892 @Test(timeout = 300000)//RT-18234 - possible 893 /** 894 * Add big amount of elements in a list and select some of the according to 895 * some rules. It tries to apply different combinations of keys pushing with 896 * modifiers. A few time in process it tries to check screenshots. 897 */ 898 public void complexSelectionScreenShotTest() throws InterruptedException, Throwable { 899 setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefHeight, 200); 900 setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefWidth, 200); 901 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.MULTIPLE, Properties.selectionMode); 902 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); 903 904 final int elementsCount = 50; 905 addAndSelectElements(elementsCount); 906 final int step = 5; 907 908 for (Orientation orientation : Orientation.values()) { 909 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, orientation, Properties.orientation); 910 Wrap<Text> cellWrap = getCellWrap((Integer) (0)); //mouse will be over the second item. 911 cellWrap.as(Showable.class).shower().show(); 912 cellWrap.mouse().click(1, cellWrap.getClickPoint(), Mouse.MouseButtons.BUTTON1, CTRL_DOWN_MASK_OS); 913 914 KeyboardButtons lessKey = (orientation == Orientation.HORIZONTAL ? KeyboardButtons.LEFT : KeyboardButtons.UP); 915 KeyboardButtons moreKey = (orientation == Orientation.HORIZONTAL ? KeyboardButtons.RIGHT : KeyboardButtons.DOWN); 916 917 applyKeysPushing(2, KeyboardButtons.PAGE_DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 918 applyKeysPushing(1, KeyboardButtons.PAGE_DOWN, CTRL_DOWN_MASK_OS); 919 applyKeysPushing(2, KeyboardButtons.PAGE_UP, KeyboardModifiers.SHIFT_DOWN_MASK); 920 applyKeysPushing(1, KeyboardButtons.PAGE_UP, CTRL_DOWN_MASK_OS); 921 922 applyKeysPushing(15, moreKey, CTRL_DOWN_MASK_OS); 923 for (int i = 0; i < 10; i++) { 924 if (Utils.isMacOS()) { 925 applyKeysPushing(i, KeyboardButtons.SPACE, CTRL_DOWN_MASK_OS, KeyboardModifiers.CTRL_DOWN_MASK); 926 } else { 927 applyKeysPushing(i, KeyboardButtons.SPACE, CTRL_DOWN_MASK_OS); 928 } 929 applyKeysPushing(2, lessKey, CTRL_DOWN_MASK_OS); 930 } 931 applyKeysPushing(5, lessKey, KeyboardModifiers.SHIFT_DOWN_MASK); 932 applyKeysPushing(1, KeyboardButtons.SPACE, KeyboardModifiers.SHIFT_DOWN_MASK); | 222 setPropertyBySlider(SettingType.UNIDIRECTIONAL, Properties.prefWidth, 150); 223 checkTextFieldValue(Properties.prefWidth, 150); 224 225 setPropertyBySlider(SettingType.UNIDIRECTIONAL, Properties.prefWidth, 50); 226 checkTextFieldValue(Properties.prefWidth, 50); 227 } 228 229 // SITUATIONAL TESTS 230 @Smoke 231 @Test(timeout = 300000) 232 public void keyboardRangeMultipleSelection2Test() throws Throwable { 233 addElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); 234 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.MULTIPLE, Properties.selectionMode); 235 KeyboardButtons CTRL_OS = Utils.isMacOS() ? KeyboardButtons.META : KeyboardButtons.CONTROL; 236 237 selectionHelper = new MultipleSelectionHelper(1, DATA_ITEMS_NUM); 238 selectionHelper.setMultiple(true); 239 240 requestFocusOnControl(testedControl); 241 242 testedControl.keyboard().pressKey(KeyboardButtons.SHIFT); 243 try { 244 for (int i = 1; i < 5; i++) { 245 testedControl.keyboard().pushKey(KeyboardButtons.DOWN); 246 selectionHelper.push(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 247 checkSelection(); 248 } 249 } finally { 250 testedControl.keyboard().releaseKey(KeyboardButtons.SHIFT); 251 } 252 253 testedControl.keyboard().pressKey(CTRL_OS); 254 try { 255 for (int i = 1; i < 5; i++) { 256 testedControl.keyboard().pushKey(KeyboardButtons.DOWN); 257 selectionHelper.push(KeyboardButtons.DOWN, CTRL_DOWN_MASK_OS); 258 checkSelection(); 259 } 260 } finally { 261 testedControl.keyboard().releaseKey(CTRL_OS); 295 296 setSize(50, 50); 297 for (Orientation orientation : Orientation.values()) { 298 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, orientation, Properties.orientation); 299 300 scrollTo(size); 301 checkScrollingState(1, false, true, size, orientation); 302 303 scrollTo(0); 304 checkScrollingState(0, true, false, size, orientation); 305 306 scrollTo(size * 2); 307 checkScrollingState(1, false, true, size, orientation); 308 309 scrollTo(-size); 310 checkScrollingState(0, true, false, size, orientation); 311 } 312 } 313 314 private void checkScrollingState(final double scrollValue, boolean beginVisible, boolean endVisible, int size, final Orientation orientation) { 315 //assertEquals(findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), orientation, true).getControl().getValue(), scrollValue, 0.01); 316 testedControl.waitState(new State() { 317 public Object reached() { 318 Wrap<? extends ScrollBar> sb = findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), orientation, true); 319 if (Math.abs(sb.getControl().getValue() - scrollValue) < 0.01) { 320 return true; 321 } else { 322 return null; 323 } 324 } 325 }); 326 327 if (beginVisible) { 328 assertTrue(isCellShown(0, orientation)); 329 } 330 if (endVisible) { 331 assertTrue(isCellShown(size, orientation)); 332 } 333 } 334 335 private boolean isCellShown(final int item, Orientation orientation) { 336 Wrap<Text> cellWrap = getCellWrap(item); 337 Rectangle cellRect = cellWrap.getScreenBounds(); 338 Rectangle control = testedControl.getScreenBounds(); 351 } 352 353 @Smoke 354 @Test(timeout = 30000) 355 public void fixedCellSizePropertyTest() throws InterruptedException { 356 adjustControl(); 357 fixedCellSizePropertyTestCommon(testedControl, Properties.fixedCellSize, Utils.isCaspian() ? 19.4 : 21); 358 } 359 360 @Smoke 361 @Test(timeout = 30000) 362 public void fixedCellSizePropertyCSSTest() { 363 adjustControl(); 364 fixedCellSizePropertyCSSTestCommon(testedControl, Properties.fixedCellSize, Utils.isCaspian() ? 19.4 : 21); 365 } 366 367 @Smoke 368 @Test(timeout = 300000) 369 public void verticalScrollBarBehaviorOnAddingDeletingTest() throws InterruptedException { 370 setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefHeight, 50); 371 assertFalse(findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, false) == null); 372 addElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); 373 assertFalse(findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true) == null); 374 setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefHeight, 500); 375 assertFalse(findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, false) == null); 376 setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefHeight, 50); 377 for (int i = 0; i < 10; i++) { 378 removeFromPos(0); 379 } 380 assertFalse(findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, false) == null); 381 } 382 383 //Test//RT-17538//Test removed, as non actual (bug - is not a bug). 384 public void steadyScrollingTest() throws InterruptedException { 385 setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefHeight, 150); 386 387 addRectangleAtPos(0); 388 addTextFieldAtPos(1); 389 addRectangleAtPos(2); 390 391 Wrap<? extends ScrollBar> sb = findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true); 392 ScrollingChecker sc = new ScrollingChecker(sb.getControl().valueProperty()); 393 testedControl.mouse().move(); 394 for (int i = 0; i < 8; i++) { 395 findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+1); 396 sc.checkChanging(+1); 397 } 398 } 399 400 @Smoke 401 @Test(timeout = 300000) 402 public void scrollAppearingOnResizingTest() throws InterruptedException { 403 setSize(50, 50); 404 checkScrollbarsStates(false, false); 405 406 addRectangleAtPos(0); 407 408 checkScrollbarsStates(true, true); 409 410 setSize(230, 50); 411 checkScrollbarsStates(false, true); 412 413 setSize(50, 225); 414 checkScrollbarsStates(true, false); 415 441 public void eventsCommingTest() throws InterruptedException { 442 addFormAtPos(0); 443 444 setSize(200, 200); 445 446 clickFormButton(); 447 checkFormClickCounter(1); 448 scrollFormScrollBar(-1); 449 checkFormScrollCounter(1); 450 } 451 452 //Test//RT-17701// Test removed, because developers don't want to count size of content, to evaluate scrollBar size propertly. 453 public void scrollBarSize1Test() throws InterruptedException, Throwable { 454 setSize(150, 150); 455 addRectangleAtPos(0); 456 addRectangleAtPos(0); 457 addTextFieldAtPos(1); 458 459 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); 460 461 checkScreenshot("ListView_scrollBarSize1Test_HorizontalScroll_1", findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true)); 462 checkScreenshot("ListView_scrollBarSize1Test_VerticalScroll_1", findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true)); 463 throwScreenshotError(); 464 } 465 466 @ScreenshotCheck 467 @Test(timeout = 300000) //RT-17460 468 public void scrollBarSize2Test() throws InterruptedException, Throwable { 469 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); 470 setSize(200, 210); 471 472 addRectangleAtPos(0); 473 addRectangleAtPos(0); 474 checkScreenshot("ListView_HorizontalScroll_2", findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true)); 475 throwScreenshotError(); 476 } 477 478 @Smoke 479 @Test(timeout = 300000) //RT-17462 480 public void scrollBarDisappearTest() throws InterruptedException { 481 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); 482 setSize(210, 210); 483 484 addRectangleAtPos(0); 485 addRectangleAtPos(0); 486 487 for (int i = 0; i < 100; i++) { 488 findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true).mouse().turnWheel(+1); 489 } 490 491 assertFalse(findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true) == null); 492 } 493 494 @ScreenshotCheck 495 @Smoke 496 @Test(timeout = 300000)//RT-17465 497 public void selectionSavingTest() throws InterruptedException, Throwable { 498 setSize(100, 100); 499 addRectangleAtPos(0); 500 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); 501 testedControl.mouse().click(); 502 503 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.VERTICAL, Properties.orientation); 504 checkScreenshot("ListView_SelectionSavingChecking", testedControl); 505 506 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); 507 checkScreenshot("ListView_SelectionSavingChecking", testedControl); 508 509 throwScreenshotError(); 510 } 511 512 @ScreenshotCheck 513 @Test(timeout = 300000)//RT-17705 514 public void scrollingConfused1Test() throws InterruptedException, Throwable { 515 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); 516 setSize(150, 150); 517 addRectangleAtPos(0); 518 int scroll_value = Utils.isMacOS() ? -20 : +20; 519 findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true).mouse().turnWheel(scroll_value); 520 521 findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(scroll_value); 522 523 checkScreenshot("ListView_ScrollingIssue_1", testedControl); 524 throwScreenshotError(); 525 } 526 527 @ScreenshotCheck 528 @Test(timeout = 300000)//RT-17730 529 public void scrollingConfused2Test() throws InterruptedException, Throwable { 530 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.VERTICAL, Properties.orientation); 531 setSize(150, 150); 532 addRectangleAtPos(0); 533 Thread.sleep(500); 534 535 for (int i = 0; i < 20; i++) { 536 findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true).mouse().turnWheel(+1); 537 } 538 539 for (int i = 0; i < 20; i++) { 540 findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+1); 541 } 542 543 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); 544 findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true).mouse().turnWheel(+20); 545 checkScreenshot("ListView_ScrollingIssue_2", testedControl); 546 throwScreenshotError(); 547 } 548 549 @ScreenshotCheck 550 @Test(timeout = 300000)//RT-17733 551 public void scrollingConfused3Test() throws Throwable { 552 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.VERTICAL, Properties.orientation); 553 setSize(150, 150); 554 addRectangleAtPos(0); 555 556 findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.HORIZONTAL, true).mouse().turnWheel(+20); 557 findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+20); 558 checkScreenshot("ListView_ScrollingIssue_3", testedControl); 559 throwScreenshotError(); 560 } 561 562 @Smoke 563 @Test(timeout = 300000)//RT-17522 564 public void addingElementOnFocusPositionTest() { 565 addElements(1, 2, 3, 4, 5, 6, 7); 566 testedControl.mouse().click(); 567 568 testedControl.keyboard().pushKey(KeyboardButtons.DOWN); 569 testedControl.keyboard().pushKey(KeyboardButtons.DOWN); 570 571 checkListener(Listeners.focusedIndex, 2); 572 addElement("0", 0); 573 checkListener(Listeners.focusedIndex, 3); 574 addElement("0", 2); 575 checkListener(Listeners.focusedIndex, 4); 576 addElement("0", 4); 577 checkListener(Listeners.focusedIndex, 5); 578 } 579 580 //Test//RT-17539//Test removed because developers don't count size of content. 581 public void knobSizeChangingTest() throws InterruptedException, Throwable { 582 setSize(150, 150); 583 584 addTextFieldAtPos(0); 585 addRectangleAtPos(1); 586 addElement("0", 2); 587 588 checkScreenshot("ListView_ScrollBarKnobSizeIssue_1", testedControl); 589 590 for (int i = 0; i < 20; i++) { 591 findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+1); 592 } 593 594 checkScreenshot("ListView_ScrollBarKnobSizeIssue_2", testedControl); 595 596 findScrollBar((Parent<Node>) testedControl.as(Parent.class, Node.class), Orientation.VERTICAL, true).mouse().turnWheel(+10); 597 598 checkScreenshot("ListView_ScrollBarKnobSizeIssue_3", testedControl); 599 throwScreenshotError(); 600 } 601 602 @Smoke 603 @Test(timeout = 300000)//RT-18234 - possible 604 public void singleSelectionOnKeyBoardTest() throws InterruptedException, Throwable { 605 addElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); 606 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.MULTIPLE, Properties.selectionMode); 607 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.SINGLE, Properties.selectionMode); 608 setSize(130, 130); 609 610 selectionHelper = new MultipleSelectionHelper(1, DATA_ITEMS_NUM); 611 selectionHelper.setSingleCell(false); 612 selectionHelper.setMultiple(false); 613 614 requestFocusOnControl(testedControl); 615 616 //Testing section 617 try { 618 for (int i = 0; i < 5; i++) { 619 testedControl.keyboard().pushKey(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 620 selectionHelper.push(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 621 checkSelection(); 622 } 623 624 for (int i = 0; i < 3; i++) { 625 testedControl.keyboard().pushKey(KeyboardButtons.UP, CTRL_DOWN_MASK_OS); 626 selectionHelper.push(KeyboardButtons.UP, CTRL_DOWN_MASK_OS); 627 checkSelection(); 628 } 629 630 testedControl.keyboard().pushKey(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 631 testedControl.keyboard().releaseKey(KeyboardButtons.SHIFT); 632 selectionHelper.push(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 633 checkSelection(); 634 // End of testing section 635 } catch (Throwable error) { 636 throw error; 637 } 638 } 639 640 @Smoke 641 @Test(timeout = 300000) 642 public void multipleSelectionCommonLogicOnKeyBoardTest() throws InterruptedException, Throwable { 643 addElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); 644 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.SINGLE, Properties.selectionMode); 645 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.MULTIPLE, Properties.selectionMode); 646 setSize(130, 130); 647 648 selectionHelper = new MultipleSelectionHelper(1, 10); 649 selectionHelper.setSingleCell(false); 650 selectionHelper.setMultiple(true); 651 652 requestFocusOnControl(testedControl); 653 654 //Testing section 655 try { 656 for (int i = 0; i < 2; i++) { 657 testedControl.keyboard().pushKey(KeyboardButtons.DOWN); 658 selectionHelper.push(KeyboardButtons.DOWN); 659 } 660 661 for (int i = 0; i < 5; i++) { 662 testedControl.keyboard().pushKey(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 663 selectionHelper.push(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 664 checkSelection(); 665 } 666 //Elements from 2 to 7 are selected 667 668 for (int i = 0; i < 2; i++) { 669 testedControl.keyboard().pushKey(KeyboardButtons.DOWN, CTRL_DOWN_MASK_OS); 670 selectionHelper.push(KeyboardButtons.DOWN, CTRL_DOWN_MASK_OS); 671 checkSelection(); 672 } 673 703 // End of testing section 704 } catch (Throwable error) { 705 throw error; 706 } 707 } 708 709 @Smoke 710 @Test(timeout = 300000) 711 public void ctrlAClickSingleTest() throws InterruptedException, Throwable { 712 addElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); 713 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.MULTIPLE, Properties.selectionMode); 714 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.SINGLE, Properties.selectionMode); 715 setSize(130, 130); 716 717 selectionHelper = new MultipleSelectionHelper(1, DATA_ITEMS_NUM); 718 selectionHelper.setSingleCell(false); 719 selectionHelper.setMultiple(false); 720 721 requestFocusOnControl(testedControl); 722 723 //Testing section 724 try { 725 for (int i = 0; i < 2; i++) { 726 testedControl.keyboard().pushKey(KeyboardButtons.DOWN); 727 selectionHelper.push(KeyboardButtons.DOWN); 728 } 729 730 for (int i = 0; i < 4; i++) { 731 testedControl.keyboard().pushKey(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 732 selectionHelper.push(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 733 checkSelection(); 734 } 735 //Elements from 2 to 6 are selected 736 737 for (int i = 0; i < 2; i++) { 738 testedControl.keyboard().pushKey(KeyboardButtons.DOWN, CTRL_DOWN_MASK_OS); 739 selectionHelper.push(KeyboardButtons.DOWN, CTRL_DOWN_MASK_OS); 740 checkSelection(); 741 } 742 750 // End of testing section 751 } catch (Throwable error) { 752 throw error; 753 } 754 } 755 756 @Smoke 757 @Test(timeout = 300000) 758 public void ctrlAClickMultipleTest() throws InterruptedException, Throwable { 759 addElements(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); 760 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.SINGLE, Properties.selectionMode); 761 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.MULTIPLE, Properties.selectionMode); 762 setSize(130, 130); 763 764 selectionHelper = new MultipleSelectionHelper(1, 10); 765 selectionHelper.setSingleCell(false); 766 selectionHelper.setMultiple(true); 767 768 requestFocusOnControl(testedControl); 769 770 //Testing section 771 try { 772 for (int i = 0; i < 2; i++) { 773 testedControl.keyboard().pushKey(KeyboardButtons.DOWN); 774 selectionHelper.push(KeyboardButtons.DOWN); 775 } 776 777 for (int i = 0; i < 4; i++) { 778 testedControl.keyboard().pushKey(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 779 selectionHelper.push(KeyboardButtons.DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 780 checkSelection(); 781 } 782 //Elements from 2 to 6 are selected 783 784 for (int i = 0; i < 2; i++) { 785 testedControl.keyboard().pushKey(KeyboardButtons.DOWN, CTRL_DOWN_MASK_OS); 786 selectionHelper.push(KeyboardButtons.DOWN, CTRL_DOWN_MASK_OS); 787 checkSelection(); 788 } 789 857 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.MULTIPLE, Properties.selectionMode); 858 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); 859 860 final int elementsCount = 15; 861 addAndSelectElements(elementsCount); 862 863 final int step = 6; 864 checkScreenshotsWithStep("SimpleTest", elementsCount, step); 865 } 866 867 @Test(timeout = 300000)//RT-18234 - possible 868 /** 869 * Add big amount of elements in a list and select some of the according to 870 * some rules. It tries to apply different combinations of keys pushing with 871 * modifiers. A few time in process it tries to check screenshots. 872 */ 873 public void complexSelectionScreenShotTest() throws InterruptedException, Throwable { 874 setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefHeight, 200); 875 setPropertyBySlider(SettingType.BIDIRECTIONAL, Properties.prefWidth, 200); 876 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, SelectionMode.MULTIPLE, Properties.selectionMode); 877 selectionHelper.setMultiple(true); 878 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, Orientation.HORIZONTAL, Properties.orientation); 879 880 final int elementsCount = 50; 881 addAndSelectElements(elementsCount); 882 final int step = 5; 883 884 for (Orientation orientation : Orientation.values()) { 885 setPropertyByChoiceBox(SettingType.BIDIRECTIONAL, orientation, Properties.orientation); 886 Wrap<Text> cellWrap = getCellWrap((Integer) (0)); //mouse will be over the second item. 887 cellWrap.as(Showable.class).shower().show(); 888 cellWrap.mouse().click(1, cellWrap.getClickPoint(), Mouse.MouseButtons.BUTTON1, CTRL_DOWN_MASK_OS); 889 selectionHelper.click(0, 0, KeyboardButtons.CONTROL); 890 checkSelection(); 891 892 KeyboardButtons lessKey = (orientation == Orientation.HORIZONTAL ? KeyboardButtons.LEFT : KeyboardButtons.UP); 893 KeyboardButtons moreKey = (orientation == Orientation.HORIZONTAL ? KeyboardButtons.RIGHT : KeyboardButtons.DOWN); 894 895 applyKeysPushing(2, KeyboardButtons.PAGE_DOWN, KeyboardModifiers.SHIFT_DOWN_MASK); 896 applyKeysPushing(1, KeyboardButtons.PAGE_DOWN, CTRL_DOWN_MASK_OS); 897 applyKeysPushing(2, KeyboardButtons.PAGE_UP, KeyboardModifiers.SHIFT_DOWN_MASK); 898 applyKeysPushing(1, KeyboardButtons.PAGE_UP, CTRL_DOWN_MASK_OS); 899 900 applyKeysPushing(15, moreKey, CTRL_DOWN_MASK_OS); 901 for (int i = 0; i < 10; i++) { 902 if (Utils.isMacOS()) { 903 applyKeysPushing(i, KeyboardButtons.SPACE, CTRL_DOWN_MASK_OS, KeyboardModifiers.CTRL_DOWN_MASK); 904 } else { 905 applyKeysPushing(i, KeyboardButtons.SPACE, CTRL_DOWN_MASK_OS); 906 } 907 applyKeysPushing(2, lessKey, CTRL_DOWN_MASK_OS); 908 } 909 applyKeysPushing(5, lessKey, KeyboardModifiers.SHIFT_DOWN_MASK); 910 applyKeysPushing(1, KeyboardButtons.SPACE, KeyboardModifiers.SHIFT_DOWN_MASK); |