Release Notes
On this page
#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 pagesPages\v9\FrontOffice\PageandPages\v9\BackOffice\Page. On PS 9 this failed withClass "…\Pages\v9\FrontOffice\Page" not found, which made the newVisualTestsSuiteunusable there, and broke every custom page extending either class. Both are back.- A suite's own PrestaShop version now applies. The
$psVersionproperty andonVersion()announced in 1.8.0 changed nothing: the suite kept the version fromPRESTAFLOW_PS_VERSION. The version is now resolved when the suite loads its globals, and again whenonVersion()is called, so the pages imported next come from the pinned namespace. Resolution order:onVersion()>$psVersion>PRESTAFLOW_PS_VERSION>8.1.0.
Upgrade
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 theDEVICE/LOCALEglobals or, on the CLI, fromPRESTAFLOW_DEVICE/PRESTAFLOW_LOCALE. Checkpoints excluded for a device, or a locale that doesn't apply, are reported as skipped.VisualDevicespresets (desktop / tablet / mobile).CommonPage::visualCheckpoint(..., array $masks = [])masks elements by selector (always removed afterwards), plusscrollBelow()andwaitForStable()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 viaimportPage(..., ['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/Checkoutruns only those sub-folders. This is what the GitHub Action'ssuitesinput 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.
onAfterTesthook to stream progress out of a running suite.- Aggregated results — suites land in a single JSON, with the source location of each test.
bin/prestaflowis 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 pollsdocument.readyState, takes an optional timeout (30 s default) and throwsTimeoutException.- 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_HEADERSis 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}\PagetoPages\v9\....Commonnow 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 toPrestaFlow\Library\Pages\v9\...or go throughimportPage().- Calling a method that neither the page object nor the chrome-php
Pagedefines now throwsBadMethodCallExceptioninstead of silently returningnull. A suite that relied on a mistyped call will now fail, which is intended. waitForPageLoaded()can now throwTimeoutExceptionon a page that never finishes loading.- A
--suites/PRESTAFLOW_SUITESname that matches no folder fails the run. - The
BROWSER.WINDOW_SIZE_*globals defaulted to a swapped 1000 × 1920 (portrait) whenPRESTAFLOW_WINDOW_SIZE_WIDTH/HEIGHTwere 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. CallresetBrowser()between combinations that need different window sizes (the app does).
Upgrade
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 unusedcreatePage(), andCommonPage::__call()evaluatesgetPage()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
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 viagoToPage()/recreatePage()).Copied!1PRESTAFLOW_EXTRA_HEADERS='{"X-CI-Bypass":"secret","X-Request-Id":"abc"}'Same solid application path as
presetBasicAuth():setConnectionHttpHeaders()at the browser level plusapplyExtraHttpHeaders()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 aroundsmalot/pdfparserfor asserting on text extracted from a PDF (invoices, credit notes, delivery slips, e-tickets, gift cards). API:Copied!1use PrestaFlow\Library\Support\Pdf;23$pdf = Pdf::fromFile('/tmp/invoice.pdf'); // or fromString()4$pdf->contains('VAT'); // case-insensitive by default5$pdf->matches('/Invoice\s*#?\s*(\d+)/', 1);6$pdf->pages(); // string[] per pageAdds
smalot/pdfparser ^2.11as 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 thevisual[]block ofresults.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 causingfile_put_contents: Failed to open streamwarnings on every install.getFilePath()now falls back tosys_get_temp_dir()prefixedprestaflow-, and createsdatas/whenstorage_path()is available. Typo.broswer→.browserfixed 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.OrderLifecyclesuite — composesCheckoutOrder→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 stepscheckoutAsGuest/fillNewAddress),OrderConfirmation(isConfirmed,getOrderReference),Rgpd(cookie-consent banner handling for the FrontOffice). - BackOffice:
OrderView(updateStatus/hasStatusInHistory,setInternalNote/getInternalNote,addTracking/getTracking),Ordersextended withopenOrder,filterByReference,getOrderReferenceInList. - Products: real PS 9 create flow (
goToNewProductbypasses 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.UrlsFrench 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 avisual-results.jsonside-file, wired tobin/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 bygoToPage).
🔧 Changed — CommonPage primitives (behavioural supersets)
getInputValuenow reads the live.valueproperty via JS. Fixes<textarea>reads and any field whose current value differs from the initialvalueattribute.selectOption/selectValuenow usequerySelector+ dispatchchange. Handle compound CSS selectors and drive select2 (previously only worked with a bare#id/.class).- New
setValueByJs($selector, $value)— reliable JS value-set (firesinput+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 toPage::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
ExecuteSuiteand clean the socket — series runs are now stable. - Session isolation per suite:
before()clears cookies via CDPNetwork.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. selectOptionno longer writes a straytemp.logdebug 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.9910with price 0). Now driven viasetValueByJs. - 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
localeto the suite ($testSuite->params['locale']) before importing pages, soimportPageresolves French friendly URLs on the FR demo shop (otherwise/login,/cart,/orderfell 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+navigateingoToPage— swallows the sporadic cold-startgetTargetInfo() on nullfrom target enumeration. - Retry
getPage()on the same flake. - Basic Auth: enable
Networkdomain beforesetBasicAuthHeader(otherwise the header was silently dropped); install it at the connection level so it survivesgoToPage'screatePage. - 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: prefergetcwd()(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_AGENTis now honored ingetBrowser().
🧰 CI / DX
- CI-ready runs: non-zero exit on failure,
--junitreport. - 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):
ProductsCrud4/4 ·CreateProductAndVerify4/4 ·CheckoutOrder5/5 ·OrderLifecycle9/9 ·GuestCheckout4/4 ·EditProduct4/4. All three critical suites re-run green after themainmerge — 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) + FrontOfficeRgpdpage (Knowband___kbgdcc+ generic fallback). #24 - fix:
getBrowser()honoursPRESTAFLOW_USER_AGENT(no more hardcodedPrestaFlowUser-Agent) — allows a realistic UA to pass anti-bot protections (Cloudflare Browser Integrity Check…). #23
Backwards-compatible.