mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[gui-test] improved selectedWithKeyboard to work both when tree is expanded and no
This commit is contained in:
+2
-2
@@ -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")
|
||||
|
||||
+11
-5
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user