Testing
AuraScore 81/100

Omnichannel BOPIS Inventory Reconciliation Test Suite

Develop Python pytest integration scripts to validate real-time store inventory sync and Buy Online, Pick-up in Store workflows.

Use this template when rolling out or updating omnichannel fulfillment systems. It generates an end-to-end integration test script verifying stock synchronization between Point-of-Sale terminals and central Order Management Systems.

Template

Role: Principal QA Automation Engineer specializing in retail supply chain, omnichannel fulfillment, and POS-to-cloud integration.

Context

  • In-Store Point of Sale Platform: {{pos_system_type}}
  • Central Order Management System: {{order_management_system}}
  • Physical Store Identifier: {{store_location_id}}
  • Safety Stock Margin: {{safety_stock_threshold}}
  • Event Queue Polling Interval: {{sync_interval_seconds}}
  • Ingestion Webhook Event: {{webhook_event_name}}

Task

Create an asynchronous Python pytest integration test script that validates real-time inventory decrement, safety buffer enforcement, and order allocation between {{pos_system_type}} and {{order_management_system}} for store location {{store_location_id}} without leaving phantom stock allocations.

Method

  1. Establish fixture setup routines connecting to {{order_management_system}} REST/GraphQL APIs and {{pos_system_type}} client emulators.
  2. Query baseline inventory for designated test SKUs at {{store_location_id}} and snapshot starting availability.
  3. Trigger automated Buy-Online-Pick-Up-in-Store (BOPIS) order placement payloads to trigger {{webhook_event_name}}.
  4. Poll inventory delta queues at {{sync_interval_seconds}} intervals with timeout assertions to ensure rapid reconciliation.
  5. Assert available-to-promise (ATP) quantities accurately decrement while respecting {{safety_stock_threshold}} limits.
  6. Inject POS register physical sale transactions simultaneously to test race condition handling and out-of-stock lockouts.
  7. Test customer cancellation and order return scenarios to verify stock restoration integrity and audit log completeness.
  8. Teardown test states by resetting inventory levels to snapshot values across both local and enterprise stores.

Constraints

  • Test code MUST use Python 3.10+ async/await syntax with pytest and httpx libraries.
  • Assertions MUST NOT pass if inventory count breaches below {{safety_stock_threshold}} during concurrent checkouts.
  • Every API interaction MUST log response payloads and latency metrics to standard test artifacts.
  • Database state cleanup MUST execute regardless of assertion pass or fail status.

Output format

Single fully executable Python script containing:

  • Pytest test classes and parameterized test methods
  • Fixtures for authentication, API client sessions, and state teardown
  • Detailed assertion logging using Python logging module
  • A markdown summary section below the code detailing required environment variables, dependency list (requirements.txt block), and CLI execution instructions.

Self-review

  • Ensure {{pos_system_type}}, {{order_management_system}}, and {{store_location_id}} are wired into fixture configuration.
  • Verify race condition assertions check {{safety_stock_threshold}} calculations.
  • Confirm polling loops utilize {{sync_interval_seconds}} with strict timeout ceilings.
AuraScore breakdown
81/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

developers
developers-testing
retail-consumer-goods
python
pytest
omnichannel