// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package software.aws.toolkits.jetbrains.uitests.fixtures import com.intellij.remoterobot.RemoteRobot import com.intellij.remoterobot.data.RemoteComponent import com.intellij.remoterobot.fixtures.ComponentFixture import com.intellij.remoterobot.fixtures.FixtureName import com.intellij.remoterobot.search.locators.byXpath import com.intellij.remoterobot.utils.waitFor fun IdeaFrame.actionMenu(text: String): ActionMenuFixture { val xpath = byXpath("text '$text'", "//div[@class='ActionMenu' and @text='$text']") waitFor { findAll(xpath).isNotEmpty() } return findAll(xpath).first() } fun IdeaFrame.actionMenuItem(text: String): ActionMenuItemFixture { val xpath = byXpath("text '$text'", "//div[@class='ActionMenuItem' and @text='$text']") waitFor { findAll(xpath).isNotEmpty() } return findAll(xpath).first() } @FixtureName("ActionMenu") class ActionMenuFixture(remoteRobot: RemoteRobot, remoteComponent: RemoteComponent) : ComponentFixture(remoteRobot, remoteComponent) @FixtureName("ActionMenuItem") class ActionMenuItemFixture(remoteRobot: RemoteRobot, remoteComponent: RemoteComponent) : ComponentFixture(remoteRobot, remoteComponent)