Examples
Common workflows and usage patterns for playwright-tui.
Basic usage
Run all tests in the current directory:
playwright-tui
Filter tests with grep
Run only tests matching a pattern:
playwright-tui -- --grep @smoke
Set worker count
Control parallelism:
playwright-tui -- --workers=4
Target a specific browser
playwright-tui -- --project=chromium
Run against a different project
Point to a directory containing playwright.config.*:
playwright-tui -C ../my-app
Combine options
Run smoke tests on chromium with 4 workers from a different directory:
playwright-tui -C ../my-app -- --grep @smoke --project=chromium --workers=4
Use npx instead of bunx
Force npx as the runner:
playwright-tui --runner npx -- --grep login
Disable timing history
Run without saving or loading timing data:
playwright-tui --no-history
Custom history file
Store timing data in a project-specific location:
playwright-tui --history-file ./test-timings.json
Iterative development workflow
A typical development workflow with playwright-tui:
-
Start the TUI with your tests:
playwright-tui -C ../my-app -
Watch the dashboard as tests execute -- monitor progress bars, worker status, and failures in real time.
-
Toggle watch mode by pressing
wso tests re-run on file changes. -
Filter to a specific area by pressing
f, typing a file or test name, and pressingEnter. -
Investigate failures by pressing
Tabto switch to the failures panel, navigating withj/k, and pressingEnterto expand error details. -
Rerun failed tests by pressing
rafter fixing issues -- only the previously failed tests will run. -
Rerun everything by pressing
ato confirm all tests pass. -
View summary by pressing
sto see final stats and slowest tests. -
Quit by pressing
q.
CI integration
In non-TTY environments, playwright-tui automatically uses headless mode:
# In a CI script
playwright-tui -C ./my-app -- --workers=2
Output:
Playwright TUI (headless mode)
Progress 5/20 pass=4 fail=0 flaky=0 skip=1 ETA=45s
Progress 10/20 pass=9 fail=0 flaky=0 skip=1 ETA=22s
Progress 15/20 pass=14 fail=0 flaky=0 skip=1 ETA=10s
Progress 20/20 pass=19 fail=0 flaky=0 skip=1 ETA=--
Done in 1m 12s. pass=19 fail=0 flaky=0 skip=1
Compiled binary distribution
Build and distribute a standalone binary:
# Build
bun run build:exe
# Copy to a location in PATH
cp ./dist/playwright-tui /usr/local/bin/
# Use from anywhere
cd ~/projects/my-app
playwright-tui -- --grep @regression