Canvas test selector
Use this skill after identifying changed files and before running broad validation.
Decision flow
- •Classify changed paths:
- •UI app:
web/modules/contrib/canvas/ui/**. - •Playwright tests or E2E-affecting code:
web/modules/contrib/canvas/tests/**. - •Backend PHP:
web/modules/contrib/canvas/**outsideui/**andtests/**. - •Other packages:
web/modules/contrib/canvas/packages/**.
- •Run narrow, directly impacted tests first.
- •Run broader suite only where policy requires it.
Command matrix
- •UI targeted Vitest:
ddev n run test -- <relative-test-path-from-ui-dir> - •UI full Vitest after targeted pass:
ddev n run test - •UI targeted Cypress component spec:
ddev cy --component --spec tests/unit/<spec-file> - •Playwright targeted spec:
ddev playwright --spec tests/src/Playwright/<spec-file> - •Backend targeted PHPUnit:
ddev phpunit <relative-path-from-canvas-root> - •Backend static analysis:
ddev phpstan - •Backend coding standards:
ddev phpcs [optional-relative-path]
Guardrails
- •Never run full Cypress component suite.
- •Never run Cypress end-to-end tests.
- •Do not invent unverified broad test commands for CLI package paths.
Output format
When asked to choose tests, return:
- •Exact commands in run order.
- •Why each command is included.
- •Explicit mention of what is intentionally skipped.
Read references/path-mapping.md when path classification is ambiguous.