Release Notes


#PrestaFlow/php-library

#v1.8.1 — PrestaShop 9 area base pages, per-suite version

Released: September 28, 2026

Fix release for two defects in 1.8.0. Upgrade if you run PrestaShop 9 or pin a version per suite. (#70)

Fixes

  • importPage('FrontOffice') works again on PrestaShop 9. 1.8.0 dropped the area base pages Pages\v9\FrontOffice\Page and Pages\v9\BackOffice\Page. On PS 9 this failed with Class "…\Pages\v9\FrontOffice\Page" not found, which made the new VisualTestsSuite unusable there, and broke every custom page extending either class. Both are back.
  • A suite's own PrestaShop version now applies. The $psVersion property and onVersion() announced in 1.8.0 changed nothing: the suite kept the version from PRESTAFLOW_PS_VERSION. The version is now resolved when the suite loads its globals, and again when onVersion() is called, so the pages imported next come from the pinned namespace. Resolution order: onVersion() > $psVersion > PRESTAFLOW_PS_VERSION > 8.1.0.

Upgrade

Copied!
1composer update prestaflow/php-library:^1.8.1

No API change. Drop-in patch release.


#v1.8.0 — Visual suites, theme-aware selectors, One Page Checkout 9.2, run-scoped browser

Released: September 28, 2026

> Upgrade to v1.8.1.](https://github.com/PrestaFlow/php-library/releases/tag/v1.8.1).**) 1.8.0 breaks importPage('FrontOffice') on PrestaShop 9 (so VisualTestsSuite there), and its per-suite $psVersion / onVersion() have no effect.

Highlights

  • Data-driven visual suites (#67, #68) — the groundwork for visual suites edited from the PrestaFlow app:
    • VisualTestsSuite: a suite declared with literal $devices / $locales / $checkpoints. One run = one device × locale combination, taken from the DEVICE / LOCALE globals or, on the CLI, from PRESTAFLOW_DEVICE / PRESTAFLOW_LOCALE. Checkpoints excluded for a device, or a locale that doesn't apply, are reported as skipped.
    • VisualDevices presets (desktop / tablet / mobile).
    • CommonPage::visualCheckpoint(..., array $masks = []) masks elements by selector (always removed afterwards), plus scrollBelow() and waitForStable() helpers.
    • TestsSuite::useBrowserOptions() / browserOptions() / resetBrowser(): per-run window size and user agent, and a clean shutdown of the run's browser.
  • Theme-aware selectors — pages merge the selector overrides of the theme you state (PRESTAFLOW_THEME, or per page via importPage(..., ['theme' => ...]); nothing is auto-detected, Classic is the default). Ships a Hummingbird selector map; overrides follow the page class hierarchy, and a theme can override a selector the whole area (front office / back office) inherits. The BackOffice can also switch the shop's theme.
  • One Page Checkout for PrestaShop 9.2, plus a shop-aware checkout precondition that states the layout the four-page tunnel needs.
  • Account scenarios — account creation, and a provisioner for a known test customer.
  • Per-suite PrestaShop version — onVersion() (fluent) or a suite property overrides the version for one suite.
  • --suites / PRESTAFLOW_SUITES — prestaflow run <path> --suites=BackOffice,FrontOffice/Checkout runs only those sub-folders. This is what the GitHub Action's suites input sets, and until now the library ignored it. An unknown name fails the run (a typo no longer passes as a green job that ran zero tests).
  • Multistore screens reachable from the BackOffice.
  • onAfterTest hook to stream progress out of a running suite.
  • Aggregated results — suites land in a single JSON, with the source location of each test.
  • bin/prestaflow is now exposed as a Composer binary (vendor/bin/prestaflow).
  • Symfony Console / EventDispatcher ^7 accepted alongside ^6 (#69).

Reliability

  • One browser per run. The keepAlive browser used to be found again through one socket file per machine, so a run that finished closed any other run's Chrome under it ("The page was closed and is not available anymore", emptied carts, lost sessions). Each run now owns its browser.
  • A lost browser is reported as such instead of being read as a missing element.
  • waitForPageLoaded() now actually waits (it was a no-op): it polls document.readyState, takes an optional timeout (30 s default) and throws TimeoutException.
  • The CLI exits non-zero when a run throws.
  • Every scenario step carries an assertion, and mute steps are guarded against. Four page objects stopped reporting success they never checked.
  • PRESTAFLOW_EXTRA_HEADERS is read from the process environment too.
  • PrestaShop 1.7: account creation is reached without /registration (which does not exist there).
  • Assorted page fixes: product price inside a larger element, country re-selection, listing product link (theme-overridable, waits for the click), URL placeholders with a scalar parameter.

Architecture

  • Concrete pages moved from Pages\Common\{Area}\{Name}\Page to Pages\v9\.... Common now holds only the base classes (Common\BackOffice\Page, Common\FrontOffice\Page). The v7 and v8 namespaces are backfilled as delegates of v9, so every page still resolves on every version.

Testing infrastructure

  • Flashlight compose fixture for PrestaShop 1.7, 8.2 and 9.2 (with a second shop per container), and front-office + back-office smoke suites run in CI against all three versions.

Compatibility

  • importPage() users: no change. If you referenced a concrete page class directly (PrestaFlow\Library\Pages\Common\FrontOffice\Home\Page, …), switch to PrestaFlow\Library\Pages\v9\... or go through importPage().
  • Calling a method that neither the page object nor the chrome-php Page defines now throws BadMethodCallException instead of silently returning null. A suite that relied on a mistyped call will now fail, which is intended.
  • waitForPageLoaded() can now throw TimeoutException on a page that never finishes loading.
  • A --suites / PRESTAFLOW_SUITES name that matches no folder fails the run.
  • The BROWSER.WINDOW_SIZE_* globals defaulted to a swapped 1000 × 1920 (portrait) when PRESTAFLOW_WINDOW_SIZE_WIDTH / HEIGHT were unset. They now default to 1920 × 1080. A browser launched through that path without an explicit size will render at a different size, so check any visual baselines captured that way.
  • Known limit: on the CLI, getBrowser() reuses any live browser socket without comparing its options. Call resetBrowser() between combinations that need different window sizes (the app does).

Upgrade

Copied!
1composer update prestaflow/php-library:^1.8

#v1.7.1 — Browser/CDP connection memoization (perf)

Released: August 31, 2026

Perf

  • CDP connection memoization (#61, thanks @hugo-fasone!) — TestsSuite::getBrowser() now reuses the connected browser instead of reopening a WebSocket + CDP handshake on every call. TestsSuite::getPage() no longer re-enumerates targets after an unused createPage(), and CommonPage::__call() evaluates getPage() once instead of three times.

    Measured on a project with 2 suites / 5 tests (PHP 8.3, headless Chromium, PS 9.1):

    Before After
    getBrowser() (cached) 102 ms 0 ms
    getPage() ~1,250 ms 166 ms, then 0 ms
    importPage() 3,910 ms 3 ms
    Smoke suite (3 tests) 10.53 s 3.37 s
    Full run (2 suites, 5 tests) 23.67 s 3.60 s

Refactor

  • Hoisted $page = $this->getPage() locally in methods that called it multiple times: visualCheckpoint, getTextContent, getInputValue, navigateTo, click, setValue (CommonPage), goToSubMenu (BackOfficePage), goToNewProduct (Products/Page), openShippingModal (OrderView/Page). Cosmetic follow-up to #61 — no behaviour change.

Compatibility

  • One behaviour shift documented in #61: a dead browser now raises an error instead of being silently relaunched mid-suite (the previous silent relaunch dropped the session and cookies, producing failures that were hard to interpret).
  • No API change otherwise. Drop-in patch release.

Upgrade

Copied!
1composer update prestaflow/php-library:^1.7

#v1.7.0 — PRESTAFLOW_EXTRA_HEADERS (WAF bypass, request tracing, edge headers)

Released: August 13, 2026

Feature

  • PRESTAFLOW_EXTRA_HEADERS (#55) — new env var to attach arbitrary HTTP headers to every browser request, inherited by each page (including those recreated via goToPage() / recreatePage()).

    Copied!
    1PRESTAFLOW_EXTRA_HEADERS='{"X-CI-Bypass":"secret","X-Request-Id":"abc"}'

    Same solid application path as presetBasicAuth(): setConnectionHttpHeaders() at the browser level plus applyExtraHttpHeaders() on the current page.

Use cases

  • WAF / CDN bypass (the actual trigger): Cloudflare WAF Skip rule via X-CI-Bypass: <shared_secret>, without hardcoding the dynamic IP of the CI runners.
  • Request tracing: X-Request-Id: <ci-run-id>, X-CI-Run: <build>.
  • Edge functions: Netlify, Vercel, preview modes.
  • Server-side feature flags: X-Feature-Flag: preview-mode-2.
  • Other WAF/CDN than Cloudflare: Fastly, Sucuri, StackPath.

Robustness

  • Env absent / empty string → silent no-op.
  • Invalid JSON → warning on stderr, execution continues.
  • Non-scalar values (array/null/object) ignored.
  • Booleans/integers cast to string.
  • Merge gives priority to env values → deliberate override of an already-set header (e.g. Authorization) is possible.

Tests

8 unit tests (new file tests/Unit/Tests/ExtraHeadersFromEnvTest.php).

Upgrade

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


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

Released: August 13, 2026

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:

    Copied!
    1use PrestaFlow\Library\Support\Pdf;
    2 
    3$pdf = Pdf::fromFile('/tmp/invoice.pdf'); // or fromString()
    4$pdf->contains('VAT'); // case-insensitive by default
    5$pdf->matches('/Invoice\s*#?\s*(\d+)/', 1);
    6$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).


#v1.5.2

Released: July 12, 2026

Highlights

  • feat: Env helper (#52) — Env::get()/has() centralises reading env vars from $_ENV and getenv(), so process-env vars set by the shell (GitHub Actions env:, KEY=v php ..., docker -e ...) are picked up regardless of PHP's variables_order. Fixes silent fallback to defaults in CI when consumers set env vars but no .env file exists.

Refactor

  • ~30 callsites migrated from raw $ENV['PRESTAFLOW...'] to Env::get(). Normalization blocks kept intact. Behaviour preserved everywhere.
  • 7 new unit tests on the helper (173 total, 388 assertions).

Consumer impact

  • If you were writing a .env file to work around this in CI, you can drop it — env: in workflow YAML now suffices.
  • PrestaFlow/github-action's .env.local fallback remains in place as a safety net for older lib versions.

#v1.5.1

Released: July 11, 2026

Includes PR #51 (browser cache in sys_get_temp_dir, persistent headers, scrollToAnchor).

Key fix

  • fix(TestsSuite) — the datas/ directory no longer shipped with the composer package was causing file_put_contents: Failed to open stream warnings on every install. getFilePath() now falls back to sys_get_temp_dir() prefixed prestaflow-, and creates datas/ when storage_path() is available. Typo .broswer → .browser fixed at the same time.

Required by the smoke test on PrestaFlow/github-action-smoke](https://github.com/PrestaFlow/github-action-smoke)) and any consumer using composer install in CI.


#v1.5.0 — BackOffice validated, checkout & order lifecycle, visual regression, HTTP presets

Released: July 7, 2026

Second minor release after 1.3.0. Turns the framework from nav-validated into a proven end-to-end driver against a live PrestaShop 9: real product create/edit, guest and logged-in checkout, and full order lifecycle in the BackOffice — every increment validated live. Ships visual regression testing, HTTP presets (cookies, Basic Auth, User-Agent), a new RGPD FrontOffice page, cold-start resilience, and fixes several long-standing bugs in the core primitives.

✨ Added — reusable scenarios

  • CheckoutOrder — logged-in customer places an order end-to-end (login → cart → checkout tunnel → confirmation → order found in BackOffice). Live 5/5.
  • GuestCheckout — pure guest checkout with new address (personal info + address + shipping + payment + confirmation). Live 4/4.
  • ManageOrder — opens an order in the BackOffice, changes its status, adds an internal note, sets a tracking number, each verified.
  • OrderLifecycle suite — composes CheckoutOrder → ManageOrder: create then manage. Live 9/9.
  • EditProduct — self-cleaning: create a product, open it from the list, change its price, verify, delete. Live 4/4.
  • CreateProductAndVerify — BackOffice product creation + FrontOffice visibility check (cross-page BO → FO).

✨ Added — page objects & helpers

  • FrontOffice: Cart (goToCart, proceedToCheckout), Checkout (multi-step tunnel + guest steps checkoutAsGuest/fillNewAddress), OrderConfirmation (isConfirmed, getOrderReference), Rgpd (cookie-consent banner handling for the FrontOffice).
  • BackOffice: OrderView (updateStatus/hasStatusInHistory, setInternalNote/getInternalNote, addTracking/getTracking), Orders extended with openOrder, filterByReference, getOrderReferenceInList.
  • Products: real PS 9 create flow (goToNewProduct bypasses the JS type-choice modal), createProduct (name + price + quantity + activate + save), deleteProduct, openProduct, updatePrice, getFormPrice, getCreatedProductId, getCreatedProductUrl (reads the canonical FO URL from the BO Preview link).
  • FrontOfficePage::goToUrl($url) — navigate to an absolute FO URL with a clean session; Product::goToProductPath($path) — reach a product by canonical path.
  • Urls French catalog (src/Urls/fr.json): login=connexion, cart=panier?action=show, order=commande.

✨ Added — visual regression testing

  • CommonPage::visualCheckpoint($label, $fullPage = true) — take a screenshot, compare against a stored baseline, record pass/fail into the run.
  • Visual\VisualComparator — the underlying image diff engine.
  • Reports\VisualReport — renders an HTML report (reports/visual/index.html) plus a visual-results.json side-file, wired to bin/prestaflow run --visual-report[=path].
  • VIEWPORT capture mode via $fullPage = false (in addition to full-page).
  • Baselines stored in a persistent folder (outside the ephemeral screens/).

✨ Added — HTTP presets (env-driven)

  • PRESTAFLOW_USER_AGENT — sets the browser's User-Agent for the whole run.
  • PRESTAFLOW_COOKIES — preload cookies before the first navigation (awaited to be deterministic).
  • HTTP Basic Auth via env — installed at the connection level so it survives every createPage() (persistent headers are automatically re-applied by goToPage).

🔧 Changed — CommonPage primitives (behavioural supersets)

  • getInputValue now reads the live .value property via JS. Fixes <textarea> reads and any field whose current value differs from the initial value attribute.
  • selectOption/selectValue now use querySelector + dispatch change. Handle compound CSS selectors and drive select2 (previously only worked with a bare #id/.class).
  • New setValueByJs($selector, $value) — reliable JS value-set (fires input+change) for fields on inactive tabs or otherwise not focusable.
  • setValue (real click+type) intentionally unchanged.

🐛 Fixed

  • BackOffice login/menu against a live PS 9: correct selectors, French/English tolerance, sidebar sub-links resolve their real <a> href instead of clicking a wrapping <li>.
  • Flaky BO login: waitForPageReload() rewritten to Page::waitForReload(Page::LOAD, 10000) in a bounded try/catch (was evaluating a bogus JS string and hanging on chrome-php's 30s default).
  • Browser lifecycle across suites: keep the keep-alive browser open between suites; close it once per run in ExecuteSuite and clean the socket — series runs are now stable.
  • Session isolation per suite: before() clears cookies via CDP Network.clearBrowserCookies.
  • click() gets a JS-click fallback when a coordinate click can't reach the element (collapsed menu, etc.).
  • Self-signed HTTPS: Chrome launched with ignoreCertificateErrors — no more "connection not private" screen against local Valet TLS.
  • selectOption no longer writes a stray temp.log debug file at every call.
  • Product create field leak: price and quantity live on inactive Pricing/Stocks tabs; the old click+type couldn't focus them and leaked the text into the name field (products came out named PF Edit Test9.9910 with price 0). Now driven via setValueByJs.
  • BackOffice orders row link properly scoped to a[href*="/orders/"][href*="/view"] (the customer link also ends in /view).
  • Tracking read/write: the shipping-edit modal must be opened to populate its form (carrier + CSRF token); the read re-opens the modal (its field pre-fills). The Carriers-tab display cell is lazy and unreliable to read headlessly.
  • Locale propagation: scenarios now push their locale to the suite ($testSuite->params['locale']) before importing pages, so importPage resolves French friendly URLs on the FR demo shop (otherwise /login, /cart, /order fell back to English and 404'd).

🐛 Fixed — cold-start & network resilience

  • Retry the browser launch at cold start — avoids false-green runs when the initial CDP handshake fails ("Message could not be sent. Reason: the connection is closed").
  • Retry close+createPage+navigate in goToPage — swallows the sporadic cold-start getTargetInfo() on null from target enumeration.
  • Retry getPage() on the same flake.
  • Basic Auth: enable Network domain before setBasicAuthHeader (otherwise the header was silently dropped); install it at the connection level so it survives goToPage's createPage.
  • Re-apply persistent HTTP headers after every createPage() (Basic Auth / User-Agent leak-through fix).
  • await setCookies() in cookie presets — deterministic before navigation.
  • Autoload from bin/prestaflow: prefer getcwd() (project autoload) before the library's own vendor — fixes running the library installed as a Composer dep.
  • Composer symlink installs: project path resolution now handles repo symlinks correctly.
  • PRESTAFLOW_USER_AGENT is now honored in getBrowser().

🧰 CI / DX

  • CI-ready runs: non-zero exit on failure, --junit report.
  • New --visual-report[=path] option — HTML + JSON visual-regression report.
  • Vendored nunzion/php-expect (upstream became unreliable).
  • Screenshots on failure (helper + JUnit <system-out> attachment).

🧪 Tests

  • 78 browser-free structural tests / 377 assertions covering the page objects, scenarios, CommonPage primitives, VisualComparator, VisualReport.
  • New suites additionally validated live against a local PrestaShop 9.0.0-rc.1 (French demo shop): ProductsCrud 4/4 · CreateProductAndVerify 4/4 · CheckoutOrder 5/5 · OrderLifecycle 9/9 · GuestCheckout 4/4 · EditProduct 4/4. All three critical suites re-run green after the main merge — zero regression.

Full changelog: v1.3.0…v1.5.0

Test-shop notes for reviewers: uses the PrestaShop demo customer John DOE (pub[@prestashop](https://github.com/prestashop).com) with an address on file; offline payment modules must be enabled AND allowed for the destination country. For visual-regression baselines, use --visual-report and commit the persistent baseline folder alongside the suites.


#1.4.1

Released: July 1, 2026

fix: await on setCookies() for cookie presets (PRESTAFLOW_COOKIES / Rgpd::preAccept) — guarantees the cookie is set before the first navigation (async race fixed). #25


#1.4.0

Released: July 7, 2026

What's new

  • feat: PRESTAFLOW_COOKIES (env, JSON) — pre-sets cookies before navigation (useful for neutralising a GDPR consent banner) + FrontOffice Rgpd page (Knowband ___kbgdcc + generic fallback). #24
  • fix: getBrowser() honours PRESTAFLOW_USER_AGENT (no more hardcoded PrestaFlow User-Agent) — allows a realistic UA to pass anti-bot protections (Cloudflare Browser Integrity Check…). #23

Backwards-compatible.