mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[gui-tests] changed checkRunGutterIcons() to checkGutterIcons(), now accepting different icons
This commit is contained in:
@@ -207,19 +207,21 @@ fun GuiTestCase.checkProjectIsRun(configuration: String, message: String) {
|
||||
}
|
||||
}
|
||||
|
||||
fun GuiTestCase.checkRunGutterIcons(expectedNumberOfRunIcons: Int, expectedRunLines: List<String>) {
|
||||
fun GuiTestCase.checkGutterIcons(gutterIcon: GutterFixture.GutterIcon,
|
||||
expectedNumberOfIcons: Int,
|
||||
expectedLines: List<String>) {
|
||||
ideFrame {
|
||||
logTestStep("Going to check whether $expectedNumberOfRunIcons `Run` gutter icons are present")
|
||||
logTestStep("Going to check whether $expectedNumberOfIcons $gutterIcon gutter icons are present")
|
||||
editor {
|
||||
waitUntilFileIsLoaded()
|
||||
waitUntilErrorAnalysisFinishes()
|
||||
gutter.waitUntilIconsShown(mapOf(GutterFixture.GutterIcon.RUN_SCRIPT to expectedNumberOfRunIcons))
|
||||
val gutterRunLines = gutter.linesWithGutterIcon(GutterFixture.GutterIcon.RUN_SCRIPT)
|
||||
gutter.waitUntilIconsShown(mapOf(gutterIcon to expectedNumberOfIcons))
|
||||
val gutterLinesWithIcon = gutter.linesWithGutterIcon(gutterIcon)
|
||||
val contents = this@editor.getCurrentFileContents(false)?.lines() ?: listOf()
|
||||
for ((index, line) in gutterRunLines.withIndex()) {
|
||||
for ((index, line) in gutterLinesWithIcon.withIndex()) {
|
||||
// line numbers start with 1, but index in the contents list starts with 0
|
||||
val currentLine = contents[line - 1]
|
||||
val expectedLine = expectedRunLines[index]
|
||||
val expectedLine = expectedLines[index]
|
||||
assert(currentLine.contains(expectedLine)) {
|
||||
"At line #$line the actual text is `$currentLine`, but it was expected `$expectedLine`"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user