Skip to content

ReportPortal Integration

How E2E test results are reported to ReportPortal in real time during CI pipeline runs.

ReportPortal is a test observability platform that aggregates E2E test results across pipeline runs, allowing you to track test history, identify flaky tests, and drill into failure details.

Dashboard: https://reportportal.shared.cwiq.io Project: orchestrator_ui (note: underscore, not hyphen)


How It Works

The @reportportal/agent-js-playwright reporter is added to Playwright's reporter array. When RP_ENDPOINT is set, the reporter streams test results to ReportPortal as each test completes — you do not need to wait for the pipeline to finish to see results.

flowchart LR
    PW[Playwright test runner] -->|real-time events| RPR[ReportPortal reporter]
    RPR -->|HTTP POST| RP[ReportPortal API<br/>reportportal.shared.cwiq.io]
    RP --> DASH[ReportPortal dashboard<br/>orchestrator_ui project]
    PW -->|after all tests| HTML[HTML report artifact]
    PW -->|after all tests| XML[results.xml JUnit artifact]

Reporter Configuration

The reporter is conditionally enabled in playwright.config.ts. If RP_ENDPOINT is not set (local runs), the block is excluded entirely and ReportPortal reporting is silently disabled.

// platform/ui/playwright.config.ts (reporter section)
reporter: [
  ['list'],
  ['html', { open: 'never', outputFolder: 'playwright-report' }],
  ['junit', { outputFile: 'results.xml' }],
  ...(process.env.RP_ENDPOINT
    ? ([
        [
          '@reportportal/agent-js-playwright',
          {
            endpoint: process.env.RP_ENDPOINT,
            apiKey: process.env.RP_API_KEY || '',
            project: process.env.RP_PROJECT || 'orchestrator_ui',
            launch: process.env.RP_LAUNCH || 'UI E2E Tests',
            description: 'Playwright E2E test run for CWIQ Orchestrator UI',
            attributes: [
              { value: process.env.CI_COMMIT_REF_NAME || 'local' },
              { value: process.env.CI_PIPELINE_ID || 'manual' },
            ],
          },
        ],
      ] as const)
    : []),
],

Environment Variables

These variables are set by the CI job. They are not needed for local runs unless you want to send local results to ReportPortal.

Variable Value in CI Source
RP_ENDPOINT https://reportportal.shared.cwiq.io/api/v2 GitLab CI variable
RP_API_KEY (secret) Vault: secret/data/reportportal/svc-orchestratorapi_key
RP_PROJECT orchestrator_ui GitLab CI variable
RP_LAUNCH UI E2E Tests GitLab CI variable

The RP_API_KEY is never stored in GitLab CI/CD variables. It is fetched from Vault at job start using the nexus-ci role. See CI Integration for the full Vault fetch sequence.


npm Dependency

The reporter is installed as a dev dependency:

// platform/ui/package.json (devDependencies excerpt)
{
  "@reportportal/agent-js-playwright": "5.2.1"
}

To upgrade the reporter, update the version in package.json and run npm install. Check the ReportPortal changelog for breaking changes before upgrading.


Viewing Test Results

From the ReportPortal Dashboard

  1. Open https://reportportal.shared.cwiq.io.
  2. Log in with SSO.
  3. Select the orchestrator_ui project from the project selector.
  4. Click Launches in the left navigation.
  5. Each row is one CI pipeline run. The row shows total test count, pass, fail, and skip counts.
  6. Click a launch to expand it into test suites, then click a suite to see individual tests.
  7. Failed tests show screenshots and Playwright traces attached directly in the ReportPortal UI.

Launch Attributes

Every launch is tagged with two attributes:

  • The git branch name (CI_COMMIT_REF_NAME) — always main for E2E runs.
  • The GitLab pipeline ID (CI_PIPELINE_ID) — links this ReportPortal launch to the specific pipeline run.

Use the attribute filter in ReportPortal to find launches from a specific pipeline or branch.


Sending Local Results to ReportPortal

If you want to send results from a local run to ReportPortal (for debugging a specific test failure), set the required variables before running the tests:

export RP_ENDPOINT=https://reportportal.shared.cwiq.io/api/v2
export RP_API_KEY=<your-personal-api-key-from-reportportal>
export RP_PROJECT=orchestrator_ui
export RP_LAUNCH="Local run - $(whoami)"
export PLAYWRIGHT_BASE_URL=http://localhost:3000

cd platform/ui
npm run e2e

Your personal API key is available in ReportPortal under User ProfileAPI Keys.

When running locally without RP_ENDPOINT, ReportPortal reporting is completely disabled.

You still get the standard console output and the HTML report at playwright-report/index.html. Open it with any browser: open playwright-report/index.html.