Skip to main content

ReportPortal Integration

TestFly can stream TestNG results to ReportPortal in real time. The integration uses the official ReportPortal TestNG agent and is fully opt-in via testfly.yml.

What gets reported​

  • Every TestNG test method is reported as a test item in ReportPortal.
  • Launch name, description, and attributes are taken from testfly.yml.
  • Test statuses are mapped automatically by the ReportPortal agent.
  • After the suite finishes, TestFly prints the ReportPortal dashboard URL and a summary to the console.

Prerequisites​

The ReportPortal TestNG agent is an optional dependency in TestFly. Add it explicitly to your project:

<dependency>
<groupId>com.epam.reportportal</groupId>
<artifactId>agent-java-testng</artifactId>
<version>5.6.8</version>
</dependency>

Or with Gradle:

testImplementation 'com.epam.reportportal:agent-java-testng:5.6.8'

Enable ReportPortal​

Add the reporting.reportportal block to testfly.yml:

reporting:
reportportal:
enabled: true
endpoint: http://localhost:8080
apiKey: ${RP_API_KEY}
project: superadmin_personal
launch: "TestFly Regression"
description: "Automated TestFly test execution"
attributes: "env:ci;branch:main"

Configuration options​

OptionRequiredDefaultDescription
enablednofalseToggle ReportPortal reporting.
endpointyes—ReportPortal server URL.
apiKeyyes—ReportPortal API key. Use ${RP_API_KEY} and inject via environment.
projectyessuperadmin_personalReportPortal project name.
launchyesTestFly LaunchLaunch name.
descriptionnoAutomated TestFly test executionLaunch description.
attributesno—Semicolon-separated key:value pairs, e.g. env:ci;branch:main.

How it works​

  1. FrameworkBootstrap.initialize() reads the ReportPortal config.
  2. The config is converted to ReportPortal system properties (rp.endpoint, rp.api.key, etc.).
  3. SuiteExecutionListener registers com.epam.reportportal.testng.ReportPortalTestNGListener dynamically when the agent is on the classpath.
  4. The agent uploads results while tests run.
  5. After the suite finishes, ReportPortalReportAdapter logs the dashboard URL and summary.

Environment variables​

Use environment variables for secrets instead of hardcoding them:

reporting:
reportportal:
apiKey: ${RP_API_KEY}
endpoint: ${RP_ENDPOINT}

Disabling ReportPortal​

Set enabled: false or remove the reportportal block entirely:

reporting:
reportportal:
enabled: false

Troubleshooting​

ReportPortal is enabled but the TestNG agent is not on the classpath​

Add com.epam.reportportal:agent-java-testng to your project dependencies as shown in Prerequisites.

Missing required field errors​

Check the server log for messages like:

[TestFly] ReportPortal adapter disabled: reporting.reportportal.endpoint is required ...

Make sure endpoint, apiKey, project, and launch are all provided.

Launch does not appear in ReportPortal​

Verify that:

  • The ReportPortal server is reachable from the test runner.
  • The apiKey has permission to write to the configured project.
  • The project name matches the project URL slug in ReportPortal (case-sensitive).