...
Table of Contents | ||
---|---|---|
|
Overview
Test impact analysis is intended to be implemented as part of an automated process. The following overview describes the test impact analysis process:
...
Info | ||
---|---|---|
| ||
TIA is supported for Java 11 and higher- Java 17. See System Requirements for additional information. |
Configuration
Perform the following steps to enable TIA.
Deploy Your Application
Deploy your application under test. An application packaged in any zip-based file format, including zip, war, jar, and ear, is supported, as is a hierarchical directory structure that contains standalone class files or class files embedded within a zip-based file.
Configuring the Selenic Plug-in for Maven
Add the plug-in to your project pom.xml file. The following example shows how to add the dependency for Selenic version 2024.1, but you should use the current version in your build file.
Code Block | ||
---|---|---|
| ||
<build> <plugins> <plugin> <groupId>com.parasoft.selenic</groupId> <artifactId>selenic-maven-plugin</artifactId> <version>1.0.0</version> </plugin> </plugins> </build> |
Configuring Java VM Options
Using the Selenic plug-in for Maven, you can configure Java VM options using the vmArgs
property. See https://parasoft.github.io/selenic-maven-plugin/impacted-tests-mojo.html#vmArgs for more information.
Attaching the Coverage Agent to the AUT
Selenic includes a Java agent that generates the coverage information necessary to determine which tests are affected by changes.
The agent is shipped in the <INSTALL_DIR>/coverage/Java/jtest_agent
directory. It takes configuration settings from the agent.properties file in the same directory. You should copy the coverage directory that contains the agent.jar and agent.properties files to the machine where the AUT is running.
...
You can also check the directory you specified with the runtimeData
property (/home/TIA/coverage_storage
in the example above). The directory should contain a set of coverage data files. The files are generated when the agent is started.
Collecting Test and Coverage Data
Run your Selenium tests using the Selenic agent. The Selenic agent should be configured to collect coverage and to connect to the host and port where the AUT and coverage agent are running. You should also specify a local directory for downloading the coverage information from the server:
...
Refer to the Command Line chapter for additional information about Selenic agent command line arguments.
Collecting Test and Coverage Data in Multi-session Mode
Enable multi-session mode if multiple users or test processes are concurrently accessing the application during Selenium test execution. Multi-session mode enables you to identify the that comes from the Selenium tests being executed. Perform the following actions to run in multi-session mode:
...
Code Block |
---|
mvn test -DargLine=-javaagent:<PATH_TO_SELENIC_AGENT.JAR>=collectCoverage=true,coverageAgentURL=<HTTP://|HTTPS://><HOST>:<PORT>,coverageAgentUserID=<USER_ID>,proxyPort=40090,coverageDir=<PATH_TO_SAVE> |
Generating Baseline Coverage
Selenic includes a Jtest coverage tool (jtestcov) for creating the baseline coverage report. Run it to generate a coverage file as shown in the example below:
...
When the script finishes, the coverage.xml report will be saved to the location specified by the report
flag.
Executing Tests Affected by Change
When a new version of the application is available, you can execute your tests with the Selenic plug-in for Maven and specify the coverage file, deployed WAR file, and path to the Selenic home directory to execute only the tests reported by TIA:
...