---
title: Introduction to Testing in Shopware | Shopware Community Hub
description: >-
  Learn why testing matters in Shopware, how unit tests and end-to-end tests
  differ, and when to use PHPUnit, Jest, and Playwright.
canonical_url: 'https://hub.shopware.com/learn/unit/intro-testing-shopware'
---

<LearningObjectives>

- Understand why automated testing matters in Shopware projects.
- Distinguish unit tests from end-to-end tests and decide when each test type fits.
- Identify PHPUnit, Jest, and Playwright as the main testing tools in Shopware.
- Choose a sensible starting point for adding tests to a plugin or App project.

</LearningObjectives>

# Introduction to Testing in Shopware

Testing is not only a quality topic. In Shopware projects, it directly affects how safely you can change code, ship new features, and keep extensions stable over time.

If your plugin or App grows, manual checks quickly stop being enough. A small change in business logic, storefront behavior, or the administration can break something that used to work.

In this learning unit, you learn why testing matters, how the main test types differ, and which tools Shopware uses for unit and end-to-end testing.

## Why Testing Matters

Imagine your plugin or App is feature-complete and works well in your local environment. The next release changes a service, updates a template, or adds a new storefront interaction. Without tests, you often notice problems only after manual QA or after release.

Tests reduce that risk. They help you verify expected behavior early and give you more confidence when the codebase changes.

That way, testing becomes part of reliable delivery, not just a final check before launch.

## Convincing the Decision-Maker(s)

Testing often looks expensive at first because it adds visible work before a feature is shipped. A good argument for testing should not only say that tests are a best practice. It should connect testing to concrete Shopware project risks: Regressions, repeated manual checks, late bug fixes, and risky releases.

When you talk to decision-makers, start with the practical questions:

- Which storefront, administration, or checkout behavior must not break?
- How often does the team need to retest the same Shopware flows manually?
- How expensive would it be to find a defect after release?
- Which parts of the plugin, App, or project would benefit most from faster feedback?

Then connect those risks to testing:

- **Unit tests** give fast feedback when business logic or services change.
- **End-to-end tests** protect critical Shopware flows, such as storefront checkout, product detail behavior, or administration workflows.
- **Tests in CI/CD** make important checks repeatable before plugin, App, or project changes are merged or released.

Atlassian provides a practical overview of how testing fits into CI/CD and release workflows in [software testing in CI/CD](https://www.atlassian.com/continuous-delivery/software-testing).

For a broader economic perspective, the **National Institute of Standards and Technology (NIST)** published a report on the economic impact of inadequate software testing infrastructure. The full report, [The Economic Impacts of Inadequate Infrastructure for Software Testing](https://www.nist.gov/system/files/documents/director/planning/report02-3.pdf), is older and should not be used as a modern tooling guide, but it is useful background for explaining why late defect detection and insufficient testing can become expensive. For a shorter version, see the [NIST summary](https://www.nist.gov/system/files/documents/2021/03/24/econImpactSumm.v23.pdf).

You do not need to promise a fixed return on investment. A realistic message is enough: Testing costs time early, but it can reduce risk, repeated manual work, and expensive late fixes later.

If your project does not have tests yet, start with the areas where tests protect the most value first.

<Callout title="Note" type="info">

Some developers follow a **Test-Driven Development (TDD)** approach, where tests are written **before** the actual implementation.

However, in Shopware projects and plugin development, it is often more practical to start testing once the architecture and key components are stable enough to test deliberately.

</Callout>

## Choose the Right Test Type

The next question is not which framework to install first. The more useful question is: **What exactly do I want to verify?**

- Use **unit tests** when you want to verify a small piece of logic in isolation.
- Use **end-to-end tests** when you want to verify that a complete user flow works in the running application.

This distinction keeps testing efficient. Small logic problems should not require a full browser test, and user journeys cannot be proven by isolated unit tests alone.

## Unit Tests

Unit tests are used to test **individual units of code**, such as functions or classes. They run in isolation from the rest of the codebase and should be fast to execute. Their main goal is to ensure that small building blocks or your application behave as expected.

Use them when you want fast feedback on business logic, service behavior, or small frontend units.

### PHPUnit

Shopware uses **PHPUnit** for backend unit tests. If you created your plugin with the optional files from `bin/console plugin:create <PluginName>`, the necessary PHPUnit configuration is already set up for you.

This is the right tool for testing PHP classes, services, and backend logic in your extension.

You will find all necessary information about writing and running unit tests, setting up integration tests, and mocking services in the [official documentation](https://developer.shopware.com/docs/guides/plugins/plugins/testing/php-unit.html).

<Callout title="Outlook: Unit Tests (Intermediate)" type="info">

If you want to dive deeper into **PHP unit testing** (test structure, best practices, and more examples), continue with the successor intermediate learning path.

A good next reference point is the [Unit Tests](/learn/unit/phpunit-foundations) learning unit.

</Callout>

### Jest

You can also write unit tests using **Jest** for frontend development (storefront and administration).

Jest is useful when you want to test Vue components, custom JavaScript functions, and storefront plugins in isolation. It also provides features such as mocking and snapshot testing.

You can find more information in the official documentation:

- [Jest unit tests in Shopware's storefront](https://developer.shopware.com/docs/guides/development/testing/unit/jest-storefront.html)
- [Jest unit tests in Shopware's administration](https://developer.shopware.com/docs/guides/development/testing/unit/jest-admin.html)

## End-to-End Tests

End-to-end tests are used to test the **entire application flow** or a **specific feature**. They simulate **real user interactions** with the application.

For example, you might verify that a customer can open a product detail page, click a button, complete a checkout step, or see the expected result in the UI.

Use this test type when the question is no longer "Does this function return the right value?" but "Does this feature work from the user's point of view?"

### Playwright

Shopware uses [Playwright](https://playwright.dev/) for end-to-end testing. Playwright allows you to **automate browser actions**, **simulate user journeys**, and **verify UI behavior** across different pages and browsers.

Shopware provides an official [acceptance test suite](https://github.com/shopware/acceptance-test-suite), which includes preconfigured tests and utilities to **kickstart your testing setup**.

This is the right choice when you want to test real browser behavior across the storefront or administration.

For detailed installation and usage instructions, check the official developer documentation and the dedicated [Playwright learning unit](/learn/unit/playwright-end-to-end-tests). They show how to install the test suite and run the first tests.

<Callout title="Legacy Note" type="info">

Older Shopware materials may still mention **Cypress**, but that setup is now **legacy**. For new work, use **Playwright** as the default end-to-end testing framework.

</Callout>

## Where to Start in Real Projects

If your project does not have tests yet, do not try to automate everything at once.

A good starting point is usually:

1. Add **PHPUnit** tests for important backend logic.
2. Add **Jest** tests when storefront or administration JavaScript has meaningful custom behavior.
3. Add **Playwright** tests for a few critical user journeys that must not break.

That way, you build coverage where it gives the highest value first.

## Summary

In this learning unit, you have learned:

- Why testing is essential for ensuring code quality and long-term stability.
- The difference between **unit tests** (small, isolated checks) and **end-to-end tests** (full user journeys).
- Which testing tools Shopware provides:
  - **PHPUnit** for backend logic.
  - **Jest** for storefront and administration.
  - **Playwright** for end-to-end testing.
- How to choose a sensible starting point for testing in a Shopware project.

With this knowledge, you can now choose the right test type more deliberately and build a testing strategy that fits your Shopware project.
