Search in sources :

Example 26 with SeleniumWMultiDropdownWebElement

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

the class WMultiDropdownTestingExample_Test method testGetDropdownByTextRO.

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

Example 27 with SeleniumWMultiDropdownWebElement

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

the class WMultiDropdownTestingExample_Test method getDropdownsHelper.

/**
 * Helper for getDropdowns tests.
 * @param component the conponent to test
 * @param expected the List of expected selected options.
 */
private void getDropdownsHelper(final SeleniumWMultiDropdownWebElement component, final List expected) {
    List<WebElement> dropdowns = component.getDropdowns();
    Assert.assertEquals(expected.size(), dropdowns.size());
    Select se;
    for (WebElement dropdown : dropdowns) {
        se = new Select(dropdown);
        Assert.assertTrue(expected.contains(se.getFirstSelectedOption().getText()));
    }
}
Also used : Select(org.openqa.selenium.support.ui.Select) WebElement(org.openqa.selenium.WebElement) SeleniumWMultiDropdownWebElement(com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMultiDropdownWebElement)

Example 28 with SeleniumWMultiDropdownWebElement

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

the class WMultiDropdownTestingExample_Test method testDeselectReadOnly.

@Test(expected = SystemException.class)
public void testDeselectReadOnly() {
    SeleniumWMultiDropdownWebElement component = getByLabel(WMultiDropdownTestingExample.LABEL_RO_ALL_SELECTED);
    String text = WMultiDropdownTestingExample.DATA_LIST.get(1);
    component.deselect(text);
}
Also used : SeleniumWMultiDropdownWebElement(com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMultiDropdownWebElement) Test(org.junit.Test)

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