mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[gui-test] another attempt to make call of Project Structure more stable on Linux
This commit is contained in:
+13
-14
@@ -88,39 +88,38 @@ fun KotlinGuiTestCase.checkInProjectStructure(actions: KotlinGuiTestCase.() -> U
|
||||
}
|
||||
return null
|
||||
}
|
||||
logTestStep("Check structure of gradle project")
|
||||
|
||||
val projectStructureTitle = "Project Structure"
|
||||
logTestStep("Check structure of the project")
|
||||
ideFrame {
|
||||
val numberOfAttempts = 5
|
||||
var isCorrectDialogOpen = false
|
||||
for (currentAttempt in 0..numberOfAttempts){
|
||||
for (currentAttempt in 0..numberOfAttempts) {
|
||||
waitAMoment()
|
||||
// invokeMainMenu("ShowProjectStructureSettings")
|
||||
logUIStep("Call '$projectStructureTitle' dialog with Ctrl+Shift+Alt+S. Attempt ${currentAttempt + 1}")
|
||||
shortcut(Modifier.CONTROL + Modifier.SHIFT + Modifier.ALT + Key.S)
|
||||
try {
|
||||
dialog("Project Structure") {
|
||||
val activeDialog = getActiveModalDialog()
|
||||
logUIStep("Active dialog: ${activeDialog?.title}")
|
||||
if (activeDialog?.title == projectStructureTitle) {
|
||||
dialog(projectStructureTitle) {
|
||||
try {
|
||||
isCorrectDialogOpen = true
|
||||
actions()
|
||||
}
|
||||
catch (t: Throwable) {
|
||||
throw t
|
||||
}
|
||||
finally {
|
||||
logUIStep("Close Project Structure dialog with Cancel")
|
||||
button("Cancel").click()
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e: WaitTimedOutError) {
|
||||
// no dialog or incorrect dialog is show
|
||||
val activeDialog = getActiveModalDialog()
|
||||
else {
|
||||
if (activeDialog != null) {
|
||||
dialog(activeDialog.title) {
|
||||
button("Cancel").click()
|
||||
}
|
||||
logUIStep("Active dialog is incorrect, going to close it with Escape")
|
||||
shortcut(Key.ESCAPE)
|
||||
}
|
||||
}
|
||||
if(isCorrectDialogOpen) break
|
||||
if (isCorrectDialogOpen) break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user