Import and export test cases
Move test cases between Agnox, spreadsheets, other test management tools and your Playwright code.
Migrating from Qase, TestRail, Xray or Zephyr? Start with the step-by-step Migrate & Export Test Cases guide. This page is the field-level reference.
In the dashboard, open Test Cases: Export offers every format below for the selected rows, else the open folder, else the whole project. Import (admins, developers and manual testers) previews a file before anything is written.
Export
POST /api/test-cases/export (dashboard, returns the file) or POST /api/v1/test-cases/export (API key, returns { files: [{ path, content }] }). Every role may export.
{ "projectId": "665f…", "format": "csv", "folderPath": "/root/Login", "ids": ["…"] }
format | File | Content |
|---|---|---|
json | agnox-test-cases.json | { format: "agnox.test-cases", version: 1, exportedAt, testCases: [...] }. Re-imports losslessly. |
csv | agnox-test-cases.csv | ID, Title, Folder, Description, Preconditions, Steps, Expected Results, Severity, Type, Tags, Kind. UTF-8 with BOM, CRLF. Steps are numbered lines in one cell; tags are ;-separated. A cell starting with =, +, - or @ is prefixed with ' so spreadsheets do not run it as a formula. |
markdown | agnox-test-cases.md | A heading per folder, a heading per case, and a step table |
playwright | agnox-export.spec.ts (dashboard), one file per top-level folder (API and CLI) | test.describe per folder, one test() per manual case with its steps as comments and test.fixme(...) so it never passes before it is implemented. Automated cases are skipped (they already have a spec). |
At most 5 000 cases per export; narrow by folder or selection beyond that.
Import
POST /api/test-cases/import (dashboard) or POST /api/v1/test-cases/import (API key):
{
"projectId": "665f…",
"format": "auto",
"content": "<file content as text>",
"filename": "testrail-export.csv",
"dryRun": true,
"duplicateStrategy": "update",
"syncFolders": false,
"targetFolderId": "optional folder to import under"
}
Formats
format | Accepts |
|---|---|
auto | Detects the format below from the content |
agnox-json, agnox-csv | Agnox exports |
testrail | TestRail CSV, including "separated steps" exports (one row per step) |
qase | Qase JSON (nested suites) or Qase CSV (suite_id / suite_parent_id hierarchy) |
xray | Xray CSV (Issue Key, Summary, Test Repository Path, one row per step) |
zephyr | Zephyr Scale CSV (Name, Folder, Test Script (Step-by-Step) - Step, one row per step) |
generic-csv | Any CSV with a title column |
Column names are matched case-insensitively. When a field has no column under the vendor's name, these common names are used: title ← title, name, summary; folder ← folder, suite, section (separated by /, > or /); steps ← steps, action; expected result ← expected, expected_result, expected result; priority ← priority, severity; tags ← tags, labels.
Priorities map to severities: critical, blocker, highest, p0 → CRITICAL; high, major, p1 → HIGH; medium, normal, p2 → MEDIUM; low, minor, trivial, lowest, p3 → LOW; anything else → MEDIUM with a warning.
XML exports are not supported: export CSV from TestRail or Zephyr, or JSON from Qase.
Preview and report
dryRun: true parses and validates the file and writes nothing. Both a preview and a real import return:
{
"format": "testrail", "total": 4, "toCreate": 3, "toUpdate": 0, "unchanged": 0, "skipped": 0, "duplicates": 0, "invalid": 1,
"foldersToCreate": ["Login", "Login / Happy Path", "Account"],
"errors": [{ "row": 4, "message": "Title is missing" }],
"warnings": [],
"missingFromFile": { "count": 1, "sample": [{ "tcId": "AG-TC-9", "title": "Old checkout", "externalId": "C9" }] },
"preview": [{ "title": "Valid login", "folderPath": ["Login", "Happy Path"], "steps": [] }],
"created": 3, "updated": 0, "createdFolders": 3
}
created, updated and createdFolders are present only on a real import. skipped counts valid rows that were left out; in update mode warnings gives the reason for each. missingFromFile lists test cases imported earlier from the same source whose ID is not in this file. It is information only: an import never deletes a test case.
Rules
- A case is a duplicate when the project already has a case with the same title in the same folder.
duplicateStrategy: "skip"(default) leaves it out;"create"imports it again;"update"updates it in place (see below). - Folders are created top-down. An existing folder with the same parent and name is reused. A
/in a folder name becomes-. - Cases get consecutive
AG-TC-Nnumbers in file order, type MANUAL, andimportSource { format, source, externalId, sourceProject, importedAt }. - A row without a title is reported with its row number and skipped; the rest of the file is imported.
Update existing
duplicateStrategy: "update" works with every format. Each row is matched inside the project, in this order:
- AG-TC key, for Agnox exports.
- ID in the source system: the Qase
id, TestRailCase IDorID, XrayIssue KeyorKey, Zephyr ScaleKey, or theexternal_id,externalIdoridcolumn of another CSV. Aproject_codeorproject keycolumn, when present, keeps equal IDs of two source projects apart. - Folder and title, when exactly one test case has them. The test case then gets the row's source ID, so later renames and moves still match.
A row with no match is created. A row that could mean more than one test case is skipped with a warning.
| Fields | |
|---|---|
| Updated when they differ | title, description, preconditions, steps, severity, tags, test type |
| Never changed | AG-TC key, automated or manual, linked test and spec file, stability, quarantine, cycle history, comments |
A field the file has no column for keeps its value, and so does the severity when the cell is empty or unknown. The steps of a test case created from a test run follow the code, not the file. Test cases stay in their Agnox folder unless syncFolders is true. Every update is recorded in the test case's history.
IDs must mean the same thing in every import. If two spreadsheets number their rows 1, 2, 3…, or two Qase projects are exported without a project code, import them into separate Agnox projects. The preview warns about each title that would change because of an ID match.
Limits
| Limit | Value |
|---|---|
| File size | 5 MB |
| Cases per import | 2 000 |
| Steps per case | 200 |
| Folder depth | 10 |
| Title | 500 characters |
| Any other field | 10 000 characters |
| Tags per case | 20 (extra tags are dropped with a warning) |
Error code | When |
|---|---|
UNKNOWN_FORMAT | The format could not be detected, or is not supported (XML) |
INVALID_FILE | The file is not the chosen format, or a CSV quote is never closed |
LIMIT_EXCEEDED | More than 2 000 cases |
NOTHING_TO_IMPORT | No row is a valid test case |