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.
Install this package via composer (assuming you have setup the composer.yireo.com
repository correctly already):
composer require loki-checkout/magento2-functional-tests
Next, enable this module:
bin/magento module:enable LokiCheckout_FunctionalTests
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=foobar
Next, copy the file modules.json.example
to modules.json
and include a list of modules you would like to include for testing. To generate a new listing for all existing modules, run the following:
bin/magento loki-checkout:modules:list --format=json > vendor/loki-checkout/magento2-functional-tests/Test/Playwright/modules.json
Make sure a secure token is configured. The security token can also be reset from the CLI:
bin/magento config:set loki_functional_tests/general/token foobar
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_functional_tests/general/token $TOKEN
Just make sure that the token matches the one in .env
.
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 modules.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_ basic-test
npx playwright test --ui --project=LokiCheckout_ 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 :(
For getting support, create an Issue under the following project URL:
https://gitlab.yireo.com/loki-checkout/LokiCheckout_FunctionalTests
The following options of this module can be configured via the Store Configuration:
loki_functional_tests/general/token
The following dependencies are declared in the module its `etc/module.xml` file:
Magento_Backend
Magento_Catalog
Magento_Checkout
Magento_Quote
Magento_Store
LokiCheckout_Core
LokiCheckout_DevProfiles
LokiCheckout_DevTools
Loki_Components
Loki_FieldComponents
LokiCheckout_FunctionalTests
loki-checkout/magento2-functional-tests
ext-json: *
ext-pcre: *
magento/framework: ^103.0
magento/module-backend: ^102.0
magento/module-catalog: ^104.0
magento/module-checkout: ^100.4
magento/module-quote: ^101.2
magento/module-store: ^101.1
symfony/console: ~v6.4.21
loki-checkout/magento2-core: ^2.0
loki-checkout/magento2-dev-profiles: ^2.0
loki-checkout/magento2-dev-tools: ^2.0
loki/magento2-components: ^2.0
dev-main | 29 August 2025 |
2.0.6 | 26 August 2025 |
2.0.5 | 21 August 2025 |
2.0.4 | 18 August 2025 |
2.0.3 | 18 August 2025 |
2.0.2 | 15 August 2025 |
2.0.1 | 07 August 2025 |
2.0.0 | 22 July 2025 |
Yireo_Loki*
to Loki*
yireo/magento2-loki*
to loki/magento2*
LokiCheckout_Core
to 2.0.0hasAlpineComponent
Yireo_ExtensionChecker
enabled