A terminal tree-view of your Playwright suite
- 🌲 A new tree display of your Playwright suite
- 🏗 Configurable and customizable display and style options
brew tap dennisbergevin/tools
brew install pwtree
Install with Go:
go install github.com/dennisbergevin/pwtree@latest
Or grab a binary from the latest release.
To view all files and their respective suites/tests:
pwtree
To display specific suite and/or test titles:
pwtree --filter "Persistence;Editing files"
To display only tests with specific tags:
pwtree --filter "@smoke;@sanity"
To not show a title or tag in tree, prefix with "-":
pwtree --filter "-@smoke;-Persistence"
To display only suites/tests that have ".skip":
pwtree --skipped
To display only suites/tests that have ".fixme":
pwtree --fixme
To display only suites/tests that have ".fail":
pwtree --fail
If you store the output of npx playwright test --list --reporter=json
in a separate file, and you'd like to use that file to generate a tree display in the terminal:
pwtree --json-data-path ./playwright.dev.config.ts
All available commands, including common Playwright arguments such as "--only-changed" and "--project" are included in the help menu:
pwtree --help
You may want to run pwtree
in continuous integration, without custom colors or emojis.
pwtree --ci
If you want to configure certain display, emoji and style options, you can do so in two ways:
- Create a
.pwtree.json
in the Playwright project's root directory - For global configurations you can create a
config.json
file in the~/.config/pwtree/
directory
The content should be in the following format:
{
"showProjects": true,
"showTags": true,
"showFileLines": true,
"emojis": {
"root": "🎭",
"file": "🧪",
"suite": "📁"
},
"styles": [
{
"name": "enumerator",
"color": "150",
"bold": true,
"italic": false,
"faint": false
},
{
"name": "root",
"color": "7",
"bold": true,
"italic": false,
"faint": false
},
{
"name": "item",
"color": "7",
"bold": true,
"italic": false,
"faint": false
},
{
"name": "tag",
"color": "6",
"bold": false,
"italic": false,
"faint": false
},
{
"name": "project",
"color": "4",
"bold": false,
"italic": true,
"faint": true
},
{
"name": "fileLine",
"color": "7",
"bold": false,
"italic": true,
"faint": true
},
{
"name": "skipped",
"color": "10",
"bold": false,
"italic": true,
"faint": false
},
{
"name": "fixme",
"color": "3",
"bold": false,
"italic": true,
"faint": false
},
{
"name": "fail",
"color": "5",
"bold": false,
"italic": true,
"faint": false
},
{
"name": "test",
"color": "7",
"bold": false,
"italic": false,
"faint": false
},
{
"name": "counter",
"color": "7",
"bold": false,
"italic": true,
"faint": true
},
{
"name": "file",
"color": "7",
"bold": true,
"italic": false,
"faint": false
},
{
"name": "suite",
"color": "7",
"bold": true,
"italic": false,
"faint": false
}
]
}