Skip to main content

Autotest Agent

To use Drill Test2Code plugin with autotests (RESTful API and Selenium-based UI *) add a special autotest agent to your test automation framework.

Supported test runners:

junit4
junit5
testNG
cucumber

Gradle#

Add the following lines to your project settings.gradle:

pluginManagement {
repositories {
maven { url "https://drill4j.jfrog.io/artifactory/drill" }
}
}

Add the following lines to your project build.gradle:

plugins {
id 'java'
id 'com.epam.drill.agent.runner.autotest' version '0.2.3'
}
drill {
version = "0.16.2"
adminHost = "localhost"
agentId = "ExampleAgentId"
adminPort = 8090
}

Maven#

Add the following lines to your project POM:

<pluginRepositories>
<pluginRepository>
<id>drill</id>
<url>https://drill4j.jfrog.io/artifactory/drill</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>com.epam.drill.agent.runner</groupId>
<artifactId>maven</artifactId>
<version>0.2.3</version>
<executions>
<execution>
<goals>
<goal>autotest</goal>
</goals>
</execution>
</executions>
<configuration>
<drill>
<version>0.16.2</version>
<agentId>ExampleAgentId</agentId>
<adminHost>localhost</adminHost>
<adminPort>8090</adminPort>
</drill>
</configuration>
</plugin>
</plugins>
</build>

For Surefire plugin add args to the main properties block:

<properties>
<extraArgs>${argLine}</extraArgs> // expose to surfire if needed
</properties>

and add to Surefire plugin:

<argLine>-Dfile.encoding=UTF-8 ${extraArgs}</argLine>

or set Drill profile:

<profile>
<id>drill</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>env</name>
<value>dev</value>
</property>
</activation>
<pluginRepositories>
<pluginRepository>
<id>drill</id>
<url>https://drill4j.jfrog.io/artifactory/drill</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>com.epam.drill.agent.runner</groupId>
<artifactId>maven</artifactId>
<version>0.2.3</version>
<executions>
<execution>
<goals>
<goal>autotest</goal>
</goals>
</execution>
</executions>
<configuration>
<drill>
<version>0.16.2</version>
<agentId>ExampleAgentId</agentId>
<adminHost>localhost</adminHost>
<adminPort>8090</adminPort>
<logLevel>TRACE</logLevel>
<logFile>drillLog.log</logFile>
</drill>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<extraArgs>${argLine}</extraArgs> // expose to surfire if needed
</properties>
</profile>

run it:

-P drill

Notes#

If you use the remote setup for UI autotests run (Selenium GRID, SELENOID and etc.), you need to deploy proxy service:

browser-proxy:
image: drill4j/browser-proxy:0.2.0
ports:
- 7777:7777

and add additional param browserProxyAddress to autotests agent config:

Gradle

drill {
additionalParams = ["browserProxyAddress" : "proxyHost:7777"]
version = "0.16.2"
adminHost = "localhost"
agentId = "ExampleAgentId"
adminPort = 8090
}

Maven

<configuration>
<drill>
<additionalParams>
<browserProxyAddress>proxyHost:7777</browserProxyAddress>
</additionalParams>
<version>0.16.2</version>
<agentId>ExampleAgentId</agentId>
<adminHost>localhost</adminHost>
<adminPort>8090</adminPort>
</drill>
</configuration>