@dzhechkov/keysarium 1.7.15 → 1.7.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/.dz-manifest.json +213 -53
  2. package/README.md +29 -6
  3. package/README.ru.md +17 -0
  4. package/package.json +3 -3
  5. package/sbom.json +454 -54
  6. package/src/cli.js +32 -2
  7. package/src/commands/doctor.js +25 -1
  8. package/src/commands/init.js +46 -12
  9. package/src/utils.js +1 -0
  10. package/templates/.agents/skills/casarium/SKILL.md +29 -0
  11. package/templates/.claude/agents/code-goal-planner.md +9 -0
  12. package/templates/.claude/commands/casarium.md +3 -1
  13. package/templates/.claude/commands/cjm-prototype.md +2 -2
  14. package/templates/.claude/commands/research.md +4 -1
  15. package/templates/.claude/rules/checkpoint-protocol.md +2 -1
  16. package/templates/.claude/rules/research-quality.md +11 -6
  17. package/templates/.claude/shards/phase-2-research.shard.md +12 -8
  18. package/templates/.claude/shards/phase-25-cjm.shard.md +5 -3
  19. package/templates/.claude/skills/feature-adr/SKILL.md +17 -15
  20. package/templates/.claude/skills/feature-adr/modules/03-adr.md +1 -1
  21. package/templates/.claude/skills/feature-adr/modules/03.5-ideation-swarm.md +1 -1
  22. package/templates/.claude/skills/feature-adr/modules/06-implementation-plan.md +2 -2
  23. package/templates/.claude/skills/feature-adr/modules/08-qe.md +1 -1
  24. package/templates/.claude/skills/feature-adr/modules/09-fleet-qe.md +12 -12
  25. package/templates/.claude/skills/feature-adr/references/agentic-qe/LICENSE.agentic-qe +21 -0
  26. package/templates/.claude/skills/feature-adr/references/agentic-qe/README.md +20 -16
  27. package/templates/.claude/skills/feature-adr/references/agentic-qe/UPSTREAM-MANIFEST.json +246 -0
  28. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-brutal-honesty-review/README.md +218 -0
  29. package/templates/.claude/skills/feature-adr/references/agentic-qe/{brutal-honesty-review.md → qe-ref-brutal-honesty-review/REFERENCE.md} +14 -1
  30. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-brutal-honesty-review/resources/assessment-rubrics.md +295 -0
  31. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-brutal-honesty-review/resources/review-template.md +102 -0
  32. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-brutal-honesty-review/schemas/output.json +291 -0
  33. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-brutal-honesty-review/scripts/assess-code.sh +179 -0
  34. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-brutal-honesty-review/scripts/assess-tests.sh +223 -0
  35. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-brutal-honesty-review/scripts/validate-config.json +34 -0
  36. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-enterprise-integration-testing/REFERENCE.md +758 -0
  37. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-enterprise-integration-testing/evals/enterprise-integration-testing.yaml +158 -0
  38. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-enterprise-integration-testing/schemas/output.json +74 -0
  39. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-enterprise-integration-testing/scripts/validate-config.json +25 -0
  40. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/REFERENCE.md +226 -0
  41. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/evals/qcsd-ideation-swarm.yaml +138 -0
  42. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/schemas/output.json +568 -0
  43. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/scripts/validate-config.json +25 -0
  44. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/steps/01-flag-detection.md +57 -0
  45. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/steps/02-core-agents.md +29 -0
  46. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/steps/03-batch1-results.md +15 -0
  47. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/steps/04-conditional-agents.md +23 -0
  48. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/steps/05-decision-synthesis.md +29 -0
  49. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/steps/06-report-generation.md +18 -0
  50. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/steps/07-learning-persistence.md +29 -0
  51. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qcsd-ideation-swarm/steps/08-final-output.md +18 -0
  52. package/templates/.claude/skills/feature-adr/references/agentic-qe/{qe-coverage-analysis.md → qe-ref-qe-coverage-analysis/REFERENCE.md} +42 -3
  53. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qe-coverage-analysis/evals/qe-coverage-analysis.yaml +494 -0
  54. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qe-coverage-analysis/schemas/output.json +286 -0
  55. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qe-coverage-analysis/scripts/validate-config.json +42 -0
  56. package/templates/.claude/skills/feature-adr/references/agentic-qe/{qe-requirements-validation.md → qe-ref-qe-requirements-validation/REFERENCE.md} +13 -3
  57. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qe-requirements-validation/evals/qe-requirements-validation.yaml +598 -0
  58. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qe-requirements-validation/schemas/output.json +587 -0
  59. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-qe-requirements-validation/scripts/validate-config.json +37 -0
  60. package/templates/.claude/skills/feature-adr/references/agentic-qe/{regression-testing.md → qe-ref-regression-testing/REFERENCE.md} +30 -49
  61. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-regression-testing/evals/regression-testing.yaml +504 -0
  62. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-regression-testing/schemas/output.json +311 -0
  63. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-regression-testing/scripts/validate-config.json +50 -0
  64. package/templates/.claude/skills/feature-adr/references/agentic-qe/{risk-based-testing.md → qe-ref-risk-based-testing/REFERENCE.md} +23 -52
  65. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-risk-based-testing/evals/risk-based-testing.yaml +141 -0
  66. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-risk-based-testing/schemas/output.json +480 -0
  67. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-risk-based-testing/scripts/validate-config.json +25 -0
  68. package/templates/.claude/skills/feature-adr/references/agentic-qe/{shift-left-testing.md → qe-ref-shift-left-testing/REFERENCE.md} +33 -88
  69. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-shift-left-testing/evals/shift-left-testing.yaml +145 -0
  70. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-shift-left-testing/schemas/output.json +459 -0
  71. package/templates/.claude/skills/feature-adr/references/agentic-qe/qe-ref-shift-left-testing/scripts/validate-config.json +25 -0
  72. package/templates/CLAUDE.md +3 -1
  73. package/templates/docs/feature-adr/04-admin-guide.md +1 -1
  74. package/templates/docs/improvement-directions.md +3 -3
  75. package/templates/docs/keysarium/02-admin-guide.md +2 -2
  76. package/templates/docs/keysarium/03-user-guide.md +3 -3
  77. package/templates/docs/keysarium/05-architecture.md +9 -8
  78. package/templates/docs/keysarium/06-user-flows.md +4 -4
  79. package/templates/lib/platform-templates/copilot.md +1 -1
  80. package/templates/lib/platform-templates/opencode.md +1 -1
  81. package/templates/.claude/skills/feature-adr/references/agentic-qe/enterprise-integration-testing.md +0 -111
  82. package/templates/.claude/skills/feature-adr/references/agentic-qe/qcsd-ideation-swarm.md +0 -126
@@ -0,0 +1,758 @@
1
+ ---
2
+ name: enterprise-integration-testing
3
+ description: "Use when testing enterprise integrations across SAP, middleware, WMS, or backend systems, validating E2E enterprise flows, testing SAP-specific patterns (RFC, BAPI, IDoc, OData, Fiori), or enforcing cross-system quality gates."
4
+ category: enterprise-integration
5
+ priority: high
6
+ tokenEstimate: 2000
7
+ agents: [qe-soap-tester, qe-message-broker-tester, qe-sap-rfc-tester, qe-middleware-validator, qe-sap-idoc-tester, qe-odata-contract-tester, qe-sod-analyzer]
8
+ implementation_status: optimized
9
+ optimization_version: 1.0
10
+ last_optimized: 2026-02-04
11
+ dependencies: [api-testing-patterns, contract-testing, chaos-engineering-resilience]
12
+ quick_reference_card: true
13
+ tags: [enterprise, sap, esb, middleware, integration, e2e, order-to-cash]
14
+ trust_tier: 3
15
+ validation:
16
+ schema_path: schemas/output.json
17
+ validator_path: scripts/validate-config.json
18
+ eval_path: evals/enterprise-integration-testing.yaml
19
+ ---
20
+
21
+ <!-- Vendored from https://github.com/proffesor-for-testing/agentic-qe at 0a6de058575cbe292afe220df105cc74120f7674 (MIT, Copyright (c) 2025 Agentic QE Contributors), 2026-10-23. Bundled references do not install aqe, MCP tools, pattern memory, or fleet runtime. See ../LICENSE.agentic-qe and ../README.md. -->
22
+
23
+ ## Keysarium execution adapter
24
+
25
+ This pinned upstream body is methodology inside the bundled feature-ADR pipeline. In Reference Mode, the feature-ADR module that loaded this file owns orchestration and checkpoints. Use the reasoning and output shape below with the host's available tools. Do not treat upstream `aqe` CLI/MCP calls, named agent roles, browser tools, or example absolute paths as installed capabilities. Name a missing capability or evidence in the checkpoint instead of reporting that an upstream step ran. The schemas and eval files are bundled for explicit validation; bundling them does not run those checks automatically.
26
+
27
+ Relative paths such as `schemas/output.json`, `evals/...` and `steps/...` resolve from this skill directory under `references/agentic-qe/`. When Direct Mode has a separately installed `aqe` runtime, follow the feature-ADR module's direct-mode branch and verify that each required runtime capability is actually available.
28
+
29
+ The upstream names specialized SAP and browser agents. Dispatch only roles actually available in this project; otherwise use boundary-specific checks and report any unverified integration surface.
30
+
31
+ <!-- BEGIN AGENTIC-QE UPSTREAM BODY -->
32
+
33
+ # Enterprise Integration Testing
34
+
35
+ ## Browser engine
36
+
37
+ UI-level enterprise integration checks (SAP Fiori launchpad smoke tests, admin UI validation) should use the **qe-browser** fleet skill. RFC/BAPI/IDoc/OData/SOAP testing continues to use the dedicated `qe-soap-tester`, `qe-sap-rfc-tester`, `qe-sap-idoc-tester`, and `qe-odata-contract-tester` agents. See `.claude/skills/qe-browser/SKILL.md`.
38
+
39
+ <default_to_action>
40
+ When testing enterprise integrations or SAP-connected systems:
41
+ 1. MAP the end-to-end flow (web -> API -> middleware -> backend -> response)
42
+ 2. IDENTIFY integration points and protocols (REST, SOAP, RFC, IDoc, OData, EDI)
43
+ 3. SELECT the right agent for each integration type
44
+ 4. TEST each integration boundary with contract and data validation
45
+ 5. VALIDATE cross-system data consistency (SAP <-> WMS <-> middleware)
46
+ 6. EXERCISE enterprise error handling (compensation, retry, alerting)
47
+ 7. GATE releases with enterprise-specific quality criteria
48
+
49
+ **Agent Selection Guide:**
50
+ - SAP RFC/BAPI calls -> `qe-sap-rfc-tester`
51
+ - SAP IDoc flows -> `qe-sap-idoc-tester`
52
+ - OData/Fiori services -> `qe-odata-contract-tester`
53
+ - SOAP/ESB endpoints -> `qe-soap-tester`
54
+ - Message broker flows -> `qe-message-broker-tester`
55
+ - Middleware routing/transformation -> `qe-middleware-validator`
56
+ - Authorization / SoD conflicts -> `qe-sod-analyzer`
57
+
58
+ **Critical Success Factors:**
59
+ - Enterprise testing is cross-system: no system is tested in isolation
60
+ - Data consistency across systems is the primary quality signal
61
+ - Environment access and test data are the biggest bottlenecks
62
+ </default_to_action>
63
+
64
+ ## Quick Reference Card
65
+
66
+ ### When to Use
67
+ - Testing SAP-connected enterprise systems (S/4HANA, ECC, BW)
68
+ - Validating end-to-end business processes (Order-to-Cash, Procure-to-Pay)
69
+ - Testing middleware/ESB integrations (IIB, MuleSoft, SAP PI/PO)
70
+ - Cross-system data reconciliation (SAP <-> WMS <-> CRM)
71
+ - Enterprise release readiness assessment
72
+
73
+ ### Enterprise Integration Types
74
+ | Integration | Protocol | Agent | Typical Use |
75
+ |-------------|----------|-------|-------------|
76
+ | SAP RFC/BAPI | RFC | qe-sap-rfc-tester | Real-time SAP function calls |
77
+ | SAP IDoc | ALE/EDI | qe-sap-idoc-tester | Asynchronous document exchange |
78
+ | SAP OData | REST/OData | qe-odata-contract-tester | Fiori apps, external APIs |
79
+ | SOAP/ESB | SOAP/HTTP | qe-soap-tester | Legacy service integration |
80
+ | Message Broker | AMQP/JMS | qe-message-broker-tester | Async messaging (MQ, Kafka) |
81
+ | Middleware | Various | qe-middleware-validator | Routing, transformation |
82
+ | Authorization | SAP Auth | qe-sod-analyzer | SoD conflicts, role testing |
83
+
84
+ ### Critical Test Scenarios
85
+ | Scenario | Must Test | Example |
86
+ |----------|----------|---------|
87
+ | E2E Order Flow | Full order lifecycle | Web order -> SAP Sales Order -> WMS Pick -> Ship -> Invoice |
88
+ | Data Consistency | Cross-system match | SAP inventory = WMS inventory |
89
+ | IDoc Processing | Inbound/outbound | Purchase order IDoc -> SAP PO creation |
90
+ | Authorization | SoD compliance | User cannot create AND approve PO |
91
+ | Error Recovery | Compensation | Failed payment -> reverse inventory reservation |
92
+ | Master Data Sync | Replication accuracy | Material master in SAP = Product in WMS |
93
+
94
+ ### Tools
95
+ - **SAP**: SAP GUI, Transaction codes (SE37, WE19, SEGW), Eclipse ADT
96
+ - **Middleware**: IBM IIB/ACE, MuleSoft, SAP PI/PO/CPI
97
+ - **Testing**: SoapUI, Postman, qe-browser (via Vibium for Fiori/web UIs), custom harnesses
98
+ - **Monitoring**: SAP Solution Manager, Splunk, Dynatrace
99
+ - **Data**: SAP LSMW, SECATT, eCATT
100
+
101
+ ### Agent Coordination
102
+ - `qe-sap-rfc-tester`: SAP RFC/BAPI function module testing
103
+ - `qe-sap-idoc-tester`: IDoc inbound/outbound processing validation
104
+ - `qe-odata-contract-tester`: OData service contract and Fiori app testing
105
+ - `qe-soap-tester`: SOAP/WSDL contract validation and WS-Security
106
+ - `qe-message-broker-tester`: Message broker flows, DLQ, ordering
107
+ - `qe-middleware-validator`: ESB routing, transformation, EIP patterns
108
+ - `qe-sod-analyzer`: Segregation of Duties and authorization testing
109
+
110
+ ---
111
+
112
+ ## E2E Enterprise Flow Testing
113
+
114
+ ### Order-to-Cash Flow
115
+ ```javascript
116
+ describe('Order-to-Cash E2E Flow', () => {
117
+ it('processes web order through SAP to warehouse fulfillment', async () => {
118
+ // Step 1: Create order via web API
119
+ const webOrder = await api.post('/orders', {
120
+ customerId: 'CUST-1000',
121
+ items: [{ materialNumber: 'MAT-500', quantity: 10 }],
122
+ shippingAddress: { city: 'Portland', state: 'OR' }
123
+ });
124
+ expect(webOrder.status).toBe(201);
125
+ const webOrderId = webOrder.body.orderId;
126
+
127
+ // Step 2: Verify SAP Sales Order created via middleware
128
+ const sapOrder = await sapClient.call('BAPI_SALESORDER_GETLIST', {
129
+ CUSTOMER_NUMBER: 'CUST-1000',
130
+ SALES_ORGANIZATION: '1000'
131
+ });
132
+ const matchingSapOrder = sapOrder.find(o => o.PURCHASE_ORDER_NO === webOrderId);
133
+ expect(matchingSapOrder).toBeDefined();
134
+ const sapOrderId = matchingSapOrder.SD_DOC;
135
+
136
+ // Step 3: Verify WMS received pick instruction
137
+ const wmsPickTask = await wmsApi.get(`/pick-tasks?externalRef=${sapOrderId}`);
138
+ expect(wmsPickTask.status).toBe(200);
139
+ expect(wmsPickTask.body.status).toBe('PENDING');
140
+
141
+ // Step 4: Complete pick in WMS
142
+ await wmsApi.post(`/pick-tasks/${wmsPickTask.body.taskId}/complete`, {
143
+ pickedItems: [{ sku: 'MAT-500', quantity: 10, location: 'A-01-03' }]
144
+ });
145
+
146
+ // Step 5: Verify SAP delivery created (via IDoc confirmation)
147
+ await waitFor(async () => {
148
+ const delivery = await sapClient.call('BAPI_DELIVERYPROCESSING_GETLIST', {
149
+ SALES_ORDER: sapOrderId
150
+ });
151
+ return delivery.length > 0 && delivery[0].DELVRY_STATUS === 'C';
152
+ }, { timeout: 30000, interval: 3000 });
153
+
154
+ // Step 6: Verify invoice posted in SAP
155
+ await waitFor(async () => {
156
+ const invoice = await sapClient.call('BAPI_BILLINGDOC_GETLIST', {
157
+ REFDOCNUMBER: sapOrderId
158
+ });
159
+ return invoice.length > 0;
160
+ }, { timeout: 30000, interval: 3000 });
161
+ });
162
+ });
163
+ ```
164
+
165
+ ### Procure-to-Pay Flow
166
+ ```javascript
167
+ describe('Procure-to-Pay E2E Flow', () => {
168
+ it('creates purchase requisition through to vendor payment', async () => {
169
+ // Step 1: Create Purchase Requisition
170
+ const prResult = await sapClient.call('BAPI_PR_CREATE', {
171
+ PRHEADER: { PR_TYPE: 'NB', CTRL_IND: '' },
172
+ PRHEADERX: { PR_TYPE: 'X' },
173
+ PRITEMS: [{ MATERIAL: 'MAT-RAW-100', QUANTITY: 500, UNIT: 'EA', PLANT: '1000' }]
174
+ });
175
+ expect(prResult.NUMBER).toBeDefined();
176
+ const prNumber = prResult.NUMBER;
177
+
178
+ // Step 2: Verify PR triggers sourcing (ME57 equivalent)
179
+ const sourcingResult = await sapClient.call('BAPI_PR_GETDETAIL', {
180
+ NUMBER: prNumber
181
+ });
182
+ expect(sourcingResult.PRITEM[0].PREQ_NO).toBe(prNumber);
183
+
184
+ // Step 3: Create Purchase Order from PR
185
+ const poResult = await sapClient.call('BAPI_PO_CREATE1', {
186
+ POHEADER: { COMP_CODE: '1000', DOC_TYPE: 'NB', VENDOR: 'VEND-500' },
187
+ POITEMS: [{ PO_ITEM: '00010', MATERIAL: 'MAT-RAW-100', QUANTITY: 500, PLANT: '1000' }]
188
+ });
189
+ expect(poResult.PO_NUMBER).toBeDefined();
190
+
191
+ // Step 4: Verify PO IDoc sent to vendor
192
+ const idocStatus = await sapClient.call('IDOC_STATUS_READ', {
193
+ DOCNUM: poResult.IDOC_NUMBER
194
+ });
195
+ expect(idocStatus.STATUS).toBe('03'); // Successfully sent
196
+ });
197
+ });
198
+ ```
199
+
200
+ ---
201
+
202
+ ## SAP-Specific Testing Patterns
203
+
204
+ ### RFC/BAPI Testing
205
+ ```javascript
206
+ describe('SAP RFC/BAPI Testing', () => {
207
+ it('validates BAPI return structure and error handling', async () => {
208
+ // Test with valid input
209
+ const result = await sapClient.call('BAPI_MATERIAL_GETDETAIL', {
210
+ MATERIAL: 'MAT-EXIST'
211
+ });
212
+ expect(result.RETURN.TYPE).not.toBe('E');
213
+ expect(result.MATERIAL_GENERAL_DATA.MATL_DESC).toBeDefined();
214
+
215
+ // Test with invalid material
216
+ const errorResult = await sapClient.call('BAPI_MATERIAL_GETDETAIL', {
217
+ MATERIAL: 'MAT-NONEXIST'
218
+ });
219
+ expect(errorResult.RETURN.TYPE).toBe('E');
220
+ expect(errorResult.RETURN.MESSAGE).toContain('does not exist');
221
+ });
222
+
223
+ it('handles BAPI commit correctly', async () => {
224
+ const createResult = await sapClient.call('BAPI_SALESORDER_CREATEFROMDAT2', {
225
+ ORDER_HEADER_IN: {
226
+ DOC_TYPE: 'OR',
227
+ SALES_ORG: '1000',
228
+ DISTR_CHAN: '10',
229
+ DIVISION: '00'
230
+ },
231
+ ORDER_PARTNERS: [{ PARTN_ROLE: 'AG', PARTN_NUMB: 'CUST-1000' }],
232
+ ORDER_ITEMS_IN: [{ MATERIAL: 'MAT-500', TARGET_QTY: 10 }]
233
+ });
234
+
235
+ // Must call BAPI_TRANSACTION_COMMIT to persist
236
+ await sapClient.call('BAPI_TRANSACTION_COMMIT', { WAIT: 'X' });
237
+
238
+ // Verify order exists after commit
239
+ const getResult = await sapClient.call('BAPI_SALESORDER_GETDETAIL', {
240
+ SALESDOCUMENT: createResult.SALESDOCUMENT
241
+ });
242
+ expect(getResult.ORDER_HEADER_OUT.SD_DOC_CAT).toBe('C');
243
+ });
244
+ });
245
+ ```
246
+
247
+ ### IDoc Testing
248
+ ```javascript
249
+ describe('SAP IDoc Processing', () => {
250
+ it('validates inbound IDoc creates correct SAP document', async () => {
251
+ // Send IDoc via middleware
252
+ const idocPayload = {
253
+ IDOCTYP: 'ORDERS05',
254
+ MESTYP: 'ORDERS',
255
+ SNDPOR: 'SAPEXT',
256
+ SNDPRT: 'LS',
257
+ SNDPRN: 'EXTERN',
258
+ RCVPOR: 'SAPSI1',
259
+ RCVPRT: 'LS',
260
+ RCVPRN: 'SAPCLNT100',
261
+ segments: {
262
+ E1EDK01: { BELNR: 'EXT-PO-001' },
263
+ E1EDK14: [{ QUESSION: '001', ORGID: '1000' }],
264
+ E1EDP01: [{ POSEX: '000010', MENGE: '100', MENEE: 'EA', MATNR: 'MAT-500' }]
265
+ }
266
+ };
267
+
268
+ const idocNumber = await middlewareClient.sendIDoc(idocPayload);
269
+
270
+ // Wait for IDoc processing in SAP
271
+ await waitFor(async () => {
272
+ const status = await sapClient.call('IDOC_STATUS_READ', { DOCNUM: idocNumber });
273
+ return status.STATUS === '53'; // Application document posted successfully
274
+ }, { timeout: 60000, interval: 5000 });
275
+
276
+ // Verify SAP document was created
277
+ const sapDoc = await sapClient.call('BAPI_SALESORDER_GETLIST', {
278
+ PURCHASE_ORDER_NO: 'EXT-PO-001'
279
+ });
280
+ expect(sapDoc).toHaveLength(1);
281
+ });
282
+
283
+ it('handles IDoc error status correctly', async () => {
284
+ // Send IDoc with invalid material
285
+ const idocPayload = buildIdocPayload({ materialNumber: 'INVALID-MAT' });
286
+ const idocNumber = await middlewareClient.sendIDoc(idocPayload);
287
+
288
+ await waitFor(async () => {
289
+ const status = await sapClient.call('IDOC_STATUS_READ', { DOCNUM: idocNumber });
290
+ return ['51', '56'].includes(status.STATUS); // Error statuses
291
+ }, { timeout: 60000 });
292
+
293
+ const status = await sapClient.call('IDOC_STATUS_READ', { DOCNUM: idocNumber });
294
+ expect(status.STATUS_TEXT).toContain('Material');
295
+ });
296
+ });
297
+ ```
298
+
299
+ ### OData Service Testing
300
+ ```javascript
301
+ describe('SAP OData Service Testing', () => {
302
+ it('validates OData entity CRUD operations', async () => {
303
+ // CREATE
304
+ const createResponse = await odataClient.post('/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder', {
305
+ SalesOrderType: 'OR',
306
+ SalesOrganization: '1000',
307
+ DistributionChannel: '10',
308
+ OrganizationDivision: '00',
309
+ SoldToParty: 'CUST-1000'
310
+ });
311
+ expect(createResponse.status).toBe(201);
312
+ const salesOrder = createResponse.body.d.SalesOrder;
313
+
314
+ // READ with $expand
315
+ const readResponse = await odataClient.get(
316
+ `/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder('${salesOrder}')?$expand=to_Item`
317
+ );
318
+ expect(readResponse.status).toBe(200);
319
+ expect(readResponse.body.d.SalesOrder).toBe(salesOrder);
320
+
321
+ // READ collection with $filter
322
+ const listResponse = await odataClient.get(
323
+ `/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder?$filter=SoldToParty eq 'CUST-1000'&$top=10`
324
+ );
325
+ expect(listResponse.status).toBe(200);
326
+ expect(listResponse.body.d.results.length).toBeGreaterThan(0);
327
+ });
328
+
329
+ it('validates OData $metadata contract', async () => {
330
+ const metadata = await odataClient.get(
331
+ '/sap/opu/odata/sap/API_SALES_ORDER_SRV/$metadata'
332
+ );
333
+ expect(metadata.status).toBe(200);
334
+
335
+ const parsedMetadata = parseEdmx(metadata.body);
336
+ expect(parsedMetadata.entityTypes).toContain('A_SalesOrder');
337
+ expect(parsedMetadata.entityTypes).toContain('A_SalesOrderItem');
338
+
339
+ // Validate required properties exist
340
+ const salesOrderType = parsedMetadata.getEntityType('A_SalesOrder');
341
+ expect(salesOrderType.properties).toContain('SalesOrder');
342
+ expect(salesOrderType.properties).toContain('SalesOrderType');
343
+ expect(salesOrderType.navigationProperties).toContain('to_Item');
344
+ });
345
+ });
346
+ ```
347
+
348
+ ### Fiori Launchpad Testing
349
+ ```javascript
350
+ describe('Fiori Launchpad App Testing', () => {
351
+ it('validates Fiori tile loads and displays correct data', async () => {
352
+ await page.goto(`${fioriLaunchpadUrl}#SalesOrder-manage`);
353
+
354
+ // Wait for OData call to complete
355
+ await page.waitForResponse(resp =>
356
+ resp.url().includes('API_SALES_ORDER_SRV') && resp.status() === 200
357
+ );
358
+
359
+ // Verify smart table loaded with data
360
+ const tableRows = await page.locator('table tbody tr');
361
+ expect(await tableRows.count()).toBeGreaterThan(0);
362
+
363
+ // Verify filter bar is functional
364
+ await page.fill('[data-sap-ui="filterField-SalesOrder"]', '1000000');
365
+ await page.click('[data-sap-ui="btnGo"]');
366
+
367
+ await page.waitForResponse(resp =>
368
+ resp.url().includes("$filter=SalesOrder eq '1000000'")
369
+ );
370
+ });
371
+ });
372
+ ```
373
+
374
+ ---
375
+
376
+ ## Cross-System Data Validation
377
+
378
+ ```javascript
379
+ describe('Cross-System Data Consistency', () => {
380
+ it('SAP inventory matches WMS inventory', async () => {
381
+ const materials = ['MAT-100', 'MAT-200', 'MAT-300'];
382
+
383
+ for (const material of materials) {
384
+ // Get SAP stock
385
+ const sapStock = await sapClient.call('BAPI_MATERIAL_STOCK_REQ_LIST', {
386
+ MATERIAL: material,
387
+ PLANT: '1000'
388
+ });
389
+ const sapQuantity = parseFloat(sapStock.TOTAL_STOCK);
390
+
391
+ // Get WMS inventory
392
+ const wmsInventory = await wmsApi.get(`/inventory/${material}`);
393
+ const wmsQuantity = wmsInventory.body.availableQuantity;
394
+
395
+ expect(wmsQuantity).toBe(sapQuantity);
396
+ }
397
+ });
398
+
399
+ it('customer master data is consistent across systems', async () => {
400
+ const customerId = 'CUST-1000';
401
+
402
+ const sapCustomer = await sapClient.call('BAPI_CUSTOMER_GETDETAIL', {
403
+ CUSTOMERNO: customerId
404
+ });
405
+
406
+ const crmCustomer = await crmApi.get(`/customers/${customerId}`);
407
+ const wmsCustomer = await wmsApi.get(`/customers/${customerId}`);
408
+
409
+ // Core fields must match
410
+ expect(crmCustomer.body.name).toBe(sapCustomer.CUSTOMER_GENERAL_DATA.NAME);
411
+ expect(wmsCustomer.body.name).toBe(sapCustomer.CUSTOMER_GENERAL_DATA.NAME);
412
+ expect(crmCustomer.body.taxId).toBe(sapCustomer.CUSTOMER_GENERAL_DATA.TAX_NUMBER);
413
+ });
414
+
415
+ it('order status is synchronized across all systems', async () => {
416
+ const orderId = 'ORD-SYNC-TEST';
417
+
418
+ // Create order and wait for propagation
419
+ await api.post('/orders', { orderId, customerId: 'CUST-1000', items: [{ sku: 'MAT-100', qty: 5 }] });
420
+ await sleep(10000); // Allow for async propagation
421
+
422
+ const webStatus = (await api.get(`/orders/${orderId}`)).body.status;
423
+ const sapStatus = (await sapClient.call('BAPI_SALESORDER_GETDETAIL', {
424
+ SALESDOCUMENT: orderId
425
+ })).ORDER_HEADER_OUT.DOC_STATUS;
426
+ const wmsStatus = (await wmsApi.get(`/orders/${orderId}`)).body.status;
427
+
428
+ // All systems should reflect same logical status
429
+ expect(mapSapStatus(sapStatus)).toBe(webStatus);
430
+ expect(mapWmsStatus(wmsStatus)).toBe(webStatus);
431
+ });
432
+ });
433
+ ```
434
+
435
+ ---
436
+
437
+ ## Enterprise Test Data Management
438
+
439
+ ```javascript
440
+ describe('Enterprise Test Data Strategy', () => {
441
+ // Master data setup - reusable across test suites
442
+ const masterDataFixture = {
443
+ async setup() {
444
+ // Create customer in SAP (source of truth)
445
+ const customer = await sapClient.call('BAPI_CUSTOMER_CREATE', {
446
+ PI_COPYREFERENCE: { SALESORG: '1000', DISTR_CHAN: '10' },
447
+ PI_PERSONALDATA: { FIRSTNAME: 'Test', LASTNAME: `Customer-${Date.now()}` }
448
+ });
449
+ await sapClient.call('BAPI_TRANSACTION_COMMIT', { WAIT: 'X' });
450
+
451
+ // Wait for replication to downstream systems
452
+ await waitFor(async () => {
453
+ const wms = await wmsApi.get(`/customers/${customer.CUSTOMERNO}`);
454
+ return wms.status === 200;
455
+ }, { timeout: 60000 });
456
+
457
+ return { customerId: customer.CUSTOMERNO };
458
+ },
459
+
460
+ async teardown(customerId) {
461
+ // Mark customer for deletion (SAP does not hard delete)
462
+ await sapClient.call('BAPI_CUSTOMER_CHANGEFROMDATA', {
463
+ CUSTOMERNO: customerId,
464
+ PI_PERSONALDATA: { DELETION_FLAG: 'X' }
465
+ });
466
+ await sapClient.call('BAPI_TRANSACTION_COMMIT', { WAIT: 'X' });
467
+ }
468
+ };
469
+
470
+ let testCustomer;
471
+
472
+ beforeAll(async () => {
473
+ testCustomer = await masterDataFixture.setup();
474
+ });
475
+
476
+ afterAll(async () => {
477
+ await masterDataFixture.teardown(testCustomer.customerId);
478
+ });
479
+
480
+ it('uses properly replicated test customer', async () => {
481
+ const order = await api.post('/orders', {
482
+ customerId: testCustomer.customerId,
483
+ items: [{ sku: 'MAT-100', qty: 1 }]
484
+ });
485
+ expect(order.status).toBe(201);
486
+ });
487
+ });
488
+ ```
489
+
490
+ ---
491
+
492
+ ## Environment Strategy
493
+
494
+ ### Enterprise Environment Matrix
495
+ | Environment | Purpose | Data | SAP Client | Access |
496
+ |-------------|---------|------|------------|--------|
497
+ | Sandbox (SBX) | Developer exploration | Sample data | 100 | Open |
498
+ | Development (DEV) | Feature development | Synthetic | 200 | Dev team |
499
+ | Integration (INT) | Cross-system testing | Controlled sets | 300 | QE + Dev |
500
+ | Quality (QAS) | Release validation | Production-like | 400 | QE only |
501
+ | Pre-Production (PRE) | Final verification | Masked production copy | 500 | Release team |
502
+ | Production (PRD) | Live system | Real data | 600 | Operations |
503
+
504
+ ```javascript
505
+ // Environment-aware test configuration
506
+ const envConfig = {
507
+ INT: {
508
+ sapClient: '300',
509
+ sapHost: 'sap-int.company.com',
510
+ wmsHost: 'wms-int.company.com',
511
+ middlewareHost: 'esb-int.company.com',
512
+ testDataStrategy: 'synthetic', // Create and teardown
513
+ maxParallelTests: 5
514
+ },
515
+ QAS: {
516
+ sapClient: '400',
517
+ sapHost: 'sap-qas.company.com',
518
+ wmsHost: 'wms-qas.company.com',
519
+ middlewareHost: 'esb-qas.company.com',
520
+ testDataStrategy: 'reserved-sets', // Pre-allocated test data
521
+ maxParallelTests: 3
522
+ }
523
+ };
524
+
525
+ function getTestConfig() {
526
+ const env = process.env.TEST_ENVIRONMENT || 'INT';
527
+ return envConfig[env];
528
+ }
529
+ ```
530
+
531
+ ---
532
+
533
+ ## Enterprise Quality Gates
534
+
535
+ ### QCSD Flags for Enterprise Systems
536
+ ```javascript
537
+ const enterpriseFlags = {
538
+ HAS_MIDDLEWARE: true, // ESB/middleware in the flow
539
+ HAS_SAP_INTEGRATION: true, // SAP RFC/BAPI/IDoc/OData calls
540
+ HAS_AUTHORIZATION: true, // SoD and role-based access
541
+ HAS_CROSS_SYSTEM_DATA: true, // Data replicated across systems
542
+ HAS_ASYNC_PROCESSING: true, // IDoc, message queue, batch jobs
543
+ HAS_LEGACY_PROTOCOL: true // SOAP, RFC, flat-file, EDI
544
+ };
545
+ ```
546
+
547
+ ### Release Readiness Criteria
548
+ ```javascript
549
+ describe('Enterprise Release Readiness', () => {
550
+ it('passes all enterprise quality gates', async () => {
551
+ const gates = [
552
+ {
553
+ name: 'Cross-System Data Consistency',
554
+ check: async () => {
555
+ const results = await runDataReconciliation(['MAT-100', 'MAT-200']);
556
+ return results.every(r => r.consistent);
557
+ }
558
+ },
559
+ {
560
+ name: 'IDoc Processing Success Rate',
561
+ check: async () => {
562
+ const stats = await sapClient.call('IDOC_STATUS_SUMMARY', { PERIOD: 'LAST_24H' });
563
+ const successRate = stats.SUCCESS / stats.TOTAL;
564
+ return successRate >= 0.99; // 99% threshold
565
+ }
566
+ },
567
+ {
568
+ name: 'Middleware Error Rate',
569
+ check: async () => {
570
+ const errors = await middlewareMonitor.getErrorCount({ period: '24h' });
571
+ return errors < 10; // Less than 10 errors in 24h
572
+ }
573
+ },
574
+ {
575
+ name: 'SoD Violations',
576
+ check: async () => {
577
+ const violations = await sodAnalyzer.scan({ scope: 'changed-roles' });
578
+ return violations.critical === 0;
579
+ }
580
+ },
581
+ {
582
+ name: 'E2E Order Flow',
583
+ check: async () => {
584
+ const result = await runE2EOrderFlow();
585
+ return result.allStepsCompleted && result.duration < 120000; // Under 2 minutes
586
+ }
587
+ }
588
+ ];
589
+
590
+ for (const gate of gates) {
591
+ const passed = await gate.check();
592
+ expect(passed).toBe(true);
593
+ }
594
+ });
595
+ });
596
+ ```
597
+
598
+ ---
599
+
600
+ ## Best Practices
601
+
602
+ ### Do This
603
+ - Map the full E2E flow before writing any tests
604
+ - Test each integration boundary separately AND end-to-end
605
+ - Use SAP-aware test data management (create, use, teardown with BAPIs)
606
+ - Validate data consistency across all systems after each integration event
607
+ - Include IDoc status monitoring in your test assertions
608
+ - Test authorization (SoD) as part of every enterprise release gate
609
+ - Use service virtualization for systems that are hard to provision
610
+
611
+ ### Avoid This
612
+ - Testing SAP only through the UI (Fiori/SAP GUI) without API-level tests
613
+ - Ignoring IDoc error statuses (51, 56) and only checking happy path
614
+ - Sharing test data between teams without reservation mechanisms
615
+ - Testing enterprise flows only in sandbox environments
616
+ - Skipping BAPI_TRANSACTION_COMMIT after create/update BAPIs
617
+ - Assuming cross-system data is immediately consistent (allow for async propagation)
618
+ - Deploying without verifying SoD compliance for changed authorization roles
619
+
620
+ ---
621
+
622
+ ## Agent-Assisted Enterprise Testing
623
+
624
+ ```typescript
625
+ // SAP RFC/BAPI function testing
626
+ await Task("SAP BAPI Validation", {
627
+ bapis: ['BAPI_SALESORDER_CREATEFROMDAT2', 'BAPI_SALESORDER_GETDETAIL'],
628
+ testScenarios: ['valid-input', 'missing-required', 'invalid-customer', 'commit-rollback'],
629
+ validateReturnStructure: true
630
+ }, "qe-sap-rfc-tester");
631
+
632
+ // IDoc processing validation
633
+ await Task("IDoc Flow Validation", {
634
+ idocType: 'ORDERS05',
635
+ direction: 'inbound',
636
+ testStatuses: ['53-success', '51-application-error', '56-syntax-error'],
637
+ validateSapDocument: true
638
+ }, "qe-sap-idoc-tester");
639
+
640
+ // OData contract testing
641
+ await Task("OData Service Contract Test", {
642
+ serviceUrl: '/sap/opu/odata/sap/API_SALES_ORDER_SRV',
643
+ validateMetadata: true,
644
+ testCrud: true,
645
+ testFilters: ['$filter', '$expand', '$orderby', '$top', '$skip'],
646
+ checkBackwardCompatibility: true
647
+ }, "qe-odata-contract-tester");
648
+
649
+ // SOAP service validation
650
+ await Task("SOAP Service Validation", {
651
+ wsdl: 'services/OrderService.wsdl',
652
+ operations: ['CreateOrder', 'GetOrderStatus'],
653
+ testWsSecurity: true,
654
+ testFaultCodes: true
655
+ }, "qe-soap-tester");
656
+
657
+ // Middleware flow validation
658
+ await Task("Middleware Integration Test", {
659
+ flow: 'order-to-cash',
660
+ stages: ['web-api', 'esb-routing', 'sap-rfc', 'wms-api'],
661
+ testDLQ: true,
662
+ testCompensation: true,
663
+ validateCorrelationIds: true
664
+ }, "qe-middleware-validator");
665
+
666
+ // Message broker testing
667
+ await Task("Message Broker Validation", {
668
+ broker: 'ibm-mq',
669
+ queues: ['orders.inbound', 'orders.sap', 'orders.wms', 'orders.dlq'],
670
+ testOrdering: true,
671
+ testRetry: true
672
+ }, "qe-message-broker-tester");
673
+
674
+ // Segregation of Duties analysis
675
+ await Task("SoD Conflict Analysis", {
676
+ scope: 'changed-roles',
677
+ ruleSet: 'sap-standard',
678
+ criticalTransactions: ['ME21N', 'ME29N', 'MIRO', 'FB60'],
679
+ reportFormat: 'matrix'
680
+ }, "qe-sod-analyzer");
681
+ ```
682
+
683
+ ---
684
+
685
+ ## Agent Coordination Hints
686
+
687
+ ### Memory Namespace
688
+ ```
689
+ aqe/enterprise-integration/
690
+ flows/ - E2E flow definitions and test results
691
+ sap/
692
+ rfc-results/ - RFC/BAPI test outcomes
693
+ idoc-results/ - IDoc processing validation
694
+ odata-contracts/ - OData $metadata snapshots and diffs
695
+ middleware/
696
+ routing/ - ESB routing test results
697
+ transforms/ - Transformation validation
698
+ cross-system/
699
+ reconciliation/ - Data consistency reports
700
+ master-data/ - Master data sync validation
701
+ authorization/
702
+ sod-reports/ - SoD conflict analysis results
703
+ role-testing/ - Role and permission test results
704
+ quality-gates/ - Enterprise release gate results
705
+ ```
706
+
707
+ ### Fleet Coordination
708
+ ```typescript
709
+ const enterpriseFleet = await FleetManager.coordinate({
710
+ strategy: 'enterprise-integration',
711
+ agents: [
712
+ 'qe-sap-rfc-tester', // SAP function module testing
713
+ 'qe-sap-idoc-tester', // IDoc processing validation
714
+ 'qe-odata-contract-tester', // OData/Fiori service testing
715
+ 'qe-soap-tester', // SOAP/ESB endpoint testing
716
+ 'qe-message-broker-tester', // Message broker flows
717
+ 'qe-middleware-validator', // Middleware routing/transformation
718
+ 'qe-sod-analyzer' // Authorization and SoD
719
+ ],
720
+ topology: 'hierarchical'
721
+ });
722
+
723
+ await enterpriseFleet.execute({
724
+ flow: 'order-to-cash',
725
+ phases: [
726
+ { name: 'contract-validation', agents: ['qe-odata-contract-tester', 'qe-soap-tester'] },
727
+ { name: 'integration-testing', agents: ['qe-sap-rfc-tester', 'qe-sap-idoc-tester', 'qe-middleware-validator'] },
728
+ { name: 'e2e-validation', agents: ['qe-message-broker-tester'] },
729
+ { name: 'authorization-check', agents: ['qe-sod-analyzer'] }
730
+ ]
731
+ });
732
+ ```
733
+
734
+ ---
735
+
736
+ ## Related Skills
737
+ - [api-testing-patterns](../api-testing-patterns/) - REST/GraphQL API testing fundamentals
738
+ - [contract-testing](../contract-testing/) - Consumer-driven contract testing with Pact
739
+ - [middleware-testing-patterns](../middleware-testing-patterns/) - ESB, routing, transformation, DLQ
740
+ - [wms-testing-patterns](../wms-testing-patterns/) - Warehouse management system testing
741
+ - [chaos-engineering-resilience](../chaos-engineering-resilience/) - Fault injection for enterprise systems
742
+ - [database-testing](../database-testing/) - Database integrity and migration testing
743
+ - [security-testing](../security-testing/) - Security and authorization testing
744
+
745
+ ---
746
+
747
+ ## Remember
748
+
749
+ Enterprise integration testing is about verifying that independently correct systems work correctly together. No system is an island. Test each integration boundary with protocol-appropriate tools, validate cross-system data consistency, and always include authorization and SoD checks. The biggest risks are in the seams between systems, not within them.
750
+
751
+ **With Agents:** Use specialized agents for each integration type (RFC, IDoc, OData, SOAP, messaging). Orchestrate them hierarchically: contract validation first, then integration testing, then E2E flows, then authorization. The enterprise fleet catches cross-system inconsistencies that single-system testing misses entirely.
752
+ <!-- END AGENTIC-QE UPSTREAM BODY -->
753
+
754
+ ## Keysarium local addition: integration evidence in feature-ADR
755
+
756
+ For a feature-ADR implementation, map the user journey before choosing tests. Name each boundary between modules or services, the contract at that boundary, the data that must survive it, and one failure path. Keep a small set of end-to-end checks for the complete journey; use focused contract and integration checks to identify which boundary failed.
757
+
758
+ The QE report should link each claimed cross-module behavior to a command, fixture, and observed result. If a dependency or environment was unavailable, record that boundary as unverified rather than declaring the whole journey passed.