Exemplo n.º 1
0
 /** Test keyboard navigation using ARROW_RIGHT and ARROW_LEFT */
 @Test
 public void testKeyboardLeftRight() {
   testNextPreviousEvent(
       () -> KEYBOARD.pressShortcut(Keystrokes.RIGHT),
       () -> KEYBOARD.pressShortcut(Keystrokes.SHIFT, Keystrokes.RIGHT),
       () -> KEYBOARD.pressShortcut(Keystrokes.LEFT),
       () -> KEYBOARD.pressShortcut(Keystrokes.SHIFT, Keystrokes.LEFT));
 }
  @Test
  public void testCreateNewDawnEditorWrongResourceName() throws Exception {
    getBot().menu("File").menu("New").menu("Other...").click();

    SWTBotShell shell = getBot().shell("New");
    shell.activate();
    getBot().tree().expandNode("Dawn Examples").select(DawnAcoreTestUtil.CREATION_WIZARD_NAME_EMF);
    getBot().button("Next >").click();

    shell = getBot().shell("New");
    shell.activate();

    SWTBotText fileSemanticNameLabel = getBot().textWithLabel(resourceFieldLabel);
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    Keyboard keyboard = KeyboardFactory.getDefaultKeyboard(fileSemanticNameLabel.widget, null);
    fileSemanticNameLabel.setFocus();
    fileSemanticNameLabel.setText("x");
    // fileSemanticNameLabel.typeText("x", 500);
    keyboard.pressShortcut(Keystrokes.BS);

    assertEquals(false, getBot().button("Next >").isEnabled());
    getBot().button("Cancel").click();
  }