mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
[IFT] Add test script to Modal commit enabled warning
It will fix UI tests if for some reason modal commit dialog is enabled by default. IJ-CR-19745 GitOrigin-RevId: 2a71ab9387367fa8d0ca239439f3f1193ee4a898
This commit is contained in:
committed by
intellij-monorepo-bot
parent
cf1a201c6e
commit
75508378c8
@@ -212,6 +212,12 @@ object GitLessonsUtil {
|
||||
+ " " + GitLessonsBundle.message("git.click.to.change.settings", callbackId)) {
|
||||
!VcsApplicationSettings.getInstance().COMMIT_FROM_LOCAL_CHANGES
|
||||
}
|
||||
test {
|
||||
if (!VcsApplicationSettings.getInstance().COMMIT_FROM_LOCAL_CHANGES) {
|
||||
Thread.sleep(1000) // need to wait until LessonMessagePane become updated after restart and warning will be showed
|
||||
clickLessonMessagePaneLink(" click ")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -368,14 +368,20 @@ fun TaskContext.proceedLink(additionalAbove: Int = 0) {
|
||||
}
|
||||
addStep(gotIt)
|
||||
test {
|
||||
ideFrame {
|
||||
val linkText = "Click to proceed"
|
||||
val lessonMessagePane = findComponentWithTimeout(defaultTimeout) { _: LessonMessagePane -> true }
|
||||
val offset = lessonMessagePane.text.indexOf(linkText)
|
||||
if (offset == -1) error("Not found '$linkText' in the LessonMessagePane")
|
||||
val rect = lessonMessagePane.modelToView2D(offset + linkText.length / 2)
|
||||
robot.click(lessonMessagePane, Point(rect.centerX.toInt(), rect.centerY.toInt()))
|
||||
}
|
||||
clickLessonMessagePaneLink("Click to proceed")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Will click on the first occurrence of [linkText] in the [LessonMessagePane]
|
||||
*/
|
||||
fun TaskTestContext.clickLessonMessagePaneLink(linkText: String) {
|
||||
ideFrame {
|
||||
val lessonMessagePane = findComponentWithTimeout(defaultTimeout) { _: LessonMessagePane -> true }
|
||||
val offset = lessonMessagePane.text.indexOf(linkText)
|
||||
if (offset == -1) error("Not found '$linkText' in the LessonMessagePane")
|
||||
val rect = lessonMessagePane.modelToView2D(offset + linkText.length / 2)
|
||||
robot.click(lessonMessagePane, Point(rect.centerX.toInt(), rect.centerY.toInt()))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user