Merv-Local + JUnit 5 guide
Introduction
JUnit 5 is the standard unit and integration test framework for Java. Merv-Local integrates via @ExtendWith(MervJUnitHandler.class) and writes HTML/JSON reports under merv.report.folder.
- How to add
merv-client-apito Maven - Minimum
merv.propertiesfor local mode - How to register
MervJUnitHandler - Optional Selenium binding for screenshots
- How to record
data,validation, andinfosteps
Add dependency
Add MERV to your project (use the latest version from Maven Central when available):
<dependency>
<groupId>io.github.techelliptica</groupId>
<artifactId>merv-client-api</artifactId>
<version>3.0.3</version>
</dependency>
Configure merv.properties
Place merv.properties on the classpath (for example src/test/resources/):
merv.local=true
merv.regression_suite=Your Regression Suite Name
merv.report.folder=./merv-reports
merv.execution.parallel=false
merv.screenshot=on
Register JUnit 5 extension
Add the extension to your test class:
import org.junit.jupiter.api.extension.ExtendWith;
import org.teche.merv.client.plugin.MervJUnitHandler;
@ExtendWith(MervJUnitHandler.class)
class MyTests {
// tests...
}
Alternatively, use @RegisterExtension if you want per-class control.
Bind automation (optional)
When merv.screenshot=on, bind your driver during test execution:
// Selenium example
MervJUnitHandler.setAutomationToolObject(AutomationTool.SELENIUM, driver);
Plugin steps in tests
Use the unified reporter API (same for Cucumber, TestNG, and JUnit 5):
MervReporter.validation("Verify total", expected, actual);
MervReporter.data("Payload", requestJson);
MervReporter.info("Reached checkout page");
Run tests
mvn test
Viewing Merv reports
After a run, reports live under {merv.report.folder} (for example
./merv-reports/). Open paths through a local web server — not via
file:// in the file manager.
index.html— dashboard: suite grid, KPI charts, consolidated views{runFolder}/html/merv-report.html— final suite report for one run{runFolder}/html/merv-report-live.html— live suite view while tests run
Open with a web server
Merv-Local reports load JSON and charts with fetch. Browsers often block that on
file:// URLs. Use your IDE’s static server (or any local HTTP server) so the address
bar shows http://localhost:….
- In VS Code, install Live Server, right-click
merv-reports/index.html, and choose Open with Live Server. - In IntelliJ IDEA, right-click
index.htmland choose Open in Browser (built-in preview server). - While tests run, keep
merv-report-live.htmlopen on the same server for live updates.
What’s next
- Merv documentation — pick another framework
- Cucumber guide · TestNG guide
- Home — product overview and screenshots
MERV