procurement-testing
Validate procurement workflows, skills, data extraction, compliance, and integration with systematic testing methodology for procurement domain
SKILL.mdskills/shared/procurement-testing/SKILL.md
GitHubProcurement Testing
Overview
Systematically validate procurement workflows, skills, data extraction, compliance checking, and integration to ensure all procurement components work correctly. Covers unit testing patterns, integration testing, end-to-end workflow testing, data accuracy verification, and compliance rule validation for the procurement domain.
Announce at start: "I'm using the procurement-testing skill to validate procurement workflows, skills, and integrations."
When to Use This Skill
Trigger Conditions:
- Validating procurement workflow implementations before deployment
- Testing new procurement skills for correctness
- Verifying data extraction accuracy and provenance
- Validating compliance rules and audit trail functionality
- Integration testing between procurement services and UI components
- Regression testing after code changes
Prerequisites:
- Procurement components to be tested identified
- Test data available (sample orders, quotes, invoices, contracts)
- Expected outcomes defined for each test
- Testing environment configured
Step-by-Step Procedure
Step 1: Test Scope Definition
Define test scope based on changes or requirements:
| Test Type | Scope | When to Use |
|---|---|---|
| Unit Test | Individual functions, validation rules, calculations | After code generation, before integration |
| Integration Test | Service interactions, API endpoints, data flow | After service deployment |
| Workflow Test | End-to-end procurement scenarios | Before release, after major changes |
| Data Accuracy Test | Data extraction, provenance, cross-references | After data pipeline changes |
| Compliance Test | Authority limits, audit trail, regulatory rules | Before audit, after rule changes |
| UI Test | Form submission, validation display, error handling | After UI changes, before release |
Step 2: Test Data Preparation
Prepare test data covering positive, negative, and edge cases:
Test Order Data:
VALID_ORDER: {
order_type: "PO",
supplier: "approved_supplier_1",
total_value: 50000,
currency: "ZAR",
budget_code: "WBS-01900-STR-01",
line_items: [{item: "Steel W310", qty: 100, uom: "t", price: 18500}],
incoterms: "DAP",
delivery_date: "2026-07-15"
}
LOW_VALUE_ORDER: {
order_type: "PO",
total_value: 15000, // Below $25k threshold
workflow: "single_approval"
}
HIGH_VALUE_ORDER: {
order_type: "PO",
total_value: 250000, // Above $100k threshold
workflow: "multi_level_approval"
}
INVALID_ORDER_MISSING_FIELDS: {
order_type: "PO",
total_value: null, // Missing required field
expected: "validation_error"
}
INVALID_ORDER_OVER_BUDGET: {
order_type: "PO",
total_value: 150000,
budget_code: "WBS-exhausted", // Budget depleted
expected: "budget_exceeded_error"
}
Test Approval Scenarios:
APPROVAL_<$25K: {value: 20000, expected_approvers: ["procurement_officer"]}
APPROVAL_$25K-$100K: {value: 50000, expected_approvers: ["procurement_manager", "project_manager"]}
APPROVAL_$100K: {value: 150000, expected_approvers: ["procurement_manager", "project_manager", "finance_manager", "director"]}
SELF_APPROVAL_BLOCKED: {value: 50000, created_by: "procurement_manager", expected: "approval_rerouted"}
Test Invoice Data:
VALID_INVOICE: {
invoice_number: "INV-2026-001",
po_reference: "PO-2026-0089",
total_amount: 6290000,
matches_po: true,
expected: "pass_3way_match"
}
INVALID_INVOICE_AMOUNT: {
invoice_number: "INV-2026-002",
po_reference: "PO-2026-0089",
total_amount: 6500000, // Different from PO
matches_po: false,
expected: "fail_3way_match"
}
DUPLICATE_INVOICE: {
invoice_number: "INV-2026-001", // Same as processed invoice
expected: "duplicate_detected"
}
Step 3: Workflow Testing
Execute end-to-end procurement workflow tests:
Test Scenario 1: Standard Order Creation
- Submit requisition with valid data
- Verify requisition stored with correct fields
- Create PO from requisition
- Verify PO fields match requisition
- Submit for approval (<$25k)
- Verify single approver assigned
- Approve order
- Verify status changed to "approved"
- Issue PO to supplier
- Verify PO sent and status updated
- Record SO acknowledgment
- Verify SO terms match PO
- Record delivery and GRN
- Process invoice
- Verify 3-way match passed
- Process payment
- Verify order closed
Test Scenario 2: High-Value Order with Multi-Level Approval
- Create PO with value >$100k
- Verify 4-level approval chain configured
- Obtain all approvals
- Verify no approver approved own order
- Process through delivery and payment
Test Scenario 3: Rejection and Rework
- Submit order for approval
- Reject with reason
- Verify order returned to draft status
- Correct issue and resubmit
- Verify rejection reason logged in audit trail
Test Scenario 4: Compliance Boundary Testing
- Attempt to order without budget allocation
- Verify hard block enforced
- Attempt to approve over authority limit
- Verify approval rerouted or blocked
- Attempt payment without GRN
- Verify payment blocked
Step 4: Data Extraction Testing
Validate data extraction accuracy:
| Test | Input | Expected Output | Pass Condition |
|---|---|---|---|
| PO Data Extraction | Sample PO PDF | Extracted JSON with all fields | All required fields extracted, accuracy >95% |
| Invoice Data Extraction | Sample invoice PDF | Extracted JSON with line items | All amounts match, PO reference captured |
| Quotation Data Extraction | Supplier quotation PDF | Extracted pricing, validity terms | All prices extracted correctly, validity date parsed |
| GRN Data Extraction | Delivery note | Quantities received, dates match | Quantities match delivery, timestamp extracted |
Provenance Verification:
- Verify every extracted value has source document reference
- Verify source field mapping is correct
- Verify extraction timestamp logged
- Verify confidence score calculated
Step 5: Integration Testing
Validate integrations between procurement components:
| Integration | Test | Expected Result |
|---|---|---|
| Order → Approval | Submit order for approval | Approval chain triggered, approver notified |
| Order → Budget | Create order with cost code | Budget allocated, remaining balance updated |
| PO → Invoice Reconciliation | Match invoice to PO | 3-way match result correct |
| Contract → Order | Create order under contract | Order terms match contract, pricing correct |
| Supplier DB → Order | Select supplier for order | Supplier on approved list, tier verified |
| Audit Trail → All Actions | Execute workflow sequence | Every action logged with actor, timestamp, data |
Step 6: Compliance Testing
Validate compliance enforcement:
| Compliance Rule | Test Scenario | Expected Result |
|---|---|---|
| Authority Limits | Order at threshold boundary | Correct approver assigned |
| Budget Limits | Order at 105% of budget | Blocked with budget exceeded error |
| Approval Sequence | Attempt parallel approval | Sequential order enforced |
| Audit Trail | Complete workflow | All actions logged, no gaps |
| Immutability | Attempt to modify approved order | Modification blocked or requires re-approval |
| Segregation of Duties | User attempts to approve own order | Routed to different approver |
| Document Retention | Query historical records | Records accessible, complete |
Step 7: Test Results Documentation
Document test results with pass/fail for each:
TEST RESULTS — [Test Suite Name]
Date: [YYYY-MM-DD]
Tester: [Agent/Person]
SUMMARY:
Total Tests: [N]
Passed: [N]
Failed: [N]
Skipped: [N]
Pass Rate: [X%]
FAILURE DETAILS:
| Test ID | Test Name | Expected | Actual | Root Cause |
|---------|-----------|----------|--------|------------|
REMEDIATION ACTIONS:
| Failure | Action Required | Responsible | Due Date |
|---------|----------------|-------------|----------|
Success Criteria
- Test scope defined covering all changed components
- Test data prepared covering positive, negative, and edge cases
- All workflow tests executed with expected results
- Data extraction accuracy >95% for all tested documents
- All integration tests pass (order → approval → budget → audit)
- All compliance rules enforced correctly (no bypass possible)
- Test results documented with pass/fail for each test
- Failures logged with root cause and remediation actions
Common Pitfalls
- Testing Happy Path Only — Always test negative cases (missing data, over budget, unauthorized approval) and edge cases (threshold values, boundary conditions).
- Using Production Data — Test data must be synthetic. Real orders contain sensitive pricing and supplier information.
- Skipping Compliance Tests — Compliance rules are the most critical to test because failures create legal, financial, and regulatory risk.
- No Regression Testing — After fixing one issue, always re-run the full test suite to ensure the fix didn't break something else.
- Ignoring Timing Tests — Approval routing, workflow sequencing, and audit trail logging can fail under load. Test performance as well as correctness.
Cross-References
Related Skills
procurement-order-management— Workflow testing for order creationprocurement-compliance— Compliance rule testingprocurement-data-extraction— Data extraction accuracy testingprocurement-document-generation— Document generation testingcontract-intelligence— Contract analysis validationtesting-verification— General testing methodology
Related Agents
Mobile Testing Specialist(DomainForge) — Mobile procurement testingProcurement Analytics Specialist(DomainForge) — Data accuracy validationQualityForge guardian— Quality assurance oversight, test strategyPromptForge Probe— Component testing execution
Example Usage
Scenario: Validate procurement order creation workflow before release
- Scope: Order creation, approval routing, compliance checks
- Test Data: 8 test orders (valid low value, valid high value, missing fields, over budget, self-approval attempt, expired quotation, duplicate, complex multi-line)
- Workflow Tests: Full end-to-end for standard order, high-value order, rejected order
- Compliance Tests: Authority limits, budget blocks, audit trail logging
- Results: 47/47 tests passed (100%), no compliance bypasses found
- Documentation: Full test results logged, signed off for release
Performance Metrics
Target Performance:
- Workflow test coverage: 100% of workflow paths tested
- Compliance test coverage: 100% of compliance rules verified enforced
- Data extraction accuracy: >95% across all document types
- Integration test pass rate: >98% of integration points working
- Test execution time: <5 minutes for unit tests, <30 minutes for full workflow suite