Search in sources :

Example 41 with PublicAtsApi

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

the class SwingTable method doubleClickCell.

/**
     * Double click table cell
     *
     * @param row the row number
     * @param column the column number
     * @throws VerificationException if the element doesn't exist
     */
@PublicAtsApi
public void doubleClickCell(int row, int column) {
    new SwingElementState(this).waitToBecomeExisting();
    JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
    try {
        tableFixture.cell(new TableCell(row, column) {
        }).doubleClick();
    } 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 42 with PublicAtsApi

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

the class SwingTable method setFieldValue.

/**
     * Set table field value
     *
     * @param value the value to set
     * @param row the row number
     * @param column the column number
     * @throws VerificationException if the element doesn't exist
     */
@Override
@PublicAtsApi
public void setFieldValue(String value, int row, int column) {
    new SwingElementState(this).waitToBecomeExisting();
    JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
    try {
        TableCell tableCell = new TableCell(row, column) {
        };
        // if the cell coordinates are wrong, the exception will be thrown
        tableFixture.selectCell(tableCell);
        if (tableFixture.component().isCellEditable(row, column)) {
            tableFixture.enterValue(tableCell, value);
        } else {
            throw new NotSupportedOperationException("The table cell [" + row + "," + column + "] is not editable. " + toString());
        }
    } catch (IndexOutOfBoundsException ioobe) {
        throw new UiElementException(ioobe.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) NotSupportedOperationException(com.axway.ats.uiengine.exceptions.NotSupportedOperationException) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 43 with PublicAtsApi

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

the class SwingTable method clickHeader.

/**
     * Click table header by column name
     *
     * @param columnName the column name
     * @throws VerificationException if the table element doesn't exist
     */
@PublicAtsApi
public void clickHeader(String columnName) {
    new SwingElementState(this).waitToBecomeExisting();
    JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
    JTableHeaderFixture tableHeaderFixture = tableFixture.tableHeader();
    try {
        tableHeaderFixture.clickColumn(columnName);
    } catch (Exception e) {
        throw new UiElementException(e.getMessage(), this);
    }
}
Also used : JTableFixture(org.fest.swing.fixture.JTableFixture) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) UiElementException(com.axway.ats.uiengine.exceptions.UiElementException) JTableHeaderFixture(org.fest.swing.fixture.JTableHeaderFixture) 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 44 with PublicAtsApi

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

the class SwingTable method selectCells.

/**
     * Select table cells
     *
     * @param cells the cells coordinates (eg. new int[][]{ { 1, 1 }, { 1, 2 }, { 2, 2 } )
     * @throws VerificationException if the element doesn't exist
     */
@PublicAtsApi
public void selectCells(int[][] cells) {
    new SwingElementState(this).waitToBecomeExisting();
    JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
    try {
        TableCell[] cellsToSelect = new TableCell[cells.length];
        for (int i = 0; i < cells.length; i++) {
            int row = cells[i][0];
            int column = cells[i][1];
            cellsToSelect[i] = new TableCell(row, column) {
            };
        }
        tableFixture.selectCells(cellsToSelect);
    } 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 45 with PublicAtsApi

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

the class SwingSpinner method clickNext.

/**
     * Click next/increment spinner button
     * @param times number of times to click. Must be greater than 0
     * @throws VerificationException if the element doesn't exist
     */
@PublicAtsApi
public void clickNext(int times) {
    if (times <= 0) {
        throw new UiElementException("The number of times to click must be greater than 0", this);
    }
    new SwingElementState(this).waitToBecomeExisting();
    ((JSpinnerFixture) SwingElementLocator.findFixture(this)).increment(times);
}
Also used : SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) JSpinnerFixture(org.fest.swing.fixture.JSpinnerFixture) UiElementException(com.axway.ats.uiengine.exceptions.UiElementException) 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