Search in sources :

Example 61 with PublicAtsApi

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

the class SwingMultiSelectList method verifyNotValue.

/**
     * Verify the specified value is NOT selected
     *
     * @param notExpectedValue
     * @throws VerificationException if the element doesn't exist
     * @throws VerifyNotEqualityException if the verification fails
     */
@Override
@PublicAtsApi
public void verifyNotValue(String notExpectedValue) {
    new SwingElementState(this).waitToBecomeExisting();
    JListFixture listFixture = ((JListFixture) SwingElementLocator.findFixture(this));
    String selectedValue = (String) listFixture.component().getSelectedValue();
    if ((notExpectedValue == null && selectedValue == null) || (StringUtils.isNotNullAndEquals(selectedValue, notExpectedValue))) {
        throw new VerifyNotEqualityException(notExpectedValue, this);
    }
}
Also used : JListFixture(org.fest.swing.fixture.JListFixture) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) VerifyNotEqualityException(com.axway.ats.uiengine.exceptions.VerifyNotEqualityException) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 62 with PublicAtsApi

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

the class SwingMultiSelectList method clearSelections.

/**
     * Clears the selection
     *
     * @throws VerificationException if the element doesn't exist
     */
@PublicAtsApi
public void clearSelections() {
    new SwingElementState(this).waitToBecomeExisting();
    ((JListFixture) SwingElementLocator.findFixture(this)).clearSelection();
}
Also used : JListFixture(org.fest.swing.fixture.JListFixture) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 63 with PublicAtsApi

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

the class SwingMultiSelectList method unsetValue.

/**
     * Unset MultiSelectList value
     * @throws VerificationException if the element doesn't exist
     */
@Override
@PublicAtsApi
public void unsetValue(String value) {
    if (Arrays.asList(getValues()).contains(value)) {
        JListFixture listFixture = ((JListFixture) SwingElementLocator.findFixture(this));
        listFixture.pressKey(KeyEvent.VK_CONTROL);
        try {
            listFixture.clickItem(value);
        } finally {
            listFixture.releaseKey(KeyEvent.VK_CONTROL);
        }
    }
}
Also used : JListFixture(org.fest.swing.fixture.JListFixture) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 64 with PublicAtsApi

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

the class SwingMultiSelectList method setValue.

/**
     * Set MultiSelectList 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();
    JListFixture listFixture = ((JListFixture) SwingElementLocator.findFixture(this));
    listFixture.pressKey(KeyEvent.VK_CONTROL);
    try {
        listFixture.selectItem(value);
    } finally {
        listFixture.releaseKey(KeyEvent.VK_CONTROL);
    }
}
Also used : JListFixture(org.fest.swing.fixture.JListFixture) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 65 with PublicAtsApi

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

the class SwingPopupMenu method clickMenuItemByText.

/**
     * Click {@link MenuItem} pop-up element by text (actually it's the 'label' attribute value)
     *
     * @param menuItemText {@link MenuItem} text/label
     */
@PublicAtsApi
public void clickMenuItemByText(String... menuItemText) {
    new SwingElementState(this).waitToBecomeExisting();
    ((JPopupMenuFixture) SwingElementLocator.findFixture(this)).menuItemWithPath(menuItemText).click();
}
Also used : SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) 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