LokiCheckout_FunctionalTests
This is an internal package containing Functional Tests based on Playwright. This is used specifically by the Loki Checkout core development team. Do not use this for your own shop. Also, do not enable the module LokiCheckout_FunctionalTests in production. When using this module anyway, do make sure to configured a proper token.
Installation
Install this package via composer:
composer require loki-checkout/magento2-functional-tests
Next, enable this module:
bin/magento module:enable LokiCheckout_FunctionalTests
Setup
Setup Playwright:
cd vendor/loki-checkout/magento2-functional-tests/Test/Playwright/ npm install npx playwright install
Next, create a custom .env file within the same Test/Playwright/ folder:
TEST_URL=http://magento.local TEST_TOKEN=loki
Next, make sure the listing of LokiCheckout modules in app/etc/loki-checkout.json is up to date:
bin/magento loki-checkout:modules:dump
Set the token from the CLI
Make sure a secure token is configured. The security token can also be reset from the CLI:
bin/magento config:set loki_checkout/functional_tests/token loki
For instance, you could generate a random token as follows
TOKEN=`tr -dc A-Za-z0-9 </dev/urandom | head -c 128; echo` bin/magento config:set loki_checkout/functional_tests/token $TOKEN
Just make sure that the token matches the one in .env.
Running tests
All commands are run from the previous folder:
cd vendor/loki-checkout/magento2-functional-tests/Test/Playwright/
Run tests in headless mode:
npx playwright test npx playwright show-report
Or run tests in the UI mode:
npx playwright test --ui
Or:
npx playwright test --headed
Because the app/etc/loki-checkout.json file contains entries that are being turned into Playwright projects, you can also run just a single project:
npx playwright test --ui --project=LokiCheckout_Mollie npx playwright test --ui --project=LokiCheckout_Core basic-test npx playwright test --ui --project=LokiCheckout_Core basic-test --debug
Note that parallelism doesn't work well. Each test could reconfigure the Magento instance with specific modules and configuration options. With that, the reconfiguration for one test might conflict with another test. Because of this, tests should not be run in parallel :(
If the Magento root could not be detected, for instance because your modules are symlinked into the Magento folder, define the Magento root via the environment variable MAGENTO_ROOT:
MAGENTO_ROOT=/var/www/html npx playwright test --ui
Running the run-playwright-tests.sh script
This script is used mainly by the Loki Checkout core development team. To use it, navigate to your Magento root and symlink the script:
ln -s ./vendor/loki-checkout/magento2-functional-tests/run-playwright-tests.sh .
The script allows for the following parameters:
- A Playwright project aka Magento 2 module with a
Test/Playwright/folder. This can also beuito start the UI instead; - A specific test (or test pattern) within the Playwright project);
- Token type. Currently
randomis supported. Otherwise the token defaults toloki;
Run all LokiCheckout_Core tests:
./run-playwright-tests.sh LokiCheckout_Core
Starting the UI:
./run-playwright-tests.sh ui
Support
For getting support, create an Issue under the following project URL:
https://gitlab.yireo.com/loki-checkout-dev/LokiCheckout_FunctionalTests.git
Configuration Options
The following options of this module can be configured via the Store Configuration:
loki_checkout/functional_tests/token
Module Dependencies
The following dependencies are declared in the module its `etc/module.xml` file:
LokiCheckout_Core
LokiCheckout_DevProfiles
Loki_Base
Loki_Components
Loki_CssUtils
Loki_FieldComponents
Loki_MapComponents
Magento_Backend
Magento_Catalog
Magento_CatalogInventory
Magento_Checkout
Magento_CheckoutAgreements
Magento_Cms
Magento_Config
Magento_Customer
Magento_Directory
Magento_Eav
Magento_Indexer
Magento_Newsletter
Magento_Payment
Magento_Quote
Magento_Sales
Magento_Shipping
Magento_Store
Magento_Tax
Magento_Theme
Magento_Vault
Yireo_CspUtilities
Composer details
LokiCheckout_FunctionalTestsloki-checkout/magento2-functional-tests
ext-json: *
ext-pcre: *
loki-checkout/magento2-core: ^2.3
loki-checkout/magento2-nl: ^2.0
loki-checkout/magento2-us: ^1.0
loki-checkout/magento2-dev-profiles: ^2.0
loki/magento2-components: ^2.2
loki/magento2-css-utils: ^1.0
magento/framework: ^103.0
magento/module-backend: ^102.0
magento/module-catalog: ^104.0
magento/module-checkout: ^100.4
magento/module-customer: ^103.0
magento/module-quote: ^101.2
magento/module-store: ^101.1
symfony/console: ^6.0|^7.0
Releases
| 2.0.25 | 12 June 2026 |
| 2.0.24 | 12 June 2026 |
| 2.0.23 | 12 June 2026 |
| 2.0.22 | 12 June 2026 |
| 2.0.21 | 12 June 2026 |
| 2.0.20 | 12 June 2026 |
| 2.0.19 | 12 June 2026 |
| 2.0.18 | 12 June 2026 |
| 2.0.17 | 12 June 2026 |
| 2.0.16 | 12 June 2026 |
| 2.0.15 | 12 June 2026 |
| 2.0.14 | 12 June 2026 |
| 2.0.13 | 12 June 2026 |
| 2.0.12 | 12 June 2026 |
| 2.0.11 | 12 June 2026 |
| 2.0.10 | 12 June 2026 |
| 2.0.9 | 12 June 2026 |
| 2.0.8 | 12 June 2026 |
| 2.0.7 | 12 June 2026 |
| 2.0.6 | 12 June 2026 |
Changelog
[2.0.25] - 16 April 2026
Fixed
- When errors occur during setup of the checkout, throw an error
[2.0.24] - 16 April 2026
Fixed
- Auto-enable module if needed
- Wrong assumption of
/checkoutnot ending with/
[2.0.23] - 15 April 2026
Fixed
- Add Playwright reporting
- Add
LokiCheckout_SampleDatato setup to skip official sample data - Make sure URL of checkout is not checkout/cart
- Improve test run script
[2.0.22] - 14 April 2026
Fixed
- Add slash
[2.0.21] - 14 April 2026
Fixed
- Fix relative paths in CI
[2.0.20] - 14 April 2026
Fixed
- Convert to string
[2.0.19] - 14 April 2026
Fixed
- Add additional debugging when modules are not found
- Additional Chrome options to speed up Playwright execution
[2.0.18] - 12 March 2026
Fixed
- Loose constraint with symfony/console
- Add phpcs:ignore to usage of
$_SESSION - Do not enable tests DB by default
- Store temporary config settings directly in session
- Allow for Test/Playwright/.env.local file
- Wait for domloaded not networkidle
- Fix
SKIP_MAGENTO_VERSIONS - Skip magento 2.4.5-p14
[2.0.17] - 02 March 2026
Fixed
- Pending changes
- Add Messages-object
- Allow better testing of failed scenarios
- Allow recursive merging of config object
[2.0.16] - 19 February 2026
Fixed
- Make sure generated customer record has password
[2.0.15] - 13 February 2026
Fixed
- Add fix for streetlines to be equal to EAV attribute setting
[2.0.14] - 12 February 2026
Fixed
- Allow PHP Config to read from current store level
- Allow for AXE testing in Playwright
- Allow for logging in a customer
- Allow for creating and logging in a customer
- Make sure Playwright page tests have session properly initialized
- Move page objects into page/ or component/ folder
[2.0.13] - 23 January 2026
Fixed
- Fix IDs in Playwright tests
- Pick random product from list ordered by ID, to get first ID
- Copy generic CI/CD files
- Improve running Playwright tests
[2.0.12] - 19 December 2025
Fixed
- Make sure core-modules are allowed but not required for running tests
- Improve feedback on AJAX endpoints
[2.0.11] - 12 December 2025
Fixed
- Autopopulate token with default value
- Update composer keywords
- Update composer keywords
- Update composer keywords
[2.0.10] - 22 October 2025
Fixed
- Allow for install under Symfony 5
- Remove int return type from Symfony commands for Symfony 5 compat
- Do not escape
$css()withescapeHtmlAttr()butescapeHtml()
[2.0.9] - 27 September 2025
Fixed
- Fix wrong escaping
- Update README with proper instructions
- Update README
[2.0.8] - 24 September 2025
Fixed
- Add .gitignore
- Remove redundant CSS classes from icon containers
- Add uniq name
- Implement new imageRenderer
[2.0.7] - 02 September 2025
Fixed
- Whitelist more modules during functional testing
- Refactor Loki-library location in Playwright tests
- Ignore SSL certificate errors
- Add CI files
- Replace yireo/opensearch with yireo/opensearch-dummy in Gitlab CI
[2.0.6] - 26 August 2025
Fixed
- 81e6559 Add GitLab CI files
[2.0.5] - 21 August 2025
Fixed
- Declare used PHP namespaces
- Document latest version of template
[2.0.4] - 18 August 2025
Fixed
- Prevent escaping of SVGs
[2.0.3] - 18 August 2025
Fixed
- Lower requirements to PHP 8.1
- A11Y fixes
- Rename tab in Store Config from "Yireo" to "Loki"
[2.0.2] - 15 August 2025
Fixed
- Move token config to Loki Checkout in Store Config
[2.0.1] - 07 August 2025
Fixed
- Lower PHP requirement to PHP 8.2+
[2.0.0] - 22 July 2025
Fixed
- Rename PHP namespace from
Yireo_Loki*toLoki* - Rename composer package from
yireo/magento2-loki*toloki/magento2* - Bump loki/magento2-components to major 2.0
- Bump loki/magento2-field-components to major 2.0
- Bump
LokiCheckout_Coreto 2.0.0 - Add assertion
hasAlpineComponent - Add Checkout to Playwright objects
- Add AlpineComponents as Playwright object
- Add Sidebar to Playwright objects
- Always keep
Yireo_ExtensionCheckerenabled - Rewrite @helpers to @loki in Playwright tests
- Upgrade to Playwright 1.52
[1.0.0] - 28 May 2025
Fixed
- Whitelist various modules during testing
- Configure token and profile from XML layout
- Allow for setting qty of addtocart
- Clean cache more drastically
- Check if module exists before trying to enable it
- Fix error when request param is missing (though it should not happen)
- Allowlist and disallowlist for all modules to disable or enable
- CLI for enabling specific module-sets (mainly for testing)
- Update admin settings with tooltip and regenerate new MODULE.json
- Make sure empty config does not give error
- Generate new MODULE.json with simple test count
- Fix additional runs of Playwright tests
- Copy handy script
- Always enable LokiCheckoutDevProfiles as well
- Move autoaddtocart from DevTools to FunctionalTests
- Allow PHP 8.4 in CI
[0.0.4] - 25 April 2025
Fixed
- Allow upgrading to LokiFieldComponents and LokiCheckout 1.0
- Switch to specific profile with single addtocart action
[0.0.3] - 04 April 2025
Fixed
- Enhance Playwright tests
- Rewrite ugly require to standard import
- Make sure there is only 1 worker
[0.0.2] - 22 February 2025
Fixed
- Change deps
[0.0.1] - 21 February 2025
- Initial release