Skip to content

Specification: Phase 4 — API Tests

This phase updates and extends the Bruno API tests in the api-test repository to validate all print endpoint changes from Phases 1-3. Tests run against a deployed environment (local or dev).

Requirements: Phase 4 Requirements Verification: Phase 4 Verification Analysis: Gap Analysis — Gap A-1 Depends on: Phases 1, 2, and 3 must be complete and deployed to the target environment.

Task 1: Update existing print tests for composite response

Section titled “Task 1: Update existing print tests for composite response”

Files:

  • api-test/collections/item/bearer-auth/Printing/PrintLabels.bru
  • api-test/collections/item/bearer-auth/Printing/PrintBreadcrumb.bru
  • api-test/collections/kanban/Print-Cards/PrintOneCard.bru
  • api-test/collections/kanban/Print-Cards/PrintMultpleCards.bru

Change:

  1. Remove the disabled tag from all four tests
  2. Update response assertions to validate the new composite shape:
    • res.body.job is a UUID
    • res.body.asOF contains effective and recorded timestamps
    • res.body.results is a non-empty array
    • Each result has templateId, description, itemCount, and url (non-null for success)
  3. Update live-print=false to ensure test mode is used

Tests: T-P4-001 through T-P4-004.

Requirement: REQ-P4-001


Task 2: Add multi-template bulk print tests

Section titled “Task 2: Add multi-template bulk print tests”

Files (new):

  • api-test/collections/item/bearer-auth/Printing/PrintLabelsMixedSizes.bru
  • api-test/collections/item/bearer-auth/Printing/PrintBreadcrumbsMixedSizes.bru
  • api-test/collections/kanban/Print-Cards/PrintCardsMixedSizes.bru

Change: Create tests that send item/card IDs with different configured sizes. Assert:

  • Response contains multiple entries in results array (one per template group)
  • Each entry has the correct templateId and itemCount
  • At least one entry has a non-null url

Although labels and breadcrumbs share the ItemPrintingService code path, testing both endpoint routes validates that the protocol adaptor and route configuration are correct for each.

Prerequisite: Test data setup must include items with different labelSize/cardSize/breadcrumbSize values. This may require a setup script or pre-existing test data.

Tests: T-P4-005, T-P4-006, T-P4-006b.

Requirement: REQ-P4-002


Files (new):

  • api-test/collections/item/bearer-auth/Printing/PrintLabelsOverLimit.bru
  • api-test/collections/item/bearer-auth/Printing/PrintLabelsBatchSplit.bru

Change:

  1. Over-limit test: Send more IDs than maxItemsPerRequest. Assert 400/422 error with descriptive message.
  2. Batch split test: Send more items than maxItemsPerDocumintRequest but fewer than maxItemsPerRequest. Assert multiple result entries for the same template.

Tests: T-P4-007, T-P4-008.

Requirement: REQ-P4-003


Files (new):

  • api-test/collections/kanban/Print-Cards/UnmarkPrinted.bru

Change: Create a test sequence:

  1. Print a card (confirm status changes to PRINTED)
  2. Call POST /v1/kanban/kanban-card/{eId}/event/unmark
  3. Assert card’s printStatus is NOT_PRINTED

Tests: T-P4-009.

Requirement: REQ-P4-004


Files (new):

  • api-test/collections/item/bearer-auth/Printing/PrintLabelsDebug.bru
  • api-test/collections/item/bearer-auth/Printing/PrintLabelsDryRun.bru
  • api-test/collections/item/bearer-auth/Printing/PrintLabelsTestMode.bru

Change:

  1. Debug test: POST /v1/item/item/print-label?debug=true&live-print=false. Assert response includes both url (non-null) and debugPayload (non-null JSON) in each result.
  2. Dry-run test: POST /v1/item/item/print-label?dry-run=true. Assert response includes debugPayload but url is null. Verify no side effects by re-reading items.
  3. Test mode: POST /v1/item/item/print-label?live-print=false. Assert 200 OK (watermark not verifiable via API).

Tests: T-P4-010, T-P4-011, T-P4-012.

Requirement: REQ-P4-005


Task 6: Add notes mapping validation tests

Section titled “Task 6: Add notes mapping validation tests”

Files (new):

  • api-test/collections/kanban/Print-Cards/PrintCardNotesMapping.bru
  • api-test/collections/item/bearer-auth/Printing/PrintLabelNotesMapping.bru
  • api-test/collections/item/bearer-auth/Printing/PrintBreadcrumbNotesMapping.bru

Change: Use debug=true (or dry-run=true) to inspect the Documint payload:

  1. Card notes test: Print a card whose KanbanCard.notes is null but Item.notes has content. Assert debugPayload contains "notes": "" (not the item’s order history).
  2. Label notes test: Print a label for an item with notes = "Test note". Assert debugPayload contains "notes": "Test note".
  3. Breadcrumb notes test: Print a breadcrumb for an item with notes = "Test note". Assert debugPayload contains "notes": "Test note". Validates the breadcrumb endpoint route and protocol adaptor independently from labels.

Tests: T-P4-013, T-P4-014, T-P4-015.

Requirement: REQ-P4-006


#QuestionOptionsRecommendationDecision
1Should api-test tests run against local (K8s) or dev environment?A) Local B) Dev C) BothA for development, B for CI — but this is operational, not a design questionA for development iteration, B for final validation. Dev deployment gated on explicit user prompt.

Before proceeding to implementation, confirm:

  • Phases 1, 2, 3 deployed to target environment
  • Test data available (items with different sizes, cards with various print statuses)
  • Requirements approved

Copyright: (c) Arda Systems 2025-2026, All rights reserved