public AddWsdlTestStepAction() {
super("Add Step", "Adds a TestStep to this TestCase");
}
public void perform(WsdlTestCase testCase, Object param) {
WsdlTestStepFactory factory = (WsdlTestStepFactory) param;
if (!factory.canAddTestStepToTestCase(testCase)) {
return;
}
String name = UISupport.prompt("Specify name for new step", "Add Step", factory.getTestStepName());
if (name == null) {
return;
}
while (testCase.getTestStepByName(name.trim()) != null) {
name = UISupport.prompt("Specify unique name of TestStep", "Rename TestStep", name);
if (StringUtils.isNullOrEmpty(name)) {
return;
}
}
TestStepConfig newTestStepConfig = factory.createNewTestStep(testCase, name);
if (newTestStepConfig != null) {
WsdlTestStep testStep = testCase.addTestStep(newTestStepConfig);
if (testStep != null) {
UISupport.selectAndShow(testStep);
}