Search in sources :

Example 6 with JPopupMenuFixture

use of org.fest.swing.fixture.JPopupMenuFixture in project ats-framework by Axway.

the class SwingTree method rightClick.

@PublicAtsApi
public void rightClick(int rowIndex, String... contextMenuItems) {
    new SwingElementState(this).waitToBecomeExisting();
    JTreeFixture treeFixture = (JTreeFixture) SwingElementLocator.findFixture(this);
    JPopupMenuFixture popUpMenu = treeFixture.showPopupMenuAt(rowIndex);
    popUpMenu.menuItemWithPath(contextMenuItems).click();
}
Also used : JTreeFixture(org.fest.swing.fixture.JTreeFixture) JPopupMenuFixture(org.fest.swing.fixture.JPopupMenuFixture) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 7 with JPopupMenuFixture

use of org.fest.swing.fixture.JPopupMenuFixture in project ats-framework by Axway.

the class SwingTree method rightClick.

@PublicAtsApi
public void rightClick(String[] path, String... contextMenuItems) {
    new SwingElementState(this).waitToBecomeExisting();
    JTreeFixture treeFixture = (JTreeFixture) SwingElementLocator.findFixture(this);
    // sometimes it is necessary
    expandTree(treeFixture, path);
    JPopupMenuFixture popUpMenu = treeFixture.showPopupMenuAt(buildPath(path));
    popUpMenu.menuItemWithPath(contextMenuItems).click();
}
Also used : JTreeFixture(org.fest.swing.fixture.JTreeFixture) JPopupMenuFixture(org.fest.swing.fixture.JPopupMenuFixture) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 8 with JPopupMenuFixture

use of org.fest.swing.fixture.JPopupMenuFixture in project android by JetBrains.

the class ManifestEditorTest method testRemoveFromManifest.

@Test
public void testRemoveFromManifest() throws IOException {
    guiTest.importMultiModule();
    IdeFrameFixture projectFrame = guiTest.ideFrame();
    EditorFixture editor = projectFrame.getEditor();
    editor.open("app/src/main/AndroidManifest.xml");
    String addedText = "        <activity\n" + "            android:name=\"com.android.mylibrary.MainActivity\"\n" + "            tools:remove=\"android:label\" />\n";
    assertThat(editor.getCurrentFileContents()).doesNotContain(addedText);
    editor.selectEditorTab(EditorFixture.Tab.MERGED_MANIFEST);
    MergedManifestFixture mergedManifestFixture = editor.getMergedManifestEditor();
    JTreeFixture tree = mergedManifestFixture.getTree();
    // row 28 = "manifest/application/activity/android:name = com.android.mylibrary.MainActivity"
    JPopupMenuFixture popup = tree.showPopupMenuAt(22);
    popup.menuItemWithPath("Remove").click();
    editor.selectEditorTab(EditorFixture.Tab.EDITOR);
    assertThat(editor.getCurrentFileContents()).contains(addedText);
}
Also used : JTreeFixture(org.fest.swing.fixture.JTreeFixture) MergedManifestFixture(com.android.tools.idea.tests.gui.framework.fixture.MergedManifestFixture) EditorFixture(com.android.tools.idea.tests.gui.framework.fixture.EditorFixture) JPopupMenuFixture(org.fest.swing.fixture.JPopupMenuFixture) IdeFrameFixture(com.android.tools.idea.tests.gui.framework.fixture.IdeFrameFixture) Test(org.junit.Test)

Example 9 with JPopupMenuFixture

use of org.fest.swing.fixture.JPopupMenuFixture in project android by JetBrains.

the class AvdManagerDialogFixture method deleteAvd.

public AvdManagerDialogFixture deleteAvd(String name) {
    TableView tableView = robot().finder().findByType(target(), TableView.class, true);
    JTableFixture tableFixture = new JTableFixture(robot(), tableView);
    JTableCellFixture cell = tableFixture.cell(name);
    cell.click(RIGHT_BUTTON);
    JPopupMenuFixture contextMenuFixture = new JPopupMenuFixture(robot(), robot().findActivePopupMenu());
    contextMenuFixture.menuItemWithPath("Delete").click();
    MessagesFixture.findByTitle(robot(), "Confirm Deletion").clickYes();
    return this;
}
Also used : JTableCellFixture(org.fest.swing.fixture.JTableCellFixture) JTableFixture(org.fest.swing.fixture.JTableFixture) JPopupMenuFixture(org.fest.swing.fixture.JPopupMenuFixture) TableView(com.intellij.ui.table.TableView)

Aggregations

JPopupMenuFixture (org.fest.swing.fixture.JPopupMenuFixture)9 PublicAtsApi (com.axway.ats.common.PublicAtsApi)5 SwingElementState (com.axway.ats.uiengine.utilities.swing.SwingElementState)5 JTreeFixture (org.fest.swing.fixture.JTreeFixture)4 JTableFixture (org.fest.swing.fixture.JTableFixture)3 JMenuItem (javax.swing.JMenuItem)2 JListFixture (org.fest.swing.fixture.JListFixture)2 JMenuItemFixture (org.fest.swing.fixture.JMenuItemFixture)2 EditorFixture (com.android.tools.idea.tests.gui.framework.fixture.EditorFixture)1 IdeFrameFixture (com.android.tools.idea.tests.gui.framework.fixture.IdeFrameFixture)1 MergedManifestFixture (com.android.tools.idea.tests.gui.framework.fixture.MergedManifestFixture)1 ElementNotFoundException (com.axway.ats.uiengine.exceptions.ElementNotFoundException)1 SwingDriverInternal (com.axway.ats.uiengine.internal.driver.SwingDriverInternal)1 TableView (com.intellij.ui.table.TableView)1 Component (java.awt.Component)1 ArrayList (java.util.ArrayList)1 JButton (javax.swing.JButton)1 JCheckBox (javax.swing.JCheckBox)1 JComboBox (javax.swing.JComboBox)1 JLabel (javax.swing.JLabel)1