Task #102: Adds Playwright UI coverage for the receiver side of the
service-orders flow, mirroring the existing API-level matrix in
artifacts/api-server/tests/service-orders.test.mjs.
What's added
- artifacts/tx-os/tests/order-receiver-flow.spec.mjs with two tests:
1) "receiver claims, prepares, completes — requester sees live status
updates": seeds a requester (role "user") and a receiver (role
"order_receiver"), runs each in its own browser context, has the
requester place an order via /services, then has the receiver claim
it from /orders/incoming and walk it through Mark Preparing →
Mark Completed. After every receiver action it asserts that the
requester's /my-orders status pill ("Received", "Preparing",
"Completed") updates without a manual refresh — exercising the
order_updated socket.io push wired through use-notifications-socket.
2) "receiver cancels after claiming — requester sees Cancelled pill":
covers the receiver-side cancel path required by the task by
claiming the order and then cancelling from /orders/incoming, and
verifies the requester's card flips to the red "Cancelled" pill and
loses the timeline step circles.
Test design notes
- English UI only; the language matrix is already covered for the
requester side by order-place-cancel.spec.mjs.
- Each test creates a unique requester display name so that incoming
cards can be uniquely located by service name + "From <display name>"
even if other cards exist on the page.
- Status assertions use exact-text matching on the pill to avoid the
"Received" / "Awaiting receiver" substring overlap.
- afterAll cleans up service_orders, notifications, user_roles and the
seeded users (defensive: also deletes any orders referencing those
users that weren't explicitly tracked).
Other
- The new spec is automatically picked up by the existing
`pnpm --filter @workspace/tx-os test:e2e` run (testMatch in
artifacts/tx-os/playwright.config.mjs already globs *.spec.mjs).
- Verified locally: full tx-os e2e suite (9 specs) passes.
Replit-Task-Id: bdbee3d1-20e0-4a40-b2b1-51ea16a15bb7