use of com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMultiDropdownWebElement in project wcomponents by BorderTech.
the class WMultiDropdownTestingExample_Test method testGetAddButton.
@Test
public void testGetAddButton() {
SeleniumWMultiDropdownWebElement component = getByLabel(WMultiDropdownTestingExample.LABEL_NO_SELECTION);
WebElement button = component.getAddButton();
Assert.assertNotNull(button);
// what can we do with the add button?
component = getByLabel(WMultiDropdownTestingExample.LABEL_DISABLED);
button = component.getAddButton();
Assert.assertNotNull(button);
Assert.assertFalse(button.isEnabled());
}
use of com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMultiDropdownWebElement in project wcomponents by BorderTech.
the class WMultiDropdownTestingExample_Test method testDeselectNull.
@Test(expected = IllegalArgumentException.class)
public void testDeselectNull() {
SeleniumWMultiDropdownWebElement component = getByLabel(WMultiDropdownTestingExample.LABEL_ALL_SELECTED);
component.deselect(null);
}
use of com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMultiDropdownWebElement in project wcomponents by BorderTech.
the class WMultiDropdownTestingExample_Test method testGetRemoveButton.
@Test
public void testGetRemoveButton() {
SeleniumWMultiDropdownWebElement component = getByLabel(WMultiDropdownTestingExample.LABEL_ALL_SELECTED);
// anything other than 0 for this test
WebElement dropdown = component.getDropdown(1);
Assert.assertNotNull(component.getRemoveButton(dropdown));
}
use of com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMultiDropdownWebElement in project wcomponents by BorderTech.
the class WMultiDropdownTestingExample_Test method testDeselect.
// TODO: need exception tests for select
@Test
public void testDeselect() {
// to do: this needs to be beefed up a bit.
try {
SeleniumWMultiDropdownWebElement component = getByLabel(WMultiDropdownTestingExample.LABEL_ALL_SELECTED);
List<WebElement> startSelection = component.getSelected();
// cannot deselect the oth item: have to switch it.
String text = WMultiDropdownTestingExample.DATA_LIST.get(1);
component.deselect(text);
List<WebElement> endSelection = component.getSelected();
Assert.assertEquals(startSelection.size() - 1, endSelection.size());
for (WebElement option : endSelection) {
if (text.equalsIgnoreCase(option.getText())) {
Assert.assertFalse("Should not have this in the selection", true);
}
}
} finally {
reset();
}
}
use of com.github.bordertech.wcomponents.test.selenium.element.SeleniumWMultiDropdownWebElement in project wcomponents by BorderTech.
the class WMultiDropdownTestingExample_Test method testDeselectNotSelected.
@Test(expected = SystemException.class)
public void testDeselectNotSelected() {
SeleniumWMultiDropdownWebElement component = getByLabel(WMultiDropdownTestingExample.LABEL_SOME_SELECTED);
component.deselect(StringUtils.join(WMultiDropdownTestingExample.DATA_SOME_SELECTED, " "));
}
Aggregations