protected static String formField(FormTester form, String leafName) { return "form:" + TestFinders.findId(form.getForm(), leafName).orElse(null); }
protected Stream<FormComponent> findFormComponentsByType(SType type) { return findFormComponentsByType(form.getForm(), type); }
protected static String formField(FormTester form, String leafName) { return "form:" + TestFinders.findId(form.getForm(), leafName).orElse(null); }
protected Stream<FormComponent> findFormComponentsByType(SType type) { return findFormComponentsByType(form.getForm(), type); }
/** * Gets the value for an <code>AbstractTextComponent</code> with the provided id. * * @param id * <code>Component</code> id * @return the value of the text component */ public String getTextComponentValue(final String id) { Component c = getForm().get(id); if (c instanceof AbstractTextComponent) { return ((AbstractTextComponent<?>)c).getValue(); } return null; }
/** * Gets the value for an <code>AbstractTextComponent</code> with the provided id. * * @param id * <code>Component</code> id * @return the value of the text component */ public String getTextComponentValue(String id) { Component c = getForm().get(id); if (c instanceof AbstractTextComponent) { return ((AbstractTextComponent)c).getValue(); } return null; }
/** * Gets the value for an <code>AbstractTextComponent</code> with the provided id. * * @param id * <code>Component</code> id * @return the value of the text component */ public String getTextComponentValue(final String id) { Component c = getForm().get(id); if (c instanceof AbstractTextComponent) { return ((AbstractTextComponent<?>)c).getValue(); } return null; }
/** * Gets the value for an <code>AbstractTextComponent</code> with the provided id. * * @param id * <code>Component</code> id * @return the value of the text component */ public String getTextComponentValue(String id) { Component c = getForm().get(id); if (c instanceof AbstractTextComponent) { return ((AbstractTextComponent<?>)c).getValue(); } return null; }
/** * A convenience method for submitting the <code>Form</code> with an alternate button. * <p> * Note that if the button is associated with a model, it's better to use the * <code>setValue</code> method instead: * * <pre> * formTester.setValue("to:my:button", "value on the button"); * formTester.submit(); * </pre> * * @param buttonComponentId * relative path (from <code>Form</code>) to the button * @return This */ public FormTester submit(final String buttonComponentId) { Component submitter = getForm().get(buttonComponentId); if (submitter == null) { fail("Cannot submit the form because there is no submitting component with id: " + buttonComponentId); } return submit(submitter); }
/** * A convenience method for submitting the <code>Form</code> with an alternate button. * <p> * Note that if the button is associated with a model, it's better to use the * <code>setValue</code> method instead: * * <pre> * formTester.setValue("to:my:button", "value on the button"); * formTester.submit(); * </pre> * * @param buttonComponentId * relative path (from <code>Form</code>) to the button * @return This */ public FormTester submit(final String buttonComponentId) { Component submitter = getForm().get(buttonComponentId); if (submitter == null) { fail("Cannot submit the form because there is no submitting component with id: " + buttonComponentId); } return submit(submitter); }
public void testImportShapefileCopyGUI() { tester.clickLink(WicketPath.IMPORT_LINK.path); tester.clickLink(WicketPath.IMPORT_SHAPEFILELINK.path); // Checks that, by default, the output directory cannot be set FormTester form = tester.newFormTester(WicketPath.IMPORT_FORM.path); this.assertDisabled(form.getForm(), WicketPath.IMPORT_OUTDIRECTORY.path); // Checks that, the output directory is enabled when "copy" is set form.setValue(WicketPath.IMPORT_COPY.path, true); this.executeWidgetUpdate(); this.assertEnabled(form.getForm(), WicketPath.IMPORT_OUTDIRECTORY.path); }
this.checkFormStateWhenCopyIsUnchecked(form.getForm()); this.checkFormStateWhenCopyIsChecked(form.getForm()); this.checkFormStateWhenTileIsUnchecked(form.getForm()); this.checkFormStateWhenOverviewIsUnchecked(form.getForm()); this.checkFormStateWhenCopyIsChecked(form.getForm()); this.checkFormStateWhenTileIsChecked(form.getForm()); this.checkFormStateWhenOverviewIsUnchecked(form.getForm()); this.checkFormStateWhenCopyIsChecked(form.getForm()); this.checkFormStateWhenTileIsChecked(form.getForm()); this.checkFormStateWhenOverviewIsChecked(form.getForm()); this.checkFormStateWhenCopyIsChecked(form.getForm()); this.checkFormStateWhenTileIsChecked(form.getForm()); this.checkFormStateWhenOverviewIsUnchecked(form.getForm()); this.checkFormStateWhenCopyIsChecked(form.getForm()); this.checkFormStateWhenTileIsUnchecked(form.getForm()); this.checkFormStateWhenOverviewIsUnchecked(form.getForm()); this.checkFormStateWhenCopyIsUnchecked(form.getForm()); this.checkCompressionTypeIsNONE(form.getForm()); form.select(WicketPath.GEOTIFF_COMPRESSIONTYPE.path, 1); this.executeWidgetUpdate(); this.checkCompressionTypeIsNotNONE(form.getForm()); form.select(WicketPath.GEOTIFF_COMPRESSIONTYPE.path, 0);