JetBrains / intellij-ui-test-robot

The library allows you to write and execute UI tests among IntelliJ IDEA. You can test your Plugin.

Home Page:https://jetbrains-platform.slack.com/archives/C026SVA9MMM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duplicate `JPopupMenuFixture`, macOs, v0.11.7

bric3 opened this issue · comments

Hey I came across, what I think is a bug when rewriting a query to access a menu form the main menu bar.

In order to be able to use script the menu bar I had to pass this system property (apple.laf.useScreenMenuBar=false) as mentioned in my comment #17 (comment)

I wrote this code

robot.find(byXpath("//div[@text='${path[0]}']//div[@text='${path[1]}']"))

And when replacing it with JPopupMenuFixture, the find method failed because two fixtures of the same menu showed up.

To workaround this I replaced find by findAll and taking the first item.

attempt(tries = 3) {
    menuBar.select(path[0])
}

return robot.findAll<JPopupMenuFixture>(JPopupMenuFixture.byContainsItem(path[1]))
    .map { it.menuItem(path[1]) }
    .firstOrNull() // select the first item