Search in sources :

Example 26 with JTabbedPaneFixture

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

the class SwingTabbedPane method selectTabUsingSubElement.

/**
 * Select tab by title using SubElement described in the map file. The required property is 'title'
 *
 * @param mapId the sub-element mapID. This element must have property 'title'
 * @throws VerificationException if the table element doesn't exist
 */
@PublicAtsApi
public void selectTabUsingSubElement(String mapId) {
    new SwingElementState(this).waitToBecomeExisting();
    try {
        String elementMapId = properties.getInternalProperty(UiElementProperties.MAP_ID_INTERNAL_PARAM);
        if (elementMapId == null) {
            throw new UiElementException("The element must be in the MAP file", this);
        }
        UiElementProperties elProperties = ElementsMap.getInstance().getSubElementProperties(elementMapId, mapId);
        String tabTitle = elProperties.getProperty("title");
        if (tabTitle == null) {
            throw new UiElementException("The Sub-Element doesn't have 'title' attribute, " + "which is required for tab selection.", this);
        }
        ((JTabbedPaneFixture) SwingElementLocator.findFixture(this)).selectTab(tabTitle);
    } catch (Exception e) {
        throw new UiElementException(e.getMessage(), this);
    }
}
Also used : SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) UiElementProperties(com.axway.ats.uiengine.elements.UiElementProperties) UiElementException(com.axway.ats.uiengine.exceptions.UiElementException) JTabbedPaneFixture(org.fest.swing.fixture.JTabbedPaneFixture) UiElementException(com.axway.ats.uiengine.exceptions.UiElementException) VerificationException(com.axway.ats.uiengine.exceptions.VerificationException) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 27 with JTabbedPaneFixture

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

the class SwingTabbedPane method selectTabUsingSubElement.

/**
 * Select tab by title using sub-element properties. The required property is 'title'
 *
 * @param elementProperties the sub-element {@link UiElementProperties} which contains property 'title'
 * @throws VerificationException if the table element doesn't exist
 */
@PublicAtsApi
public void selectTabUsingSubElement(UiElementProperties elementProperties) {
    new SwingElementState(this).waitToBecomeExisting();
    try {
        String tabTitle = elementProperties.getProperty("title");
        if (tabTitle == null) {
            throw new UiElementException("The Sub-Element doesn't have 'title' attribute, " + "which is required for tab selection.", this);
        }
        ((JTabbedPaneFixture) SwingElementLocator.findFixture(this)).selectTab(tabTitle);
    } catch (Exception e) {
        throw new UiElementException(e.getMessage(), this);
    }
}
Also used : SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) UiElementException(com.axway.ats.uiengine.exceptions.UiElementException) JTabbedPaneFixture(org.fest.swing.fixture.JTabbedPaneFixture) UiElementException(com.axway.ats.uiengine.exceptions.UiElementException) VerificationException(com.axway.ats.uiengine.exceptions.VerificationException) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Aggregations

JTabbedPaneFixture (org.fest.swing.fixture.JTabbedPaneFixture)27 File (java.io.File)23 Test (org.junit.Test)23 JTableFixture (org.fest.swing.fixture.JTableFixture)8 JComboBoxFixture (org.fest.swing.fixture.JComboBoxFixture)5 DeltaExchangeOperator (beast.evolution.operators.DeltaExchangeOperator)2 PublicAtsApi (com.axway.ats.common.PublicAtsApi)2 UiElementException (com.axway.ats.uiengine.exceptions.UiElementException)2 VerificationException (com.axway.ats.uiengine.exceptions.VerificationException)2 SwingElementState (com.axway.ats.uiengine.utilities.swing.SwingElementState)2 Component (java.awt.Component)2 JButtonFixture (org.fest.swing.fixture.JButtonFixture)2 JCheckBoxFixture (org.fest.swing.fixture.JCheckBoxFixture)2 JListFixture (org.fest.swing.fixture.JListFixture)2 JMenuItemFixture (org.fest.swing.fixture.JMenuItemFixture)2 JTextComponentFixture (org.fest.swing.fixture.JTextComponentFixture)2 UiElementProperties (com.axway.ats.uiengine.elements.UiElementProperties)1 ElementNotFoundException (com.axway.ats.uiengine.exceptions.ElementNotFoundException)1 SwingDriverInternal (com.axway.ats.uiengine.internal.driver.SwingDriverInternal)1 Dimension (java.awt.Dimension)1