Score test quality
score_test_qualityAnalyze Playwright spec files and Page Objects via TypeScript AST to measure semantic locators vs raw CSS/XPath, assertion density, and anti-patterns. Get line-number warnings and scaffold status.
Instructions
Score a spec file and its imported Page Objects with the TypeScript AST (comments and strings are ignored): % semantic locators vs raw CSS/XPath, assertion density, anti-pattern warnings with line numbers, and scaffold skeleton status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| specPath | Yes | Path to the spec file or page object to score, relative to project root or absolute. | |
| projectRoot | No | Optional path to the project root. If omitted, auto-detected by searching for playwright.config.*. | |
| generateHtmlReport | No | Set to true to generate the standalone visual quality report at test-results/quality-report.html. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scaffold | Yes | ||
| warnings | Yes | ||
| antiPatterns | Yes | ||
| fileBreakdown | No | ||
| locatorQuality | Yes | ||
| assertionDensity | Yes | ||
| qualityReportHtmlPath | No |