diff --git a/community-guitests/testSrc/com/intellij/ide/projectWizard/kotlin/createProject/CreateKotlinMPProjectGuiTest.kt b/community-guitests/testSrc/com/intellij/ide/projectWizard/kotlin/createProject/CreateKotlinMPProjectGuiTest.kt index 786c0206e57b..c42621c9efe2 100644 --- a/community-guitests/testSrc/com/intellij/ide/projectWizard/kotlin/createProject/CreateKotlinMPProjectGuiTest.kt +++ b/community-guitests/testSrc/com/intellij/ide/projectWizard/kotlin/createProject/CreateKotlinMPProjectGuiTest.kt @@ -48,8 +48,8 @@ class CreateKotlinMPProjectGuiTest : KotlinGuiTestCase() { kotlinVersion, expectedJars ) - checkFacetInOneModule(defaultFacetSettings[TargetPlatform.Common]!!, "$projectName(0)", "${projectName}_main", "Kotlin") - checkFacetInOneModule(defaultFacetSettings[TargetPlatform.Common]!!, "$projectName(0)", "${projectName}_test", "Kotlin") + checkFacetInOneModule(defaultFacetSettings[TargetPlatform.Common]!!, "$projectName", "${projectName}_main", "Kotlin") + checkFacetInOneModule(defaultFacetSettings[TargetPlatform.Common]!!, "$projectName", "${projectName}_test", "Kotlin") if (setOfMPPModules.contains(KotlinKind.JS)) { checkFacetInOneModule(defaultFacetSettings[TargetPlatform.JavaScript]!!, "${projectName}-js", "${projectName}-js_main", "Kotlin") checkFacetInOneModule(defaultFacetSettings[TargetPlatform.JavaScript]!!, "${projectName}-js", "${projectName}-js_test", "Kotlin") diff --git a/community-guitests/testSrc/com/intellij/ide/projectWizard/kotlin/model/ActionsInProjectStructure.kt b/community-guitests/testSrc/com/intellij/ide/projectWizard/kotlin/model/ActionsInProjectStructure.kt index f8f9fa4350bf..3d71bb01f4c7 100644 --- a/community-guitests/testSrc/com/intellij/ide/projectWizard/kotlin/model/ActionsInProjectStructure.kt +++ b/community-guitests/testSrc/com/intellij/ide/projectWizard/kotlin/model/ActionsInProjectStructure.kt @@ -24,13 +24,19 @@ fun KotlinGuiTestCase.checkFacetInOneModule(expectedFacet: FacetStructure, varar } fun ExtendedTreeFixture.selectWithKeyboard(testCase: GuiTestCase, vararg path: String) { + fun currentValue(): String { + val selectedRow = target().selectionRows.first() + return valueAt(selectedRow) ?: throw IllegalStateException("Nothing is selected in the tree") + } click() testCase.shortcut(Key.HOME) // select the top row - for (step in 0 until path.size) { - val regex = Regex("""(.*)\(\d+\)""") - val clearedPathStep = if (regex.matches(path[step])) regex.matchEntire(path[step])!!.groups[1]?.value ?: path[step] else path[step] - testCase.typeText(clearedPathStep) - testCase.shortcut(Key.RIGHT) + for((index, step) in path.withIndex()){ + if(currentValue() != step) { + testCase.typeText(step) + while (currentValue() != step) + testCase.shortcut(Key.DOWN) + } + if(index < path.size -1) testCase.shortcut(Key.RIGHT) } } diff --git a/community-guitests/testSrc/com/intellij/ide/projectWizard/kotlin/model/ProjectsWithKotlin.kt b/community-guitests/testSrc/com/intellij/ide/projectWizard/kotlin/model/ProjectsWithKotlin.kt index 208608961d6d..aa153101e828 100644 --- a/community-guitests/testSrc/com/intellij/ide/projectWizard/kotlin/model/ProjectsWithKotlin.kt +++ b/community-guitests/testSrc/com/intellij/ide/projectWizard/kotlin/model/ProjectsWithKotlin.kt @@ -888,11 +888,11 @@ fun KotlinGuiTestCase.checkInProjectStructureGradleExplicitModuleGroups( ) checkFacetInOneModule( expectedFacet, - "$projectName(0)", "${projectName}_main", "Kotlin" + "$projectName", "${projectName}_main", "Kotlin" ) checkFacetInOneModule( expectedFacet, - "$projectName(0)", "${projectName}_test", "Kotlin" + "$projectName", "${projectName}_test", "Kotlin" ) } }