Automated Test Execution, Suites & CI
Prerequisite: Read
first. If there is a conflict between the old main entry and the domain rules of this skill, follow the current CLI help and this skill. For complex scenario step modeling, refer to
../apifox-test-scenario/SKILL.md
; for interface cases, refer to
../apifox-test-case/SKILL.md
. Commands related to environment, variables, and reports are subject to the current CLI help; the following focuses on execution boundaries and common pitfalls.
Specific command parameters are subject to the current CLI help. Before execution, focus on confirming resource boundaries, empty suite risks, runner/scheduled task constraints, CI report boundaries, and post-run troubleshooting sequence. In Agent scenarios, use the run result as the acceptance action; in CI scenarios, use the exit code, report file, and upload status as the gatekeeping basis.
When to Use
- Create, update, and run test suites.
- Run existing test scenarios.
- Configure scheduled tasks or CI regression.
- Manage runners or check runner status.
- Need execution parameters, reporters, iterations, variable overrides, SSL, timeout, and report upload for .
Resource Boundaries
| User Requirement | Priority Resource |
|---|
| Test cases under a single interface | , redirect to |
| Multi-step business process modeling | , redirect to |
| Regression of multi-scenario collections | |
| Scheduled execution | |
| Private execution machine | |
| View execution results | , query or download reports according to current CLI help |
Command Entry
Use the current CLI help to query parameters for
,
,
, and
.
covers parameters such as reporters, out-dir, upload-report, iteration, variable overrides, SSL, timeout, and
--carry-runtime-variables
.
will create an empty suite, which can be displayed on the client but has
. Unless the user explicitly requests a placeholder suite, "creating a regression suite/automation suite" must add items via
or subsequent update, and verify that
is not empty via
.
Non-empty suites should use the frontend-compatible structure in
cli-schema get test-suite-create
, such as
+
to reference existing test cases. Do not use legacy shorthand, such as
which will be intentionally blocked by schema validation.
Runner is a team-level execution resource. Before creation, the team and usage must be confirmed. Currently, the commonly used combination is
,
. Do not treat runner as a lightweight resource within the project and create it casually.
Creation/Update Rules
For complex test scenario creation/update, use
.
Do not provide empty shell examples when creating scheduled tasks. Although schema required may only mark
name/cronExpression/runOn
, a usable task usually requires valid contexts such as effective runner and
entityId;
is limited to values supported by the current CLI help/schema, such as
, do not write unsupported
.
Before updating, you must first
the original structure to avoid overwriting steps, variables, scenario references, or suite members.
Running Parameters
Common running parameters are subject to
and specific run command help. In CI scenarios, focus on confirming environment, reporters, out-dir, upload-report, iteration, variable overrides, timeout, bigint, and whether
--carry-runtime-variables
is needed.
Recommended minimal CI command format:
bash
apifox test-suite run <suiteId> --project <projectId> --environment <environmentId> --reporters cli,json,junit --upload-report
Post-Execution Actions
- Local report: Check and .
- Cloud report: Only after running with , execute
test-report list/get/download
according to the current CLI help.
- Failure troubleshooting: First check CLI output, JSON report, agentHints, then locate the specific scenario/suite/case.
- When is not used, the result of this local execution will not appear in the cloud .
- In CI, it is recommended to explicitly specify , inject tokens using CI secrets, and do not write them into the repository.
Common Recovery
| Phenomenon | Handling |
|---|
| Incorrect steps after scenario creation | Redirect to ; confirm whether steps are updated after creation |
| Empty suite run | Use to confirm included scenarios/cases |
| Suite | This is an empty placeholder suite, not a valid regression suite |
| CI cannot find the environment | Use according to current CLI help to confirm environmentId |
| Runner unavailable | Run , then check runner get/list |
| Report lacks step details | First distinguish between local JSON, cloud upload, and download interface summaries, then redirect to if necessary |