Search in sources :

Example 11 with SeleniumWMultiDropdownWebElement

use of com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMultiDropdownWebElement in project wcomponents by BorderTech.

the class WMultiDropdownTestingExample_Test method testGetDropdownByTextNonsense.

@Test(expected = SystemException.class)
public void testGetDropdownByTextNonsense() {
    SeleniumWMultiDropdownWebElement component = getByLabel(WMultiDropdownTestingExample.LABEL_SOME_SELECTED);
    String notInThisWorld = StringUtils.join(WMultiDropdownTestingExample.DATA_SOME_SELECTED, " ");
    component.getDropdown(notInThisWorld);
}
Also used : SeleniumWMultiDropdownWebElement(com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMultiDropdownWebElement) Test(org.junit.Test)

Example 12 with SeleniumWMultiDropdownWebElement

use of com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMultiDropdownWebElement in project wcomponents by BorderTech.

the class WMultiDropdownTestingExample_Test method testGetDropdownsReadOnly.

@Test(expected = SystemException.class)
public void testGetDropdownsReadOnly() {
    SeleniumWMultiDropdownWebElement component = getByLabel(WMultiDropdownTestingExample.LABEL_RO_ONE_SELECTED);
    component.getDropdowns();
}
Also used : SeleniumWMultiDropdownWebElement(com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMultiDropdownWebElement) Test(org.junit.Test)

Example 13 with SeleniumWMultiDropdownWebElement

use of com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMultiDropdownWebElement in project wcomponents by BorderTech.

the class WMultiDropdownTestingExample_Test method testGetDropdownByIdxReadOnly.

@Test(expected = SystemException.class)
public void testGetDropdownByIdxReadOnly() {
    SeleniumWMultiDropdownWebElement component = getByLabel(WMultiDropdownTestingExample.LABEL_RO_SOME_SELECTED);
    component.getDropdown(0);
}
Also used : SeleniumWMultiDropdownWebElement(com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMultiDropdownWebElement) Test(org.junit.Test)

Example 14 with SeleniumWMultiDropdownWebElement

use of com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMultiDropdownWebElement in project wcomponents by BorderTech.

the class WMultiDropdownTestingExample_Test method getOptionsHelper.

/**
 * Helper for getOptions tests for read-only components.
 * @param component the component to test
 * @param expected the list of strings we expect to be selected
 */
private void getOptionsHelper(final SeleniumWMultiDropdownWebElement component, final List expected) {
    List<WebElement> options = component.getOptions();
    Assert.assertEquals(expected.size(), options.size());
    for (WebElement option : options) {
        Assert.assertTrue(expected.contains(option.getText()));
    }
}
Also used : WebElement(org.openqa.selenium.WebElement) SeleniumWMultiDropdownWebElement(com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMultiDropdownWebElement)

Example 15 with SeleniumWMultiDropdownWebElement

use of com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMultiDropdownWebElement in project wcomponents by BorderTech.

the class WMultiDropdownTestingExample_Test method getOptionsHelper.

/**
 * Helper for getOptions tests.
 * @param component the SeleniumWMultiDropdownWebElement to test
 */
private void getOptionsHelper(final SeleniumWMultiDropdownWebElement component) {
    List<WebElement> options = component.getOptions();
    Assert.assertEquals(WMultiDropdownTestingExample.DATA_LIST.size(), options.size());
    for (WebElement option : options) {
        Assert.assertTrue(WMultiDropdownTestingExample.DATA_LIST.contains(option.getText()));
    }
}
Also used : WebElement(org.openqa.selenium.WebElement) SeleniumWMultiDropdownWebElement(com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMultiDropdownWebElement)

Aggregations

SeleniumWMultiDropdownWebElement (com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMultiDropdownWebElement)28 Test (org.junit.Test)25 WebElement (org.openqa.selenium.WebElement)9 Select (org.openqa.selenium.support.ui.Select)1