mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
gui-tests-framework: SimpleGitTest fixes
This commit is contained in:
+12
@@ -20,6 +20,8 @@ import com.intellij.diagnostic.MessagePool;
|
||||
import com.intellij.ide.GeneralSettings;
|
||||
import com.intellij.ide.PrivacyPolicy;
|
||||
import com.intellij.ide.RecentProjectsManager;
|
||||
import com.intellij.openapi.actionSystem.ActionManager;
|
||||
import com.intellij.openapi.actionSystem.KeyboardShortcut;
|
||||
import com.intellij.openapi.application.ApplicationBundle;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ApplicationNamesInfo;
|
||||
@@ -848,4 +850,14 @@ public final class GuiTestUtil {
|
||||
LOG.info("Invoking action via shortcut " + shortcut);
|
||||
robot.pressAndReleaseKey(keyStroke.getKeyCode(), new int[]{keyStroke.getModifiers()});
|
||||
}
|
||||
|
||||
public static void invokeAction(@NotNull Robot robot, @NotNull String actionId) {
|
||||
|
||||
KeyboardShortcut keyboardShortcut = ActionManager.getInstance().getKeyboardShortcut(actionId);
|
||||
|
||||
assert keyboardShortcut != null;
|
||||
KeyStroke keyStroke = keyboardShortcut.getFirstKeyStroke();
|
||||
LOG.info("Invoking action \"" + actionId +"\" via shortcut " + keyboardShortcut.toString());
|
||||
robot.pressAndReleaseKey(keyStroke.getKeyCode(), new int[]{keyStroke.getModifiers()});
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -47,7 +47,7 @@ public class SimpleGitTest extends GuiTestCase {
|
||||
ProjectViewFixture.NodeFixture src = projectPane.selectByPath(projectName, "src");
|
||||
|
||||
//invoke "New..." action
|
||||
GuiTestUtil.invokeActionViaShortcut(myRobot, "control N");
|
||||
GuiTestUtil.invokeAction(myRobot, "NewElement");
|
||||
//select first element (Java class)
|
||||
myRobot.pressAndReleaseKey(KeyEvent.VK_ENTER);
|
||||
|
||||
@@ -61,9 +61,9 @@ public class SimpleGitTest extends GuiTestCase {
|
||||
fileChooserDialogFixture.select(ideFrameFixture.getProject().getBaseDir()).clickOk();
|
||||
Pause.pause(GuiTestUtil.THIRTY_SEC_TIMEOUT.duration()); //wait when file will be added to commit
|
||||
|
||||
GuiTestUtil.invokeActionViaShortcut(myRobot, "alt meta A");
|
||||
GuiTestUtil.invokeAction(myRobot, "ChangesView.AddUnversioned");
|
||||
waitForIdle();
|
||||
GuiTestUtil.invokeActionViaShortcut(myRobot, "meta K");
|
||||
GuiTestUtil.invokeAction(myRobot, "CheckinProject");
|
||||
|
||||
DialogFixture commitDialogFixture = DialogFixture.find(myRobot, VcsBundle.message("commit.dialog.title"));
|
||||
myRobot.enterText("initial commit");
|
||||
|
||||
Reference in New Issue
Block a user