Search in sources :

Example 36 with PublicAtsApi

use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.

the class SwingTable method clickCell.

/**
     * Click table cell
     *
     * @param row the row number
     * @param column the column number
     * @throws VerificationException if the table element doesn't exist
     */
@PublicAtsApi
public void clickCell(int row, int column) {
    new SwingElementState(this).waitToBecomeExisting();
    JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
    try {
        tableFixture.cell(new TableCell(row, column) {
        }).click();
    } catch (Exception e) {
        throw new UiElementException(e.getMessage(), this);
    }
}
Also used : JTableFixture(org.fest.swing.fixture.JTableFixture) TableCell(org.fest.swing.data.TableCell) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) UiElementException(com.axway.ats.uiengine.exceptions.UiElementException) VerifyNotEqualityException(com.axway.ats.uiengine.exceptions.VerifyNotEqualityException) VerifyEqualityException(com.axway.ats.uiengine.exceptions.VerifyEqualityException) VerificationException(com.axway.ats.uiengine.exceptions.VerificationException) UiElementException(com.axway.ats.uiengine.exceptions.UiElementException) NotSupportedOperationException(com.axway.ats.uiengine.exceptions.NotSupportedOperationException) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 37 with PublicAtsApi

use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.

the class SwingTable method drag.

/**
     * Simulates a user dragging a cell from this table
     *
     * @param row the row number
     * @param column the column number
     */
@PublicAtsApi
public void drag(int row, int column) {
    new SwingElementState(this).waitToBecomeExisting();
    ((JTableFixture) SwingElementLocator.findFixture(this)).drag(new TableCell(row, column) {
    });
}
Also used : JTableFixture(org.fest.swing.fixture.JTableFixture) TableCell(org.fest.swing.data.TableCell) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 38 with PublicAtsApi

use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.

the class SwingTable method getCellBackgroundColors.

/**
     * Gets table cell backgrounds (as {@link Color}) of all table cells.
     *
     * @return array of java.awt.Color objects one for each cell. First index is
     * table row and second is the column in this row.
     */
@PublicAtsApi
public Color[][] getCellBackgroundColors() {
    new SwingElementState(this).waitToBecomeExisting();
    final JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
    int rowCount = tableFixture.rowCount();
    // SwingUtilities.
    int columnCount = GuiActionRunner.execute(new GuiQuery<Integer>() {

        @Override
        protected Integer executeInEDT() throws Throwable {
            return tableFixture.component().getColumnCount();
        }
    });
    Color[][] resultArr = new Color[rowCount][columnCount];
    for (int i = 0; i < rowCount; i++) {
        for (int j = 0; j < columnCount; j++) {
            resultArr[i][j] = tableFixture.backgroundAt(new TableCell(i, j) {
            }).target();
        }
    }
    return resultArr;
}
Also used : JTableFixture(org.fest.swing.fixture.JTableFixture) TableCell(org.fest.swing.data.TableCell) Color(java.awt.Color) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 39 with PublicAtsApi

use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.

the class SwingTextArea method appendValue.

/**
     * Works in same way as the 'set text' method
     * 
     * @param value
     */
@Override
@PublicAtsApi
public void appendValue(String value) {
    new SwingElementState(this).waitToBecomeExisting();
    ((JTextComponentFixture) SwingElementLocator.findFixture(this)).setText(value);
}
Also used : SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) JTextComponentFixture(org.fest.swing.fixture.JTextComponentFixture) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 40 with PublicAtsApi

use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.

the class SwingTextArea method setValue.

/**
     * Set text area value
     *
     * @param value the value to set
     * @throws VerificationException if the element doesn't exist
     */
@Override
@PublicAtsApi
public void setValue(String value) {
    new SwingElementState(this).waitToBecomeExisting();
    ((JTextComponentFixture) SwingElementLocator.findFixture(this)).setText(value);
}
Also used : SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) JTextComponentFixture(org.fest.swing.fixture.JTextComponentFixture) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Aggregations

PublicAtsApi (com.axway.ats.common.PublicAtsApi)409 Validator (com.axway.ats.core.validation.Validator)66 SwingElementState (com.axway.ats.uiengine.utilities.swing.SwingElementState)60 WebElement (org.openqa.selenium.WebElement)57 IFileSystemOperations (com.axway.ats.core.filesystem.model.IFileSystemOperations)44 HiddenHtmlElementState (com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState)32 NoSuchMimePackageException (com.axway.ats.action.objects.model.NoSuchMimePackageException)31 PackageException (com.axway.ats.action.objects.model.PackageException)31 RealHtmlElementState (com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState)31 MessagingException (javax.mail.MessagingException)31 VerificationException (com.axway.ats.uiengine.exceptions.VerificationException)24 ArrayList (java.util.ArrayList)18 SeleniumOperationException (com.axway.ats.uiengine.exceptions.SeleniumOperationException)16 UiElementException (com.axway.ats.uiengine.exceptions.UiElementException)16 IOException (java.io.IOException)16 JTableFixture (org.fest.swing.fixture.JTableFixture)16 Actions (org.openqa.selenium.interactions.Actions)16 NotSupportedOperationException (com.axway.ats.uiengine.exceptions.NotSupportedOperationException)15 VerifyNotEqualityException (com.axway.ats.uiengine.exceptions.VerifyNotEqualityException)15 XMLException (com.axway.ats.common.xml.XMLException)14