@Test public void selectDate() { DatePicker datePickerNode = (DatePicker) getPrimaryStage().getScene().getRoot().lookup(".date-picker"); IJavaFXElement datePicker = datePickers.get(0); Platform.runLater(() -> { datePicker.marathon_select(dateString); }); List<Object> dates = new ArrayList<>(); Platform.runLater(() -> { LocalDate value = datePickerNode.getValue(); dates.add(datePickerNode.getConverter().toString(value)); }); new Wait("Waiting for date to be set.") { @Override public boolean until() { return dates.size() > 0; } }; AssertJUnit.assertEquals(dateString, dates.get(0)); }
@Override public boolean marathon_select(String value) { DatePicker datePicker = (DatePicker) getComponent(); if (!value.equals("")) { try { LocalDate date = datePicker.getConverter().fromString(value); datePicker.setValue(date); } catch (Throwable t) { throw new DateTimeException("Invalid value for '" + value + "' for date-picker '"); } return true; } return false; }
JavaFXDatePickerElement extends JavaFXElement { @Override public boolean marathon_select(String value) { DatePicker datePicker = (DatePicker) getComponent(); if (!value.equals("")) { try { LocalDate date = datePicker.getConverter().fromString(value); datePicker.setValue(date); } catch (Throwable t) { throw new DateTimeException("Invalid value for '" + value + "' for date-picker '"); } return true; } return false; } }
JavaFXDatePickerElement extends JavaFXElement { @Override public boolean marathon_select(String value) { DatePicker datePicker = (DatePicker) getComponent(); if (!value.equals("")) { try { LocalDate date = datePicker.getConverter().fromString(value); datePicker.setValue(date); } catch (Throwable t) { throw new DateTimeException("Invalid value for '" + value + "' for date-picker '"); } return true; } return false; } JavaFXDatePickerElement(Node component, IJavaFXAgent driver, JFXWindow window); }
JavaFXDatePickerElement extends JavaFXElement { @Override public boolean marathon_select(String value) { DatePicker datePicker = (DatePicker) getComponent(); if (!value.equals("")) { try { LocalDate date = datePicker.getConverter().fromString(value); datePicker.setValue(date); } catch (Throwable t) { throw new DateTimeException("Invalid value for '" + value + "' for date-picker '"); } return true; } return false; } JavaFXDatePickerElement(Node component, IJavaFXAgent driver, JFXWindow window); @Override boolean marathon_select(String value); @Override String _getText(); }
JavaFXDatePickerElement extends JavaFXElement { @Override public boolean marathon_select(String value) { DatePicker datePicker = (DatePicker) getComponent(); if (!value.equals("")) { try { LocalDate date = datePicker.getConverter().fromString(value); datePicker.setValue(date); } catch (Throwable t) { throw new DateTimeException("Invalid value for '" + value + "' for date-picker '"); } return true; } return false; } JavaFXDatePickerElement(Node component, IJavaFXAgent driver, JFXWindow window); @Override boolean marathon_select(String value); @Override String _getText(); static final Logger LOGGER; }