Testing & building
Build the interface
The React app lives in assets/:
cd assets
npm install
npm run build # → public/dashboard.js, dashboard.css and the Studio plugin build
Then, in each project that uses Keel:
bin/console assets:install public
While developing against a local project, ./sync-to-project.sh ~/my-project copies the bundle into the project's
vendor/.
Unit tests
cd assets && npm test # node --test, no extra packages: rich-text cleanup, list queries, bulk jobs, focus handling
The PHP unit tests run inside a Pimcore project's PHP container, or after composer install with
KEEL_HOST_AUTOLOAD=vendor/autoload.php:
vendor/bin/phpunit --testsuite unit
The integration suite runs against a real Pimcore project's database (throwaway classes, items and users, removed afterwards); its HTTP smoke test sends real requests through the web server and needs the site's queue worker running:
php -d memory_limit=1G vendor/bin/phpunit -c /path/to/keel-bundle/phpunit.xml.dist --testsuite integration
Interface texts
From the bundle's root:
node tests/i18n/check.cjs # Croatian; add `de` for German
Every interface text needs a translation. The check covers the texts in assets/src and, since it also reads the PHP
code, the texts PHP sends to users. It exits with code 1 when a translation is missing, and also when a PHP text is
built by joining strings, because such a text cannot be translated.
Stress test (before every release)
tests/stress/stress.cjs hammers a running Keel the way impatient editors do and fails when Keel breaks:
- refresh bursts on the start page, in a list and in an editor,
- fast market switching, every list opened in a row,
- filter and sort bursts, fast typing in list search,
- editor open/close and tab bursts, Preview and device flipping,
- Ctrl+K bursts, light/dark toggling, Customize open/cancel, asset lists,
- 250 random safe clicks, and a long session that checks the JavaScript heap.
After each scenario it checks: no page or console errors, no failed or 4xx/5xx requests, the Keel frame still there and no error message on screen.
npm i -D puppeteer # once (or puppeteer-core + CHROME_PATH)
KEEL_URL=https://staging.example.com KEEL_USER=… KEEL_PASS=… node tests/stress/stress.cjs
node tests/stress/stress.cjs --only=refresh,finder # only some scenarios
node tests/stress/stress.cjs --write # also double-Save and Save+Refresh races – test data only!
KEEL_ADMIN=classic node tests/stress/stress.cjs # Pimcore 11 classic admin
Exit code 0 means all passed. Screenshots of failures and report.json go to ./stress-report.
Warning
--write saves objects. Only run it against test data.
Functional test (before every release)
tests/stress/functional.cjs works as a real editor in a real browser and checks the result of every action by
reloading or by reading the database: objects (every field type, publish, delete), a regression item a save must leave
byte-identical, lists and bulk actions, pages and the content editor, assets, permissions, licence keys, two
editors on one item, History and Revert, My view and Customize.
KEEL_URL=http://localhost:8082 node tests/stress/functional.cjs
node tests/stress/functional.cjs --only=objects,regression # some areas
node tests/stress/functional.cjs --cleanup # after a run that was killed
Warning
It writes: use a test site only. It needs Docker access to the project's PHP container (KEEL_PHP_CONTAINER).
Everything it creates is called zz-keel-test-… and is removed at the end, also after a failure; it then compares the
site with a snapshot from the start (demo unchanged). Its licence area writes a temporary licence file to
config/local/ of the project (KEEL_PROJECT_DIR) and clears the cache, so Keel's licence on that site changes while
it runs.
Content editor check
bin/console keel:check-editables --all verifies every page's content fields round-trip – see
Console commands.