ISA後端指令
指令總覽
SpecFormula ISA 支援的所有指令
指令是 SpecFormula 測試規格的核心組成,每個指令對應一種測試操作。
可用指令
| 指令 | 用途 |
|---|---|
| ApiCall | 執行 HTTP API 請求 |
| EntitySetup | 準備測試資料(INSERT) |
| ResponseValidate | 驗證 API 回應 |
| EntityValidate | 驗證資料庫記錄存在 |
| EntityNonExistenceValidate | 驗證資料庫記錄不存在 |
| TimeControl | 控制 Mock 時間 |
指令與 Gherkin 的對應
指令透過 isa.yml 中的正則表達式與 Gherkin Step 文字對應:
instructions:
- name: API call
format: ^\((?:No Actor|UID="(?P<userId>\$[\w.]+)")\) (?P<summary>.+?), call table:$
instruction_type: api_call當 Gherkin Step 匹配正則表達式時,框架會執行對應的指令邏輯。