Spaces:
Sleeping
Download docs/CUSTOM_CASES.md from EnergyVenom/patch-testing-coworker: direct link, hf CLI and curl.
- Browser
- Download file 5.79 kB
-
https://huggingface.co/spaces/EnergyVenom/patch-testing-coworker/resolve/main/docs/CUSTOM_CASES.md
- Command line
-
hf download hf://spaces/EnergyVenom/patch-testing-coworker/docs/CUSTOM_CASES.md
-
curl -L -o CUSTOM_CASES.md https://huggingface.co/spaces/EnergyVenom/patch-testing-coworker/resolve/main/docs/CUSTOM_CASES.md
Custom test cases
People and other agents can give Patchwise their own test cases. Patchwise turns each scenario into a browser script, tries it once on the chosen test environment (a dry run), and a person approves it. Approved scenarios join the script library and run like any other test run. Nothing runs before a person approves it.
Who can use it: consultants, QA approvers and administrators can upload and build. Only consultants and administrators can approve or reject (the same rule as approving scenarios in a run).
The flow
Give the cases with
POST /api/custom-cases/parse, in one of three forms:- Excel: download the template from
GET /api/custom-cases/template.xlsx, fill it in, and upload it asmultipart/form-datain the fieldfile. Use.xlsxonly, at most 2 MB. - Plain text: send JSON
{"text": "...", "area": "AP"}. The area is optional; anArea:line in the text sets it. - JSON, for agents: send
{"cases": [...]}in the shape shown below. The schema is strict: an unknown field refuses the whole batch.
The answer is a batch:
{batch_id, cases: [{key, title, area, priority, steps, warnings, state}], errors}. Nothing has run and nothing is in the library yet. Awarningnames a step that can't be turned into a browser step: reword it and parse again.- Excel: download the template from
Build with
POST /api/custom-cases/{batch_id}/build {"pod_id": 3}. Each scenario becomes a steps draft inFPT_HOME/staging, never in the library, and is then dry-run on the pod in the background. PollGET /api/custom-cases/{batch_id}untilstatusisbuilt(orfailed, with the reason inmessage). Each scenario ends in one of these states:State Meaning dry_run_passedThe script ran end to end. dry_run_failedfailed_stepandmessagesay where and why it failed.not_scriptableA step couldn't be mapped to a browser step; messagesays which one.script_previewlists the steps as Patchwise will run them.simulated: truemeans nothing ran on a pod. That is the case when browser runs are off, or when the pod is the practice app: the step runner drives only Oracle Fusion, so the batch message then reads "Needs a Fusion pod".Approve or reject with
POST /api/custom-cases/{batch_id}/approve {"keys": ["c1"]}, or/reject. Only scenarios whose dry run passed can be approved. Approval does the following:- adds the scenario to the script library as
tests/cases/<AREA>-USR-<nnn>.yaml, together with its entry spec; - commits the addition to
library.git; - records who approved it and when.
If case write-back is off (
FPT_CASE_WRITEBACK=0), the approved scenario stays in staging and can't be started as a run.- adds the scenario to the script library as
Run with
POST /api/custom-cases/{batch_id}/run {"keys": ["c1"], "mode": "quick" | "browser"}. This accepts approved keys only; if any key isn't approved, nothing starts. It starts a normal test run of those scenarios (case_ids) on the batch's pod and returns{run_id}. From there the run, its report and the Excel export work as usual.browserneeds a Fusion pod.
Batches expire 14 days after they are created. Approved scenarios stay in the library.
The one shape
{"cases": [{
"title": "Standard invoice is validated",
"area": "AP",
"priority": "P1",
"preconditions": ["A supplier with a pay site exists"],
"data": {"amount": "100"},
"steps": [
{"action": "Open Payables > Invoices > Create Invoice", "expected": "The Create Invoice page opens"},
{"action": "Enter {{pod.ap.supplier}} in Supplier"},
{"action": "Set Amount to 100"},
{"action": "Save"},
{"action": "Run invoice action Validate"},
{"action": "Check Status is Validated", "expected": "The invoice shows Validated"}
]
}]}
Limits per batch: 50 scenarios, 40 steps per scenario, 500 characters per step, and 50,000 characters of text.
area: a business-area code such as AP, PO, GL or P2P.priority: P1 to P4. P2 is used when it's empty.
Plain text uses the same fields:
Scenario: Standard invoice is validated
Area: AP
Priority: P1
1. Open Payables > Invoices > Create Invoice -> The Create Invoice page opens
2. Enter {{pod.ap.supplier}} in Supplier
3. Check Status is Validated -> The invoice shows Validated
How steps are written
Each action is mapped to the step runner by a fixed grammar. A sign-in step is added at the start when it's missing.
| Write | Becomes |
|---|---|
Sign in |
sign_in |
Open Payables > Invoices > Create Invoice |
open_task |
Enter 100 in Amount, Set Amount to 100 |
enter |
Click Save and Close |
click |
Save |
save |
Add line 100 |
add_line |
Run invoice action Validate |
invoice_action |
Check Status is Validated |
expect_status |
Check Amount is 100 |
expect_value |
Check Supplier is filled |
expect_filled |
Remember Invoice Number as inv |
remember |
Confirm if asked |
confirm_if_asked |
Cancel without saving |
cancel_without_saving |
Placeholders keep pod-specific data out of the file:
{{pod.ap.supplier}}and{{pod.ap.business_unit}}: values from the pod;{{today}}: today's date;{{unique:TAG}}: a value unique to this run;{{saved.name}}: a value saved earlier withremember.
Privacy
User-written cases can contain client data, so they are never sent to an AI model, frontier or local. If a step can't be mapped, it is reported back to be reworded rather than guessed. More in SECURITY.md.