# Headless Commerce Testing: The Bugs Live Between the Services

> How to test a headless or composable commerce stack: where the bugs hide between storefront, commerce engine, CMS, search, promotions, payments and tracking, which tests catch them, and how to test every change on a preview deployment.

Source: https://qa.tech/blog/headless-commerce-testing · Published: 2026-11-30

---
<div class="qa-highlight">

In a headless store, the storefront, commerce engine, CMS, search, promotions, payments and analytics are separate services that only meet in the shopper's browser. **Each service can pass its own tests while the store is broken.** Test the contracts between services in code, and test the assembled store from the shopper's side on a preview of every change.

</div>

## What makes headless commerce different to test

On a monolithic platform, the vendor wires the parts together. Add to cart sends the analytics event, checkout writes the consent flag, the promotion engine sees the same cart the payment step charges. Headless moves that wiring into your storefront code. Most of the bugs below sit in that code, at the points where one service hands data to another.

[Commerce-UI](https://commerce-ui.com/), a Shopify Plus agency that also builds headless stores, hears this from brands planning their next site. In its 2026 report on 76 brands, one brand said, "We feel like we're losing so much data with being headless." Commerce-UI explains why. "On a headless build, developers have to connect each of those events, plus consent, themselves. When nobody does, data goes missing." In the same research, 5% of brands asked outright for a headless build, and another 5% wanted to leave headless and go back to a standard theme. A quarter said they struggle to connect ERP, PIM or stock systems.

The same wiring gap costs money when the cart shows one price and the payment step charges another.

## Where the bugs hide

**Cart state across services.** The storefront holds a copy of the cart, and the commerce engine holds the real one. When a quantity change reaches one and not the other, the shopper sees a stale total. We saw this on a German consumer-electronics brand's store in [our Black Friday study](https://qa.tech/blog/black-friday-ecommerce-bugs). After the agent raised the quantity to 2, line price, subtotal and shipping kept their old values. They only caught up on the next action.

**Prices computed twice.** The product listing gets its price from search or the CMS, the cart gets it from the commerce engine, and promotions are applied by a third service. When they disagree, the shopper sees two prices. Seven stores in our study had a confirmed price or discount mismatch, like a product page at 74,25 kr and a cart charging 99 kr for the same item.

**Promotions as their own system.** Promotion logic is often the most custom code in the stack. In our study, a Scandinavian D2C brand's German store listed a −382 € product discount in the cart. The subtotal and total stayed at 379,98 €.

**Search and filters from another vendor.** Search-as-a-service keeps its own index of products and prices. That index refreshes on its own schedule. Broken price sorts and filters were the most common confirmed bug category in our study, on 11 of 72 stores.

**Payments, tax and fulfilment.** Each one is a third party with its own sandbox, and the sandbox doesn't behave quite like production. The engineering leader of a made-to-measure webshop told us: "There is somehow an end-to-end test built, but it's not really maintained... we don't do integration testing, we don't do overlapping testing, so in general, it's really just non-existing."

**Events, consent and emails.** Analytics, abandoned-cart emails and marketing consent all depend on events the storefront has to send. When one is missing, nothing errors. The email just never goes out. Only 4 of [the 24 carts we abandoned](https://qa.tech/blog/abandoned-cart-email-testing) got a reminder. From the outside, a missing event looks exactly like a flow nobody switched on.

## Which tests catch which bugs

| Layer | Catches | Misses |
|---|---|---|
| Unit tests in each service | Logic inside one service | Anything between services |
| Contract tests on APIs | A service changing its response shape | Two services both correct and disagreeing |
| End-to-end tests of the storefront | What the shopper actually sees and pays | Root cause, which the logs have to show |
| Production checks up to payment | Config drift between staging and production | Anything after the payment step |

The first two belong in each service's own pipeline. Headless teams often skip the third. A storefront end-to-end test needs the whole stack running, and that stack is often five vendors.

## Test the storefront on every change

The practical answer is a preview deployment per pull request. Vercel, Netlify and similar hosts build one for every branch. GitHub sees each one as a deployment. Point the preview at the sandbox versions of your commerce engine, payment provider and search, and every change gets the full stack, assembled, before it merges.

Then test what the change touched, on that preview. A change to the cart component gets cart and checkout journeys. A change to the promotion service gets the promotion cases. A library change gets every journey that uses it. That last one is why the testing side needs to see the code. At a kickoff with a retailer's engineers in November, [Vilhelm von Ehrenheim](https://www.linkedin.com/in/vilhelm-von-ehrenheim/), our co-founder and Chief AI Officer, explained why the diff alone isn't enough. "If you change, say, a library function, where is that actually used? And which user journeys are potentially affected."

QA.tech, an AI testing platform, does this with [PR testing](https://qa.tech/product/pr-testing). It picks up the preview URL from the GitHub deployment and reads the diff. Then it picks the existing test cases that cover the change, writes the missing ones and runs them in the running storefront. The result lands on the pull request as a check and a review comment. Where there's no preview environment, the same review can run right after merge against staging (GitHub, GitLab and Azure DevOps). It won't catch a bug in a journey the change didn't touch, which is the job of a scheduled run over checkout and the other paths a store can't lose.

More on the setup in [preview environments](https://qa.tech/blog/preview-environments) and [testing Vercel preview deployments](https://qa.tech/blog/test-vercel-preview-deployments), and on the wider approach in [the ecommerce testing guide](https://qa.tech/blog/ecommerce-testing).

## Frequently asked questions

**How do you test a headless commerce site?**
Test each service's contract with its own tests, then test the assembled store end to end from the shopper's side, because most bugs appear where services meet. Run those end-to-end checks on a preview deployment of every change, against sandbox versions of the commerce engine and payment provider.

**Is headless commerce harder to test than a monolith?**
It has more seams. The storefront, commerce engine, CMS, search, promotions, payments and analytics each work on their own, and the storefront team has to wire them together, including events and consent that a monolithic platform would send for you.

**Can you test a headless storefront on every pull request?**
Yes, if each pull request gets a preview deployment. Vercel, Netlify and similar hosts create one automatically and report it to GitHub, so a testing tool can find the preview URL and test the change before merge.
