Yireo_LokiCheckoutFunctionalTests

Jump to User Docs

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

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 Yireo_LokiCheckoutFunctionalTests 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 yireo/magento2-loki-checkout-functional-tests

Next, enable this module:

bin/magento module:enable Yireo_LokiCheckoutFunctionalTests

Setup

Setup Playwright:

cd vendor/yireo/magento2-loki-checkout-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 yireo:loki-checkout:modules:list --format=json > vendor/yireo/magento2-loki-checkout-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 yireo_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 yireo_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/yireo/magento2-loki-checkout-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=Yireo_LokiCheckoutMollie
npx playwright test --ui --project=Yireo_LokiCheckout basic-test
npx playwright test --ui --project=Yireo_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/Yireo_LokiCheckoutFunctionalTests

Configuration Options

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

> Token
yireo_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 Yireo_LokiCheckout Yireo_LokiCheckoutDevProfiles Yireo_LokiCheckoutDevTools Yireo_LokiComponents Yireo_LokiFieldComponents
Composer details
Magento module name
Yireo_LokiCheckoutFunctionalTests
Composer name
yireo/magento2-loki-checkout-functional-tests
Composer version
1.0.0
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
yireo/magento2-loki-checkout: ~0.0 | ^1.0
yireo/magento2-loki-checkout-dev-profiles: ~0.0 | ^1.0
yireo/magento2-loki-checkout-dev-tools: ^1.0
yireo/magento2-loki-components: ~0.0 | ^1.0
yireo/magento2-loki-field-components: ~0.0 | ^1.0
Releases
dev-main 06 June 2025
1.0.0 28 May 2025
0.0.4 25 April 2025
0.0.3 04 April 2025
0.0.2 22 February 2025
0.0.1 21 February 2025
Changelog

[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: April 30, 2025