Align the module with the PrestaEdit blog series - #1
Conversation
- displayHome renders #psflowdemo-block with the title in an h3, from views/templates/hook/displayHome.tpl, escaped on output - getContent() renders a HelperForm (PSFLOWDEMO_TITLE, submitPsflowdemo) and shows the core "Settings updated" confirmation; empty titles are refused - install sets PSFLOWDEMO_TITLE to "Bienvenue sur notre boutique", uninstall deletes it; compatible PrestaShop 1.7.8 to 9, PHP 7.2+ Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- tests/prestaflow autoloaded as Tests\, suites in Tests\Suites - Home and Configuration pages for v7/v8/v9, shared logic in Pages/Common - DisplayHome, UpdateTitle, Checkout, Regression/NoXssInBlockTitle and a browser-free Smoke suite - Flashlight init-scripts that install the module and seed its title - dev dependencies in vendor-dev/: PrestaShop includes the vendor/autoload.php of installed modules, and the library's Symfony 6 packages crash the shop Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`composer prestaflow -- <args>` now forwards to the CLI, so the blog articles can show the same command whatever the vendor dir or library version. The former all-suites script becomes `prestaflow:all`. process-timeout is disabled: Composer kills scripts after 300 s by default, which an end-to-end run easily exceeds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PrestaFlow 1.7.1 ucfirst()s the folder argument, so tests/prestaflow becomes Tests/prestaflow: fine on macOS, not found on Linux (CI), and the run still exits 0. A ./ prefix is left untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PrestaFlow — Test reportResult: ❌ 3 failures out of 18 tests
PS Failure details (3)❌ Tests\Suites\Checkout / add a product to the cart
❌ Tests\Suites\Regression\NoXssInBlockTitle / accepte un titre contenant du HTML/JS depuis la config
❌ Tests\Suites\UpdateTitle / met à jour le titre du bloc
Generated by PrestaFlow/github-action@v2 · commit |
A fresh Flashlight shop is installed with GB as its country, and its payment modules (ps_wirepayment, ps_checkpayment, ps_cashondelivery) are restricted to GB in ps_module_country. The library's GuestCheckout scenario uses a French address, so no payment method was offered and the Checkout suite failed. France is not even active on the 1.7.8.11 image. The init-script activates France and opens every paymentOptions module to every active country, in every shop. Idempotent. Checked on fresh Flashlight 8.1.7 shops: without the script Checkout fails at the address step, with it all four steps pass (order confirmation reached). On 1.7.8.11 and 9.0.0 the suite fails earlier, at add-to-cart, for an unrelated library reason (page closed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 'page was closed' failures seen on 1.7.8.11 and 9.0.0 were not version-specific: two PrestaFlow processes running at once shared one browser file, and each closed the other's Chrome at exit. Fixed in the library; with the payment init-script, Checkout passes on all three. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PrestaFlow — Test report ✅ · PS 1.7.8.1118 tests passed in 27s
PS Generated by PrestaFlow/github-action@v2 · commit |
PrestaFlow — Test report ✅ · PS 9.0.018 tests passed in 59s
PS Generated by PrestaFlow/github-action@v2 · commit |
PrestaFlow — Test report ✅ · PS 8.1.718 tests passed in 27s
PS Generated by PrestaFlow/github-action@v2 · commit |
39ef9cf to
acfa3f1
Compare
Makes psflowdemo the module the PrestaFlow article series on the PrestaEdit blog actually describes, so every example in the articles runs against the real repository.
The module
#psflowdemo-blockwith a configurableh3title, rendered byviews/templates/hook/displayHome.tpland escaped on output.PSFLOWDEMO_TITLE, buttonsubmitPsflowdemo, default title « Bienvenue sur notre boutique », set on install and removed on uninstall.The full contract (selectors, keys, messages) is in the README.
Tests
tests/prestaflow/(PSR-4Tests\), with the layout used in the articles:DisplayHome,UpdateTitle,Checkout,Smoke,Regression/NoXssInBlockTitle.tests/flashlight-init/: install the module, seed the title.vendor-dev/instead ofvendor/PrestaShop includes
modules/<module>/vendor/autoload.phpfor every installed module. The PrestaFlow library brings Symfony 6 components that clash with the shop's and crash it (checked on PrestaShop 8.1.7), so dev dependencies live invendor-dev/.The CLI is exposed as
composer prestaflow -- <args>, withprocess-timeout: 0: Composer kills scripts after 300 s. Paths are passed as./tests/..., because PrestaFlow 1.7.1ucfirst()s the folder argument, which breaks on Linux.Verified
DisplayHome,UpdateTitle,RegressionandSmokepass. The regression suite turns red with an unescaped template.Checkoutstops at the payment step: a fresh Flashlight shop has no active payment module.🤖 Generated with Claude Code