Search in sources :

Example 1 with VerifyNotEqualityException

use of com.axway.ats.uiengine.exceptions.VerifyNotEqualityException 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)

Aggregations

PublicAtsApi (com.axway.ats.common.PublicAtsApi)1 VerifyNotEqualityException (com.axway.ats.uiengine.exceptions.VerifyNotEqualityException)1 SwingElementState (com.axway.ats.uiengine.utilities.swing.SwingElementState)1 JListFixture (org.fest.swing.fixture.JListFixture)1