From a89512ac83238ca1b81a88ac8df709dae5494da0 Mon Sep 17 00:00:00 2001 From: Sergey Karashevich Date: Fri, 30 Sep 2016 12:48:37 +0300 Subject: [PATCH] gui-tests-framework: change start IdeTestApplication from GuiTestCase method to a proper annotation; cleanup --- .../framework/GuiTestBase.java | 2 - .../framework/GuiTestRunner.java | 18 +--- .../framework/ScriptingAPI.kt | 49 --------- .../framework/TestWithIde.java} | 23 ++-- .../testGuiFramework/impl/GuiTestCase.java | 9 +- ...plicationImpl.java => IdeaGuiTestApp.java} | 6 +- .../testGuiFramework/tests/GitGuiTest.kt | 4 +- .../tests/JavaGitGuiTest.java | 101 ------------------ .../testGuiFramework/tests/JavaProjectTest.kt | 87 --------------- .../tests/NewProjectTest.java | 93 ---------------- .../testGuiFramework/tests/ShortGuiTest.kt | 40 ------- .../tests/SimpleApplicationImportTest.kt | 32 ------ .../testGuiFramework/tests/SimpleGitTest.java | 11 -- 13 files changed, 19 insertions(+), 456 deletions(-) delete mode 100644 platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/ScriptingAPI.kt rename platform/testGuiFramework/{testSrc/com/intellij/testGuiFramework/tests/CurrentTest.kt => src/com/intellij/testGuiFramework/framework/TestWithIde.java} (65%) rename platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/{IdeTestApplicationImpl.java => IdeaGuiTestApp.java} (98%) delete mode 100644 platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/JavaGitGuiTest.java delete mode 100644 platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/JavaProjectTest.kt delete mode 100644 platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/NewProjectTest.java delete mode 100644 platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/ShortGuiTest.kt delete mode 100644 platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/SimpleApplicationImportTest.kt diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/GuiTestBase.java b/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/GuiTestBase.java index 6ecca6b4c567..0fe432d732df 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/GuiTestBase.java +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/GuiTestBase.java @@ -343,6 +343,4 @@ public abstract class GuiTestBase { }); } - public abstract Class getIdeTestApplicationClass(); - } \ No newline at end of file diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/GuiTestRunner.java b/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/GuiTestRunner.java index 8bd2d9dc5e47..5c932c25e380 100755 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/GuiTestRunner.java +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/GuiTestRunner.java @@ -36,7 +36,6 @@ import java.awt.*; import java.lang.management.GarbageCollectorMXBean; import java.lang.management.ManagementFactory; import java.lang.management.MemoryMXBean; -import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.text.SimpleDateFormat; import java.util.Date; @@ -60,22 +59,7 @@ public class GuiTestRunner extends BlockJUnit4ClassRunner { Class guiTestCaseClass = testClass.getSuperclass(); //check test extends GuiTestBase guiTestCaseClass.isInstance(GuiTestBase.class); - try { - myIdeTestApplicationClass = (Class)guiTestCaseClass.getMethod("getIdeTestApplicationClass") - .invoke(guiTestCaseClass.newInstance()); - } - catch (NoSuchMethodException e) { - e.printStackTrace(); - } - catch (InstantiationException e) { - e.printStackTrace(); - } - catch (IllegalAccessException e) { - e.printStackTrace(); - } - catch (InvocationTargetException e) { - e.printStackTrace(); - } + myIdeTestApplicationClass = guiTestCaseClass.getAnnotation(TestWithIde.class).value(); myScreenshotTaker = canRunGuiTests() ? new ScreenshotTaker() : null; diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/ScriptingAPI.kt b/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/ScriptingAPI.kt deleted file mode 100644 index 797ef5b3a3e8..000000000000 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/ScriptingAPI.kt +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.testGuiFramework.framework - -import com.intellij.testGuiFramework.impl.GuiTestCase -import com.intellij.ui.components.JBList -import org.fest.swing.core.Robot -import org.fest.swing.fixture.JListFixture -import org.fest.swing.timing.Condition -import org.fest.swing.timing.Pause -import java.awt.Container - -/** - We presume that IDEA is already started, shows "Welcome dialog" and we could create a new project - - !!UNFINISHED!! -**/ - - -fun GuiTestCase.createNewProject(): com.intellij.testGuiFramework.fixtures.WelcomeFrameFixture { - return findWelcomeFrame().createNewProject() -} - -fun pause(time: Long, root: Robot) { - Pause.pause(object : Condition("Wait for user actions") { - override fun test(): Boolean { - return false - } - }, time) - -} - -fun clickListItem(itemName: String, robot: Robot, parentContainer: Container) { - val listFixture = JListFixture(robot, robot.finder().findByType(parentContainer, JBList::class.java, true)) - listFixture.clickItem(itemName) -} \ No newline at end of file diff --git a/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/CurrentTest.kt b/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/TestWithIde.java similarity index 65% rename from platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/CurrentTest.kt rename to platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/TestWithIde.java index edc7f88624ad..0abb6c2f87b3 100644 --- a/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/CurrentTest.kt +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/framework/TestWithIde.java @@ -13,21 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.testGuiFramework.tests +package com.intellij.testGuiFramework.framework; -import com.intellij.testGuiFramework.impl.GuiTestCase -import org.junit.Test +import java.lang.annotation.*; /** * @author Sergey Karashevich */ -class CurrentTest: GuiTestCase(){ - @Test - fun testMe() { - val ideFrame = findIdeFrame() - ideFrame.waitForBackgroundTasksToFinish() - - ideFrame.editor.enterText("Hello!") - } -} +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Inherited +public @interface TestWithIde { + /** + * @return a IdeTestApplication class (must have a getInstance() method that runs apropriate IDE) + */ + Class value(); +} \ No newline at end of file diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestCase.java b/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestCase.java index 8fc09387849b..c3eb876963c5 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestCase.java +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/GuiTestCase.java @@ -16,7 +16,7 @@ package com.intellij.testGuiFramework.impl; import com.intellij.testGuiFramework.framework.GuiTestBase; -import com.intellij.testGuiFramework.framework.IdeTestApplication; +import com.intellij.testGuiFramework.framework.TestWithIde; import com.intellij.util.net.HttpConfigurable; import org.fest.swing.core.FastRobot; @@ -26,6 +26,7 @@ import static com.intellij.testGuiFramework.framework.GuiTestUtil.setUpSdks; /** * @author Sergey Karashevich */ +@TestWithIde(IdeaGuiTestApp.class) public class GuiTestCase extends GuiTestBase { public GuiTestCase() { @@ -43,12 +44,6 @@ public class GuiTestCase extends GuiTestBase { setUpSdks(); } - @Override - public Class getIdeTestApplicationClass() { - return IdeTestApplicationImpl.class; - } - - private static void setIdeSettings() { // Clear HTTP proxy settings, in case a test changed them. HttpConfigurable ideSettings = HttpConfigurable.getInstance(); diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/IdeTestApplicationImpl.java b/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/IdeaGuiTestApp.java similarity index 98% rename from platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/IdeTestApplicationImpl.java rename to platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/IdeaGuiTestApp.java index 5ec200a485e4..284aa4c601e3 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/IdeTestApplicationImpl.java +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/impl/IdeaGuiTestApp.java @@ -49,7 +49,7 @@ import static com.intellij.util.ui.UIUtil.initDefaultLAF; import static org.fest.reflect.core.Reflection.method; import static org.junit.Assert.assertNotNull; -public class IdeTestApplicationImpl extends IdeTestApplication implements Disposable { +public class IdeaGuiTestApp extends IdeTestApplication implements Disposable { private static final Logger LOG = Logger.getInstance(IdeTestApplication.class); private static final String PROPERTY_IGNORE_CLASSPATH = "ignore.classpath"; private static final String PROPERTY_ALLOW_BOOTSTRAP_RESOURCES = "idea.allow.bootstrap.resources"; @@ -69,7 +69,7 @@ public class IdeTestApplicationImpl extends IdeTestApplication implements Dispos System.setProperty("idea.test.guimode", "true"); if (!isLoaded()) { - ourInstance = new IdeTestApplicationImpl(); + ourInstance = new IdeaGuiTestApp(); recreateDirectory(configDirPath); File newProjectsRootDirPath = getProjectCreationDirPath(); @@ -96,7 +96,7 @@ public class IdeTestApplicationImpl extends IdeTestApplication implements Dispos ensureExists(path); } - private IdeTestApplicationImpl() throws Exception { + private IdeaGuiTestApp() throws Exception { String[] args = EMPTY_STRING_ARRAY; LOG.assertTrue(ourInstance == null, "Only one instance allowed."); diff --git a/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/GitGuiTest.kt b/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/GitGuiTest.kt index 9b531c3324f6..745181db6abd 100644 --- a/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/GitGuiTest.kt +++ b/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/GitGuiTest.kt @@ -26,6 +26,7 @@ import com.intellij.ui.EditorComboBox import org.fest.swing.edt.GuiActionRunner import org.fest.swing.edt.GuiTask import org.fest.swing.fixture.DialogFixture +import org.junit.Ignore import org.junit.Test /** @@ -33,7 +34,7 @@ import org.junit.Test */ class GitGuiTest : GuiTestCase() { - @Test + @Test @Ignore fun testGitImport(){ val vcsName = "Git" val gitApp = "path_to_git_repo" @@ -60,7 +61,6 @@ class GitGuiTest : GuiTestCase() { with (dialog1) { GuiTestUtil.findAndClickButton(this, "Next") val textField = GuiTestUtil.findTextField(myRobot, "Project name:").click() -// textField.setText("test-project") GuiTestUtil.findAndClickButton(this, "Next") GuiTestUtil.findAndClickButton(this, "Next") GuiTestUtil.findAndClickButton(this, "Next") //libraries diff --git a/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/JavaGitGuiTest.java b/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/JavaGitGuiTest.java deleted file mode 100644 index 6369c730e291..000000000000 --- a/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/JavaGitGuiTest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.testGuiFramework.tests; - -import com.intellij.dvcs.ui.CloneDvcsDialog; -import com.intellij.dvcs.ui.DvcsBundle; -import com.intellij.ide.IdeBundle; -import com.intellij.openapi.vcs.VcsBundle; -import com.intellij.testGuiFramework.fixtures.*; -import com.intellij.testGuiFramework.impl.GuiTestCase; -import com.intellij.ui.EditorComboBox; -import org.fest.swing.edt.GuiActionRunner; -import org.fest.swing.edt.GuiTask; -import org.junit.Ignore; -import org.junit.Test; - -import static com.intellij.testGuiFramework.framework.GuiTestUtil.findAndClickButton; - -/** - * @author Sergey Karashevich - */ -public class JavaGitGuiTest extends GuiTestCase { - - @Ignore - @Test - public void testGitImport(){ - String gitPath = "https://github.com/karashevich/test.git"; - - //wait welcome frame - //get welcome frame - WelcomeFrameFixture welcomeFrameFixture = WelcomeFrameFixture.find(myRobot); - - //click ActionLink "Check out from Version Control" - welcomeFrameFixture.checkoutFrom(); - - //click ListPopup menu item "Git" - String vcsName = "Git"; - JBListPopupFixture.findListPopup(myRobot).invokeAction(vcsName); - //find new dialog "Clone Repository" - DialogFixture dialogFixture = new DialogFixture(myRobot, IdeaDialogFixture.find(myRobot, CloneDvcsDialog.class).dialog); - //find EditorComboBox near label "Git Repository URL:" - String message = DvcsBundle.message("clone.repository.url", vcsName); - EditorComboBox editorComboBox = myRobot.finder().findByLabel(dialogFixture.target(), message, EditorComboBox.class); - //enter gitPath - GuiActionRunner.execute(new GuiTask() { - @Override - protected void executeInEDT() throws Throwable { - editorComboBox.setText(gitPath); - } - }); - - //click button "Clone" - findAndClickButton(dialogFixture, DvcsBundle.message("clone.button")); - //find message with title "Checkout From Version Control" - //click "Yes" - MessagesFixture.findByTitle(myRobot, welcomeFrameFixture.target(), VcsBundle.message("checkout.title")).clickYes(); - //find new dialog "Import Project" - DialogFixture importProjectFixture = DialogFixture.find(myRobot, "Import Project"); - //click "Next" - findAndClickButton(importProjectFixture, "Next"); - //click "Next" - findAndClickButton(importProjectFixture, "Next"); - //click "Next" - findAndClickButton(importProjectFixture, "Next"); - //click "Next" - findAndClickButton(importProjectFixture, "Next"); - //click "Next" - findAndClickButton(importProjectFixture, "Next"); - //click "Next" - findAndClickButton(importProjectFixture, "Next"); - //find message with title "No SDK Specified" - //click "Ok" - MessagesFixture.findByTitle(myRobot, welcomeFrameFixture.target(), IdeBundle.message("title.no.jdk.specified")).clickOk(); - //click "Finish" - findAndClickButton(importProjectFixture, "Finish"); - - //wait ideFrame - IdeFrameFixture ideFrame = findIdeFrame(); - //wait background processes (indexing) - ideFrame.waitForBackgroundTasksToFinish(); - - //check java class "src/Test.java" - //open Test.java in editor - String testJavaPath = "src/Test.java"; - EditorFixture editor = ideFrame.getEditor(); - editor.open(testJavaPath); - } -} diff --git a/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/JavaProjectTest.kt b/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/JavaProjectTest.kt deleted file mode 100644 index 1f8e30db7208..000000000000 --- a/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/JavaProjectTest.kt +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.testGuiFramework.tests - -import com.intellij.testGuiFramework.fixtures.DialogFixtures.CreateDialogFixture -import com.intellij.testGuiFramework.fixtures.EditorFixture -import com.intellij.testGuiFramework.fixtures.JBPopupFixture -import com.intellij.testGuiFramework.framework.clickListItem -import com.intellij.testGuiFramework.framework.createNewProject -import com.intellij.testGuiFramework.impl.GuiTestCase -import org.junit.Ignore -import org.junit.Test -import java.io.File -import javax.swing.text.JTextComponent - -/** - * @author Sergey Karashevich - */ -class JavaProjectTest: GuiTestCase() { - - @Test - @Ignore - fun testJavaProject(){ - var locationFile: File? = null - val projectName = "smoke-test" - createNewProject() - - val newProjectWizard = findNewProjectWizard() - with(newProjectWizard){ - setupJdk() -// selectProjectType("Java") - clickListItem("Java", robot(), this.target()) - selectFramework("JavaEE Persistence") - clickNext() - setProjectName(projectName); - locationFile = locationInFileSystem - clickFinish() - } - - requireNotNull(locationFile) { - "Unable to determine location for \"$projectName\" project" - } - - val ideFrame = findIdeFrame(projectName, locationFile!!) - with(ideFrame){ - val paneFixture = projectView.selectProjectPane() - - paneFixture.selectByPath(projectName, "src", "META-INF", "persistence.xml").doubleClick(robot()) - - val node = paneFixture.selectByPath(projectName, "src") - - node.invokeContextMenu(robot()) - val contextMenu = JBPopupFixture.findContextMenu(robot()) - waitForBackgroundTasksToFinish() - with(contextMenu) { - assertContainsAction("Cut") - invokeAction("New", "Java Class") - } - val newDialog = CreateDialogFixture.find(robot()) - with(newDialog) { - val jTextComponent = robot().finder().findByLabel("Name:", JTextComponent::class.java) - jTextComponent.setText("Test") - clickOK() - } - with(editor) { - invokeAction(EditorFixture.EditorAction.COMPLETE_CURRENT_STATEMENT) - enterText("psvm") - invokeAction(EditorFixture.EditorAction.TAB) - } - waitForBackgroundTasksToFinish() - } - } -} - diff --git a/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/NewProjectTest.java b/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/NewProjectTest.java deleted file mode 100644 index 7edde5323f47..000000000000 --- a/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/NewProjectTest.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.testGuiFramework.tests; - -import com.intellij.openapi.application.ApplicationBundle; -import com.intellij.openapi.project.ProjectBundle; -import com.intellij.testGuiFramework.fixtures.ProjectViewFixture; -import com.intellij.testGuiFramework.fixtures.newProjectWizard.NewProjectWizardFixture; -import com.intellij.testGuiFramework.framework.GuiTestUtil; -import com.intellij.testGuiFramework.framework.IdeGuiTest; -import com.intellij.testGuiFramework.impl.GuiTestCase; -import org.junit.Ignore; -import org.junit.Test; - -import javax.swing.*; -import java.io.File; -import java.io.IOException; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Date; - -import static com.intellij.testGuiFramework.framework.GuiTestUtil.getSystemJdk; - - -/** - * @author Sergey Karashevich - */ -public class NewProjectTest extends GuiTestCase { - - - //Should run with main_idea_tests module classpath - @Test @IdeGuiTest - @Ignore - public void testNewProject() throws IOException, InterruptedException { - - DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm"); - Date date = new Date(); - String projectName = "smoke-test-project-" + dateFormat.format(date); - - findWelcomeFrame().createNewProject(); - NewProjectWizardFixture newProjectWizard = findNewProjectWizard(); - - //check Project SDK is not Empty - setupJdkIfNeeded(newProjectWizard); - - //select project type and framework - newProjectWizard. - selectProjectType("Java"). - selectFramework("JavaEE Persistence"); - - newProjectWizard.clickNext(); - - newProjectWizard.setProjectName(projectName); - final File locationInFileSystem = newProjectWizard.getLocationInFileSystem(); - newProjectWizard.clickFinish(); - - myProjectFrame = findIdeFrame(projectName, locationInFileSystem); - - final ProjectViewFixture projectView = myProjectFrame.getProjectView(); - final ProjectViewFixture.PaneFixture paneFixture = projectView.selectProjectPane(); - - paneFixture.selectByPath(projectName, "src", "META-INF", "persistence.xml"); - Thread.sleep(10000); - - } - - private void setupJdkIfNeeded(NewProjectWizardFixture newProjectWizard) { - if (newProjectWizard.isJdkEmpty()) { - JButton newButton = GuiTestUtil.findButton(newProjectWizard, - GuiTestUtil.adduction(ApplicationBundle.message("button.new")), - myRobot); - myRobot.click(newButton); - File javaSdkPath = new File(getSystemJdk()); - String sdkType = GuiTestUtil.adduction(ProjectBundle.message("sdk.java.name")); - GuiTestUtil.clickPopupMenuItem(sdkType, newButton, myRobot); - newProjectWizard.selectSdkPath(javaSdkPath, sdkType); - } - } - -} diff --git a/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/ShortGuiTest.kt b/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/ShortGuiTest.kt deleted file mode 100644 index 1feecfcb6405..000000000000 --- a/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/ShortGuiTest.kt +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.testGuiFramework.tests - -import com.intellij.testGuiFramework.fixtures.WelcomeFrameFixture -import com.intellij.testGuiFramework.framework.createNewProject -import com.intellij.testGuiFramework.impl.GuiTestCase -import org.junit.Assert -import org.junit.Test - -/** - * @author Sergey Karashevich - */ -class ShortGuiTest: GuiTestCase() { - - @Test - fun testJavaProject(){ - val createNewProject = createNewProject() - val newProjectWizard = findNewProjectWizard() - with(newProjectWizard) { - clickCancel() - } - val find = WelcomeFrameFixture.find(myRobot) - Assert.assertNotNull(find) - } -} - diff --git a/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/SimpleApplicationImportTest.kt b/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/SimpleApplicationImportTest.kt deleted file mode 100644 index d64ae10011a9..000000000000 --- a/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/SimpleApplicationImportTest.kt +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.testGuiFramework.tests - -import com.intellij.testGuiFramework.framework.IdeGuiTest -import com.intellij.testGuiFramework.impl.GuiTestCase -import org.junit.Test - -/** - * @author Sergey Karashevich - */ -class SimpleApplicationImportTest: GuiTestCase() { - - @Test @IdeGuiTest - fun testSimpleApplication(){ - val app = importSimpleApplication() - app.waitForBackgroundTasksToFinish() - } -} \ No newline at end of file diff --git a/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/SimpleGitTest.java b/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/SimpleGitTest.java index ab8428de00ff..4042dfebf0df 100644 --- a/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/SimpleGitTest.java +++ b/platform/testGuiFramework/testSrc/com/intellij/testGuiFramework/tests/SimpleGitTest.java @@ -23,13 +23,11 @@ import com.intellij.testGuiFramework.framework.GuiTestUtil; import com.intellij.testGuiFramework.impl.GuiTestCase; import git4idea.i18n.GitBundle; import org.fest.swing.core.FastRobot; -import org.fest.swing.timing.Pause; import org.junit.Test; import java.awt.event.KeyEvent; import java.io.IOException; -import static com.intellij.testGuiFramework.framework.GuiTestUtil.SHORT_TIMEOUT; import static com.intellij.testGuiFramework.matcher.TitleMatcher.withTitleMatcher; /** @@ -67,20 +65,11 @@ public class SimpleGitTest extends GuiTestCase { GuiTestUtil.invokeActionViaShortcut(myRobot, "meta K"); DialogFixture commitDialogFixture = DialogFixture.find(myRobot, VcsBundle.message("commit.dialog.title")); - //EditorTextField editorTextField = myRobot.finder().findByType(commitDialogFixture.target(), EditorTextField.class); - //editorTextField.getDocument().setText(""); myRobot.enterText("initial commit"); GuiTestUtil.findAndClickButton(commitDialogFixture, "Commit"); MessagesFixture.findByTitle(myRobot, commitDialogFixture.target(), VcsBundle.message("code.smells.error.messages.tab.name")) .click("Commit"); - - Pause.pause(SHORT_TIMEOUT.duration()); - - //create file in project src/Second.java - //init git - //add Second.java to git - //commit } catch (IOException e) { e.printStackTrace();