Skip to content
Novus Examples
json13.8 KB

Playwright — JSON Report

Playwright's native JSON report, four levels deep: suites contain specs, specs contain tests (one per project) and tests contain results (one per attempt). Its stats use expected/unexpected rather than passed/failed, because a test annotated as expected-to-fail counts as expected when it fails. Reports the same canonical run as the JUnit dialect files: 12 tests, 9 passed, 1 assertion failure, 1 error and 1 skip.

Preview — first 50 linesjson
{
  "config": {
    "configFile": "playwright.config.ts",
    "rootDir": "/builds/novus/checkout",
    "workers": 4,
    "version": "1.47.0",
    "projects": [
      {
        "outputDir": "test-results",
        "name": "chromium",
        "testDir": "tests",
        "retries": 0
      }
    ]
  },
  "suites": [
    {
      "title": "tests/cart/pricing.spec.ts",
      "file": "tests/cart/pricing.spec.ts",
      "column": 0,
      "line": 0,
      "specs": [
        {
          "title": "appliesUnitPrice",
          "ok": true,
          "tags": [],
          "id": "ff8d286f-7bfe-35",
          "file": "tests/cart/pricing.spec.ts",
          "line": 12,
          "column": 5,
          "tests": [
            {
              "timeout": 30000,
              "annotations": [],
              "expectedStatus": "passed",
              "projectId": "chromium",
              "projectName": "chromium",
              "status": "expected",
              "results": [
                {
                  "workerIndex": 0,
                  "status": "passed",
                  "duration": 643,
                  "startTime": "2026-08-07T09:14:22.031Z",
                  "attachments": [],
                  "stdout": [],
                  "stderr": [],
                  "retry": 0
                }
              ]
464 lines total — download for the full file.

Specifications

Seed
61200
Encoding
UTF-8
Line Endings
LF
Format
Playwright JSON reporter
Tests
12
Expected
9
Unexpected
2
Skipped
1
Flaky
0
Duration Unit
milliseconds
Nesting
suites > specs > tests > results

Testing contract

Expected to pass
Scenario
Translate Playwright's expected/unexpected stats into pass/fail counts.
Expected result
expected=9 and unexpected=2 with skipped=1 sum to 12, matching the JUnit twins once the annotation semantics are accounted for.

What is a .json file?

JSON (JavaScript Object Notation) is a lightweight, text-based data-interchange format representing objects, arrays, strings, numbers, booleans, and null. It is language-independent, human-readable, and the dominant format for web APIs and configuration. It requires a single well-formed root value.

How to use this file

Use an example JSON file to test parsers and serializers, schema validation, Unicode and number-precision handling, and API request or response processing.

How to use this file for testing

“Playwright — JSON Report” is a deterministic Novus Examples fixture for JSON parsing, Conversion testing, Error handling. Flat, deeply nested, JSON Lines, and intentionally invalid JSON for testing parsers and error handling.

Documented properties for this file: seed 61200 · UTF-8 · LF. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Test and coverage reports document their totals (suites, cases, passes, failures, skips, covered lines) in the spec table. Point your CI dashboard, coverage gate, or report converter at the file and assert those counts survive; format twins carry identical numbers so a conversion can be scored exactly.

Feed the file to your parser and assert it handles the documented quirks — quoted delimiters, embedded newlines, ragged rows, or invalid syntax; the valid↔invalid distinction is labelled in the title.

Code examples

import json

with open("playwright-report.json") as f:
    data = json.load(f)
print(type(data), len(data))

Generated by generation/testing.py. Free for any use, no attribution required — license.