Playwright now has a BDD entry path without losing the existing E2E suite
This story is the first app-side substrate step for BDD. The change
wires playwright-bdd into the existing Playwright runner
instead of creating a parallel runner, so later stacked stories can
add product scenarios while keeping the current PRAMAAN E2E behavior.
What changed
playwright.config.ts now registers BDD feature files from
tests/features/**/*.feature and step definitions from
tests/steps/**/*.ts. The generated Playwright specs are
written under tests/e2e/.features-gen, which remains
inside the existing tests/e2e test directory.
That shape keeps the existing unauthenticated smoke specs, Argos
reporter selection, browser projects, baseURL, and
web-server environment switches in the same Playwright config.
First scenario
The seed scenario is intentionally small and real: it opens
/en/sign-in through a BDD step and asserts the browser is
on the English sign-in route. The step file uses
createBdd(test) with the test fixture
exported by playwright-bdd.
Acceptance evidence
| Criterion | Evidence | State |
|---|---|---|
| Pin current 9.x line |
package.json pins playwright-bdd to
9.2.0.
|
done |
| Keep existing Playwright behavior |
testDir, reporter, webkit/chromium project behavior,
Argos, E2E_BASE_URL, and
PLAYWRIGHT_SKIP_WEB_SERVER remain on the existing
config path.
|
done |
| Generate BDD tests |
pnpm exec bddgen succeeds and emits the generated
spec under tests/e2e/.features-gen.
|
done |
| Local verify gate |
pnpm exec tsc --noEmit, pnpm run lint,
and pnpm run test:unit pass locally.
|
done |
Local E2E execution is left to CI/runtime gates per the story brief; this ticket wires the BDD substrate and one generated scenario without expanding into product flows owned by later stacked tickets.
Files changed
6 file(s), +227 / -6 lines
| Path | Role | + | - |
|---|---|---|---|
| .gitignore | Source | +1 | -0 |
| package.json | Config | +4 | -3 |
| playwright.config.ts | Source | +7 | -0 |
| pnpm-lock.yaml | Config | +196 | -3 |
| tests/features/playwright-bdd-wiring.feature | Test | +5 | -0 |
| tests/steps/playwright-bdd-wiring.steps.ts | Test | +14 | -0 |