Skip to content
Novus Examples
xml2.8 KB

JUnit XML — @Playwright/Test Dialect (playwright)

The same 12-case Novus Checkout run written the way @playwright/test 1.47 junit reporter writes it. Playwright puts the run totals on the <testsuites> root, names each suite after its spec file, and uses the bare describe title as classname. All eight dialect files in this group report 12 tests, 1 failure, 1 error and 1 skip, so a JUnit parser can be held to identical totals across every producer.

Preview — first 34 linesxml
<?xml version="1.0" encoding="UTF-8"?>
<testsuites id="" name="" tests="12" failures="1" skipped="1" errors="1" time="7.450">
  <testsuite name="tests/cart/pricing.spec.ts" timestamp="2026-08-07T09:14:22.031Z" hostname="chromium" tests="5" failures="1" skipped="0" time="3.744" errors="0">
    <testcase classname="PricingTest" name="appliesUnitPrice" time="0.643" file="tests/cart/pricing.spec.ts"/>
    <testcase classname="PricingTest" name="appliesQuantityMultiplier" time="0.659" file="tests/cart/pricing.spec.ts"/>
    <testcase classname="PricingTest" name="roundsHalfUpAtTwoDecimals" time="1.042" file="tests/cart/pricing.spec.ts"/>
    <testcase classname="PricingTest" name="rejectsNegativeQuantity" time="1.048" file="tests/cart/pricing.spec.ts"/>
    <testcase classname="PricingTest" name="appliesTaxToSubtotal" time="0.352" file="tests/cart/pricing.spec.ts">
      <failure message="expected:&lt;12.60&gt; but was:&lt;12.59&gt;" type="java.lang.AssertionError"><![CDATA[java.lang.AssertionError: expected:<12.60> but was:<12.59>
	at cart.PricingTest.appliesTaxToSubtotal(PricingTest.java:88)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
]]></failure>
    </testcase>
  </testsuite>
  <testsuite name="tests/cart/discounts.spec.ts" timestamp="2026-08-07T09:14:22.031Z" hostname="chromium" tests="4" failures="0" skipped="1" time="2.067" errors="0">
    <testcase classname="DiscountTest" name="appliesPercentageDiscount" time="0.147" file="tests/cart/discounts.spec.ts"/>
    <testcase classname="DiscountTest" name="stacksDiscountsInDeclaredOrder" time="0.327" file="tests/cart/discounts.spec.ts"/>
    <testcase classname="DiscountTest" name="ignoresExpiredCoupon" time="0.893" file="tests/cart/discounts.spec.ts"/>
    <testcase classname="DiscountTest" name="appliesLoyaltyTier" time="0.700" file="tests/cart/discounts.spec.ts">
      <skipped message="loyalty tiers are disabled in the CI profile"/>
    </testcase>
  </testsuite>
  <testsuite name="tests/checkout/session.spec.ts" timestamp="2026-08-07T09:14:22.031Z" hostname="chromium" tests="3" failures="0" skipped="0" time="1.639" errors="1">
    <testcase classname="SessionTest" name="createsSessionForNewCart" time="0.783" file="tests/checkout/session.spec.ts"/>
    <testcase classname="SessionTest" name="expiresSessionAfterTimeout" time="0.695" file="tests/checkout/session.spec.ts">
      <error message="Connection refused: sessions.example.com:5432" type="java.net.ConnectException"><![CDATA[java.net.ConnectException: Connection refused: sessions.example.com:5432
	at checkout.SessionStore.open(SessionStore.java:41)
	at checkout.SessionTest.expiresSessionAfterTimeout(SessionTest.java:57)
]]></error>
    </testcase>
    <testcase classname="SessionTest" name="restoresCartOnResume" time="0.161" file="tests/checkout/session.spec.ts"/>
  </testsuite>
</testsuites>

Specifications

Seed
61200
Dialect
playwright
Producer
@playwright/test 1.47 junit reporter
Tests
12
Failures
1
Errors
1
Skipped
1
Passed
9
Suite Time Seconds
7.45
Root Element
testsuites
Encoding
UTF-8
Line Endings
LF

Testing contract

Expected to pass
Scenario
Parse a JUnit XML report produced in the playwright dialect and extract the run totals.
Expected result
12 tests, 9 passed, 1 failure, 1 error and 1 skipped — identical to the other seven dialect files in this group.

What is a .xml file?

XML (Extensible Markup Language) is a verbose, self-describing markup language using nested tags, attributes, and namespaces to represent structured, hierarchical data. It supports schemas, entities, and validation and underlies many document and data formats. It remains common in enterprise, publishing, and interchange contexts.

How to use this file

Use an example XML file to test parsers, namespace and schema validation, XPath queries, and protection against entity-expansion and external-entity attacks.

How to use this file for testing

“JUnit XML — @Playwright/Test Dialect (playwright)” is a deterministic Novus Examples fixture for Conversion testing, Error handling, Log parsing. The same content exported across many formats and linked as a group, so you can convert one and diff against the expected twin.

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.

Code examples

import xml.etree.ElementTree as ET

tree = ET.parse("playwright-junit-results.xml")
root = tree.getroot()
print(root.tag, [c.tag for c in root][:5])

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