Procurement 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
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 creation
procurement-compliance — Compliance rule testing
procurement-data-extraction — Data extraction accuracy testing
procurement-document-generation — Document generation testing
contract-intelligence — Contract analysis validation
testing-verification — General testing methodology
Related Agents
Mobile Testing Specialist (DomainForge) — Mobile procurement testing
Procurement Analytics Specialist (DomainForge) — Data accuracy validation
QualityForge guardian — Quality assurance oversight, test strategy
PromptForge 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
1---2name: procurement-testing3description: Validate procurement workflows, skills, data extraction, compliance, and integration with systematic testing methodology for procurement domain4---56# Procurement Testing78## Overview910Systematically 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.1112**Announce at start:** "I'm using the procurement-testing skill to validate procurement workflows, skills, and integrations."1314## When to Use This Skill1516**Trigger Conditions:**17- Validating procurement workflow implementations before deployment18- Testing new procurement skills for correctness19- Verifying data extraction accuracy and provenance20- Validating compliance rules and audit trail functionality21- Integration testing between procurement services and UI components22- Regression testing after code changes2324**Prerequisites:**25- Procurement components to be tested identified26- Test data available (sample orders, quotes, invoices, contracts)27- Expected outcomes defined for each test28- Testing environment configured2930## Step-by-Step Procedure3132### Step 1: Test Scope Definition3334Define test scope based on changes or requirements:3536| Test Type | Scope | When to Use |37|-----------|------|-------------|38| **Unit Test** | Individual functions, validation rules, calculations | After code generation, before integration |39| **Integration Test** | Service interactions, API endpoints, data flow | After service deployment |40| **Workflow Test** | End-to-end procurement scenarios | Before release, after major changes |41| **Data Accuracy Test** | Data extraction, provenance, cross-references | After data pipeline changes |42| **Compliance Test** | Authority limits, audit trail, regulatory rules | Before audit, after rule changes |43| **UI Test** | Form submission, validation display, error handling | After UI changes, before release |4445### Step 2: Test Data Preparation4647Prepare test data covering positive, negative, and edge cases:4849**Test Order Data:**50```51VALID_ORDER: {52 order_type: "PO",53 supplier: "approved_supplier_1",54 total_value: 50000,55 currency: "ZAR",56 budget_code: "WBS-01900-STR-01",57 line_items: [{item: "Steel W310", qty: 100, uom: "t", price: 18500}],58 incoterms: "DAP",59 delivery_date: "2026-07-15"60}6162LOW_VALUE_ORDER: {63 order_type: "PO",64 total_value: 15000, // Below $25k threshold65 workflow: "single_approval"66}6768HIGH_VALUE_ORDER: {69 order_type: "PO",70 total_value: 250000, // Above $100k threshold71 workflow: "multi_level_approval"72}7374INVALID_ORDER_MISSING_FIELDS: {75 order_type: "PO",76 total_value: null, // Missing required field77 expected: "validation_error"78}7980INVALID_ORDER_OVER_BUDGET: {81 order_type: "PO",82 total_value: 150000,83 budget_code: "WBS-exhausted", // Budget depleted84 expected: "budget_exceeded_error"85}86```8788**Test Approval Scenarios:**89```90APPROVAL_<$25K: {value: 20000, expected_approvers: ["procurement_officer"]}91APPROVAL_$25K-$100K: {value: 50000, expected_approvers: ["procurement_manager", "project_manager"]}92APPROVAL_$100K: {value: 150000, expected_approvers: ["procurement_manager", "project_manager", "finance_manager", "director"]}93SELF_APPROVAL_BLOCKED: {value: 50000, created_by: "procurement_manager", expected: "approval_rerouted"}94```9596**Test Invoice Data:**97```98VALID_INVOICE: {99 invoice_number: "INV-2026-001",100 po_reference: "PO-2026-0089",101 total_amount: 6290000,102 matches_po: true,103 expected: "pass_3way_match"104}105106INVALID_INVOICE_AMOUNT: {107 invoice_number: "INV-2026-002",108 po_reference: "PO-2026-0089",109 total_amount: 6500000, // Different from PO110 matches_po: false,111 expected: "fail_3way_match"112}113114DUPLICATE_INVOICE: {115 invoice_number: "INV-2026-001", // Same as processed invoice116 expected: "duplicate_detected"117}118```119120### Step 3: Workflow Testing121122Execute end-to-end procurement workflow tests:123124**Test Scenario 1: Standard Order Creation**1251. Submit requisition with valid data1262. Verify requisition stored with correct fields1273. Create PO from requisition1284. Verify PO fields match requisition1295. Submit for approval (<$25k)1306. Verify single approver assigned1317. Approve order1328. Verify status changed to "approved"1339. Issue PO to supplier13410. Verify PO sent and status updated13511. Record SO acknowledgment13612. Verify SO terms match PO13713. Record delivery and GRN13814. Process invoice13915. Verify 3-way match passed14016. Process payment14117. Verify order closed142143**Test Scenario 2: High-Value Order with Multi-Level Approval**1441. Create PO with value >$100k1452. Verify 4-level approval chain configured1463. Obtain all approvals1474. Verify no approver approved own order1485. Process through delivery and payment149150**Test Scenario 3: Rejection and Rework**1511. Submit order for approval1522. Reject with reason1533. Verify order returned to draft status1544. Correct issue and resubmit1555. Verify rejection reason logged in audit trail156157**Test Scenario 4: Compliance Boundary Testing**1581. Attempt to order without budget allocation1592. Verify hard block enforced1603. Attempt to approve over authority limit1614. Verify approval rerouted or blocked1625. Attempt payment without GRN1636. Verify payment blocked164165### Step 4: Data Extraction Testing166167Validate data extraction accuracy:168169| Test | Input | Expected Output | Pass Condition |170|------|-------|----------------|----------------|171| PO Data Extraction | Sample PO PDF | Extracted JSON with all fields | All required fields extracted, accuracy >95% |172| Invoice Data Extraction | Sample invoice PDF | Extracted JSON with line items | All amounts match, PO reference captured |173| Quotation Data Extraction | Supplier quotation PDF | Extracted pricing, validity terms | All prices extracted correctly, validity date parsed |174| GRN Data Extraction | Delivery note | Quantities received, dates match | Quantities match delivery, timestamp extracted |175176**Provenance Verification:**1771. Verify every extracted value has source document reference1782. Verify source field mapping is correct1793. Verify extraction timestamp logged1804. Verify confidence score calculated181182### Step 5: Integration Testing183184Validate integrations between procurement components:185186| Integration | Test | Expected Result |187|------------|------|----------------|188| Order → Approval | Submit order for approval | Approval chain triggered, approver notified |189| Order → Budget | Create order with cost code | Budget allocated, remaining balance updated |190| PO → Invoice Reconciliation | Match invoice to PO | 3-way match result correct |191| Contract → Order | Create order under contract | Order terms match contract, pricing correct |192| Supplier DB → Order | Select supplier for order | Supplier on approved list, tier verified |193| Audit Trail → All Actions | Execute workflow sequence | Every action logged with actor, timestamp, data |194195### Step 6: Compliance Testing196197Validate compliance enforcement:198199| Compliance Rule | Test Scenario | Expected Result |200|----------------|---------------|-----------------|201| Authority Limits | Order at threshold boundary | Correct approver assigned |202| Budget Limits | Order at 105% of budget | Blocked with budget exceeded error |203| Approval Sequence | Attempt parallel approval | Sequential order enforced |204| Audit Trail | Complete workflow | All actions logged, no gaps |205| Immutability | Attempt to modify approved order | Modification blocked or requires re-approval |206| Segregation of Duties | User attempts to approve own order | Routed to different approver |207| Document Retention | Query historical records | Records accessible, complete |208209### Step 7: Test Results Documentation210211Document test results with pass/fail for each:212213```214TEST RESULTS — [Test Suite Name]215Date: [YYYY-MM-DD]216Tester: [Agent/Person]217218SUMMARY:219Total Tests: [N]220Passed: [N]221Failed: [N]222Skipped: [N]223Pass Rate: [X%]224225FAILURE DETAILS:226| Test ID | Test Name | Expected | Actual | Root Cause |227|---------|-----------|----------|--------|------------|228229REMEDIATION ACTIONS:230| Failure | Action Required | Responsible | Due Date |231|---------|----------------|-------------|----------|232```233234## Success Criteria235236- [ ] Test scope defined covering all changed components237- [ ] Test data prepared covering positive, negative, and edge cases238- [ ] All workflow tests executed with expected results239- [ ] Data extraction accuracy >95% for all tested documents240- [ ] All integration tests pass (order → approval → budget → audit)241- [ ] All compliance rules enforced correctly (no bypass possible)242- [ ] Test results documented with pass/fail for each test243- [ ] Failures logged with root cause and remediation actions244245## Common Pitfalls2462471. **Testing Happy Path Only** — Always test negative cases (missing data, over budget, unauthorized approval) and edge cases (threshold values, boundary conditions).2482. **Using Production Data** — Test data must be synthetic. Real orders contain sensitive pricing and supplier information.2493. **Skipping Compliance Tests** — Compliance rules are the most critical to test because failures create legal, financial, and regulatory risk.2504. **No Regression Testing** — After fixing one issue, always re-run the full test suite to ensure the fix didn't break something else.2515. **Ignoring Timing Tests** — Approval routing, workflow sequencing, and audit trail logging can fail under load. Test performance as well as correctness.252253## Cross-References254255### Related Skills256- `procurement-order-management` — Workflow testing for order creation257- `procurement-compliance` — Compliance rule testing258- `procurement-data-extraction` — Data extraction accuracy testing259- `procurement-document-generation` — Document generation testing260- `contract-intelligence` — Contract analysis validation261- `testing-verification` — General testing methodology262263### Related Agents264- `Mobile Testing Specialist` (DomainForge) — Mobile procurement testing265- `Procurement Analytics Specialist` (DomainForge) — Data accuracy validation266- `QualityForge guardian` — Quality assurance oversight, test strategy267- `PromptForge Probe` — Component testing execution268269## Example Usage270271**Scenario:** Validate procurement order creation workflow before release2722731. **Scope:** Order creation, approval routing, compliance checks2742. **Test Data:** 8 test orders (valid low value, valid high value, missing fields, over budget, self-approval attempt, expired quotation, duplicate, complex multi-line)2753. **Workflow Tests:** Full end-to-end for standard order, high-value order, rejected order2764. **Compliance Tests:** Authority limits, budget blocks, audit trail logging2775. **Results:** 47/47 tests passed (100%), no compliance bypasses found2786. **Documentation:** Full test results logged, signed off for release279280## Performance Metrics281282**Target Performance:**283- Workflow test coverage: 100% of workflow paths tested284- Compliance test coverage: 100% of compliance rules verified enforced285- Data extraction accuracy: >95% across all document types286- Integration test pass rate: >98% of integration points working287- Test execution time: <5 minutes for unit tests, <30 minutes for full workflow suite