Changeset 347 for trunk/tests


Ignore:
Timestamp:
10/06/08 14:14:08 (16 years ago)
Author:
ra33
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/org/expeditee/gui/FrameKeyboardsActionsTest.java

    r337 r347  
    66import org.expeditee.items.Item;
    77
    8 
    98public class FrameKeyboardsActionsTest extends GuiTestCase {
     9       
     10        public static int DELAY = 200;
    1011
    1112        public final void testTypeText() throws Exception {
     
    1314                DisplayIO.typeKey(KeyEvent.VK_ESCAPE);
    1415                DisplayIO.typeText("hello");
    15                 //Pick the item up in the middle
     16                // Pick the item up in the middle
    1617                Item currentItem = FrameUtils.getCurrentItem();
    1718                assertNotNull(currentItem);
    18                 DisplayIO.setCursorPosition(currentItem.getX() + currentItem.getWidth() / 2, FrameMouseActions.MouseY);
     19                DisplayIO.setCursorPosition(currentItem.getX()
     20                                + currentItem.getBoundsWidth() / 2,
     21                                FrameMouseActions.MouseY - 2);
     22                Thread.sleep(DELAY);
    1923                DisplayIO.clickMouse(InputEvent.BUTTON2_MASK);
     24                Thread.sleep(DELAY);
     25                DisplayIO.setCursorPosition(
     26                                Math.round(FrameGraphics.getMaxFrameSize().getWidth() / 2),
     27                                FrameMouseActions.MouseY);
     28                Thread.sleep(DELAY);
    2029                DisplayIO.typeKey(KeyEvent.VK_ESCAPE);
     30                Thread.sleep(DELAY);
    2131                DisplayIO.clickMouse(InputEvent.BUTTON2_MASK);
    22                
    23                 //Check that the current position is the origin of the item
     32                Thread.sleep(DELAY);
     33
     34                // Check that the current position is the origin of the item
    2435                assertEquals(currentItem.getX(), FrameMouseActions.getX());
    25                
    26                 DisplayIO.typeStringDirect(0.025, "Hello Again!");
    27                
     36
    2837                DisplayIO.typeKey(KeyEvent.VK_ESCAPE);
    29                
     38
     39                DisplayIO.typeStringDirect(0.05, "Hello Again!");
     40
     41                DisplayIO.typeKey(KeyEvent.VK_ESCAPE);
     42
    3043                DisplayIO.typeText("Hello Again");
    31                
     44
    3245                assertEquals(4, testFrame.getItems(false).size());
    33                
     46
    3447        }
    3548}
Note: See TracChangeset for help on using the changeset viewer.