From 6d0dde7eafa209760ae3f5bbbd6f5dfb39917e6a Mon Sep 17 00:00:00 2001 From: Sergey Karashevich Date: Fri, 23 Mar 2018 17:58:18 +0300 Subject: [PATCH] [gui-test] add ReplaceInPathFocusTest to FocusIssuesSuite --- .../tests/community/focus/FocusIssuesSuite.kt | 3 +- .../community/focus/ReplaceInPathFocusTest.kt | 40 +++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 community-guitests/testSrc/com/intellij/testGuiFramework/tests/community/focus/ReplaceInPathFocusTest.kt diff --git a/community-guitests/testSrc/com/intellij/testGuiFramework/tests/community/focus/FocusIssuesSuite.kt b/community-guitests/testSrc/com/intellij/testGuiFramework/tests/community/focus/FocusIssuesSuite.kt index 3e185bde5d83..11349bfa4766 100644 --- a/community-guitests/testSrc/com/intellij/testGuiFramework/tests/community/focus/FocusIssuesSuite.kt +++ b/community-guitests/testSrc/com/intellij/testGuiFramework/tests/community/focus/FocusIssuesSuite.kt @@ -17,5 +17,6 @@ import org.junit.runners.Suite GoToClassTwiceFocusTest::class, InlineVariableFocusTest::class, KeyMapSettingsTestFocusTest::class, - SearchEverywhereFocusTest::class) + SearchEverywhereFocusTest::class, + ReplaceInPathFocusTest::class) class FocusIssuesSuite \ No newline at end of file diff --git a/community-guitests/testSrc/com/intellij/testGuiFramework/tests/community/focus/ReplaceInPathFocusTest.kt b/community-guitests/testSrc/com/intellij/testGuiFramework/tests/community/focus/ReplaceInPathFocusTest.kt new file mode 100644 index 000000000000..4129ad44f508 --- /dev/null +++ b/community-guitests/testSrc/com/intellij/testGuiFramework/tests/community/focus/ReplaceInPathFocusTest.kt @@ -0,0 +1,40 @@ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +package com.intellij.testGuiFramework.tests.community.focus + +import com.intellij.testGuiFramework.fixtures.IdeFrameFixture +import com.intellij.testGuiFramework.impl.GuiTestCase +import com.intellij.testGuiFramework.tests.community.CommunityProjectCreator +import com.intellij.testGuiFramework.util.Key.R +import com.intellij.testGuiFramework.util.Modifier.* +import com.intellij.testGuiFramework.util.plus +import org.fest.swing.timing.Pause +import org.junit.Test +import java.util.concurrent.TimeUnit + +class ReplaceInPathFocusTest: GuiTestCase() { + + /** + * Regression test to catch TypeAhead exception during the DumbMode and calling Replace in Path action. + * IDEA-188519 + * Fixed by f5002ec244eec48c26be78ccbc6cbb1058581d50 + */ + @Test + fun testReplaceInPathDumbModeFocus() { + CommunityProjectCreator.createCommandLineProject() + Pause.pause(1000) + ideFrame { + dumbMode { + shortcut(CONTROL + SHIFT + R, META + SHIFT + R) + Pause.pause(30, TimeUnit.SECONDS) + } + } + } + + private fun IdeFrameFixture.dumbMode(blockInDumbMode: GuiTestCase.() -> Unit) { + this@dumbMode.invokeMainMenu("DumbMode") + blockInDumbMode() + this@dumbMode.invokeMainMenu("DumbMode") + } + + +} \ No newline at end of file