use of com.github.bordertech.wcomponents.WDropdown in project wcomponents by BorderTech.
the class WDropdownSpecialCharHandlingExample_Test method testExample.
@Test
public void testExample() {
WDropdownSpecialCharHandlingExample example = (WDropdownSpecialCharHandlingExample) getUi();
// Launch the web browser to the LDE
SeleniumWComponentsWebDriver driver = getDriver();
UIContext uic = getUserContextForSession();
UIContextHolder.pushContext(uic);
try {
WDropdown dropdown = (WDropdown) TreeUtil.findWComponent(example, new String[] { "WDropdown" }).getComponent();
List<?> options = dropdown.getOptions();
for (Object option : options) {
driver.findElement(byWComponent(dropdown, option)).click();
driver.findElement(byWComponentPath("WButton")).click();
Assert.assertEquals("Incorrect option selected", option, dropdown.getSelected());
Assert.assertEquals("Incorrect text field text", (option == null ? "" : option), driver.findWTextField(byWComponentPath("WTextField")).getValue());
}
} finally {
UIContextHolder.popContext();
}
}
use of com.github.bordertech.wcomponents.WDropdown in project wcomponents by BorderTech.
the class ExpressionBuilder_Test method testAndOperatorPrecedenceRHS.
/**
* Tests for correct operator precedence when there is an AND on the right-hand side of the OR: a || b
* {@literal &}{@literal &} c.
*/
@Test
public void testAndOperatorPrecedenceRHS() {
builder.equals(new WTextField(), "1").or().equals(new WTextArea(), "2").and().equals(new WDropdown(), "3");
Assert.assertEquals("Incorrect condition", "(WTextField=\"1\" or (WTextArea=\"2\" and WDropdown=\"3\"))", builder.build().toString());
}
use of com.github.bordertech.wcomponents.WDropdown in project wcomponents by BorderTech.
the class ExpressionBuilder_Test method testAndOperatorPrecedenceLHS.
/**
* Tests for correct operator precedence when there is an AND on the left-hand side of the OR: a
* {@literal &}{@literal &} b || c.
*/
@Test
public void testAndOperatorPrecedenceLHS() {
builder.equals(new WTextField(), "1").and().equals(new WTextArea(), "2").or().equals(new WDropdown(), "3");
Assert.assertEquals("Incorrect condition", "((WTextField=\"1\" and WTextArea=\"2\") or WDropdown=\"3\")", builder.build().toString());
}
use of com.github.bordertech.wcomponents.WDropdown in project wcomponents by BorderTech.
the class ExpressionBuilder_Test method testNotWithAndCondition.
/**
* Test Not with And condition.
*/
@Test
public void testNotWithAndCondition() {
builder.equals(new WTextField(), "1").and().not(new ExpressionBuilder().equals(new WTextArea(), "2")).or().not(new ExpressionBuilder().equals(new WTextArea(), "2")).and().equals(new WDropdown(), "3");
Assert.assertEquals("Incorrect condition", "((WTextField=\"1\" and NOT (WTextArea=\"2\")) or (NOT (WTextArea=\"2\") and WDropdown=\"3\"))", builder.build().toString());
}
use of com.github.bordertech.wcomponents.WDropdown in project wcomponents by BorderTech.
the class ExpressionBuilder_Test method testThreeArgAndCondition.
@Test
public void testThreeArgAndCondition() {
builder.equals(new WTextField(), "1").and().equals(new WTextArea(), "2").and().equals(new WDropdown(), "3");
Assert.assertEquals("Incorrect condition", "(WTextField=\"1\" and WTextArea=\"2\" and WDropdown=\"3\")", builder.build().toString());
}
Aggregations