mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 15:06:56 +07:00
[driver-tests]: add ProjectViewToolWindowUi
GitOrigin-RevId: 6a282ef7d396bf545a89504c9537e98f15d7ffc0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
58be39ad5d
commit
74bda450d0
@@ -0,0 +1,26 @@
|
||||
package com.intellij.driver.sdk.ui.components
|
||||
|
||||
import com.intellij.driver.sdk.ui.Finder
|
||||
import com.intellij.driver.sdk.ui.components.UiComponent.Companion.waitFound
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
fun Finder.projectViewToolWindow(): ProjectViewToolWindowUi =
|
||||
x(ProjectViewToolWindowUi::class.java) {
|
||||
byAccessibleName("Project Tool Window")
|
||||
}
|
||||
|
||||
fun Finder.showProjectViewButton() = x { and (byAccessibleName("Project"), byClass("SquareStripeButton")) }
|
||||
|
||||
fun Finder.openProjectViewToolWindow(): ProjectViewToolWindowUi {
|
||||
return runCatching { projectViewToolWindow().waitFound(3.seconds) }.getOrElse {
|
||||
showProjectViewButton().click()
|
||||
projectViewToolWindow().waitFound(3.seconds)
|
||||
}
|
||||
}
|
||||
|
||||
class ProjectViewToolWindowUi(data: ComponentData) : JTreeUiComponent(data) {
|
||||
fun expandAll() = x("//div[@myicon='expandAll.svg']").click()
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user