LokiCheckout_FunctionalTests

Jump to User Docs

Development
PHP 8.3 | 8.4
Magento 2.4.7 | 2.4.8
Latest Release 2.0.6

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 (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

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

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_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.

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 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 :(

Support

For getting support, create an Issue under the following project URL:

https://gitlab.yireo.com/loki-checkout/LokiCheckout_FunctionalTests

Configuration Options

The following options of this module can be configured via the Store Configuration:

> Token
loki_functional_tests/general/token
When making AJAX calls, this token adds some security. Make sure to either set this on the fly, whenever you are running tests. Or make sure
Module Dependencies

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
Composer details
Magento module name
LokiCheckout_FunctionalTests
Composer name
loki-checkout/magento2-functional-tests
Composer version
2.0.6
Default branch
main
Requirements
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
Releases
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
Changelog

[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* to Loki*
  • Rename composer package from yireo/magento2-loki* to loki/magento2*
  • Bump loki/magento2-components to major 2.0
  • Bump loki/magento2-field-components to major 2.0
  • Bump LokiCheckout_Core to 2.0.0
  • Add assertion hasAlpineComponent
  • Add Checkout to Playwright objects
  • Add AlpineComponents as Playwright object
  • Add Sidebar to Playwright objects
  • Always keep Yireo_ExtensionChecker enabled
  • 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
Jump to User Docs

Last modified: July 22, 2025