return null;
}
proVersion = isProVersion(modelItem);
XFormDialogBuilder builder = XFormFactory.createDialogBuilder("Launch TestRunner");
mainForm = builder.createForm("Basic");
mainForm.addComboBox(TESTSUITE, new String[]{}, "The TestSuite to run").addFormFieldListener(
new XFormFieldListener() {
public void valueChanged(XFormField sourceField, String newValue, String oldValue) {
List<String> testCases = new ArrayList<String>();
String tc = mainForm.getComponentValue(TESTCASE);
if (newValue.equals(ALL_VALUE)) {
for (TestSuite testSuite : testSuites) {
for (TestCase testCase : testSuite.getTestCaseList()) {
if (!testCases.contains(testCase.getName())) {
testCases.add(testCase.getName());
}
}
}
} else {
TestSuite testSuite = getModelItem().getTestSuiteByName(newValue);
if (testSuite != null) {
testCases.addAll(Arrays.asList(ModelSupport.getNames(testSuite.getTestCaseList())));
}
}
testCases.add(0, ALL_VALUE);
mainForm.setOptions(TESTCASE, testCases.toArray());
if (testCases.contains(tc)) {
mainForm.getFormField(TESTCASE).setValue(tc);
}
}
});
mainForm.addComboBox(TESTCASE, new String[]{}, "The TestCase to run");
mainForm.addSeparator();
mainForm.addCheckBox(ENABLEUI, "Enables UI components in scripts");
mainForm.addTextField(TESTRUNNERPATH, "Folder containing TestRunner.bat to use", XForm.FieldType.FOLDER);
mainForm.addCheckBox(SAVEPROJECT, "Saves project before running").setEnabled(!modelItem.isRemote());
mainForm.addCheckBox(ADDSETTINGS, "Adds global settings to command-line");
mainForm.addSeparator();
mainForm.addTextField(PROJECTPASSWORD, "Set project password", XForm.FieldType.PASSWORD);
mainForm.addTextField(SOAPUISETTINGSPASSWORD, "Set soapui-settings.xml password", XForm.FieldType.PASSWORD);
mainForm.addCheckBox(IGNOREERRORS, "Do not stop if error occurs, ignore them");
mainForm.addCheckBox(SAVEAFTER, "Sets to save the project file after tests have been run");
advForm = builder.createForm("Overrides");
advForm.addComboBox(ENVIRONMENT, new String[]{"Default"}, "The environment to set for all requests")
.setEnabled(proVersion);
advForm.addComboBox(ENDPOINT, new String[]{""}, "endpoint to forward to");
advForm.addTextField(HOSTPORT, "Host:Port to use for requests", XForm.FieldType.TEXT);
advForm.addSeparator();
advForm.addTextField(USERNAME, "The username to set for all requests", XForm.FieldType.TEXT);
advForm.addTextField(PASSWORD, "The password to set for all requests", XForm.FieldType.PASSWORD);
advForm.addTextField(DOMAIN, "The domain to set for all requests", XForm.FieldType.TEXT);
advForm.addComboBox(WSSTYPE, new String[]{"", "Text", "Digest"}, "The username to set for all requests");
reportForm = builder.createForm("Reports");
reportForm.addCheckBox(PRINTREPORT, "Prints a summary report to the console");
reportForm.addCheckBox(EXPORTJUNITRESULTS, "Exports results to a JUnit-Style report");
reportForm.addCheckBox(EXPORTALL, "Exports all results (not only errors)");
reportForm.addTextField(ROOTFOLDER, "Folder to export to", XForm.FieldType.FOLDER);
reportForm.addSeparator();
reportForm.addCheckBox(COVERAGE, "Generate WSDL Coverage report (SoapUI Pro only)").setEnabled(proVersion);
reportForm.addCheckBox(OPEN_REPORT, "Opens generated report(s) in browser (SoapUI Pro only)").setEnabled(
proVersion);
reportForm.addComboBox(GENERATEREPORTSEACHTESTCASE, new String[0],
"Template used to generate report (SoapUI Pro only)").setEnabled(proVersion);
reportForm.addTextField(REPORTFORMAT, "Choose report format(s), comma-separated (SoapUI Pro only)",
XForm.FieldType.TEXT).setEnabled(proVersion);
propertyForm = builder.createForm("Properties");
propertyForm.addComponent(GLOBALPROPERTIES, createTextArea());
propertyForm.addComponent(SYSTEMPROPERTIES, createTextArea());
propertyForm.addComponent(PROJECTPROPERTIES, createTextArea());
setToolsSettingsAction(null);
buildArgsForm(builder, false, "TestRunner");
return builder.buildDialog(buildDefaultActions(HelpUrls.TESTRUNNER_HELP_URL, modelItem),
"Specify arguments for launching SoapUI TestRunner", UISupport.TOOL_ICON);
}