Skip to content

v1.6.0 — PDF assertions, visual tag support, scrollToAnchor

Choose a tag to compare

@PrestaEdit PrestaEdit released this 13 Aug 06:24
· 9 commits to main since this release

Features

  • Support\Pdf (#54) — new thin wrapper around smalot/pdfparser for asserting on text extracted from a PDF (invoices, credit notes, delivery slips, e-tickets, gift cards). API:

    use PrestaFlow\Library\Support\Pdf;
    
    $pdf = Pdf::fromFile('/tmp/invoice.pdf');   // or fromString()
    $pdf->contains('VAT');                       // case-insensitive by default
    $pdf->matches('/Invoice\s*#?\s*(\d+)/', 1);
    $pdf->pages();                               // string[] per page

    Adds smalot/pdfparser ^2.11 as a runtime dependency. 10 PHPUnit tests with a self-contained PDF fixture.

  • visual[] block in results.json + tag support (#53) — each visual checkpoint is now tagged (name, tag), and comparison results (score, threshold, status, reference / actual / diff paths) are exported in the visual[] block of results.json — groundwork for the API-side baseline + approve UI loop (MVP2).

  • CommonPage::scrollToAnchor() (#48) — new helper to frame a viewport-mode capture (visualCheckpoint(null, null, x, false)) on a given CSS anchor instead of the top of the page (promo/header banners).

Fixes

  • Visual HTML report — mobile-responsive layout (#49).

Docs

  • spec(visual): MVP2 design — full loop with API-side baseline and approve UI.

Upgrade

No breaking API change. composer update prestaflow/php-library:^1.6 (or dev-main).