Catalog E2E Tests
This guide documents Playwright scenarios that target catalog-template products (productos de catálogo): rows with IsCatalog === true, typically CT status, and behaviour tied to the Show All toggle and related catalog UI (visibility at root, dimming, import, copy-from-catalog / override, etc.). That is not the same as “any test that opens the Products tab.”
Place product creation and editing (selector, editor, categories, ticket chain on local rows) lives in Product E2E Tests. Shared vocabulary for agents and authors: see the repository rule unpispas-catalog-product-terminology.mdc.
Baseline: Preloaded database. The pw stack reset restores deterministic baseline state before runs. Scenarios in catalog-from-catalog.spec.ts run in serial order in one file and build on the same place in the database from one test to the next. Each test opens a new browser context and enables Show all again so the stubbed catalog loads on the client.
See E2E Testing (Playwright) for environment setup and how to run tests.
Tests in this guide
- Setup —
catalog-from-catalogfile (stubs + serial) — diagram and implementation (new tab) - activates one catalog product; others stay dimmed; groups remain — diagram and implementation (new tab)
- creates three place products from catalog in group A (A2–A4) — diagram and implementation (new tab)
- creates three place products from catalog in group B (B1–B3) and verifies grids — diagram and implementation (new tab)
- deleting a catalog-derived product restores dimmed catalog row — diagram and implementation (new tab)
Each heading below opens a dedicated page in a new browser tab with the full Mermaid flow and implementation details. This hub keeps only the scenario narratives—written so you could follow the same journey manually in the app.
Setup (catalog-from-catalog)
Before each run in this file, the test harness pretends the app is online and feeds a fixed catalog JSON from the network layer, so every browser context sees the same template groups and products. The suite also runs tests one after another on purpose: later scenarios assume earlier ones may already have copied some templates into the place.
From there, every scenario signs in, opens the first place, lands on Products, and climbs back to the catalog root so the options menu is available—then turns Show all on so catalog-template rows actually appear. If you were reproducing this by hand, you would do the same: stable network, same place, Show all enabled, then walk the grid. Open Setup — diagram and implementation for the exact hooks and helpers.
activates one catalog product; others stay dimmed; groups remain
Imagine you have Show all on and the grid shows several catalog groups coming from the stubbed feed. You open E2E Catalog Group A and see template rows: they look dimmed compared with normal place stock—that is the UI telling you “this is still catalog material.” You pick E2E Cat A1, copy it into the place with a price, and step back to the group.
Now E2E Cat A1 should look like a real place row: full strength, price visible, no longer in the “ghost” catalog style. Its sibling templates (E2E Cat A2, etc.) should stay dimmed catalog rows—you only activated one. Go back to the catalog home: groups A and B should still be there so the tree did not collapse. The automation checks opacity and CSS classes on the thumbs to make that visible state objective; the same cues are what you would notice on screen.
Where it lives: e2e/tests/catalog/catalog-from-catalog.spec.ts — test activates one catalog product; others stay dimmed; groups remain.
creates three place products from catalog in group A (A2–A4)
This picks up after the previous scenario already materialized E2E Cat A1. You turn Show all on again, open E2E Catalog Group A, and wait until E2E Cat A2 shows up as a template you can open (the test waits for that row to be ready so you are not clicking into a half-rendered grid). Then you copy A2, A3, and A4 in sequence, each with a price, still inside that group.
When you are done, E2E Cat A2 should already behave as a place-owned row—not a dimmed template—so you know the bulk copy path works, not just the first product.
Where it lives: e2e/tests/catalog/catalog-from-catalog.spec.ts — test creates three place products from catalog in group A (A2–A4).
creates three place products from catalog in group B (B1–B3) and verifies grids
With group A already busy from earlier tests, you open E2E Catalog Group B and repeat the same idea: copy B1, B2, and B3 with prices. Then you go home, open group B again, and sanity-check the grid: B1 should read as a normal place row, while E2E Cat B4 should still sit there as an unused catalog template—proof you did not accidentally consume every template in the group.
Where it lives: e2e/tests/catalog/catalog-from-catalog.spec.ts — test creates three place products from catalog in group B (B1–B3) and verifies grids.
deleting a catalog-derived product restores dimmed catalog row
In E2E Catalog Group Z, copy E2E Cat Del into the place, then open that live row and delete it, confirming Yes like a real user cleaning up a mistake. After you close the editor and return to Products with Show all on, the name E2E Cat Del should appear again as a dimmed catalog template—the template was always there under the hood; deleting the place copy simply reveals it again.
If the editor first opens in a read-only summary, you would tap Edit this product (or the Spanish equivalent) before the remove action appears—the test follows that same polite path.
Where it lives: e2e/tests/catalog/catalog-from-catalog.spec.ts — test deleting a catalog-derived product restores dimmed catalog row.