com.smartbear.readyapi.client.TestRecipeBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ready-api-testserver-client Show documentation
Show all versions of ready-api-testserver-client Show documentation
Java client library for creating and executing test recipes against Ready!API TestServer
package com.smartbear.readyapi.client;
import com.smartbear.readyapi.client.model.TestCase;
import com.smartbear.readyapi.client.model.TestStep;
import com.smartbear.readyapi.client.teststeps.TestStepBuilder;
import java.util.LinkedList;
import java.util.List;
public class TestRecipeBuilder {
private List testStepBuilders = new LinkedList<>();
public TestRecipeBuilder addStep(TestStepBuilder testStepBuilder) {
this.testStepBuilders.add(testStepBuilder);
return this;
}
public TestRecipe buildTestRecipe() {
TestCase testCase = new TestCase();
testCase.setFailTestCaseOnError( true );
addTestSteps(testCase);
return new TestRecipe(testCase);
}
private void addTestSteps(TestCase testCase) {
List testSteps = new LinkedList<>();
for (TestStepBuilder testStepBuilder : testStepBuilders) {
testSteps.add(testStepBuilder.build());
}
testCase.setTestSteps(testSteps);
}
public static TestRecipeBuilder newTestRecipe() {
return new TestRecipeBuilder();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy