147 — Create protocol of each variant generates unique code and grid row¶
Description¶
For every ProtocolVariant (WORK_HANDOVER, CONSTRUCTION_SITE, COMPLETED_WORK_LIST,
DOCUMENTATION, TRAINING, RETAINAGE_REQUEST_SHORT_TERM, RETAINAGE_REQUEST_LONG_TERM),
creating a protocol through the create modal generates a unique code with the
variant's prefix and shows a row in the flat grid bound to the chosen received
order, with the correct type chip and the IN_PROCESS state chip. Parametrized —
one test per variant.
Preconditions¶
- Clean database (
TestControl.cleanDb()) - User logged in with ADMIN and ACCOUNTING roles
- Customer, contract and a received order created via API
Steps¶
- Navigate to
/protocolsand click "Přidat protokol" — Expected: "Vyberte objednávku" dialog opens - Select the received order and click "Vybrat" — Expected: "Vyberte typ protokolu" dialog opens
- Click "Nový" (
new-protocol-{VARIANT}), fill the issued date (+ item price for COMPLETED_WORK_LIST) and save — Expected: navigates to the protocol detail page - Return to
/protocols— Expected: exactly one grid row - Assert the row — Expected: code matches
^{PREFIX}\d{8}$, type chipprotocol-type-chip-{VARIANT}, state chipprotocol-state-chip-IN_PROCESS, received-order cell shows the order code
Related¶
- Spec:
tests/e2e/tests/protocols.spec.ts - Code prefixes: WORK_HANDOVER=PPD, CONSTRUCTION_SITE=ZPS, COMPLETED_WORK_LIST=SPP, DOCUMENTATION=ZPD, TRAINING=PZO, RETAINAGE_REQUEST_SHORT_TERM=ZKZ, RETAINAGE_REQUEST_LONG_TERM=ZDZ