A spec-driven testing framework for Playwright: test cases are written in Markdown or Gherkin, each step is automated once by a step definition, and every test runs from day one - the steps without automation are walked by a person.
Part of CyborgTests - a modern testing ecosystem combining human insight with automation power.
- Open Node.js Downloads in browser
- Select your operating system and CPU architecture
- Download the LTS version - Node.js 22 or newer is required, 24 LTS is recommended
- Run the downloaded installer and follow the installation steps
- Open a terminal and verify that Node.js was installed successfully (
v22or higher):
node --versionClone with Git:
- Open a terminal in the folder where you want to clone the repository
- Run the commands below:
git clone https://github.com/CyborgTests/playwright-bdd-director
cd playwright-bdd-directoror download ZIP:
- Open the repository page on GitHub
- Click Code β Download ZIP
- Extract the archive to any folder
- Open a terminal in the extracted folder
npm installnpm run buildThis builds the Director UI (React/Vite) and patches Playwright to embed it into the Playwright UI interface.
npx playwright installnpm run showThis opens the combined interface in your browser:
- Director UI (built as part of this project) - file explorer, editor, staging controls
- Playwright UI (built-in Playwright feature) - test runner, traces and screenshots
Together they form a unified workspace for the full testing workflow.
In the Director UI:
- File Explorer - click New File button
- Enter filename:
login.md - File Editor - paste the following (saves automatically as you type):
@ui
## Login Tests
---
### User can login
#### Navigate to login page
#### Enter credentials
#### Click login button
#### Verify dashboard visible@ui above the suite heading is its layer - every test is @api, @ui or @e2e.
The test is in the Playwright UI list right away - tests are generated from the specs on every run and every change. No step has a step definition yet, so it is a cyborg test: run it and the Cyborg Tests control panel walks you through the steps.
npm run play cyborg login # the same from a terminalnpm run dress # which steps a person still walks
npm run steps login # step definition skeletons β src/steps/login.steps.tsImplement a skeleton with Page Objects and its step runs automatically on the next run; once every step is implemented, the test is an automated test (@auto):
Step('Navigate to login page', async ({ loginPage }) => {
await loginPage.navigateToLogin()
})npm run play auto loginAfter tests finish, close the UI window - the terminal will become available again. Then open the HTML report:
npm run reviewEvery run also writes reports for test management tools and CI:
test-results/cucumber/<device>/cucumber-report.json- Cucumber JSON (Xray, Zephyr Scale, ...) per device (Playwright project): import each as a run on that device - one test in the tool, a result per device. Every test, Markdown specs included: Feature / Background / Scenario (Outline) and steps come from the spec, step results from the run (manual steps too). Failed steps carry the error and screenshots. Xray links a scenario to its Jira test by a tag with the test key - use the format your Xray expects (often@TEST_PROJ-123) - a tags line above the heading in both formatstest-results/cucumber/<device>/cucumber-messages.ndjson- Cucumber messages, the newer Cucumber format, per device as welltest-results/cucumber/cucumber-report.html- the Cucumber HTML report of all devices for people (one offline file): a section per device and spec,tablet/test-suites/cart.feature- A known bug (
@fail,@fail:tablet) stays failed in Cucumber reports - the tool shows the product as it is - withExpected to fail (@fail:tablet): a known bugin the message; a test that passes despite the tag fails: the bug looks fixed - The folder is cleared on every run, so a run on fewer devices leaves no reports of the others
test-results/junit.xml- JUnit XML (TestRail, Zephyr, any CI)
See which tests are automated, which a person still walks, how many steps are automated and how each test did in its last run - the matrix itself runs no test:
npm run matrix # console table
npm run matrix -- --html --json --md # + test-results/coverage-matrix.{html,json,md}
npm run matrix -- --md=docs/coverage.md # any format to a custom path
npm run matrix -- --min=80 # exit 1 when automated tests are below 80%
npm run matrix -- @smoke # only tests tagged @smoke Site Navigation test-suites/navigation.md
ββββββββββββββββββββ 67% automated 2/3
Test Layer Devices Status Steps auto Last run
Open "Signup / Login" Page from Header UI all β auto 4/4 β passed 4/4
Open "Polo" Brand Products from Sidebar UI all β auto 4/4 β failed 2/4 (failed: firefox; not run: mobile)
Subscribe to Newsletter from Footer UI all β cyborg 1/5 Β· not run
By tag
Tag Tests Automated Cyborg Last run
@all-devices 8 88% 7/8 1 passed 26/29 runs Β· failed 1
@smoke 5 100% 5/5 0 passed 14/14 runs
A test with several tags counts in each of them; 6 tests (9 runs) without a tag are not listed.
Total 16 tests Β· 38 runs in 4 suite(s)
Automated ββββββββββββββββββββ 94% 15/16
Cyborg ββββββββββββββββββββ 6% 1/16
Fixme (API) ββββββββββββββββββββ 0% 0/16
Disabled ββββββββββββββββββββ 0% 0/16
Steps automated ββββββββββββββββββββ 91% 41/45
Last run passed 35/38 runs Β· failed 1 Β· flaky 0 Β· skipped 0 Β· not run 2 Β· 2026-10-26 23:00 UTC
- Status:
autoevery step automated Β·cyborga person walks the rest Β·fixmean API test waiting for step definitions Β·disabled@skip/@fixme/@failin the spec - Steps auto: automated / total steps of the test, Background included
- Runs: a test runs once per device that picks it (Playwright project: API once, UI on desktops,
@all-deviceson tablets and mobiles too, cyborg in its own project) -npm run dresscounts the same runs - Last run: the latest result of every run of the test - passed / runs, in brackets the devices where it failed, was flaky or has not run yet; the totals and By tag count runs too. Each run replaces the results of the tests it ran and keeps the others (
npm run play cyborgleaves the automated results), intest-results/last-run.json(LAST_RUN_FILE). A known bug (@fail) failing as expected counts as passed - Run history: a run started with
npm run play ... -- --record(RECORD_RUN=1for any other command, the Record run checkbox in UI mode) also keeps its own coverage matrix - every spec and the results of the tests this run ran - inrun-history/<end of the run>.json(RUN_HISTORY_DIR, gitignored), one file per run, none overwritten. It is the data for a coverage trend - By tag: the same counts for every spec tag across suites, most tests first; run settings (
@retries:N,@timeout:N,@fail:<device>) get no row. The rows do not add up to the total: a test with several tags counts in each, tests without a tag are only counted in the note under the table.npm run matrix -- @smokekeeps only the tests with the tag - HTML is a single self-contained file with filters by status and light/dark theme; JSON is the same data for CI, TMS or agents
One command for any CI service (GitHub Actions, GitLab CI, Jenkins, Azure DevOps, ...):
npm ci # install dependencies
npx playwright install --with-deps # browsers
npm run ci # dress -> automated tests -> coverage matrixdressfails first on invalid specs or ambiguous steps - no test runs then- Runs every automated test (
play auto); cyborg tests need a person and are skipped - Failed tests do not stop the coverage matrix and reports; the exit code is 1 when any stage failed
CI_MIN_COVERAGE=80 npm run cialso fails when automated tests are below 80%RECORD_RUN=1 npm run cikeeps the run in the run history: pointRUN_HISTORY_DIRat a cached or persistent directory, CI workspaces start empty- Keep
test-results/as the job artifacts:junit.xml(most CI services show it as test results, the device inhostname),cucumber/,monocart-report/,coverage-matrix.{html,json,md}
Playwright BDD Director is part of the CyborgTests ecosystem - a suite of tools that combine human insight with automation power.
It brings together:
- Playwright for automated E2E, UI, and API testing
@cyborgtests/testfor the steps a person walks- Markdown or Gherkin specs as the single source of truth
- Step definitions - each step automated once, reused everywhere
- Built-in Director UI for visual test management
Manual QA, managers, and non-technical stakeholders can review and update test specifications without touching TypeScript.
The spec is the test: its tests are generated on every run, so they cannot drift from it. There are no test files to keep in sync, review for wording or archive.
A new spec runs at once as a cyborg test - a person walks its steps. Automation is added step by step: each implemented step definition stops asking a person on the next run, in every test that uses the step.
Steps in traces and reports point to their spec lines (cart.feature:32) through a source map in the generated file. The generated tests are plain Playwright tests: fixtures, projects, traces, UI mode, the VS Code extension, parallel runs and reporters work as usual, with full TypeScript support.
Playwright BDD Director is designed to work naturally with AI coding assistants (GitHub Copilot, Cursor, Claude Code, etc.) inside your IDE.
The key advantage: specs and step definitions live in the same repository. An AI assistant sees both at once - it reads auth.md, the list of steps without definitions from npm run dress and the Page Objects, and writes exactly the missing code.
- Write test cases with AI - describe a feature, ask AI to write the spec in
test-suites/; it runs immediately as a cyborg test - Automate with AI -
npm run steps <suite>writes skeletons, AI implements them with Page Objects and clients - Review coverage with AI - point AI at
test-suites/andnpm run matrix -- --jsonand ask what is missing
1. Ask AI to write test cases β test-suites/auth.md
2. npm run play cyborg auth β a person walks them today
3. npm run steps auth β skeletons; ask AI to implement them
4. npm run play auto auth β automated
| Feature | Cucumber + PW | Pure Playwright | PW BDD Director |
|---|---|---|---|
| Main Runner | Cucumber | Playwright | Playwright |
| Native PW Features | Partial | Full | Full |
| TypeScript Support | Medium | Excellent | Excellent |
| Debugging | Harder | Excellent | Excellent |
| Readability | High | Medium | High |
| AI Friendliness | Medium | High | Very High |
| Runtime Complexity | High | Low | Low |
| Performance | Medium | High | High |
| Maintenance Cost | High | Low | Low |
| Flexibility | Medium | High | Very High |
| Visual UI | No | Basic | Advanced |
| Before automation | Nothing runs | Nothing runs | Cyborg tests |
Playwright BDD Director is a modern middle-ground:
- Keeps readable human-friendly scenarios like Cucumber - in Markdown or Gherkin
- Keeps native Playwright runner with full TypeScript support
- Removes Cucumber pain points: runtime complexity, shared context chaos, heavy abstraction layers
- Runs unautomated steps by hand instead of failing or skipping them
- Adds AI-native workflow on top
Best for: modern Playwright projects, teams moving from manual to automated testing, AI-assisted automation, teams that want readable scenarios without Cucumber complexity.
A combined visual interface - the Director UI (built in this project) together with Playwright UI (built-in Playwright feature) form a unified workspace:
Director UI (our part):
- File Explorer - browse and edit Markdown and Gherkin specs with File Editor: both formats highlighted alike (titles, Gherkin keywords, tags, notes, "strings",
<placeholders>, tables); Preview shows either as a document - headings with their tags, steps, examples tables - Stage - format the Markdown specs
- Rename and convert - double-click the file name above the editor: type a new name (Enter) or pick the other format from the
.md/.featurelist. A new format runsnpm run adapt, a new name runsnpm run rename, both - the conversion first, and only when the name is free; Escape cancels. The output (the "Not finished" warning too) goes to Output - Reword - F2 or a double click on a step or title line: the field above the editor shows the pattern of the step definition (
Step pattern:), the text of a manual step (Step:) or the title (Suite:,Rule:,Test case:). Enter runsnpm run reword: a step changes in every spec and in its pattern, a title on its line only (refused when two test cases would share it); Escape cancels. The code of a step does not change: Output warns to check that it still does what the new words say - Record run - checkbox in Testing Options: every run started while it is on keeps its coverage matrix in the run history (as
npm run play -- --record)
Playwright UI (Playwright's part):
- View all tests, run individually or in batches with real-time status - the list follows the specs as you edit them
- Detailed test execution view with step-by-step breakdown
- Traces, screenshots, and video on failure
Launch:
npm run show1 spec file = 1 test suite = 1 generated test file 1 step = 1 step definition, reused by every test
ββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββ
β test-suites/navigation.md β β src/steps/*.steps.ts β
β ## Site Navigation @ui β β Step('Open Home Page', β¦) β
β ### Open Signup Page β β Step('Click {string} β¦', β¦) β
β #### Open Home Page β ββββββββββββββββ¬ββββββββββββββββ
β #### Click "Signup" Button β β
β #### Verify Form is visible β β
ββββββββββββββββ¬ββββββββββββββββ β
ββββββββββββββ¬ββββββββββββββββββββββββ
βΌ on every run
.director/tests/navigation.test.ts (generated)
test('Open Signup Page', { tag: ['@cyborg', '@ui'] }, β¦)
await autoStep('Open Home Page', { homePage }) β has a definition
await autoStep('Click "Signup" Button', β¦)
await manualStep('Verify Form is visible') β a person walks it
- A step with a step definition is automated (
autoStep); without one - or with one without code - a person walks it (manualStep) - A test with any manual step is a cyborg test (
@cyborg, UI / E2E only): headed, one at a time, no time limit. A test with all steps automated is an automated test (@auto) - An API test with a missing step stays
fixme- nobody walks API by hand - The Director commands:
npm run dress- check before a run: invalid specs, missing layers, ambiguous steps; tests and runs per spec and project; steps a person walks; disabled tests; unused step definitionsnpm run steps <suite...>- step definition skeletons for the steps without onenpm run stage- formats the Markdown specs (---before every test case)npm run adapt <suite...>- moves a spec between Markdown and Gherkinnpm run rename <suite> <new-name>- renames a spec and its step filenpm run reword "<old>" "<new>"- rewords a step in every spec and in its step definition pattern;-- --at <suite> <line> "<title>"- a suite, rule or test case titlenpm run migrate <file.spec.ts...>- turns Playwright tests built oftest.stepinto a spec and step definitionsnpm run play- runs tests by type, suite and tag
@ui
## Test Suite Title
- Optional details
---
@smoke
### Test Case title
#### Step Title
- Optional details, test data, expected results
#### Another Step## β Test Suite
### β Test Case (### Background - steps before every test case)
#### β Test Step
@tags β tags of the suite / test case, in a line above its heading (as in Gherkin)
Lists (-) β notes for people, not part of the test
--- β separator before every test case, the only blank lines - npm run stage keeps the rest dense, as in Gherkin
Any .feature file the Gherkin parser accepts: Background, Rule (with its own Background), Scenario Outline with Examples (tagged too), DataTable, DocString, # language:. Write the layer tag above Feature::
@ui
Feature: Cart
Background:
Given user opens the products page
@all-devices @smoke
Scenario: Add "Blue Top" to cart
When user adds "Blue Top" to cart
And user opens the cart
Then cart has "Blue Top"Both formats work the same way and can live side by side; pick per suite what reads best for its authors. Base names are unique across test-suites/** (auth.md and auth.feature cannot coexist) - the name is the suite tag (npm run play auth).
npm run adapt <suite...> moves a suite to the other format and removes the old file - tags, [ID]s, Background, examples and notes move along (notes become descriptions and comments in Gherkin). Gherkin steps lose their keywords; step definitions match the step text either way, so the tests stay the same. Markdown β Gherkin is not finished by adapt: Markdown steps have no keywords, so every step comes out as * - set Given / When / Then before using the .feature file (which one fits takes understanding the step, adapt warns about it). A suite with what Markdown cannot hold (Rule, DataTable, DocString, tagged or named Examples) stays in Gherkin: adapt lists it and changes nothing.
Every test is exactly one of @api, @ui, @e2e: a suite tag for all its test cases, a test case (Rule, Examples) tag overrides it. A test without a layer stops the run. Cyborg tests are UI or E2E only.
Both formats tag the same way: a line of @tags right above the heading - ## suite and ### test case in Markdown, Feature / Rule / Scenario / Examples in Gherkin:
@ui @all-devices
## Authentication Tests
---
@smoke @JIRA-123
### User Login- The suite carries what holds for all its tests: the layer, and
@all-devices,@slow... only when every test needs it. A test carries its exceptions and additions. - Order in a line: layer β
@all-devicesβ special tags β own tags (@smoke,@logged-in, ticket keys) -@e2e @all-devices @retries:1 @smoke - Tags become Playwright tags of the generated tests, next to
@auto/@cyborg, the layer and the suite tag@<file name> - A tag starts with
@followed by letters, digits,_ . : / -; several tags are separated by spaces - Background cannot be tagged (as in Gherkin)
- Special tags
@skip,@fixme,@fail(also for one device:@fail:tablet),@slow,@retries:N,@timeout:Nbecome Playwright modifiers - Run and measure by tag:
npm run play @smoke,npm run play ui auth @smoke,npm run matrix -- @smoke
Where the example uses each kind of tag:
| Tag | Example |
|---|---|
Layer @ui / @api / @e2e |
every suite; @e2e overrides the suite on a Rule (cart.feature) and a scenario (products.feature) |
@all-devices |
suite navigation.md; test cases cart.feature (adding, placing an order) |
@retries:N, @timeout:N |
cart.feature: placing an order, Rule Checkout |
@fail, @fail:<device> |
cart.feature: quantity 0, placing an order on a tablet (real bugs) |
| Own tags | @smoke in every suite, tagged Examples in cart.feature; @logged-in picks a Before hook (cart.feature) |
A Markdown test case that runs once per data row gets an examples table right under its heading; its title and steps use <column> placeholders. In Gherkin it is a Scenario Outline with Examples.
### Login as <role>
| role | password |
| ----- | -------- |
| admin | secret |
| guest | guest |
#### Log in as "<role>" with "<password>"- One test per row, title and steps filled with the row values:
Login as adminrunsLog in as "admin" with "secret" - The title needs a placeholder of a column with unique values - Playwright requires unique test titles
Optional IDs in brackets stay in the test titles and reports: ## [TS01] Suite, ### [TC01-01] Test case. Test case IDs are unique within a spec; [] is an empty ID. Other formats (TC-001:) are part of the title.
// src/steps/navigation.steps.ts
import { Step } from './bdd' // createBdd(test) - typed with the project fixtures
Step('Click {string} Brand in Sidebar', async ({ homePage }, brand: string) => {
await homePage.clickBrand(brand)
})- Patterns: Cucumber Expressions or RegExp; the keyword does not affect matching; Markdown steps use
Step(β¦) - Fixtures: the first parameter destructures what the step needs; all steps of a test share the fixtures
- No code (empty body or comments only) = no definition: the step stays manual
- Ambiguous step β
dressand the run fail with the definitions' locations; unused definition βdresswarns - Hooks
Before/After/BeforeAll/AfterAll/BeforeStep/AfterStepwith tag expressions (@cyborgmatches the tests a person walks) - Step context
bddnext to the fixtures: tags, test title, step title,skip(),attach(), the step error inAfterStep - Migration: existing Cucumber suites move over without rewriting their steps; plain Playwright tests built of
test.stepbecome a spec and step definitions withnpm run migrate(guide)
Full guide: docs/step-definitions.md.
playwright-bdd-director/
βββ test-suites/ # Specs (source of truth): *.md, *.feature
βββ src/
β βββ steps/ # Step definitions (*.steps.ts) and hooks; bdd.ts binds them to the fixtures
β βββ fixtures/ # Playwright fixtures (base, auth, shop); index.ts - test of the generated tests
β βββ pages/ # Page objects (home, login, signup, products, cart, checkout)
β βββ clients/ # API clients (BaseClient, AuthClient, ProductsClient)
β βββ schemas/ # API response schemas and types
β βββ test-helpers/ # Test-specific helpers (masking secrets in reports)
β βββ test-utils/ # General test utilities (APIExpect, logger, schema-validator)
β βββ config/ # Playwright projects, devices
β βββ framework/ # The Director, unit tests (*.test.ts) next to the modules
β βββ bdd/ # Step registry, generator, runtime (autoStep), build, skeletons
β βββ core/ # Parsers (Markdown, Gherkin, spec document)
β βββ validation/ # Markdown structure check and formatting
β βββ reporting/ # Coverage matrix, Cucumber reports, console output
β βββ constants/ errors/ utils/
β βββ config.ts # Framework configuration (env-overridable paths)
βββ scripts/ # CLI: play, dress, stage, adapt, rename, steps, matrix, ci; generate-tests (run by the config)
βββ packages/ # Director UI & Playwright integration
βββ .director/tests/ # Generated tests (gitignored, rewritten on every run)
The repository automates automationexercise.com:
| Spec | Shows | Steps and code |
|---|---|---|
test-suites/auth.md @ui |
Markdown suite, Background, fixtures with cleanup (testUser, registeredUser) |
src/steps/auth.steps.ts |
test-suites/auth-api.md @api |
API layer through clients; "Update User City" has a step without code, so the API test stays fixme |
src/steps/auth-api.steps.ts |
test-suites/products-api.md @api |
Catalog API: products list, unsupported method (405), search; a step function reused by an e2e scenario | src/steps/products-api.steps.ts, src/clients/ProductsClient.ts |
test-suites/navigation.md @ui |
Markdown examples table (brands); the newsletter case is a cyborg test: one automated step, the rest skeletons without code | src/steps/navigation.steps.ts |
test-suites/cart.feature @ui |
Gherkin: Background, Scenario Outline with tagged Examples, DataTable, DocString, Rule with its own Background, @e2e and @timeout:90000 on a Rule, @retries:1, @fail on a real bug (quantity 0 and -2 get into the cart), @fail:tablet on a tablet-only one, own parameter type {price}, one step calling others, a cyborg scenario (invoice); adding to cart and placing an order on all devices (@all-devices) |
src/steps/cart.steps.ts |
test-suites/products.feature @ui |
Steps on Page Object methods (@StepsFor, a migration path); a desktop-only @e2e scenario (catalog price = API price) |
src/pages/ProductsPage.ts, src/steps/products.steps.ts |
test-suites/contact-us.feature @ui |
A suite migrated from Cucumber: World style steps on this; BeforeAll / AfterAll create and remove the file it uploads |
src/steps/contact-us.steps.ts |
Hooks (src/steps/hooks.steps.ts): BeforeAll checks the catalog API once per worker for @cart, Before logs in a fresh user for @logged-in, AfterStep attaches the page URL under a failed step (bdd.step).
npm run dress # specs and step definitions, what a person still walks
npm run play auto # all automated tests (headless, parallel)
npm run play cyborg # all cyborg tests (headed, one at a time)
npm run play api auth-api # API auth tests only
npm run play ui auth # UI auth tests only
npm run show # Playwright UI mode with the DirectorAll paths support environment variable overrides via src/framework/config.ts:
| Variable | Default | Description |
|---|---|---|
TEST_SUITES_DIR |
test-suites |
Specs directory |
GENERATED_TESTS_DIR |
.director/tests |
Generated tests (Playwright testDir) |
BDD_STEPS |
src/steps/**/*.steps.ts |
Step definition files |
BDD_STEPS_DIR |
src/steps |
Where npm run steps writes skeletons |
COVERAGE_MATRIX_FILE |
test-results/coverage-matrix |
Coverage matrix reports path (without extension) |
CUCUMBER_REPORTS_DIR |
test-results/cucumber |
Cucumber JSON and messages per device, HTML of all devices |
DRESS_REPORT_FILE |
test-results/dress-rehearsal.md |
Report of npm run dress |
GENERATION_ERRORS_FILE |
test-results/generation-errors.md |
Failed generation with stack traces (the console omits them) |
JUNIT_REPORT_FILE |
test-results/junit.xml |
JUnit XML of every run |
LAST_RUN_FILE |
test-results/last-run.json |
Latest result per test and device for the coverage matrix |
RUN_HISTORY_DIR |
run-history |
Coverage matrix of every recorded run, one file each |
RECORD_RUN |
- | 1 records the run in the run history (play -- --record) |
CI_MIN_COVERAGE |
- | npm run ci fails below this automated tests share |
playwright.config.ts generates the tests when Playwright loads it (prepareTests(); UI mode and IDE servers on start, then on every change of specs or source), then runs them in projects that pick their tests by tag (src/config/projects.ts, devices in src/config/devices.ts):
| Project | Device | Tests |
|---|---|---|
api |
no browser | @auto + @api - once, not per device |
chrome, firefox |
Desktop Chrome, Desktop Firefox | every @auto UI and E2E test |
tablet, mobile |
Galaxy Tab S9 landscape, Galaxy S24 | @auto UI and E2E tests tagged @all-devices in the spec |
cyborg |
Desktop Chrome, headed | @cyborg: one worker, no time limit |
Automated projects run headless and in parallel, with trace and video on failure. A new device is one entry in devices.ts. npm run play builds the --grep; a device name selects its project (npm run play e2e mobile).
@/* β src/* (tsconfig.json), in step definitions, fixtures, scripts and framework code:
import { AuthClient } from '@/clients/AuthClient'The control panel of cyborg tests (@cyborgtests/test) sends usage analytics to Google Analytics by default, while a person walks the manual steps. Per the package README it collects:
- a unique user ID, generated on the first run
- test execution events (start of a test) and results (passed / failed)
- external link clicks
- browser, OS and country
No spec content, step data or credentials are listed. To turn it off, add to src/fixtures/base.fixture.ts:
import { config } from '@cyborgtests/test'
config.setConfig({ analyticsEnabled: false })Automated runs (@auto, CI) do not open the control panel and send nothing.
Types, suites, spec tags and devices are freely combinable - test types first, then suite names (spec file names), spec tags (@smoke) and devices (chrome, firefox, tablet, mobile) anywhere:
npm run play <types...> [suites...] [@tags...] [devices...]
npm run play auto # All automated tests
npm run play cyborg # All cyborg tests
npm run play api # Automated API tests
npm run play cyborg ui # Cyborg UI tests
npm run play ui auth # Automated UI tests of auth.md
npm run play api ui auth auth-api # API + UI tests of two suites
npm run play auth # All tests of auth.md (any type)
npm run play @smoke # All tests tagged @smoke
npm run play ui auth @smoke # UI auth tests tagged @smoke
npm run play e2e mobile # E2E tests on the mobile device
npm run play auto chrome firefox # Automated tests on desktop browsers only
npm run play auto -- --record # Automated tests, the run kept in the run historySupported test types: auto, cyborg, api, ui, e2e. Help: npm run play -- --help.
npm run dress # check specs and step definitions; report in test-results/dress-rehearsal.md
npm run steps auth # step definition skeletons for steps of auth.md without one
npm run stage # format the Markdown specs
npm run adapt auth # auth.md β auth.feature (and back)
npm run rename auth login # auth.md β login.md, src/steps/auth.steps.ts β login.steps.ts
npm run reword "user adds {string} to cart" "user puts {string} in the cart" # a step everywhere
npm run migrate tests/login.spec.ts # Playwright tests (test.step) β login.md + login.steps.ts
npm run show # Playwright UI mode with the Director
npm run lint:fix # ESLint fix
npm run format # Prettier formatdress answers three questions before a run: will it start (errors), what runs where (tests per spec, runs per project), what is left to do (steps a person walks, by test; disabled tests and known bugs; step definitions no spec uses). It never changes specs, steps or tests; the same report goes to test-results/dress-rehearsal.md (DRESS_REPORT_FILE):
Spec Layer Tests Auto Cyborg Fixme Runs
auth-api.md api 6 5 - 1 6
cart.feature ui, e2e 8 7 1 - 21
...
Total 35 32 2 1 75
Runs: cyborg 2 Β· api 13 Β· chrome 20 Β· firefox 20 Β· tablet 10 Β· mobile 10
β To automate
cart.feature
Check invoice of placed order (cyborg: a person walks these steps)
β’ And user downloads the invoice - definition without code: src/steps/cart.steps.ts:69
π€ Disabled and known bugs
cart.feature βΊ Quantity 0 is not added to cart @fail
cart.feature βΊ Place order with delivery comment @fail:tablet
β
Ready for the show: 35 tests, 75 runs
Report: test-results/dress-rehearsal.md
npm test # Run tests in watch mode
npm run test:run # Run tests once (CI mode)
npm run test:ui # Open visual test UI
npm run test:coverage # Generate coverage reportStep definitions (src/framework/bdd/):
registry.ts-createBdd, Given/When/Then/Step, hooks, parameter types, Page Object decorators; a definition without code is pendinggenerator.ts- one test file per spec:autoStep/manualStep,@auto/@cyborg, layers, hooks by tags, special tags, snippetsbuild.ts- generates all specs in memory (dress,steps, matrix) and writes them (scripts/generate-tests.ts)prepare.ts- generation when Playwright loads the config; regenerates on changes in UI mode and the IDEruntime.ts-autoStep, hooks and thebddcontext of generated testsskeletons.ts- step definition skeletons fornpm run stepsmigrate.ts- Playwright tests built oftest.stepas a spec and step definitions (npm run migrate)step-reword.ts- new text for a step in every spec and its definition pattern, or for a title on its line, all or nothing (npm run reword)
Parsers (src/framework/core/):
md-parser.ts- Markdown structure (headings, IDs, tags, examples)gherkin-parser.ts- Gherkin documentsspec-document.ts- a spec of either format as one Gherkin document for the generatorspec-converter.ts- Markdown β Gherkin with notes kept (npm run adapt)spec-rename.ts- a new name for a spec and its step file, all or nothing (npm run rename)
Validation (src/framework/validation/): md-validator.ts - Markdown structure check and formatting (stage).
Reporting (src/framework/reporting/): coverage matrix and its renderers, last-run reporter (results for the matrix, run history of recorded runs), dress report, Cucumber JSON / messages / HTML reporter, console formatter.
Test Utilities (src/test-utils/):
APIExpect- PlaywrightAPIResponsewrapper: status, content type and schema assertions; the body is parsed once and attached to the report with secrets maskedlogger.ts- attaches logs and files to Playwright test reportsschema-validator.ts- small schema validator for API responses (required fields and their types), no dependencies
Test Helpers (src/test-helpers/):
test.helpers.ts-sanitizeObjectfor masking sensitive data (emails, passwords, tokens) in logs and reports; partial email masking preserves debuggability
- The spec defines what is tested: test cases, steps, data, tags, layer
- Step definitions define how a step is automated - once, for every test
- The Director generates the tests from both on every run - nothing to sync, nothing to drift
- A test runs from the moment it is written - a person walks what is not automated yet
- Automation grows step by step; a test becomes automated when its last step is
- Cyborg and automated are not two copies of a test, but two states of the same one
- Multiple test cases per file, one layer each
- Logical grouping by feature/functionality
npm run review # Open Monocart HTML report (after test run)
npm run show # Open Playwright UI mode (before/during test run)- Test execution summary
- Screenshots on failure
- Detailed step-by-step logs, manual steps included
For teams needing centralized report storage, you can add:
- @cyborgtests/reporter-playwright-reports-server - Cyborgtests reporter integration
- Playwright Reports Server - Docker-based reports storage
MIT
See also: THIRD_PARTY_NOTICES.md (licenses for dependencies like Cyborgtests and Monocart Reporter).
