Skip to main content

Playwright Integration

Use @katalon/playwright-reporter to generate Playwright test result files and upload them to your Katalon True Platform project.

Prerequisites​

  • Node.js version 18 or later.
  • @playwright/test version 1.0.0 or later.
  • A Katalon API key if you want to upload results. If you have not set one up yet, follow this guide to generate your API key.
  • Access to the Katalon True Platform project that will receive the uploaded results.
  • Your Katalon project ID. You can find it in the URL after /project/.

Upload Playwright test reports to Katalon True Platform​

  1. Install dependencies: Open your Playwright project and run one of the following commands:

    npm install --save-dev @katalon/playwright-reporter
    pnpm add -D @katalon/playwright-reporter
  2. Configure Playwright: Open playwright.config.ts, then add the reporter and the global setup helper:

    import { defineConfig } from '@playwright/test';
    import { getGlobalSetupPath } from '@katalon/playwright-reporter';

    export default defineConfig({
    globalSetup: getGlobalSetupPath(),
    reporter: [
    ['list'],
    [
    '@katalon/playwright-reporter',
    {
    outputDir: './reports',
    ...(process.env.KATALON_API_KEY && {
    platform: {
    apiKey: process.env.KATALON_API_KEY,
    projectId: process.env.KATALON_PROJECT_ID,
    baseUrl: process.env.KATALON_BASE_URL,
    executionUuid: process.env.KATALON_EXECUTION_UUID,
    authUrl: process.env.KATALON_AUTH_URL,
    },
    }),
    },
    ],
    ],
    });
  3. Run tests: Run the following command:

    npx playwright test

    Playwright runs your tests and the reporter stores Katalon logs in ./reports/.

  4. Upload reports: Choose an uploading method:

  • Separate upload: Add a script to package.json, then run it after your test execution finishes:

    {
    "scripts": {
    "upload": "playwright-reporter upload --output ./reports --api-key $KATALON_API_KEY --project-id $KATALON_PROJECT_ID"
    }
    }

    Full CLI options:

    OptionRequiredDescription
    --output <path>YesPath to the reports directory.
    --api-key <key>YesYour Katalon API key.
    --project-id <id>YesThe Katalon project ID that receives the results.
    --base-url <url>NoPlatform base URL. Default: https://testops.katalon.io.
    --auth-url <url>NoSeparate authentication URL. Default: https://api.katalon.com.
    --execution-uuid <uuid>NoAssociates the uploaded results with an existing execution.
  • Upload during test execution: Specify KATALON_API_KEY and other environment variables before you run - Reports are automatically uploaded, no separate uploading required.

    KATALON_API_KEY=your-key \
    KATALON_PROJECT_ID=your-project-id \
    KATALON_BASE_URL=https://qagen3platform.qa.katalon.com/ \
    npx playwright test

Environment variables

VariableRequiredDefaultDescription
KATALON_API_KEYFor upload—Your Katalon API key.
KATALON_PROJECT_IDFor upload—The target Katalon project ID.
KATALON_BASE_URLFor uploadhttps://testops.katalon.ioThe Katalon True Platform base URL.
KATALON_AUTH_URLNohttps://api.katalon.comOverrides the authentication endpoint.
KATALON_EXECUTION_UUIDNoAuto-generatedGroups results under an existing execution.

Result​

Playwright test results are sent to Katalon True Platform, including:

  • Test name, file path, status, and duration.
  • Screenshots, videos, and trace files as attachments.
  • Browser and project metadata, such as Chromium, Firefox, and WebKit.
  • Error messages and stack traces.

Once the upload finishes successfully, navigate to Test Runs to view your Playwright runs alongside Katalon Studio runs.

playwright test

Playwright tests can then be viewed separately in any report, using filters by Testing Framework.

playwright test in reports
Was this page helpful?