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

# Introduction to Testing in Shopware

<LearningObjectives>

- Explain 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 work early in the project. In practice, it usually saves time later by reducing regressions, manual retesting, and risky releases.

If testing is not part of your development process yet, prepare a short pitch with numbers and facts:

- **Atlassian** provides a good overview of how testing in CI/CD improves release reliability and reduces regression issues in [software testing in CI/CD](https://www.atlassian.com/continuous-delivery/software-testing).
- **CircleCI** published a [case study](https://circleci.com/blog/circleci-delivers-664-roi-and-13-98-million-npv-according-to-total-economic-impact-study/) that argues for strong ROI through automated testing and continuous integration.

You do not need to present testing as a perfect solution. A more realistic message is enough: Testing lowers risk, improves feedback, and helps teams scale development more safely.

<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 using the `bin/console plugin:create <PluginName>` command, 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.
