Changeset 347 for trunk/tests
- Timestamp:
- 10/06/08 14:14:08 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/org/expeditee/gui/FrameKeyboardsActionsTest.java
r337 r347 6 6 import org.expeditee.items.Item; 7 7 8 9 8 public class FrameKeyboardsActionsTest extends GuiTestCase { 9 10 public static int DELAY = 200; 10 11 11 12 public final void testTypeText() throws Exception { … … 13 14 DisplayIO.typeKey(KeyEvent.VK_ESCAPE); 14 15 DisplayIO.typeText("hello"); 15 // Pick the item up in the middle16 // Pick the item up in the middle 16 17 Item currentItem = FrameUtils.getCurrentItem(); 17 18 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); 19 23 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); 20 29 DisplayIO.typeKey(KeyEvent.VK_ESCAPE); 30 Thread.sleep(DELAY); 21 31 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 24 35 assertEquals(currentItem.getX(), FrameMouseActions.getX()); 25 26 DisplayIO.typeStringDirect(0.025, "Hello Again!"); 27 36 28 37 DisplayIO.typeKey(KeyEvent.VK_ESCAPE); 29 38 39 DisplayIO.typeStringDirect(0.05, "Hello Again!"); 40 41 DisplayIO.typeKey(KeyEvent.VK_ESCAPE); 42 30 43 DisplayIO.typeText("Hello Again"); 31 44 32 45 assertEquals(4, testFrame.getItems(false).size()); 33 46 34 47 } 35 48 }
Note:
See TracChangeset
for help on using the changeset viewer.