The Lippia Test Manager adapter allows to ingest cucumber test results into a Lippia Test Manager instance. To have access to a Lippia Test Manager go to Lippia.io website. To use it you need to to have a test automation code project and use Cucumber 4.
Please note that this adapter supports cucumber >= 4.4.0 && <= 4.8.1
<dependencies>
...
<dependency>
<groupId>io.lippia.report</groupId>
<artifactId>ltm-cucumber4-adapter</artifactId>
<version>1.2-SNAPSHOT</version>
</dependency>
...
</dependencies>
You need to create the class that implements the TestManagerAPIAdapter interface to capture screenshot using a variable driver depending on the type of application you are testing with the automation project
import org.openqa.selenium.remote.RemoteWebDriver
import io.appium.java_client.AppiumDriver
public class TestManagerReporter extends TestManagerAPIAdapter {
public TestManagerReporter(String arg0) {
super();
}
@Override
public String getBase64Image() {
return ((TakesScreenshot) driver.getScreenshotAs(OutputType.BASE64);
}
}
<properties>
...
<test-manager.plugin>--plugin classpath:TestManagerReporter:</test-manager.plugin>
<cucumber.options>... ${test-manager.plugin}</cucumber.options>
...
</properties>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
...
<systemPropertyVariables>
<TEST_MANAGER_USERNAME></TEST_MANAGER_USERNAME>
<TEST_MANAGER_PASSWORD></TEST_MANAGER_PASSWORD>
<TEST_MANAGER_API_HOST></TEST_MANAGER_API_HOST>
<TEST_MANAGER_API_PORT></TEST_MANAGER_API_PORT>
<TEST_MANAGER_RUN_NAME></TEST_MANAGER_RUN_NAME>
<TEST_MANAGER_PROJECT_CODE></TEST_MANAGER_PROJECT_CODE>
<TEST_MANAGER_REPOSITORY_URL></TEST_MANAGER_REPOSITORY_URL>
<TEST_MANAGER_REPOSITORY_BRANCH></TEST_MANAGER_REPOSITORY_BRANCH>
</systemPropertyVariables>
...
</configuration>
</plugin>
...
</plugins>
If you need to know in detail the purpose of each of the properties mentioned above, please continue to the next point, otherwise, ignore it.
Key | Meaning | Is |
---|---|---|
TEST_MANAGER_USERNAME | User with which the Test Manager instance will be authenticated | Mandatory |
TEST_MANAGER_PASSWORD | Password with which the Test Manager instance will be authenticated | Mandatory |
TEST_MANAGER_API_HOST | Host to which the adapter will attempt to authenticate | Mandatory |
TEST_MANAGER_API_PORT | Port on which the Test Manager instance will be listening | Optional |
TEST_MANAGER_RUN_NAME | Run name, serves as identifier of the suite execution | Mandatory |
TEST_MANAGER_PROJECT_CODE | Project Code into which the adapter will attempt to inject test results | Mandatory |
TEST_MANAGER_REPOSITORY_URL | URL of the repository linked to the project | Mandatory |
TEST_MANAGER_REPOSITORY_BRANCH | Branch from where the automated tests are being injected | Mandatory |
By default, it won't take screenshots; If you need to configure your injection, please refer to the following reference & table
config.properties
...
test-manager.screenshots = <strategy>
...
Key | Concept | Is |
---|---|---|
ON_EACH_STEP | Will take screenshots in each step that is completed | Optional |
ON_EACH_SCENARIO | Will take screenshots in each scenario that is completed | Optional |
ON_FAILURE | Will take screenshots in each failure step | Optional |
DISABLED | it won't take screenshots | Optional |