Skip to content

feat(list): add -c, --docs, and --action flags#5541

Merged
DavertMik merged 5 commits into4.xfrom
feat/list-docs-action
Apr 29, 2026
Merged

feat(list): add -c, --docs, and --action flags#5541
DavertMik merged 5 commits into4.xfrom
feat/list-docs-action

Conversation

@DavertMik
Copy link
Copy Markdown
Contributor

Summary

  • codeceptjs list now accepts -c, --config <file>, mirroring run's flag — useful when multiple configs exist (e.g. list -c test/acceptance/codecept.Playwright.js).
  • --docs prints the helper JSDoc beneath each action, with {{> name }} markers resolved against docs/webapi/*.mustache so the rendered prose matches the website docs.
  • --action <name> filters to a single action; the I. prefix is optional and --docs is implied.
  • JSDoc extraction uses acorn (already a runtime dep, see lib/parser.js) — each `Block` comment is paired with the next `MethodDefinition` from the AST, no regex on JS source.

Example

```sh
$ codeceptjs list --action I.click -c test/acceptance/codecept.Playwright.js
Playwright I.click(locator='//body', context=null, options={})
Perform a click on a link or a button, given by a locator.
...
@param {LocatorOrString} [locator='//body'] (optional, '//body' by default) ...
```

Test plan

  • `npx mocha test/runner/list_test.js` — 6 passing (baseline, `-c`, `--docs`, `--action `, `--action I.`, unknown-action message)
  • Manual: `list --docs -c test/acceptance/codecept.Playwright.js` — `I.click` shows the resolved `docs/webapi/click.mustache` content + `@param` lines; `grabCheckedElementStatus` (no mustache placeholder) shows pure JSDoc
  • Manual: same against `codecept.Puppeteer.js` — second helper renders correctly
  • Manual: `list -c /does/not/exist` errors via the same path `run` does

🤖 Generated with Claude Code

DavertMik and others added 5 commits April 26, 2026 22:27
`codeceptjs list` now mirrors `run`'s `-c` config flag. `--docs` prints
the helper JSDoc + resolved `docs/webapi/*.mustache` snippet beneath each
action. `--action <name>` filters to a single action (with optional `I.`
prefix) and implies `--docs`.

JSDoc extraction uses acorn (already a runtime dep) rather than text
patterns: each block comment is paired with the next MethodDefinition,
then `{{> name }}` markers are resolved against `docs/webapi/`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@DavertMik DavertMik merged commit 5ce3c9f into 4.x Apr 29, 2026
10 checks passed
@DavertMik DavertMik deleted the feat/list-docs-action branch April 29, 2026 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant