@Test public void selectCheckboxNotSelectedSelected() throws Throwable { CheckBox checkBoxNode = (CheckBox) getPrimaryStage().getScene().getRoot().lookup(".check-box"); AssertJUnit.assertEquals(false, checkBoxNode.isSelected()); checkBox.marathon_select("checked"); new Wait("Waiting for the check box selection.") { @Override public boolean until() { return checkBoxNode.isSelected(); } }; }
@Override public boolean marathon_select(String value) { CheckBox cb = (CheckBox) node; if (!isValidState(value)) { throw new JavaAgentException(value + " is not a valid state for CheckBox.", null); } int selection = 0; for (String state : states) { if (state.equalsIgnoreCase(value)) { break; } selection++; } int current = getSelection(cb); if (cb.isAllowIndeterminate()) { if (current != selection) { int nclicks = selection - current; if (nclicks < 0) { nclicks += 3; } for (int i = 0; i < nclicks; i++) { click(); } } } else { if (current != selection) { click(); } } return true; }
JavaFXCheckBoxElement extends JavaFXElement { @Override public boolean marathon_select(String value) { CheckBox cb = (CheckBox) node; if (!isValidState(value)) { throw new JavaAgentException(value + " is not a valid state for CheckBox.", null); } int selection = 0; for (String state : states) { if (state.equalsIgnoreCase(value)) { break; } selection++; } int current = getSelection(cb); if (cb.isAllowIndeterminate()) { if (current != selection) { int nclicks = selection - current; if (nclicks < 0) { nclicks += 3; } for (int i = 0; i < nclicks; i++) { click(); } } } else { if (current != selection) { click(); } } return true; } }
JavaFXCheckBoxElement extends JavaFXElement { @Override public boolean marathon_select(String value) { CheckBox cb = (CheckBox) node; if (!isValidState(value)) { throw new JavaAgentException(value + " is not a valid state for CheckBox.", null); } int selection = 0; for (String state : states) { if (state.equalsIgnoreCase(value)) { break; } selection++; } int current = getSelection(cb); if (cb.isAllowIndeterminate()) { if (current != selection) { int nclicks = selection - current; if (nclicks < 0) { nclicks += 3; } for (int i = 0; i < nclicks; i++) { click(); } } } else { if (current != selection) { click(); } } return true; } JavaFXCheckBoxElement(Node component, IJavaFXAgent driver, JFXWindow window); }
JavaFXCheckBoxElement extends JavaFXElement { @Override public boolean marathon_select(String value) { CheckBox cb = (CheckBox) node; if (!isValidState(value)) { throw new JavaAgentException(value + " is not a valid state for CheckBox.", null); } int selection = 0; for (String state : states) { if (state.equalsIgnoreCase(value)) { break; } selection++; } int current = getSelection(cb); if (cb.isAllowIndeterminate()) { if (current != selection) { int nclicks = selection - current; if (nclicks < 0) { nclicks += 3; } for (int i = 0; i < nclicks; i++) { click(); } } } else { if (current != selection) { click(); } } return true; } JavaFXCheckBoxElement(Node component, IJavaFXAgent driver, JFXWindow window); @Override boolean marathon_select(String value); @Override String _getText(); @Override String _getValue(); }
JavaFXCheckBoxElement extends JavaFXElement { @Override public boolean marathon_select(String value) { CheckBox cb = (CheckBox) node; if (!isValidState(value)) { throw new JavaAgentException(value + " is not a valid state for CheckBox.", null); } int selection = 0; for (String state : states) { if (state.equalsIgnoreCase(value)) { break; } selection++; } int current = getSelection(cb); if (cb.isAllowIndeterminate()) { if (current != selection) { int nclicks = selection - current; if (nclicks < 0) { nclicks += 3; } for (int i = 0; i < nclicks; i++) { click(); } } } else { if (current != selection) { click(); } } return true; } JavaFXCheckBoxElement(Node component, IJavaFXAgent driver, JFXWindow window); @Override boolean marathon_select(String value); @Override String _getText(); @Override String _getValue(); static final Logger LOGGER; static final String[] states; }