tests.json
Search tests, checked before every publish.
tests
array of objects
A request and its expectations. Plan expectations (redirect, resolved, rules, sections) need no engine and run against every draft in milliseconds; result expectations run against the index, also after index runs.
An id unique within its file, such as a search test's, an overlay's or a pattern's.
The request, exactly as the Query API receives it. A fixed time makes scheduled rules testable.
One search, category page or autocomplete request.
18 fields
What the shopper typed. Empty on a category page they only browse.
Where the request comes from. Default: search.
3 values
The search page's results.
A category's listing.
A search box's suggestions while the shopper types.
The channel. Default: the release's first channel.
The locale. Default: the channel's first locale.
The category page being browsed.
The shopper's choices in the page's facets, by field: value or group codes { "color": ["grey", "green"] }, bucket codes { "price": ["100-300"] }, a range { "width": { "gte": 160, "lte": 220 } }, a toggle { "on_sale": true }, and the category facet's choice { "category": { "within": "wohnen/sofas" } }. Values of one field are alternatives; fields narrow each other.
Picks entities (where). Attribute codes and the built-in fields brand, price, on_sale, availability and delivery_days are keys of the same object; category takes is or within.
{ "any": [{ "brand": "bosch" }, { "quality": "oe" }], "not": { "availability": "out_of_stock" } }
5 fields
At least one of these holds.
All of these hold; useful inside any.
A plain value (equal), a list (any of them), or an operator object such as { "lt": 20 }.
6 fields
A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.
A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.
A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.
A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.
From the first value to the second, both included.
True: the field has a value. False: it has none.
What the shopper took back of what the query named: those words stay text, however often the query is sent again. A value, such as { "field": "color", "value": "black" } or { "field": "category", "value": "wohnen/sofas" }, or every detection of a field, such as { "field": "width" } for a width a pattern read.
A detection the shopper removed.
Lets the response send the shopper elsewhere: to the category page a query names completely, or where a rule redirects. false answers with the results instead, as the way back from such a page does. Default: true.
A sort option. Default: the page's default sort.
The page, counted from 1.
Hits per page, up to the limit per_page. Default: 24, which fills rows of two, three, four and six tiles.
Facets to count in full, besides those the page counts first (the limit counted_facets of its layout, and every one with a choice): a facet the response lists as deferred or with more comes with every value when it is named here, as a shopper opening it needs. Each must be a facet of some page of the release; one the page does not show is left out.
Answers with each section's total alone: no hits, and no facets but those facets names, as a filter sheet's "Show 128 results" needs.
Declared context keys and their values, such as { "customer_group": "b2b" }.
The time the request is answered at. The Query API stamps it on arrival; only search tests and the preview (previewSearch) may fix it, which makes scheduled rules testable.
Adds the trace to the response.
The page the shopper loaded, which the storefront names anew on every page load. The search log counts a query in the reports once two page views typed it on a day.
Whose search this is: tests and benchmarks say so, and the reports leave them out. Default: shopper.
4 values
Everyone a storefront serves that none of the below is.
End-to-end tests, which mark their requests so.
A latency benchmark, which marks its requests so.
A crawler or another bot, as uap-core's maintained user agent rules name it; the Query API decides this from the User-Agent header of a request that says it is a shopper's.
5 fields
The request redirects here.
Where a redirect goes: an entity's page, whose URL follows the merchant's catalog, or a fixed URL.
3 fields
An entity named with its type, type:id, such as product:SOFA-LUND-3.
With a category: the filters chosen on its page, as a request's filters name them.
Picks entities (where). Attribute codes and the built-in fields brand, price, on_sale, availability and delivery_days are keys of the same object; category takes is or within.
{ "any": [{ "brand": "bosch" }, { "quality": "oe" }], "not": { "availability": "out_of_stock" } }
5 fields
At least one of these holds.
All of these hold; useful inside any.
A plain value (equal), a list (any of them), or an operator object such as { "lt": 20 }.
6 fields
A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.
A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.
A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.
A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.
From the first value to the second, both included.
True: the field has a value. False: it has none.
A fixed URL: a path such as /werkstatt, or one that starts with https://.
The resolution contains at least this.
4 fields
The id of a category node, such as wohnen/sofas: the merchant's id of a category entity.
Detected filters, such as { "color": "grey" }. Further detected filters do not fail the test.
Picks entities (where). Attribute codes and the built-in fields brand, price, on_sale, availability and delivery_days are keys of the same object; category takes is or within.
{ "any": [{ "brand": "bosch" }, { "quality": "oe" }], "not": { "availability": "out_of_stock" } }
5 fields
At least one of these holds.
All of these hold; useful inside any.
A plain value (equal), a list (any of them), or an operator object such as { "lt": 20 }.
6 fields
A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.
A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.
A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.
A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.
From the first value to the second, both included.
True: the field has a value. False: it has none.
The text left after resolution.
2 fields
The section order begins with these types.
Expectations on the hits of the first section of the entity's type.
6 fields
How many hits contains, excludes, all and none look at. Default: 10.
An entity named with its type, type:id, such as product:SOFA-LUND-3.
Every hit within top matches this.
Picks entities (where). Attribute codes and the built-in fields brand, price, on_sale, availability and delivery_days are keys of the same object; category takes is or within.
{ "any": [{ "brand": "bosch" }, { "quality": "oe" }], "not": { "availability": "out_of_stock" } }
5 fields
At least one of these holds.
All of these hold; useful inside any.
A plain value (equal), a list (any of them), or an operator object such as { "lt": 20 }.
6 fields
A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.
A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.
A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.
A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.
From the first value to the second, both included.
True: the field has a value. False: it has none.
No hit within top matches this.
Picks entities (where). Attribute codes and the built-in fields brand, price, on_sale, availability and delivery_days are keys of the same object; category takes is or within.
{ "any": [{ "brand": "bosch" }, { "quality": "oe" }], "not": { "availability": "out_of_stock" } }
5 fields
At least one of these holds.
All of these hold; useful inside any.
A plain value (equal), a list (any of them), or an operator object such as { "lt": 20 }.
6 fields
A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.
A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.
A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.
A single value in a selector, filter or test: text, a number or a boolean. Dates are text, such as 2026-10-01.
From the first value to the second, both included.
True: the field has a value. False: it has none.
$schema
string
The JSON Schema an editor checks this file against; kept as written.
Example
{
"$schema": "../../../contracts/schema/tests.json",
"tests": [
{
"id": "rug-size-from-query",
"description": "A rug size in the query becomes the size filter",
"request": { "query": "160x230 teppich" },
"expect": { "resolved": { "filters": { "size": "160x230" } } }
},
{
"id": "three-seater-in-grey",
"description": "Seats and a color group from one query",
"request": { "query": "3-sitzer grau" },
"expect": { "resolved": { "filters": { "color": "grey", "seats": 3 } } }
}
]
}Guide: Search tests