For the complete documentation index, see llms.txt. This page is also available as Markdown.

Chart & Download Assertion Evaluation

Design evidence-led tests for chart values and downloaded files, separating business correctness from click success and unsupported automation.

Editorial owner: ContextQA Documentation · Last updated: September 12, 2026

Quick answer

A successful chart render or download click proves very little. First create a synthetic source dataset with known values. Then assert the business result at the strongest observable layer: displayed labels/totals, underlying API response, accessible table, downloaded filename, file schema, row count, and exact values. Keep manual or unsupported checks visible.

Define the business oracle

Use a fixture whose answer can be calculated independently:

Dataset version: sales-fixture-v3
Rows: 4
Expected categories: North, South
Expected gross total: 1,250.00 USD
Expected North total: 750.00 USD
Expected export columns: region, orders, gross_usd
Expected export rows: 2 data rows plus header

Do not derive the expected total from the same UI or export being tested.

Evaluate chart assertions

Layer
What it can prove
Example assertion

Visible UI

User can see the intended summary

Title, categories, units, total, selected filter

Accessible representation

Semantics are exposed to assistive and test tooling

Labels and values have meaningful accessible names

Table or tooltip

Individual values match fixture

North = 750.00 USD

Network/API

Source payload is correct

Two categories and expected totals returned

Image comparison

Rendering has not shifted materially

Reviewed visual baseline within policy

An API assertion alone does not prove the chart shows the right value. A screenshot alone may not prove numerical correctness. Combine layers according to the risk.

Evaluate downloaded files

Separate these gates:

  1. the action triggers a download;

  2. the download completes;

  3. filename and extension are correct;

  4. file is readable and matches the expected format;

  5. schema, worksheet names, headers, and required columns are correct;

  6. values, row counts, units, locale, and filters match the fixture;

  7. sensitive or cross-tenant data is absent;

  8. the test deletes or safely retains the artifact.

Playwright’s current download API emits a download event and provides the URL, suggested filename, and payload handling, while noting that temporary downloads are deleted with their browser context. If a ContextQA workflow uses custom code or exported Playwright for content validation, verify the exact supported mechanism in your environment before documenting it as product behavior.

Create an honest capability matrix

Assertion
Automated and observed
Manual review
Unsupported / not evaluated
Evidence

Chart title and filter

Displayed category totals

Canvas-only pixel details

Download event and filename

CSV schema and exact values

Complex spreadsheet formulas

PDF visual pagination

Do not convert “click worked” into “file content validated.”

Run negative controls

  • change one chart source value and confirm the displayed-value assertion fails;

  • remove one required export column and confirm schema validation fails;

  • include a tenant-B row and confirm the boundary assertion fails;

  • apply a filter mismatch and confirm the row-count or total assertion fails;

  • return an empty or corrupt file and confirm the run does not pass.

Frequently asked questions

Is a successful click or download event a sufficient assertion?

No. It proves only that the interaction occurred. The test must also verify the business outcome: the expected series or value for a chart, or the filename, format, schema, records, totals, and authorization boundary for an exported file.

When is OCR acceptable for chart validation?

Use OCR only when visible text is the intended user-facing oracle and its error rate is acceptable for the risk. Prefer accessible labels, underlying data, or a supported API when they provide a more stable and precise observation.

What if the testing platform cannot parse the downloaded file?

Keep the browser step responsible for producing and identifying the artifact, then pass it to a deterministic parser or downstream validation step. Report the workflow as partially automated rather than treating the unverified file as correct.

Evaluate one representative chart or export →. ContextQA support should be scoped to what is actually demonstrated.

Last updated

Was this helpful?