mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[ui-tests] popupUI update
GitOrigin-RevId: f1cef44259577393dd80c4c6821f75da9a1be2f0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e3d1e28ab0
commit
8ceda7985c
+1
-4
@@ -13,16 +13,13 @@ fun Finder.popupMenu(@Language("xpath") xpath: String? = null) =
|
||||
x(xpath ?: "//div[@class='MyMenu']", PopupMenuUiComponent::class.java)
|
||||
|
||||
class PopupMenuUiComponent(data: ComponentData) : UiComponent(data) {
|
||||
|
||||
private val menuItems =
|
||||
xx("//div[@class='ActionMenuItem' or @class='ActionMenu']", PopupItemUiComponent::class.java)
|
||||
|
||||
fun findMenuItemByText(text: String) = menuItems.list().firstOrNull { it.getText() == text}
|
||||
?: throw AssertionError("No item with text '$text' found in popup '${this.searchContext}'")
|
||||
|
||||
fun getItemByIndex(index: Int) = menuItems.list()[index]
|
||||
|
||||
fun getItemByText(text: String) = menuItems.list().first { it.getText() == text }
|
||||
|
||||
fun select(vararg items: String) {
|
||||
items.forEach { item ->
|
||||
should(timeout = 5.seconds) { menuItems.list().map { it.getText() }.contains(item) }
|
||||
|
||||
Reference in New Issue
Block a user