Notes de version


#PrestaFlow/php-library

#v1.11.0 — Reload once on a broken image before a visual capture, skipOn()

Publiée le : December 2, 2026

Visual captures no longer go out with an image the shop failed to serve, and tests can be skipped on some environments.

Highlights

  • One reload on a broken image before a visual capture. The library already waited for images before a capture, but an image in error counted as loaded: a logo the shop failed to serve became its alt text in the capture, and the checkpoint failed at random. After the wait, <img> still broken in the captured area (complete with naturalWidth 0, confirmed by decode(); hidden, source-less, lazy below the fold, tiny or transparent images are ignored) now trigger one Page.reload, then the whole preparation again (element, masks, hide, images, scroll position), then the capture. (#195)
    • On by default in front-office visual suites. In back-office suites and in scenarios, only with 'reloadOnBrokenImages' => true: a page state made by a click is never lost. Never after a form submission (POST, POST + redirect, GET form), outside http(s), or when the navigation history can't be read.
    • An image still broken after a successful reload doesn't trigger another one in the same run.
    • Images still broken are listed as broken_images in the checkpoint and in the results.json visual block (with broken_images_reloaded), with an « Images non chargées » warning. Checkpoint statuses don't change.
    • Off with 'reloadOnBrokenImages' => false on a checkpoint or PRESTAFLOW_VISUAL_RELOAD_BROKEN_IMAGES=0.
  • skipOn() skips a test on some of the project's environments: ->it('…', fn)->skipOn('Production') or ->skipOn(['Production', 'Principal'], 'reason'), matched on PRESTAFLOW_ENVIRONMENT (case and spaces ignored). The test runs everywhere else, and when no environment is given. (#194)

#v1.10.0 — Captcha-protected back-office login, keep going after a failure, soft assertions

Publiée le : December 1, 2026

Back-office login behind an invisible captcha, module configuration in one call, suites that keep going after a failure, and .env files that merge as intended.

Highlights

  • Back-office login behind an invisible captcha. login() now waits for the Turnstile, reCAPTCHA or hCaptcha token (cf-turnstile-response, g-recaptcha-response, h-captcha-response) before submitting. Without it the form posted an empty token and the refusal looked like wrong credentials. captchaTokenTimeout sets the wait (15 s by default, 0 turns it off), and captchaTokenSeen tells whether the token came. A shop without a captcha pays a single check. On a test shop, use the provider's test keys: a challenge that needs a human never fills the field. (#189)
  • Modules::goToConfiguration($name) opens a module's configuration page in one call on 1.7, 8 and 9: dashboard, Module Manager, search, then the card's own "Configure" link. On 8 the dashboard URL carries a per-controller token=, not _token, so a URL built from it fails; the card carries the right token. (#189)
  • Keep going after a failure. skipWhenFailed(TestsSuite::SKIP_DATASET) skips only the rest of the failed dataset; the next dataset starts again from its first test. skipWhenFailed(false) runs everything. The default (true) is unchanged. (#190)
  • Soft assertions. Expect::soft() takes the same assertions as Expect::that(), notes each mismatch and lets the it() go on, then fails the test once at its end with the full list. A timeout or a non-assertion error still stops the test; one screenshot per test, at the first mismatch. (#190)

Fixes

  • .env is read even when .env.local exists. Dotenv only read the first file it found, so a .env.local hid every key of .env. Precedence is now: variable exported in the shell, then .env.local, then .env. Projects with a .env.local now also get the .env keys they don't redefine. (#191)
  • No more orphaned keepAlive Chrome after a run. (#187)
  • The "Undefined array key 0" warning raised by Expect after several failed assertions is gone. (#190)

Demo suites

  • PrestaShop 1.7 and 8 parity of the nine demo suites on native modules. (#185, #186)

Full changelog: https://github.com/PrestaFlow/php-library/compare/v1.9.0...v1.10.0


#v1.9.0 — Remote browsers, payment iframes, run diagnostics, ten new scenarios

Publiée le : November 23, 2026

Remote browsers, payment iframes, run diagnostics, ten new ready-to-use scenarios, and scenarios that no longer depend on the demo shop.

Highlights

  • Run on a remote browser. PRESTAFLOW_BROWSER_WS (ws:// / wss://) and PRESTAFLOW_BROWSER_WS_TOKEN (sent as Authorization: Bearer). Over wss://, reads no longer block, so a CDP command takes about 50 ms instead of 5 s. There is never a fallback to a local Chrome. (#169)
  • Act inside iframes from another domain (Stripe, PayPal, Adyen, Mollie…): $page->frame($urlContains) sends real clicks and keystrokes, and frameUrls() lists the open iframes. (#137)
  • Run diagnostics. Each test result now includes its JavaScript errors and failed network requests (jsErrors(), failedRequests() for strict checks) (#135). PRESTAFLOW_RECORD_DIR records a debug video. The run's page is brought to the front, so it no longer waits about 5 s per mouse event when hidden (#140).
  • Back-office visual suites. With $area = 'bo', a VisualTestsSuite signs in by itself and reaches each page through the side menu (menu); auth => false captures the login page. Also new: hide, $shopUrl / $backOfficeUrl, and frozen CSS transitions.
  • Ten new scenarios: FrontOfficeHealth, OutOfStockProduct, CartQuantities, ContactForm, CustomerOrderHistory, ProductCombinations, ProductSearch, PasswordReset, CartVoucher, AddressBook. (#153–#166)
  • Scenarios work on any shop, whatever its theme, language, catalogue or version (1.7.8 / 8 / 9). They find the product and category on the shop, generate data unique to each run, and skip with a readable reason when the shop lacks something. (#151, #152)

New settings

Variable Effect
PRESTAFLOW_BROWSER_WS / PRESTAFLOW_BROWSER_WS_TOKEN Remote browser (#169)
PRESTAFLOW_BO_LOCALE Back-office language, when it differs from the shop's (#146)
PRESTAFLOW_SHOP_ID Shop the scenarios act on in a multistore (default 1)
PRESTAFLOW_TESTS_PATH Location of the project's Tests/ folder (#143)
PRESTAFLOW_VISUAL_BASELINE Separate visual reference set per environment (#150)
PRESTAFLOW_ONLY_TEST Run only the given tests; accepts several titles, one per line (#148)
PRESTAFLOW_RECORD_DIR Debug video of each test

Also new:

  • skipWithReason() skips a test at run time, and the reason appears in the JUnit report.
  • Front-office health signals: getDocumentStatus(), failedServerRequests(), isInMaintenance().
  • Symfony Console / EventDispatcher 8 are accepted; PHP 8.1 is still the minimum. (#158)

Fixes

  • The back-office login URL no longer goes through the front office's URL catalogue. (#145)
  • Deleting a product works on PrestaShop 9.2. (#146)
  • One Page Checkout works on Classic, along with the guest form and shops without a payment method. (#168)
  • The checkout fails at once when the tunnel does not reach the address step. (#170)
  • A suite that crashes (error in init(), exit, fatal error) now fails on its own: the other suites still run, results.json and the JUnit report are always written, and the exit code is 1. (#171)

Upgrading

Docs: What's New in 1.9.0](https://prestaflow.io/docs/library/1/getting-started/whats-new)) · Back-office visual suites](https://prestaflow.io/docs/library/1/digging-deeper/visual-regression#back-office-suites))

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

These behaviour changes may affect existing suites:

  • Visual checkpoints are stricter. A checkpoint now passes when at most maxDiffPixels pixels changed (100 by default). The former 0.98 ratio allowed 2 % of the capture. Raise maxDiffPixels where a page legitimately moves, or pass threshold alone to keep the ratio. Positional calls such as visualCheckpoint('home', null, 0.98, …) stay in ratio mode.
  • Data-driven visual suites store references under a new name, <scope>.<name>--<tag>.png, where the scope is the suite class in kebab-case or $visualScope. Their first 1.9.0 run records references again (status baseline). Rename the old files to keep comparing against them.
  • The demo accounts are no longer used as a silent fallback. Without PRESTAFLOW_FO_EMAIL / PRESTAFLOW_FO_PASSWD (or the BO_ equivalents), steps that need an account are skipped or fail with a clear message, instead of signing in as pub[@prestashop](https://github.com/prestashop).com / demo[@prestashop](https://github.com/prestashop).com. (#151)
  • Scenarios follow the suite's language instead of forcing en or fr. To keep the old language, pass locale to the scenario. (#149)
  • FrontOfficePage::compare() and compareWithMaskedImage() are removed, along with the sapientpro/image-comparator dependency. This prototype always failed. Use VisualTestsSuite instead. (#147)
  • Discovery methods (goToPurchasableProduct(), goToDiscoveredCategory(), choosePayment()…) now skip the test themselves instead of returning false or null. Their return types are unchanged or widened. (#152)

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

Publiée le : 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

Publiée le : 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)

Publiée le : 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)

Publiée le : 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

Publiée le : 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

Publiée le : 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

Publiée le : 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.