Record case ids with plune ids
plune ids writes the Plune case id of every Playwright test that names none into plune/ids.json,
a map from the test’s path-title key to its case id. Test files are not edited. Playwright is the
only framework it understands.
{ "tests/cart.spec.ts#cart#adds an item": "7b0e5c3a-2f41-4d8e-a6b9-91c4d3e8f052"}It is a dry run by default: it prints what it would add. --write writes the file.
What gets an entry
Section titled “What gets an entry”The tests come from playwright test --list --reporter=json, as for plune verify.
For each test:
- A test that already names an id (a
PluneIdannotation or@P<id>in its title) or already has an entry in the file is left alone. - A test whose case Plune already holds, matched by its
path-titlekey, gets an entry. - A test with no case yet is listed and skipped. Plune creates the case on the first run.
Entries are only added. An existing entry is never overwritten, and an entry for a test no longer in the code is kept and listed. Keys are sorted, so diffs stay small, and a second run writes nothing.
A file that is not valid JSON, or not an object of strings, is refused with exit code 2 and left
untouched.
The reporter reads it
Section titled “The reporter reads it”The Playwright reporter reads
plune/ids.json when it resolves a test’s case. An entry names the case after the PluneId
annotation, @P<id> in the title and a metadata attachment id, and before the playwright-id and
path-title keys.
- The file is looked up as
plune/ids.jsonunder the directory the run starts in. - The reporter option
idsFileor the environment variablePLUNE_IDS_FILEsets another path. - A missing file is skipped. An invalid one is warned about once and ignored.
| Flag | Effect |
|---|---|
--write | Write the file. Without it nothing is written. |
--file <path> | The mapfile. Default plune/ids.json. |
--from <file> | Read a saved playwright test --list --reporter=json instead of running Playwright. |
--playwright-config <path> | Passed to playwright test --config. |
--json | Print the report as JSON instead of text. |
Like pull and push, it needs a saved login or PLUNE_TOKEN.
Exit codes
Section titled “Exit codes”As for plune verify.
| Code | When |
|---|---|
0 | Success, including a dry run. |
1 | The platform could not be reached or answered with an error. |
2 | Not logged in, a rejected token, or a file that cannot be read or is invalid. |