Skip to content

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

Choose a tag to compare

@PrestaEdit PrestaEdit released this 23 Nov 17:08
· 167 commits to main since this release
bca1e24

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 · Back-office visual suites

composer 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.com / demo@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)