Search in sources :

Example 21 with JTableFixture

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

the class TranslationsEditorTest method paste.

@Test
public void paste() {
    JTableFixture table = myTranslationsEditor.getTable();
    table.selectCell(TableCell.row(1).column(2));
    String data = "app_name\tapp_name_en\n" + "cancel\tcancel_en\n";
    Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(data), EmptyClipboardOwner.INSTANCE);
    KeyStroke keyStroke = getKeyStroke(table.target().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT), "paste");
    table.pressAndReleaseKey(KeyPressInfo.keyCode(keyStroke.getKeyCode()).modifiers(keyStroke.getModifiers()));
    assertEquals("app_name", table.valueAt(TableCell.row(1).column(2)));
    assertEquals("app_name_en", table.valueAt(TableCell.row(1).column(3)));
    assertEquals("cancel", table.valueAt(TableCell.row(2).column(2)));
    assertEquals("cancel_en", table.valueAt(TableCell.row(2).column(3)));
}
Also used : JTableFixture(org.fest.swing.fixture.JTableFixture) StringSelection(java.awt.datatransfer.StringSelection) Test(org.junit.Test)

Example 22 with JTableFixture

use of org.fest.swing.fixture.JTableFixture 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)

Example 23 with JTableFixture

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

the class AvdManagerDialogFixture method editAvdWithName.

public AvdEditWizardFixture editAvdWithName(@NotNull String name) {
    final TableView tableView = robot().finder().findByType(target(), TableView.class, true);
    JTableFixture tableFixture = new JTableFixture(robot(), tableView);
    JTableCellFixture cell = tableFixture.cell(name);
    final TableCell actionCell = TableCell.row(cell.row()).column(7);
    JTableCellFixture actionCellFixture = tableFixture.cell(actionCell);
    execute(new GuiTask() {

        @Override
        protected void executeInEDT() throws Throwable {
            tableView.editCellAt(actionCell.row, actionCell.column);
        }
    });
    JPanel actionPanel = (JPanel) actionCellFixture.editor();
    HyperlinkLabel editButtonLabel = robot().finder().find(actionPanel, new GenericTypeMatcher<HyperlinkLabel>(HyperlinkLabel.class) {

        @Override
        protected boolean isMatching(@NotNull HyperlinkLabel component) {
            return "Edit this AVD".equals(component.getToolTipText());
        }
    });
    robot().click(editButtonLabel);
    return AvdEditWizardFixture.find(robot());
}
Also used : JTableCellFixture(org.fest.swing.fixture.JTableCellFixture) GuiTask(org.fest.swing.edt.GuiTask) JTableFixture(org.fest.swing.fixture.JTableFixture) TableCell(org.fest.swing.data.TableCell) HyperlinkLabel(com.intellij.ui.HyperlinkLabel) TableView(com.intellij.ui.table.TableView)

Example 24 with JTableFixture

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

the class AvdManagerDialogFixture method selectAvd.

public AvdManagerDialogFixture selectAvd(@NotNull String name) {
    TableView tableView = robot().finder().findByType(target(), TableView.class, true);
    JTableFixture tableFixture = new JTableFixture(robot(), tableView);
    tableFixture.cell(name).select();
    return this;
}
Also used : JTableFixture(org.fest.swing.fixture.JTableFixture) TableView(com.intellij.ui.table.TableView)

Example 25 with JTableFixture

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

the class ChooseDeviceDefinitionStepFixture method selectHardwareProfile.

@NotNull
public ChooseDeviceDefinitionStepFixture selectHardwareProfile(@NotNull final String deviceName) {
    JTableFixture deviceListFixture = getTableFixture();
    JTableCellFixture cell = deviceListFixture.cell(deviceName);
    cell.select();
    return this;
}
Also used : JTableCellFixture(org.fest.swing.fixture.JTableCellFixture) JTableFixture(org.fest.swing.fixture.JTableFixture) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

JTableFixture (org.fest.swing.fixture.JTableFixture)29 PublicAtsApi (com.axway.ats.common.PublicAtsApi)16 SwingElementState (com.axway.ats.uiengine.utilities.swing.SwingElementState)16 TableCell (org.fest.swing.data.TableCell)15 NotSupportedOperationException (com.axway.ats.uiengine.exceptions.NotSupportedOperationException)11 UiElementException (com.axway.ats.uiengine.exceptions.UiElementException)11 VerificationException (com.axway.ats.uiengine.exceptions.VerificationException)10 VerifyEqualityException (com.axway.ats.uiengine.exceptions.VerifyEqualityException)10 VerifyNotEqualityException (com.axway.ats.uiengine.exceptions.VerifyNotEqualityException)10 NotNull (org.jetbrains.annotations.NotNull)7 JTableCellFixture (org.fest.swing.fixture.JTableCellFixture)6 TableView (com.intellij.ui.table.TableView)4 JPopupMenuFixture (org.fest.swing.fixture.JPopupMenuFixture)3 ImmutableList (com.google.common.collect.ImmutableList)2 JTableHeaderFixture (org.fest.swing.fixture.JTableHeaderFixture)2 ElementNotFoundException (com.axway.ats.uiengine.exceptions.ElementNotFoundException)1 SwingDriverInternal (com.axway.ats.uiengine.internal.driver.SwingDriverInternal)1 HyperlinkLabel (com.intellij.ui.HyperlinkLabel)1 Content (com.intellij.ui.content.Content)1 Color (java.awt.Color)1