Playwright Reporting Interview Questions & Answers (2026)

Introduction

Reporting is an essential part of modern software test automation. Writing automated test scripts is only one part of an automation engineer’s responsibility. QA engineers must also understand how to collect test execution results, identify failures, investigate defects, and communicate testing progress to development teams.

Playwright provides several built-in reporters that help testers generate detailed test reports in different formats. These reports display passed tests, failed tests, skipped tests, execution duration, error messages, and debugging information.

In real-world projects, reporting becomes especially important when executing large regression suites across multiple browsers and environments. A properly configured reporting framework helps teams understand application quality and make release decisions.

This is why playwright reporting interview questions are frequently asked during QA Automation Engineer and SDET technical interviews.

Interviewers expect candidates to understand built-in reporters, HTML reporting, JSON and JUnit formats, Allure integration, screenshots, videos, traces, and CI/CD reporting workflows.

Whether you are a fresher, an experienced automation tester, or a Selenium professional transitioning to Playwright, this guide will help you understand reporting concepts through practical TypeScript examples and real-world scenarios.

What Is Reporting in Playwright?

Reporting in Playwright is the process of collecting, organizing, and displaying automated test execution results in a readable format.

Playwright Test provides built-in reporters that generate information about test execution. These reports help QA engineers understand the overall testing status without manually checking every test case.

For example, consider a regression suite containing 100 test cases.

Test execution statusTest count
Passed85
Failed8
Skipped4
Flaky3
Total100

A Playwright report can provide information such as:

  • Test case names and descriptions.
  • Passed, failed, and skipped statuses.
  • Test execution duration.
  • Browser and project information.
  • Error messages and stack traces.
  • Screenshots and video recordings.
  • Trace files and attachments.
  • Retry information.

What Are the Benefits of Playwright Reporting?

Playwright reporting provides several benefits for automation projects.

1. Better test visibility: QA teams can quickly understand the results of automated test execution.

2. Faster debugging: Screenshots, videos, traces, and error messages help identify the root cause of failures.

3. Improved team collaboration: Reports can be shared with developers, QA leads, project managers, and other stakeholders.

4. CI/CD integration: Reports can be generated automatically whenever an automation pipeline executes.

5. Regression analysis: Teams can monitor application stability across different releases.

6. Flaky test identification: Reports help identify tests that produce inconsistent results.

7. Better release decisions: Test results provide useful information about application quality before deployment.

Playwright Reporting Tools and Supported Reporters

Playwright supports different reporting options for displaying and processing automated test results.

Some reporters are included with Playwright Test, while others are provided by third-party reporting frameworks.

Built-in Playwright reporters

ReporterDescription
HTMLGenerates an interactive browser-based report
ListDisplays individual test execution details in the terminal
DotProvides compact test execution output
LineDisplays live execution progress
JSONGenerates structured test results in JSON format
JUnitGenerates XML results for CI/CD tools
BlobStores test execution results for later merging
GitHubProvides GitHub Actions annotations
PerfettoGenerates a trace-compatible output for performance analysis

Third-party reporting tools

Allure Report: Allure integrates with Playwright and provides interactive reports, test categorization, labels, steps, attachments, and execution history when previous results are retained.

Other third-party solutions can also be integrated using custom reporters or external test management platforms.

An important interview point is that Playwright HTML, JSON, JUnit, and Blob are built-in reporting options, whereas Allure is a third-party reporting integration.

Basic Playwright Reporting Interview Questions and Answers

Q1. What is reporting in Playwright?

Answer:

Reporting in Playwright means generating a summary of automated test execution results.

It helps testers understand which test cases passed, failed, or were skipped during execution.

Playwright provides built-in reporters such as HTML, List, Dot, JSON, and JUnit.

For example:

npx playwright test –reporter=html

This command executes tests and generates an HTML report.

Q2. What are the different types of reporters available in Playwright?

Answer:

Playwright provides several built-in reporters.

The commonly used reporters are:

  • HTML reporter.
  • List reporter.
  • Dot reporter.
  • Line reporter.
  • JSON reporter.
  • JUnit reporter.
  • Blob reporter.
  • GitHub reporter.
  • Perfetto reporter.

Each reporter serves a different purpose.

For example, HTML is useful for detailed analysis, JSON is useful for custom processing, and JUnit is useful for CI/CD integrations.

Q3. What is the Playwright HTML report?

Answer:

The Playwright HTML report is a built-in interactive report that displays automated test execution results in a web browser.

It provides information about passed and failed tests, skipped tests, execution duration, error details, browser projects, and available attachments.

Generate the report using:

npx playwright test –reporter=html

After execution, open the report using:

npx playwright show-report

By default, Playwright stores the report in the playwright-report directory.

Q4. What is the difference between HTML and List reporters?

Answer:

The HTML reporter generates an interactive browser-based report, whereas the List reporter displays test execution information directly in the terminal.

HTML reporterList reporter
Generates an HTML reportDisplays terminal output
Supports interactive navigationDisplays individual test results
Useful for sharing resultsUseful for local execution
Supports report attachmentsDoes not generate a standalone HTML report

Q5. What is the Dot reporter in Playwright?

Answer:

The Dot reporter displays compact test execution output.

It avoids printing detailed information for every test case and is useful when executing large automation suites.

Example:

npx playwright test –reporter=dot

It is commonly used in CI/CD pipelines where concise terminal output is preferred.

Q6. What is the JSON reporter?

Answer:

The JSON reporter generates structured test execution results in JSON format.

It is useful when integrating Playwright with custom dashboards, reporting applications, and data analysis tools.

Example:

reporter: [

  [‘json’, {

    outputFile: ‘test-results/results.json’

  }]

]

The generated JSON file can be processed by other applications to create customized reporting dashboards.

Q7. What is the JUnit reporter?

Answer:

The JUnit reporter generates test results in XML format.

It is commonly used with Jenkins and other CI/CD platforms that support JUnit-compatible test result publishing.

Example:

reporter: [

  [‘junit’, {

    outputFile: ‘test-results/results.xml’

  }]

]

Jenkins can read this XML file and display test execution results in the build interface.

Q8. Can we use multiple reporters in Playwright?

Answer:

Yes. Playwright supports multiple reporters in the same configuration.

For example:

reporter: [

  [‘list’],

  [‘html’, {

    open: ‘never’

  }],

  [‘json’, {

    outputFile: ‘test-results/results.json’

  }]

]

This configuration generates three different reporting outputs during one test execution.

It is useful when QA engineers need interactive reports, developers need terminal output, and CI tools need machine-readable results.

Q9. Where does Playwright store HTML reports?

Answer:

By default, Playwright stores HTML reports in:

playwright-report/

The main report file is:

playwright-report/index.html

The report can be opened using:

npx playwright show-report

Q10. How can you prevent Playwright from automatically opening the HTML report?

Answer:

We can configure the HTML reporter using the open property.

reporter: [

  [‘html’, {

    open: ‘never’

  }]

]

The available options are:

  • always: Always open the report.
  • never: Never automatically open the report.
  • on-failure: Open the report when tests fail.

For CI/CD pipelines, never is generally preferred.

Intermediate Playwright Reporting Interview Questions

Q11. How do you configure a reporter in playwright.config.ts?

Answer:

We configure reporters inside the reporter property of the Playwright configuration file.

Example:

import { defineConfig } from ‘@playwright/test’;

export default defineConfig({

  testDir: ‘./tests’,

  reporter: [

    [‘list’],

    [‘html’, {

      outputFolder: ‘playwright-report’,

      open: ‘never’

    }]

  ]

});

This configuration executes the tests and generates an HTML report while displaying execution information in the terminal.

Q12. What is Playwright Allure reporting?

Answer:

Allure is a third-party reporting framework that integrates with Playwright.

It generates interactive reports containing test execution information, categories, labels, steps, attachments, and other useful metadata.

First, install the integration:

npm install -D allure-playwright

Configure it in playwright.config.ts:

import { defineConfig } from ‘@playwright/test’;

export default defineConfig({

  reporter: [

    [‘line’],

    [‘allure-playwright’]

  ]

});

Execute tests:

npx playwright test

Generate the report using the Allure Report 3 CLI:

npx allure generate ./allure-results

Open the generated report:

npx allure open ./allure-report

Allure provides additional reporting capabilities beyond the standard Playwright HTML reporter.

Q13. What is the difference between Playwright HTML and Allure reporting?

Answer:

Both tools generate reports, but their capabilities and intended usage are different.

FeaturePlaywright HTMLAllure
IntegrationBuilt-inThird-party
InstallationIncluded with Playwright TestRequires integration
Test execution resultsYesYes
Screenshots and attachmentsYesYes
Test categorizationBasic filteringRich categorization
Custom labelsLimitedExtensive
Historical trendsNot a built-in historical dashboardSupported through retained history
CI/CD integrationYesYes

For small projects, Playwright HTML reporting is usually sufficient. For enterprise projects requiring richer analytics and categorization, Allure can be a useful choice.

Q14. How can you capture screenshots when a test fails?

Answer:

Playwright provides a screenshot configuration option.

import { defineConfig } from ‘@playwright/test’;

export default defineConfig({

  use: {

    screenshot: ‘only-on-failure’

  }

});

This captures screenshots when a test fails.

The screenshots can be accessed through compatible test reports when the report and its attachments are preserved.

Q15. How can you record videos in Playwright?

Answer:

Playwright supports video recording through browser context configuration.

import { defineConfig } from ‘@playwright/test’;

export default defineConfig({

  use: {

    video: ‘retain-on-failure’

  }

});

Common video options include:

  • off
  • on
  • retain-on-failure
  • on-first-retry

Video recordings are useful when investigating unexpected UI behavior.

Q16. What is Trace Viewer in Playwright?

Answer:

Trace Viewer is a debugging tool that allows testers to inspect test execution step by step.

It provides information such as browser actions, DOM snapshots, network requests, console information, screenshots, and execution timelines.

Configure tracing:

use: {

  trace: ‘retain-on-failure’

}

After a failed execution, open the trace using:

npx playwright show-trace path/to/trace.zip

Trace Viewer is particularly useful for identifying timing issues, locator problems, and unexpected application behavior.

Q17. What is the difference between screenshots, videos, and traces?

Answer:

All three help investigate failures, but they provide different information.

  • Screenshot: Captures the browser’s visual state at a particular moment.
  • Video: Records browser activity throughout the test.
  • Trace: Provides detailed execution information, including actions, snapshots, network activity, and timing.

In enterprise automation projects, retaining traces on failure is especially useful because a trace provides more diagnostic information than a screenshot alone.

Q18. How can you attach custom information to a Playwright report?

Answer:

Playwright provides the testInfo.attach() method to attach custom files or content to a test result.

Example:

import { test, expect } from ‘@playwright/test’;

test(‘Attach API response details’, async ({ page }, testInfo) => {

  await page.goto(‘https://example.com’);

  const response = {

    status: ‘Success’,

    message: ‘Page loaded successfully’

  };

  await testInfo.attach(‘execution-details’, {

    body: Buffer.from(JSON.stringify(response, null, 2)),

    contentType: ‘application/json’

  });

  await expect(page).toHaveTitle(/Example/);

});

This attachment can be displayed in compatible reports.

Q19. What is a flaky test in Playwright reporting?

Answer:

A flaky test is a test that produces inconsistent results across different executions.

For example, a login test might pass during the first execution but fail during another execution because of an unstable network connection or synchronization issue.

Playwright supports retries.

import { defineConfig } from ‘@playwright/test’;

export default defineConfig({

  retries: process.env.CI ? 2 : 0

});

Reports help identify tests that fail initially but pass after a retry.

These tests should be investigated rather than automatically considered reliable.

Q20. How can you generate reports for failed tests only?

Answer:

Playwright supports the onlyFailures option for HTML, JSON, and JUnit reporters.

Example:

reporter: [

  [‘html’, {

    onlyFailures: true,

    open: ‘never’

  }]

]

This is useful when teams want a shorter report focusing on failed, flaky, and interrupted tests.

Advanced Playwright Reporting Interview Questions

Q21. What is the Blob reporter in Playwright?

Answer:

The Blob reporter generates a ZIP file containing detailed test execution results.

It is particularly useful for distributed execution and test sharding.

For example, an automation suite containing 1,000 tests can be divided across four CI jobs.

Each job generates its own Blob report. These reports can later be merged into one final HTML report.

Configure:

reporter: ‘blob’

Merge reports:

npx playwright merge-reports ./blob-report

Blob reporting helps teams manage large regression suites efficiently.

Q22. How can you create a custom reporter in Playwright?

Answer:

Playwright supports custom reporters through its Reporter API.

A custom reporter can collect execution information and generate a customized summary.

Example:

import type {

  Reporter,

  TestCase,

  TestResult

} from ‘@playwright/test/reporter’;

class CustomReporter implements Reporter {

  onTestEnd(test: TestCase, result: TestResult) {

    console.log(

      `Test: ${test.title}`,

      `Status: ${result.status}`

    );

  }

  onEnd() {

    console.log(‘Test execution completed’);

  }

}

export default CustomReporter;

Configure it:

reporter: [

  [‘./custom-reporter.ts’]

]

Custom reporters are useful when organizations require reporting formats that are not directly available through built-in reporters.

Q23. How do you integrate Playwright reporting with Jenkins?

Answer:

Jenkins can publish Playwright JUnit XML results and preserve HTML reports as build artifacts.

First, configure the JUnit reporter:

reporter: [

  [‘junit’, {

    outputFile: ‘test-results/results.xml’

  }],

  [‘html’, {

    outputFolder: ‘playwright-report’,

    open: ‘never’

  }]

]

Example Jenkins pipeline:

pipeline {

  agent any

  stages {

    stage(‘Install Dependencies’) {

      steps {

        sh ‘npm ci’

        sh ‘npx playwright install –with-deps

      }

    }

    stage(‘Execute Tests’) {

      steps {

        sh ‘npx playwright test’

      }

    }

  }

  post {

    always {

      junit ‘test-results/results.xml’

      archiveArtifacts(

        artifacts: ‘playwright-report/**’,

        allowEmptyArchive: true

      )

    }

  }

}

The always condition ensures Jenkins attempts to publish the results even when test execution fails.

Q24. How do you integrate Playwright reports with GitHub Actions?

Answer:

GitHub Actions can execute Playwright tests and upload generated reports as workflow artifacts.

Example workflow:

name: Playwright Tests

on:

  push:

    branches: [main]

  pull_request:

jobs:

  test:

    runs-on: ubuntu-latest

    steps:

      – name: Checkout

        uses: actions/checkout@v4

      – name: Setup Node

        uses: actions/setup-node@v4

        with:

          node-version: 22

      – name: Install dependencies

        run: npm ci

      – name: Install browsers

        run: npx playwright install –with-deps

      – name: Execute tests

        run: npx playwright test

      – name: Upload Playwright Report

        if: ${{ !cancelled() }}

        uses: actions/upload-artifact@v4

        with:

          name: playwright-report

          path: |

            playwright-report/

            test-results/

          retention-days: 30

After execution, open the GitHub Actions workflow and download the report from its artifacts section.

Q25. How do you manage reports for large regression suites?

Answer:

For large automation projects, generating reports from a single execution process may increase execution time.

Playwright supports sharding, which distributes test execution across multiple jobs.

A recommended strategy is:

  1. Divide the regression suite into multiple shards.
  2. Execute each shard independently.
  3. Generate Blob reports.
  4. Upload reports as CI artifacts.
  5. Download and combine the Blob reports.
  6. Generate one final HTML report.

Example:

npx playwright test –shard=1/4 –reporter=blob

Other jobs execute:

npx playwright test –shard=2/4 –reporter=blob

npx playwright test –shard=3/4 –reporter=blob

npx playwright test –shard=4/4 –reporter=blob

After collecting all reports:

npx playwright merge-reports –reporter=html ./all-blob-reports

This provides a consolidated report for the complete regression suite.

Q26. How do you identify repeated test failures from reports?

Answer:

Repeated failures can be identified by analyzing:

  • Test names.
  • Failure messages.
  • Browser information.
  • Execution duration.
  • Retry results.
  • Environment details.
  • Trace files.

For example, if the same checkout test fails repeatedly in WebKit but passes in Chromium and Firefox, the QA team should investigate browser-specific behavior.

A useful reporting strategy is to categorize failures as:

  • Application defects.
  • Automation script defects.
  • Environment failures.
  • Network-related failures.
  • Flaky tests.

This helps teams prioritize defect investigation.

Q27. What is the difference between a reporter and a test listener?

Answer:

A reporter is responsible for collecting and presenting test execution results.

Playwright’s Reporter API exposes lifecycle methods such as:

  • onBegin()
  • onTestBegin()
  • onTestEnd()
  • onEnd()

These methods allow custom reporters to process execution events.

A test listener is a more general programming concept. In Playwright, reporting integrations commonly use the Reporter API rather than a separate Selenium-style listener interface.

Q28. How do you handle reporting when tests fail in CI/CD?

Answer:

A reliable CI/CD pipeline should preserve reports and diagnostic attachments even when tests fail.

Recommended configuration:

import { defineConfig } from ‘@playwright/test’;

export default defineConfig({

  retries: process.env.CI ? 2 : 0,

  reporter: [

    [‘dot’],

    [‘html’, {

      open: ‘never’

    }],

    [‘junit’, {

      outputFile: ‘test-results/results.xml’

    }]

  ],

  use: {

    screenshot: ‘only-on-failure’,

    video: ‘retain-on-failure’,

    trace: ‘retain-on-failure’

  }

});

The CI pipeline should use an unconditional post-test publishing step or an equivalent condition.

This prevents failed tests from causing diagnostic reports to be discarded.

Q29. How can you customize Playwright HTML report settings?

Answer:

The HTML reporter supports options such as:

  • outputFolder
  • open
  • attachmentsBaseURL
  • noCopyPrompt
  • noSnippets
  • title
  • host
  • port

Example:

reporter: [

  [‘html’, {

    outputFolder: ‘reports/html’,

    open: ‘never’,

    title: ‘Automation Regression Report’

  }]

]

This configuration stores the report in a custom directory and assigns a meaningful report title.

Q30. Which reporting strategy would you recommend for an enterprise Playwright project?

Answer:

For an enterprise project, I would recommend combining multiple reporting capabilities.

My preferred approach would include:

  1. HTML reporting for interactive test analysis.
  2. JUnit reporting for Jenkins integration.
  3. Blob reporting for sharded execution.
  4. Screenshots and traces for failure investigation.
  5. Allure reporting when additional analytics and categorization are required.

I would also configure retries carefully and monitor flaky tests.

The main objective is to make test results understandable, accessible, and useful for the entire engineering team.

Configuring Playwright HTML, List, Dot, JSON, JUnit, and Allure Reporting

Understanding individual reporters is important, but interviewers also expect candidates to demonstrate practical configuration knowledge.

The following examples show how to configure different reporters.

HTML reporter configuration

reporter: [

  [‘html’, {

    outputFolder: ‘playwright-report’,

    open: ‘never’

  }]

]

This generates an interactive HTML report without automatically opening the browser.

List reporter configuration

reporter: [

  [‘list’]

]

This displays individual test execution results in the terminal.

Dot reporter configuration

reporter: [

  [‘dot’]

]

This provides compact output and is suitable for large test suites.

JSON reporter configuration

reporter: [

  [‘json’, {

    outputFile: ‘test-results/results.json’

  }]

]

This generates structured test results for custom dashboards and integrations.

JUnit reporter configuration

reporter: [

  [‘junit’, {

    outputFile: ‘test-results/results.xml’

  }]

]

This generates XML results that can be published in Jenkins and other CI/CD platforms.

Allure reporter configuration

Install the integration:

npm install -D allure-playwright

Configure:

reporter: [

  [‘allure-playwright’]

]

Execute the tests and generate the Allure report using the Allure CLI.

Complete Playwright TypeScript Reporting Configuration

The following example demonstrates a practical configuration suitable for a professional QA automation framework.

Step 1: Install Playwright

Create a new Playwright project:

npm init playwright@latest

If you already have a Node.js project, install Playwright Test:

npm install -D @playwright/test

Install browsers:

npx playwright install

Step 2: Create playwright.config.ts

import { defineConfig, devices } from ‘@playwright/test’;

export default defineConfig({

  testDir: ‘./tests’,

  fullyParallel: true,

  forbidOnly: !!process.env.CI,

  retries: process.env.CI ? 2 : 0,

  workers: process.env.CI ? 1 : undefined,

  reporter: [

    [‘list’],

    [‘html’, {

      outputFolder: ‘playwright-report’,

      open: ‘never’,

      title: ‘TechSarvam Automation Report’

    }],

    [‘json’, {

      outputFile: ‘test-results/results.json’

    }],

    [‘junit’, {

      outputFile: ‘test-results/results.xml’

    }]

  ],

  use: {

    baseURL: ‘https://example.com’,

    screenshot: ‘only-on-failure’,

    video: ‘retain-on-failure’,

    trace: ‘retain-on-failure’

  },

  projects: [

    {

      name: ‘chromium’,

      use: { …devices[‘Desktop Chrome’] }

    },

    {

      name: ‘firefox’,

      use: { …devices[‘Desktop Firefox’] }

    },

    {

      name: ‘webkit’,

      use: { …devices[‘Desktop Safari’] }

    }

  ]

});

Explanation of the configuration

testDir: Specifies where automated test files are stored.

fullyParallel: Allows independent tests to execute in parallel.

forbidOnly: Prevents accidentally committed focused tests from running in CI.

retries: Retries failed tests in CI environments.

workers: Controls the number of parallel workers.

reporter: Generates List, HTML, JSON, and JUnit outputs.

screenshot: Captures screenshots for failed tests.

video: Retains videos for failed tests.

trace: Retains traces for failed tests.

projects: Executes tests across Chromium, Firefox, and WebKit.

Step 3: Create a Sample Test

Create a file named tests/login.spec.ts.

import { test, expect } from ‘@playwright/test’;

test.describe(‘Login Functionality’, () => {

  test(‘Verify login page title’, async ({ page }) => {

    await page.goto(‘https://example.com’);

    await expect(page).toHaveTitle(/Example Domain/);

  });

  test(‘Verify page heading’, async ({ page }) => {

    await page.goto(‘https://example.com’);

    await expect(

      page.locator(‘h1’)

    ).toHaveText(‘Example Domain’);

  });

});

Step 4: Execute the tests

npx playwright test

After execution, check the generated directories:

playwright-report/

test-results/

    results.json

    results.xml

Step 5: Open the HTML report

npx playwright show-report

This opens the interactive report in the browser.

For an enterprise framework, keep reporting configuration centralized in playwright.config.ts. This avoids maintaining different reporting settings across individual test files.

Adding Screenshots, Videos, Traces, Logs, and Attachments to Reports

Good reporting should provide more than a pass/fail summary.

When a test fails, developers need enough diagnostic information to understand what happened.

Adding a screenshot manually

import { test } from ‘@playwright/test’;

test(‘Capture application screenshot’, async ({ page }, testInfo) => {

  await page.goto(‘https://example.com’);

  const screenshot = await page.screenshot();

  await testInfo.attach(‘Application Screenshot’, {

    body: screenshot,

    contentType: ‘image/png’

  });

});

This attaches a screenshot to the test result.

Attaching execution logs

import { test } from ‘@playwright/test’;

test(‘Attach execution logs’, async ({ page }, testInfo) => {

  const logs: string[] = [];

  page.on(‘console’, message => {

    logs.push(message.text());

  });

  await page.goto(‘https://example.com’);

  await testInfo.attach(‘Browser Logs’, {

    body: logs.join(‘\n’),

    contentType: ‘text/plain’

  });

});

This example captures browser console messages and attaches them to the test result.

Capturing network failures

import { test } from ‘@playwright/test’;

test(‘Capture failed network requests’, async ({ page }, testInfo) => {

  const failures: string[] = [];

  page.on(‘requestfailed’, request => {

    failures.push(

      `${request.url()} – ${request.failure()?.errorText}`

    );

  });

  await page.goto(‘https://example.com’);

  await testInfo.attach(‘Network Failures’, {

    body: failures.join(‘\n’),

    contentType: ‘text/plain’

  });

});

This approach is useful when investigating application failures caused by network requests.

Generating and Viewing Playwright Test Reports

The following commands are commonly used in automation projects.

CommandPurpose
npx playwright testExecute tests
npx playwright test –reporter=htmlGenerate HTML report
npx playwright test –reporter=listDisplay List reporter
npx playwright test –reporter=dotDisplay Dot reporter
npx playwright test –reporter=jsonGenerate JSON output
npx playwright show-reportOpen HTML report
npx playwright show-trace trace.zipOpen Trace Viewer
npx playwright merge-reports ./blob-reportMerge Blob reports

A useful interview point is that generating a report and viewing a report are two different operations.

For example, npx playwright test –reporter=html generates the report, whereas npx playwright show-report serves the generated report for browser viewing.

Integrating Playwright Reporting with Jenkins and GitHub Actions

Continuous integration allows teams to execute automated tests whenever code changes are pushed or merged.

Reporting integration helps developers understand test results without running tests manually.

Jenkins reporting workflow

A typical Jenkins workflow includes:

  1. Checkout the source code.
  2. Install Node.js dependencies.
  3. Install Playwright browsers.
  4. Execute automated tests.
  5. Generate HTML and JUnit reports.
  6. Publish JUnit results.
  7. Archive HTML reports and diagnostic attachments.

The Jenkins pipeline shown earlier demonstrates how to use the junit and archiveArtifacts steps.

GitHub Actions reporting workflow

A typical GitHub Actions workflow includes:

  1. Checkout the repository.
  2. Set up Node.js.
  3. Install dependencies.
  4. Install browsers.
  5. Execute Playwright tests.
  6. Upload reports as workflow artifacts.

The uploaded report can be downloaded from the workflow run.

Real-world recommendation: Use HTML reports for QA analysis and JUnit XML for CI test-result integration. Preserve screenshots, videos, and traces when investigating failed builds.

Real-World Reporting Scenarios for QA Automation Projects

Scenario 1: Login test passes locally but fails in Jenkins

Question: Your login automation test passes locally but fails in Jenkins. How would you investigate?

Sample answer:

I would first inspect the Jenkins test results and identify the failed test case.

Then I would check the error message, screenshot attachments, Trace Viewer, browser version, environment variables, test data, and network connectivity.

I would reproduce the issue in the same environment before modifying the automation script.

Scenario 2: Regression suite contains 2,000 tests

Question: Your project has 2,000 regression test cases. How would you generate reports efficiently?

Sample answer:

I would divide the regression suite into multiple shards and execute them through separate CI jobs.

Each job would generate a Blob report. After execution, I would collect all Blob reports and merge them into one HTML report.

This reduces execution time while maintaining a consolidated view of regression results.

Scenario 3: Management wants a daily test execution summary

Question: The project manager wants to know the overall automation execution status every day. What would you provide?

Sample answer:

I would generate reports containing total tests, passed tests, failed tests, skipped tests, flaky tests, execution duration, browser-wise results, and major defects.

I would publish reports as CI artifacts and use a dashboard or reporting integration to communicate trends.

Scenario 4: HTML report is generated but screenshots are missing

Question: Test failures appear in the report, but screenshots are unavailable. What would you check?

Sample answer:

I would check whether screenshot capture is enabled.

use: {

  screenshot: ‘only-on-failure’

}

I would also inspect the test-results directory, check CI artifact upload paths, and verify that the report and its attachment data are preserved.

I would ensure that the report is not being copied separately from its required attachment files.

Scenario 5: Tests pass after retries

Question: Ten test cases fail initially but pass during retry. How would you handle this?

Sample answer:

I would classify them as potentially flaky tests and investigate their causes.

Possible reasons include incorrect synchronization, unstable test data, network delays, application performance issues, shared test state, and browser-specific issues.

I would track these tests separately instead of treating the final successful status as proof of stability.

Troubleshooting Playwright Reporting Issues

Reporting problems are common in real automation frameworks.

ProblemPossible reasonSolution
HTML report not generatedIncorrect reporter configurationVerify the reporter property
Report does not openAutomatic opening disabledRun npx playwright show-report
Screenshots missingScreenshot option disabledEnable only-on-failure
Video missingIncorrect video configurationConfigure video retention
Trace missingTracing disabledConfigure retain-on-failure
JUnit file missingIncorrect output pathVerify JUnit configuration
JSON report missingIncorrect outputFileCheck JSON configuration
CI report unavailableArtifacts not uploadedCheck CI artifact paths
Allure report emptyMissing or stale result filesVerify Allure result generation
Merged report incompleteMissing Blob filesCollect all shard outputs

Important troubleshooting tips

1. Check the output directory

Make sure the configured output directory exists or can be created by Playwright.

2. Check CI artifact paths

Verify that the CI pipeline uploads the correct folders.

3. Avoid deleting reports too early

Some cleanup scripts remove generated reports before the upload step.

4. Check Allure results

Allure results should be generated before running the report generation command.

5. Preserve report attachments

When transferring HTML reports, preserve the report’s associated data and attachments.

6. Check execution failures separately

A missing report can result from a process being terminated before the reporter completes. Inspect the CI job logs and ensure the publishing stage runs after test execution.

Best Practices for Playwright Reporting

A professional automation framework should follow consistent reporting standards.

1. Select the right reporter

Use HTML for interactive analysis, JUnit for CI integrations, and JSON for custom processing.

2. Capture useful failure information

Enable screenshots, videos, and traces according to project requirements.

3. Avoid unnecessary attachments

Large videos and excessive screenshots can increase storage costs and CI artifact size.

4. Use meaningful test names

For example:

test(‘Verify user login with valid credentials’, async ({ page }) => {

  // Test implementation

});

Clear test names improve report readability.

5. Configure CI-specific reporting

Use concise terminal output in CI and detailed reports as downloadable artifacts.

6. Monitor flaky tests

Identify repeated failures and investigate their root causes.

7. Use Blob reporting for sharding

For large test suites, Blob reports make report consolidation easier.

8. Keep reports accessible

Provide developers and QA engineers with access to relevant execution reports.

9. Protect sensitive information

Avoid attaching passwords, authentication tokens, personal information, or confidential application data to reports.

10. Maintain historical reporting

Preserve reports when historical comparisons, trend analysis, and audit requirements are important.

Frequently Asked Questions About Playwright Reporting

Q1. Is Playwright reporting suitable for beginners?

Yes. Playwright includes built-in reporting functionality, so beginners can generate HTML reports without installing additional reporting packages.

Start with:

npx playwright test –reporter=html

Q2. Is Playwright HTML reporting free?

Yes. The built-in HTML reporter is included with Playwright Test and does not require a separate reporting subscription.

Q3. Which is the best reporter in Playwright?

The best reporter depends on the project.

HTML is excellent for interactive analysis, JUnit is useful for CI/CD integrations, and JSON is useful for programmatic processing.

Q4. Can Playwright generate reports automatically?

Yes. Playwright generates configured reports when test execution finishes.

Q5. Can we integrate Allure with Playwright TypeScript?

Yes. Install allure-playwright and configure it in playwright.config.ts.

Q6. Can Playwright generate reports for multiple browsers?

Yes. Playwright supports browser projects for Chromium, Firefox, and WebKit. Reports can display results from different projects.

Q7. Can we customize Playwright reports?

Yes. You can configure built-in reporter options, attach additional information, or implement a custom reporter.

Q8. Can we publish Playwright reports in Jenkins?

Yes. Jenkins can publish JUnit XML results and archive HTML report folders.

Q9. How do you open a Playwright report?

Use:

npx playwright show-report

Q10. What is the difference between Blob and HTML reporting?

Blob reporting creates ZIP files containing detailed execution information for later processing and merging. HTML reporting generates an interactive browser-based report.

Leave a Comment

Your email address will not be published. Required fields are marked *