Skip to content

The design principles of the testing suite

Shay Faber edited this page Sep 2, 2025 · 2 revisions

wiki-logo

The design principles of the testing suite

It's important to know how we designed the testing suite to understand how to use it. Here is an overview of our design philosophy:

Set up once

As the installation steps will make clear, setting up the testing suite can be a bit involved. This is because we think that if you set up everything once correctly, you should never have to touch it again. This is why the testing suite is shipped with a makefile include as well! Once you've set up the testing suite, we want you to be able to easily run your tests from the main magento2 folder.

We hope you find it easy to use after setting it up as well, but you can always let us know if you're having difficulties!

Integrates into your CI/CD

This testing suite is our attempt to provide a variety of tests to ensure your webshop works as intended before you deploy your changes to production. As such, the suite is shipped with both a GitHub Actions workflow file, and a Gitlab CI/CD integration, allowing you to easily integrate this suite into your workflow. The chapter Running the testing suite (To Be Written) goes into further detail of all the tests and how to run them.

Designed for vanilla Magento 2 and the default Hyvä theme

As mentioned, the testing suite is designed with the demo website sponsored by elgentos (https://hyva-demo.elgentos.io/), meaning the suite should always pass if you use a vanilla Magento 2 installation and the default Hyvä theme.

Bias for user-facing attributes

The suite is designed to install into the folder magento2/app/design/frontend/{Vendor}/{theme}/web/playwright. This is because the suite uses user-facing attributes to perform the tests, which means it is closely linked to your theme. User-facing attributes means we always prefer finding elements on the page solely based on what the user sees, as per the Playwright best practices.

Start with the setup

The suite is designed to start with the setup test. This test performs a few steps to ensure your Magento 2 webshop is properly configured to run the tests. The setup should be performed as often as your server resets.

senor-code-thumbs-up