# Fusion Patch Test Strategy (QA): all module packs Owner: QA · Drafted: 9 Oct 2026 (IST) · Status: **v0.8** (8 partly substituted P1 cases ruled stand-ins by the Chief of Staff; 9 Oct 18:34 IST). Previously **v0.7** (held = client pods/real data only; mock runs allowed and non-gating; 9 Oct about 18:30 IST). Before that **v0.6** (lifecycle fields from `tests/README.md`: retired, tolerant, held, conditional, event-driven; 9 Oct 2026, about 17:45 IST). Earlier: v0.5 made the strategy module-generic with P1–P4 score bands; v0.4 synced §5 with generate_report.py (stand-ins, fixme, first mock run); v0.2 applied the team decisions on retries, tiered scope, the P2 real-defect rule and the results path. > **Mock-only limitation (read first).** No Oracle Fusion pod or credentials are available. Every execution in > this programme runs against **local mock apps** (`mock-app/`). No result produced here is evidence > about the behaviour of Oracle Fusion or about any quarterly patch. Reports must say "run against mock" next to every > count. The only claim we can make is that the scripts and pipeline work end to end against a stand-in. Nobody may report a run > against Fusion until a real test pod (never production) is provisioned and the suite is re-run there. ## 1. Purpose and scope Purpose: show that each **module pack** of Patchwise can design, automate, run, triage and report regression tests for its module, and that its reported counts can be trusted. ### 1a. Module packs The strategy is module-generic. Every rule here (tiers, scope, entry and exit criteria, definitions, stability review) applies to each pack independently. **Scope, coverage and sign-off are per module**: one pack's gaps never block another pack's sign-off. | Module | Case IDs / folder | Coverage map | Status (9 Oct 2026) | |---|---|---|---| | **P2P** (Procure-to-Pay) | `P2P--NNN`, `tests/cases/*.yaml` | `analysis/p2p-coverage-map.md` | **First pack.** P1 (32) signed off on the mock, run 20261009-182335 (`qa/signoff.md`) | | O2C, R2R, A2R, EXP, P2M, PPM, SCM, SCP | `--NNN`, `tests/cases//` | `analysis/-coverage-map.md` | P1 signed off on the mock, run 20261009-182335 (`qa/signoff.md`); live status in `qa/audit-report-all.md` | | HCM, CX | `HCM-…`, `CX-…`, `tests/cases//` | `analysis/-coverage-map.md` | **every case on `execution_hold`** (HCM: pod masking unconfirmed, HCM-Q02); module reported as HELD. Mock runs with synthetic data are allowed (Chief of Staff, 9 Oct 18:30 IST); their results (`automation/results/held/`) are recorded as mock-only in the Held section and never gate | Case IDs of scripts and results come **only from `@` tags** (`triage/ids.py` `tag_case_id`: the whole tag must be an ID), never from titles, file names or annotation text (data-recipe IDs such as `DR-INV-001` there created a fake DR module). Stand-in detection still reads `@stand-in` tags, titles and `type: 'stand-in'` annotations. Module membership: the case-ID prefix (shared parser `triage/ids.py`: any `-[-…]-`, plus `TC-…`), else the folder `tests/cases//`. Per-module audit: `qa/audit.py --module ` (default P2P), or `--module all` for every pack. Each pack gets its own go/no-go report and its own QA sign-off file. ### 1b. P2P pack scope (first pack) | Process | Typical checks | |---|---| | Supplier | create/maintain supplier and site; inactive or on-hold supplier blocked on PO/invoice | | Requisition | create, submit, approve/reject per approval rules, cancel, convert to PO | | Purchase order | create from requisition or standalone, approve, change order, cancel, close | | Receipt | receive full/partial, over-receipt tolerance, return/correct | | Invoice | create, validate, match to PO (2-way) or PO + receipt (3-way), cancel | | Match and holds | price/qty variance holds, hold release, tolerance boundaries | | Payment | select validated invoices, pay, void; held invoices are not paid | | Roles/security | each step only allowed for the right role (requester, buyer, receiver, AP clerk, approver) | Other packs take their process list from their coverage map. Out of scope for every pack, for now: any real Fusion pod, production of any kind, performance and load, accessibility, and cross-browser beyond Chromium. Integrations are covered only as far as the mock fakes them. ## 2. Risk-based prioritisation and tiered scope Priority = **business risk × usage** (brief and architecture.pdf). The Analyst's scale (coverage maps §4) scores each item as **Impact (1–5) × Change likelihood (1–5) × Usage (1–5) = 1–125**. Usage is `ASSUMED` until the Scout provides pod data. The bands: | Tier | Score band | Source | |---|---|---| | P1 | **≥ 75** | `p2p-coverage-map.md` §4 | | P2 | **40–74** | `p2p-coverage-map.md` §4 | | P3 | **20–39** | `o2c-coverage-map.md` §4 (the old P3 "< 40" split) | | P4 | **< 20** | `o2c-coverage-map.md` §4 | `triage/risk.py` holds no score bands. It maps the case `priority` label (`P1`/critical, `P2`/high, `P3`/medium, `P4`/low, or bare 1–4) to a tier, and `reports/generate_report.py` and `qa/audit.py` both use it. The band → label step is the Test Designer's. QA check (9 Oct 2026, re-run about 17:16 IST): all 144 case files then present (120 P2P + 24 O2C) carry a `priority_score` whose product falls in the band of their `priority` label, with 0 mismatches. `p2p-coverage-map.md` still shows the three-tier scale (P3 < 40); the O2C map flags this follow-up for the Analyst. | Tier | Typical content | Scope rule (team decision, 9 Oct 2026) | |---|---|---| | P1 (critical) | e.g. P2P: invoice match 2/3-way and holds, payment, approvals, role/segregation-of-duties | **In scope, blocking.** Every P1 case must have a script that was actually run. A P1 failure always blocks GO. | | P2 (high) | lower-usage variants of core flows | **Best effort by default:** gaps are reported, never blocking (P2 *failures* still follow C2). **In scope and blocking when run with `--include-p2`** (same flag as `architecture/p2p_graph.py`; `qa/audit.py --include-p2`). P2 *failures* follow §5 C2 either way. | | P3 (medium) / P4 (low) | edge cases, rarely used options | **Deferred.** Excluded from coverage and listed as deferred. **A deferred case must never cause NO-GO.** (The graph's `select_scope` also defers P3/P4.) | | no priority | — | Treated as in scope (unknown risk) and listed as a gap until the Test Designer tiers it. | Scope rules apply **per module**: "P1 in scope" means that module's P1 cases. Current state (9 Oct 2026, about 17:45 IST; re-run `qa/audit.py --module all` for live numbers): **P2P: 161 case files = 32 P1 / 50 P2 / 57 P3 / 22 P4** (1 retired, 4 tolerant). New P2P P1 since the 17:01 sign-off: P2P-CAP-001 and P2P-SEC-005. Case files are still being added (CX appeared at 17:41 IST), so per-module counts live in `qa/audit-report-all.md`. **Data note:** `tests/README.md` says "669 cases" and "P2P 156 (122 core + 34 PRD)"; the folder holds more files than that (P2P alone has 161), so the README count is stale. QA counts files and does not use the README figure. ### 2b. Lifecycle fields (`tests/README.md`): QA treatment Precedence when a case carries several of these: **retired > held > tolerant**. Conditional and event-driven are flags on top of the tier. | Field (README) | README meaning | QA treatment (`qa/audit.py`) | |---|---|---| | `status: retired` + `superseded_by` + `retired_reason` | "Do not run retired cases"; the file stays for history | Out of every scope: not a coverage gap, not deferred, not blocking. Listed with its successor. **Warning** if `superseded_by` is missing, the successor file does not exist, or the successor is itself retired. A retired case that has a script or result is flagged. | | `suite: tolerant` + `suite_reason` + `go_no_go: false` | AI or probabilistic features; "run and reported separately, not counted toward go/no-go" | Excluded from coverage and blockers (C1/C2 scope) whatever the tier. Tolerant runs are written to `automation/results/tolerant/results.tolerant.pwjson` (QA decision, 9 Oct 17:52 IST). That file feeds **only** the **Tolerant suite** section, with its own pass/fail/flaky/skipped counts: never main totals, never gating. Any tolerant entry that leaks into the gate `results.json` is flagged, kept in totals for C5 parity, and excluded from the gating line. `suite: tolerant` without `go_no_go: false`, or the other way round, is a data warning. Example: EXP map row EXP-02a (EXP-CHN-001, `go_no_go: true`) stays P1 gating; EXP-02b (EXP-AI-001 P1, EXP-AI-002 P2) is tolerant. | | `execution_hold` + `execution_hold_reason` | No run **on a client pod or with real data** until the hold is lifted (HCM: until HCM-Q02 confirms the test pod masks person data). **Chief of Staff decision, 9 Oct 2026 18:30 IST:** the hold covers client pods and real data only; mock runs with synthetic data are allowed | **Not gating and not blocking**; listed as held with the reason. Mock-only runs of held cases (`automation/results/held/results.held.pwjson`, `--held-results`) are recorded as mock-only in the Held section. They are never in totals, coverage or sign-off until masking is confirmed. A held case in the *gate* results file is still flagged. If every case in a module is held, the module's status is **HELD**: no sign-off possible, and that is not a coverage failure. | | `condition` | Case applies only if the client has the feature/licence (CONDITIONAL map rows, "if enabled") | **Tier scope unchanged** (client answers are never invented, so QA does not drop the case on a guess). Listed separately with the condition text so a "no" from the client can retire it. | | `schedule: event-driven` | "runs in the patch cycle before the event, whatever its tier" (year-end, open enrolment, …) | Listed separately. Default: tier scope. With `qa/audit.py --event-due` (the event falls in the next cycle) all non-retired, non-held, non-tolerant event-driven cases are **in scope and blocking whatever their tier**. Which events are due is a release-calendar input, not something QA assumes. | Counts at 17:44 IST (709 case files, 11 modules; live numbers in `qa/audit-report-all.md`): retired 1 (P2P-PAY-009 → R2R-CM-003), tolerant 21, held 95 (all 60 HCM + all 35 CX), conditional 76, event-driven 30. ### 2a. Substitute (stand-in) coverage: QA decision Some cases can't be automated headless as written. **P2P-INV-006** ("Create invoices via spreadsheet and import") needs the desktop Excel spreadsheet upload, so QA's decision is to cover it with a **REST-import stand-in script** against the mock's import endpoint. - The stand-in test must carry the case ID **and** the tag `@stand-in` (also accepted: `@standin`, `@substitute`, or "stand-in" in the title). - `qa/audit.py` counts such a case as **covered by substitute**: it satisfies the coverage criterion, but it is listed separately in the audit report and **is not reported as fully covered**. The spreadsheet UI path itself stays untested and is listed as an open gap. - The same rule applies to any future case that QA approves for a stand-in. Each one is recorded in this section with the reason. | Case | Real path not automated | Stand-in | Approved | |---|---|---|---| | P2P-INV-006 (now P2) | Excel ADFdi spreadsheet upload (desktop add-in; not headless) | REST import of the same invoice data via the mock | QA, 9 Oct 2026 | | P2P-INT-009 (P2) | FBDI zip (ApInvoicesInterfaceTemplate) via the pod's ERP integration service | mock FBDI: base64 CSV via `/erpintegrations` importBulkData | Automation, 9 Oct 2026; QA accepts | **Partial substitutes are stand-ins (Chief of Staff decision, 9 Oct 2026, 18:34 IST).** A case is a stand-in when any part of its real flow is replaced by the mock, or cannot fail on the mock, even if the spec says only `mock-boundary`. Under this rule these 8 P1 cases are stand-ins: SCP-INT-001, SCP-SUP-001, SCP-SUP-002, P2M-WO-004, SCM-CST-001, EXP-RMB-001, O2C-SEC-005 and PPM-CST-001. The full list with reasons is in `qa/stand-in-cases.md`. Automation is tagging them `@stand-in`. Until a result entry carries the tag, `qa/audit.py` applies the decision from its `DECIDED_STANDINS` list, marked "tag pending". `reports/generate_report.py` (not QA-owned, not edited) sees only tags, so its "fully covered" line will count these 8 as fully covered until the tagged run is promoted. That is an expected, documented difference, not a count error. **Update 18:49 IST:** every one of the 8 is tagged in the results of promoted run 20261009-184008-330947. The audit shows no tag pending, and `generate_report.py`'s full/stand-in counts now match the audit exactly (99 / 20 of 119 P1). A stand-in never lifts a WITHHELD caused by an assertion that cannot fail; SCP-INT-001 still needs a fix and a confirming full run. Stand-in detection: a stand-in tag in source (`@stand-in`), a `type: 'stand-in'` annotation, or a stand-in tag or title on the result entry. When results exist, they are authoritative, because tags such as `caseTags()` are built at runtime and are invisible to a static scan. Patch focus: each cycle, cases that touch areas named in the patch's release notes are raised one tier. ## 3. Test levels | Level | What | Owner | Against | |---|---|---|---| | API/contract | fake REST endpoints return the agreed shapes and status codes | Automation | mock | | UI functional (Playwright) | one script per designed case, end-to-end through the mock UI | Automation | mock | | End-to-end flow | requisition → PO → receipt → invoice → match → payment chained in one scenario | Automation | mock | | Triage validation | classifier verdicts vs a human-labelled sample | Triage + QA | recorded results | | Report verification | report counts recomputed independently from raw results (`qa/audit.py`) | QA | recorded results | | Patch regression on Fusion | same suite on a real test pod | — | **not possible yet** | ## 4. Entry criteria Before a test cycle starts: Per module pack: 1. The module's coverage map exists and every process in it has a risk tier (or QA's provisional tier is accepted in writing). 2. The module's case files exist (`tests/cases/*.yaml` for P2P, `tests/cases//*.yaml` for the others). Each case has a unique ID, process, priority, steps, expected result and data recipe reference. 3. Every **P1** case of the module has a Playwright script whose title, filename or tag carries the case ID (checked by `qa/audit.py`). P2 is best effort, and P3/P4 are deferred (§2). 4. The mock app starts with one command (per `automation/` or `mock-app/` README), and its health check passes. 5. Test data is seeded by recipe (`tests/data-recipes/`), not by hand. No secrets or real client data appear in the repo. 6. The Playwright config has **`trace: 'on'`** (every test, not only on failure), `screenshot: 'on'`, **`retries: 0`** (the LangGraph graph owns the single retry, decision 1), and the JSON reporter writes to **`automation/results/results.json`** (decision 4). JUnit is optional. ## 5. Exit criteria (Go/No-Go) **Single source of truth: `reports/generate_report.py`** (`summarize()`, criteria C1–C6). It is also called by `triage/run_triage.py`. It imports `qa/audit.py` for case, script and run mapping and for recomputing counts, and it takes `tier()` from `triage/risk.py` (the shared mapping, which `qa/audit.py` also uses). **GO only if all of C1–C6 are met**, otherwise NO-GO. The table describes the code as of 9 Oct 2026, about 16:40 IST. If text and code disagree, the code wins. Tell QA so this section can be corrected. **Scope.** In scope = P1 + untiered by default, or P1 + P2 + untiered with `--include-p2` (`generate_report.py --include-p2` or `triage/run_triage.py --include-p2`). Everything else is out of scope for this run: P2 by default, and P3/P4 always. | # | Criterion as implemented | |---|---| | C1 | **Coverage (tiered).** Met only if all of these hold: (a) every in-scope case has at least one script (a stand-in script counts); (b) every in-scope scripted case has at least one **executed** result (pass/fail/flaky; skipped/`fixme` = not run); (c) every *blocking* script file has an executed result; (d) at least one script exists. A script is blocking if it maps to an in-scope case **or to no known case** (scope unknown). Not met if `qa/audit.py` is unavailable or there are no cases. Listed under open gaps but never blocking: out-of-scope cases (count and IDs), out-of-scope cases without a script, out-of-scope scripts with no executed result, and stand-in-covered cases. In-scope cases scripted but not executed are listed with their fixme reason (and block). | | C2 | Every P1 case passed **on the first attempt**. Failed, flaky, skipped or not run is not passed, so a P1 failure always blocks. This applies to all P1 cases whatever `--include-p2` says, and to stand-in results like any other test. Every P2 failure has a triage verdict (any class except `unclassified`). **A P2 failure classified `real_defect` at any confidence, or confirmed `real_defect` by a human, blocks GO** unless `reports/human-review.json` sets `"confirmed": "not_defect"` or a `"waiver"` (Chief of Staff decision, 9 Oct 2026). P2 failures are checked even when P2 is out of scope for coverage. | | C3 | Flaky rate ≤ 5% of executed tests (executed = pass + fail + flaky), and every flaky test has an owner (Playwright `owner` annotation or `human-review.json`). Not met if nothing was executed. | | C4 | False-fail rate is reported with its denominator. Always met; informational. | | C5 | The report's pass/fail/flaky/skipped/total counts equal those `qa/audit.py` `parse_playwright_json()` recomputes from the same results file. | | C6 | The report states where the results come from (the mock app with the mock-only note, or the named Oracle Fusion test pod) and has an open-gaps section. Met by construction. | **Stand-ins in the report** (§2a): stand-in tests are tagged `@stand-in`/`@standin`/`@substitute` or have "stand-in" in the title, detected on the script or on the result entry. They have their own report section, **satisfy C1**, and **count in all totals** (Total/Executed/Passed/Failed/Flaky/Skipped, and therefore C2, C3 and C5). They are **excluded from the "fully covered in-scope cases, excluding stand-ins: N of M" line**. Open gaps (never affect the decision on their own): untiered cases, real-defect verdicts awaiting human confirmation, verdicts below the review threshold, failures on P3/P4/untiered cases, P1 flaky tests, and Playwright run-level errors. Human input file: `reports/human-review.json`, shaped as `{"": {"confirmed": "real_defect" | "not_defect", "waiver": "...", "owner": "..."}}`. ### 5a. Known mismatch with the lifecycle fields (report only; `generate_report.py` is not QA's to edit) `generate_report.py` builds C1/C2 scope from the tier alone and does not read `status`, `suite`/`go_no_go`, `execution_hold`, `condition` or `schedule`. Until Triage and Reporting adds them, the report and the QA audit disagree as follows: retired cases are listed as out-of-scope P3/P4 (or would block if P1); tolerant P1 cases (EXP-AI-001) block C1/C2, and tolerant P2 failures would follow the C2 real-defect rule, while tolerant results also sit in the C3 flaky denominator; held P1 cases (HCM, CX) give NO-GO with "not run" under C1/C2/C3 instead of HELD; event-driven cases cannot be put in scope by event. Count parity (C5) is unaffected, because both sides count every result entry in the module. Where the decisions differ, QA reports the mismatch and does not overrule the report. `qa/audit.py` mirrors C1: same scope (apart from §2b/§5a), skipped/fixme = not run, the same "blocking script" rule, the same case-level "scripted but not executed" rule, and the same stand-in detection. Its coverage and count numbers should therefore agree with the report. QA sign-off additionally requires that QA has read the generated report and that `qa/audit-report.md` §3 shows no count mismatch. QA adds no GO criteria beyond C1–C6. ## 6. Definitions - **Pass**: passed on the first attempt. Playwright runs with `retries: 0`, so this is the single Playwright attempt. - **Fail**: still failing after the graph's single retry (status `unexpected` in the merged report; JUnit ``/``). - **Flaky**: fails at least once, then **passes on rerun in the same cycle with no code or data change**. Playwright does not retry (decision 1), so flaky is detected in one of two ways: (a) **graph retry**: the LangGraph executor reruns failed cases once and merges the attempts into one Playwright-shaped report, marking status `flaky`; or (b) **explicit rerun**: a separate rerun results file, passed to `qa/audit.py --rerun FILE`, where a test that failed in `results.json` passes. Flaky tests count as executed, not passed. Flaky rate = flaky / executed. Flaky-on-explicit-rerun is reported separately, because `generate_report.py` counts only its results file. - **False-fail**: a failure that triage classifies as **not a product defect**, such as a UI/locator change, a data issue, timing or the environment. False-fail rate = non-defect failures / triaged failures. A low-confidence verdict counts as non-defect only after human confirmation. Until then it is reported as "unconfirmed". - **Real defect**: a failure that triage classifies as a defect *and* a human confirms. - **Retired / tolerant / held / conditional / event-driven**: as defined in `tests/README.md`, treated as in §2b. "In scope" always means: not retired, not held, not tolerant, and tier in scope (or event-driven with `--event-due`). - **Executed**: a test with a pass, fail or flaky outcome. Skipped (including `test.fixme`) and not-run tests are reported separately and never counted as passes. A script whose only result entries are skipped/fixme **was not run**. ## 7. Script stability review criteria Every script is reviewed against these (static scan in `qa/audit.py`; findings in `qa/script-review.md`): | # | Rule | Flag | |---|---|---| | S1 | Role/label/text locators (`getByRole`, `getByLabel`, `getByText`, `getByTestId` as fallback) | `page.locator('css')`, `xpath=`, `//` selectors, `nth-child`, generated class names | | S2 | No fixed sleeps | `waitForTimeout`, `setTimeout`-based sleeps | | S3 | Rely on auto-waiting, web-first assertions | `expect(await x.isVisible()).toBe(true)`, manual polling loops, `{ force: true }` | | S4 | Isolated data: each test creates or reserves its own data via recipe, with unique suffixes | hardcoded supplier/PO/invoice numbers, dependence on test order, `test.describe.serial` without reason | | S5 | `trace: 'on'`, `screenshot: 'on'`, `retries: 0` (team decision) | `trace` not `'on'` (e.g. `retain-on-failure`/`on-first-retry`), `screenshot` unset; `retries` > 0 (against decision 1). `retries: 0` is correct and not flagged | | S6 | No secrets in code | literal passwords or tokens. Credentials only from env/vault | | S7 | Case ID traceable | case ID (any module prefix, e.g. `@P2P-…`, `@O2C-…`) in the test title or as a tag | | S8 | No focused/disabled tests left in | `test.only`, unexplained `test.skip`/`fixme` | ## 8. Metrics QA tracks per cycle Cases designed; cases with a script; scripts without a case; scripts run; pass/fail/flaky/skipped; flaky rate; false-fail rate; triage verdict mix; report-vs-raw count deltas. Over time, also human-override rate of triage, following the architecture rollout plan. ## 9. Tooling and how to check ``` python3 qa/audit.py # P2P (default): reads automation/results/results.json, writes qa/audit-report.md python3 qa/audit.py --module O2C # one pack -> qa/audit-report-o2c.md python3 qa/audit.py --module all # every pack -> per-module reports + qa/audit-report-all.md python3 qa/audit.py --include-p2 # coverage scope P1+P2 instead of P1 python3 qa/audit.py --tolerant-results F # tolerant-suite results (default automation/results/tolerant/results.tolerant.pwjson) python3 qa/audit.py --event-due # event-driven cases due this cycle: in scope whatever their tier python3 qa/audit.py --rerun rerun.json # also count fail->pass on an explicit rerun as flaky python3 qa/audit.py --help # --results FILE, --discover, --id-regex, --root python3 reports/generate_report.py --results automation/results/results.json # GO/NO-GO (C1-C6) ``` ## 10. Open risks - A mock can drift from real Fusion UI and behaviour, and locator knowledge from the mock won't carry over as-is. - Tiers come from case YAML priorities, which rest on ASSUMED usage in the coverage map and are unverified against any pod. - `reports/generate_report.py` now has `--module`, but does not apply the lifecycle fields (§5a). Owner: Triage and Reporting. - `tests/README.md` warns that automation reads only `tests/cases/*.yaml`; module packs live in sub-folders. `qa/audit.py` walks all of `tests/cases/`. - The case pack is still changing while runs happen (CX added 17:41 IST; new P2P P1 specs 17:41 IST), so each sign-off names the exact results file and time. - The triage classifier can't be validated for accuracy until there is a labelled failure sample (architecture plan: 50–100).