Release Notes


#PrestaFlow/php-library

#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 CheckoutOrderManageOrder: 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 sur setCookies() des pré-réglages de cookies (PRESTAFLOW_COOKIES / Rgpd::preAccept) — garantit que le cookie est posé avant la 1ère navigation (course async corrigée). #25


#1.4.0

Released: July 7, 2026

Nouveautés

  • feat: PRESTAFLOW_COOKIES (env, JSON) — pré-règle des cookies avant navigation (utile pour neutraliser un bandeau de consentement RGPD) + page FrontOffice Rgpd (Knowband ___kbgdcc + repli générique). #24
  • fix: getBrowser() honore PRESTAFLOW_USER_AGENT (fin du User-Agent hardcodé PrestaFlow) — permet un UA réaliste pour passer les protections anti-bot (Cloudflare Browser Integrity Check…). #23

Rétro-compatible.


#1.3.0

Released: July 1, 2026

Backward-compatible feature release.

🚀 Features

  • CI-ready exit codebin/prestaflow run now returns a non-zero exit code when any test fails, so CI can finally detect failures (previously it always exited 0).
  • JUnit XML report — new --junit[=path] flag (default prestaflow/junit.xml), consumable by GitHub Actions, GitLab and Jenkins. Failed tests reference their screenshot in the <failure> message and a <system-out> [[ATTACHMENT|…]] node.
  • BackOffice coverage (experimental) — menu-based admin navigation (goToSubMenu) and page objects for Products, Orders, Categories, Customers, Modules and Carriers, plus list / create / delete actions on the Products page, with demonstrator suites.
  • Browser-free test harness — new composer test-unit (PHPUnit) with 32 unit tests covering exit codes, JUnit serialisation, screenshots, page factorization and BackOffice page resolution.
  • Add store / retrieve helpers to TestsSuite to pass values between steps.
  • Add i18n support to Expect messages.
  • Add console / log methods to emit debug information from a test suite.

💡 Improvements

  • Page factorization — v7/v8/v9 pages factored into a shared src/Pages/Common/ tree with thin per-version stubs, so a change is made once instead of three times (importPage() and composer.json unchanged).
  • Bundled dependency — vendored nunzion/php-expect into lib/php-expect/ (MIT); the upstream Bitbucket dependency was no longer reliably installable.
  • Configurable screenshot delay via PRESTAFLOW_SCREENSHOT_DELAY (default 3 seconds, 0 disables it).
  • Show an "Open screenshot" link when the terminal supports file URLs (iTerm.app, VS Code).
  • Product price with a currency string is converted to a numeric value.
  • Allow a .env.local file to override values in a development project.

🐛 Bug fixes

  • Screenshot on failure is no longer silently lost in standalone mode — the errors directory is created before saving, and the broken terminal link path is fixed.
  • Screenshot capture failures are surfaced as a debug line instead of being swallowed.
  • Various bug fixes.

> ⚠️ Experimental / [@unverified](https://github.com/unverified): the BackOffice #subtab-Admin* menu and product-form selectors are best-effort PrestaShop 9 conventions not yet validated against a live shop (they differ on 1.7 / 8). The browser suites will need their selectors corrected against a real shop before they pass. These page classes are additive and have no impact on existing functionality.


#1.2.3

Released: November 17, 2025

#🚀 Features

  • Add selectOption() action

#💡Improvements

  • Allows more params into URL
  • Manage Back Office logout with migrated pages
  • Manage Height and Width params for the broswer
  • Display screen capture name in CLI

#🐛 Bug fixes

  • Fix with custom assertion messages
  • Various bug fixes

#1.2.2

Released: October 16, 2025

#🚀 Features

  • Output results into file while using JSON output

#💡Improvements

  • Improve the JSON output

#🐛 Bug fixes

  • Various bug fixes

#1.2.1

Released: September 23, 2025

#🚀 Features

n/d

#💡Improvements

  • Improve the whole code

#🐛 Bug fixes

  • Various bug fixes

#1.2.0

Released: August 25, 2025

#🚀 Features

  • Handle PrestaShop 1.7
  • Load custom selectors and messages from JSON files
  • Allow to use custom except message in assertions
  • Datasets support

#💡Improvements

  • Improve error handling and output formatting

#🐛 Bug fixes

  • Various bug fixes