# Framework Development

## Adding a new reusable step

1. Pick the right category under `src/steps/`.
2. Add the step definition using Cucumber's `Given`, `When`, or `Then`.
3. Keep Playwright logic small and generic.
4. Move repeated helper logic to `src/runtime/`.
5. If you create a new step file, import it from `src/steps/index.ts`.
6. Document the new step in `docs/step-reference.md`.

## Step quality checklist

Reusable steps should:

- Work across multiple applications.
- Use accessible Playwright locators first, such as role, label, and text.
- Avoid hardcoded product names, URLs, and credentials.
- Read configuration from the World instead of process variables directly.
- Produce helpful errors when config or credentials are missing.

Reusable steps should not:

- Encode one application's workflow.
- Depend on one application's CSS structure.
- Read real secrets from source-controlled files.
- Require consumers to import TypeScript helpers.

## Build

```bash
npm install
npm run build
```

The package publishes compiled JavaScript and declarations from `dist/`.
