public interface StepLibraryTool
There is no need to use this interface directly. The ibello dependency injection system automatically instantiates and injects an instance into step libraries.
StepLibrary| Modifier and Type | Method and Description |
|---|---|
CsvTransformer |
csv()
Returns an object which can be used to transform CSV file to java objects.
|
Value |
getConfigurationValue(String name)
Returns a configuration property as a
Value. |
String |
getMergedURL(String url)
Returns an URL which is merged with the
ibello.url.base configuration property. |
HttpClient |
httpClient()
Returns a HTTP client.
|
JsonTransformer |
json()
Returns an object which van be used to transform java objects into JSON and back.
|
OutputHandler |
output()
Returns the output handler tool.
|
RestClient |
restClient()
Returns a REST client.
|
TestDataBuilder |
testData()
Starts a new test data loading.
|
Value getConfigurationValue(String name)
Value. The returned value offers some public methods to
transform the configuration property into different java types.
This method always has a non-null result, even if the configuration value does not exist - in this case,
the wrapped value will be null.name - name of the configuration parameterValue instanceString getMergedURL(String url)
ibello.url.base configuration property.
If the given URL is an absolute one with protocol, then it will be returned (without any changes).
If the URL is relative, then it will be concatenated to the configuration property, and the result will be returned.
url - the absolute or relative URLTestDataBuilder testData()
TestDataBuilder instance which can be used
to configure and perform the test loading operation.TestDataBuilderOutputHandler output()
output().recordCustomAction("Username is " + username);
We can do custom expectation with the following code (using the junit assertion library):
org.junit.Assert.assertEquals("Username is wrong", "Martin", username);
output().recordCustomExpectation("Username is the expected " + username);
This code will throw an AssertionError, if the username is not the expected one. (All AssertionError type
exceptions are handled by the ibello automatically.) If the username is correct, then the second row will add a
message to the test report.OutputHandlerRestClient restClient()
RestClientHttpClient httpClient()
HttpClientJsonTransformer json()
CsvTransformer csv()
Created by Kornél Simon, 2022