@vijaypjavvadi/bdd2pw 3.12.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +135 -0
- package/README.md +9 -5
- package/dist/cli.js +41 -0
- package/dist/cli.js.map +1 -1
- package/dist/data/dataLoader.d.ts +78 -0
- package/dist/data/dataLoader.js +339 -0
- package/dist/data/dataLoader.js.map +1 -0
- package/dist/data/examplesInjector.d.ts +64 -0
- package/dist/data/examplesInjector.js +149 -0
- package/dist/data/examplesInjector.js.map +1 -0
- package/dist/data/synthGenerator.d.ts +71 -0
- package/dist/data/synthGenerator.js +265 -0
- package/dist/data/synthGenerator.js.map +1 -0
- package/dist/index.js +50 -0
- package/dist/index.js.map +1 -1
- package/dist/llm/anthropicClient.d.ts +36 -0
- package/dist/llm/anthropicClient.js +186 -0
- package/dist/llm/anthropicClient.js.map +1 -1
- package/dist/llm/geminiClient.d.ts +6 -0
- package/dist/llm/geminiClient.js +87 -0
- package/dist/llm/geminiClient.js.map +1 -1
- package/dist/llm/openaiClient.d.ts +6 -0
- package/dist/llm/openaiClient.js +82 -0
- package/dist/llm/openaiClient.js.map +1 -1
- package/dist/llm/types.d.ts +36 -0
- package/dist/types.d.ts +39 -0
- package/package.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,141 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
_Nothing yet._
|
|
11
11
|
|
|
12
|
+
## [4.0.1] — 2026-06-29
|
|
13
|
+
|
|
14
|
+
### Fixed — LLM hallucinated POM methods land as TODO instead of broken code
|
|
15
|
+
|
|
16
|
+
The LLM occasionally invented helpers like `loginPage.fill(locator, value)`
|
|
17
|
+
or `loginPage.click(locator)`, treating the Page Object as if it had a
|
|
18
|
+
generic `fill`/`click` API. Real POMs only expose `goto`, `page`, and
|
|
19
|
+
whatever fields the locator picker discovered — so the emitted spec
|
|
20
|
+
failed to compile with `Property 'fill' does not exist on type 'LoginPage'`.
|
|
21
|
+
|
|
22
|
+
`parseBindingJson` now runs a second hallucination check after the
|
|
23
|
+
existing `detectHallucinatedLocators` gate: any `<pomVar>.<token>`
|
|
24
|
+
access where `<token>` is not in the known POM identifier set
|
|
25
|
+
(`goto`, `page`, plus declared fields and methods) is rejected. The
|
|
26
|
+
binding is dropped and the step lands as `// TODO` with a useful
|
|
27
|
+
warning, same fail-safe behaviour as the v2.2.3 locator gate.
|
|
28
|
+
|
|
29
|
+
### Why this matters
|
|
30
|
+
|
|
31
|
+
In the v4.0 benchmark (R1 evidence for SoftwareX paper), 2 of 8
|
|
32
|
+
apps (Conduit, AutomationPractice) emitted specs that failed tsc
|
|
33
|
+
because of this exact hallucination. After v4.0.1 the LLM mode should
|
|
34
|
+
return to 8/8 compilation passes — the LLM still produces a binding
|
|
35
|
+
candidate, but if it invents methods, the candidate is rejected
|
|
36
|
+
rather than written to the spec.
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
|
|
40
|
+
- `detectHallucinatedPomMethods(text, pomVar, knownIdentifiers)` —
|
|
41
|
+
reusable validator, exported from `src/llm/anthropicClient.ts`.
|
|
42
|
+
- 12 unit tests in `tests/unit/v401PomHallucination.test.ts` covering
|
|
43
|
+
acceptance and rejection paths.
|
|
44
|
+
|
|
45
|
+
### No breaking changes
|
|
46
|
+
|
|
47
|
+
Patch release. Programmatic and CLI surface unchanged.
|
|
48
|
+
|
|
49
|
+
## [4.0.0] — 2026-06-25
|
|
50
|
+
|
|
51
|
+
### Theme: Data-driven scaffolds — bring your own data or generate it
|
|
52
|
+
|
|
53
|
+
v4.0 is a **major version with no breaking changes**. The number bump
|
|
54
|
+
reflects the size of the feature bundle, not the risk to existing users.
|
|
55
|
+
Scaffolds that don't use the new `--data` / `--gen-data` flags behave
|
|
56
|
+
identically to v3.12.
|
|
57
|
+
|
|
58
|
+
### Added — `--data <path>` external data file injection
|
|
59
|
+
|
|
60
|
+
Pass a CSV, JSON, or XLSX file. Every Scenario Outline in the .feature
|
|
61
|
+
file gets its Examples table swapped with rows from the data file.
|
|
62
|
+
Inline Examples in the .feature become the no-data fallback.
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
bdd2pw scaffold login.feature --data data/users.csv --url ... --page LoginPage --repo .
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
- CSV parser is dependency-free (RFC 4180 quoted fields, embedded
|
|
69
|
+
newlines, escaped quotes, mixed CRLF/LF).
|
|
70
|
+
- JSON accepts either array of objects or `{rows: [...]}` envelope.
|
|
71
|
+
- XLSX lazy-loads via the optional `xlsx` dep; clear `npm install xlsx`
|
|
72
|
+
hint if missing.
|
|
73
|
+
- Per-scenario column filtering — extra data columns are dropped per
|
|
74
|
+
scenario, so a single 50-column data file can feed many narrow
|
|
75
|
+
scenarios without each one pulling in noise.
|
|
76
|
+
- Scenarios whose placeholders reference columns NOT present in the
|
|
77
|
+
data are skipped with a warning in BDD_REVIEW.md (inline Examples
|
|
78
|
+
preserved).
|
|
79
|
+
|
|
80
|
+
### Added — `--gen-data` synthetic data generator
|
|
81
|
+
|
|
82
|
+
For when you need plausible test data but don't have a real dataset.
|
|
83
|
+
Pass a schema JSON listing each column's source:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"email": "faker.internet.email",
|
|
88
|
+
"password": "faker.internet.password",
|
|
89
|
+
"url_fragment": "inventory.html",
|
|
90
|
+
"description": "llm:auto insurance claim, one sentence"
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
bdd2pw scaffold login.feature --gen-data --schema users.schema.json --rows 50 --url ... --page LoginPage --repo .
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
- `faker.X.Y` paths resolve via `@faker-js/faker` (optional dep).
|
|
99
|
+
- `llm:<prompt>` routes through the configured LLM provider (Anthropic,
|
|
100
|
+
OpenAI, or Gemini) for context-aware domain-specific data.
|
|
101
|
+
- Literal strings repeat the same value in every row.
|
|
102
|
+
- Seeded by default (seed=42) so output is reproducible across runs.
|
|
103
|
+
Override with `--seed N`.
|
|
104
|
+
- Per-column LLM batching — one provider call per LLM-driven column
|
|
105
|
+
regardless of row count. 3 LLM fields × 50 rows = 3 calls.
|
|
106
|
+
|
|
107
|
+
### Added — `LLMClient.generateText()` API
|
|
108
|
+
|
|
109
|
+
Generic single-prompt text generation method on all three providers
|
|
110
|
+
(Anthropic, OpenAI, Gemini). Routes through the same governance
|
|
111
|
+
sanitisation, budget enforcement, timeout, and telemetry pipeline as
|
|
112
|
+
binding generation. Used by the synth data generator; available for
|
|
113
|
+
any custom downstream tooling that needs a clean LLM call.
|
|
114
|
+
|
|
115
|
+
### CLI
|
|
116
|
+
|
|
117
|
+
- `--data <path>` — load external data file
|
|
118
|
+
- `--gen-data` — enable synthetic generation
|
|
119
|
+
- `--schema <path>` — schema JSON for `--gen-data`
|
|
120
|
+
- `--rows <n>` — row count for `--gen-data` (default 20)
|
|
121
|
+
- `--seed <n>` — Faker seed (default 42)
|
|
122
|
+
|
|
123
|
+
Precedence: `--data` wins if both are passed; warning printed to stderr.
|
|
124
|
+
|
|
125
|
+
### Programmatic API
|
|
126
|
+
|
|
127
|
+
`ScaffoldOptions.dataSource: {type: "file"|"synthetic", path?, schemaPath?, rows?, seed?}`
|
|
128
|
+
- Failures fall back to inline Examples and surface as ReviewItems.
|
|
129
|
+
- Same graceful-degradation pattern as the v2.0 LLM fallback failure mode.
|
|
130
|
+
|
|
131
|
+
### New `optionalDependencies`
|
|
132
|
+
|
|
133
|
+
- `@faker-js/faker ^9.3.0` — synthetic data generation
|
|
134
|
+
- `xlsx ^0.18.5` — XLSX data file loading
|
|
135
|
+
|
|
136
|
+
Same defensive `require()` loading pattern as existing optional deps.
|
|
137
|
+
Users who only use Anthropic + CSV need neither.
|
|
138
|
+
|
|
139
|
+
### Tests
|
|
140
|
+
|
|
141
|
+
`tests/unit/v400Data.test.ts` — 28 cases across DataLoader (CSV/JSON
|
|
142
|
+
parsing, file routing, validation), SynthGenerator (literal/Faker/LLM
|
|
143
|
+
fields, error cases), and ExamplesInjector (extract placeholders,
|
|
144
|
+
swap, skip vanilla, missing-column warning, per-scenario filtering,
|
|
145
|
+
zero-row graceful handling).
|
|
146
|
+
|
|
12
147
|
## [3.12.0] — 2026-06-19
|
|
13
148
|
|
|
14
149
|
> Note: v3.11.0 was tagged in git but never published to npm. v3.12.0
|
package/README.md
CHANGED
|
@@ -42,10 +42,13 @@ Point it at a `.feature` file and a URL. It parses the Gherkin, scans the live p
|
|
|
42
42
|
|
|
43
43
|
> **The pitch.** Run `bdd2pw scaffold` and you get a Playwright TS repo where `npx playwright test` runs against the real site. For specific fixtures, all green. For vague ones, the 60-90% you'd otherwise hand-write is done; you finish the rest — or you let the governed LLM finish them.
|
|
44
44
|
|
|
45
|
-
## What's new in
|
|
45
|
+
## What's new in v4.0.0
|
|
46
46
|
|
|
47
|
-
- **NEW**
|
|
48
|
-
-
|
|
47
|
+
- **NEW** `--data <path>` — load CSV / JSON / XLSX file and inject rows into every Scenario Outline's Examples table. Drop in a 500-row dataset without touching the .feature file.
|
|
48
|
+
- **NEW** `--gen-data --schema <path> --rows N` — generate synthetic Examples rows. Schema picks per-column source: `faker.internet.email` for common fields, `llm:auto insurance claim description` for context-aware domain data. Seeded for reproducibility (`--seed 42`).
|
|
49
|
+
- **NEW** `LLMClient.generateText()` — generic single-prompt API on all three providers (Anthropic, OpenAI, Gemini). Same governance + budget + timeout + telemetry pipeline as binding generation.
|
|
50
|
+
- Gemini provider — three-provider parity complete. `--llm gemini` defaults to `gemini-2.5-flash` ($0.10/M input — cheapest across all three providers). (v3.12.0)
|
|
51
|
+
- OpenAI provider with full parity. `--llm openai` defaults to `gpt-4o-mini`. (v3.11.0)
|
|
49
52
|
- `bdd2pw heal-stats <repo>` CLI reads `<repo>/artefacts/heal-events.jsonl` and writes a heal-stats.json sidecar with heal rate, top failing fields, retry latency, candidate-selector promotions (v3.10.0).
|
|
50
53
|
- `llmStats: true` writes `<repo>/artefacts/llm-stats.json` with per-call latency, token counts, cache hit rate, and an estimated cost in USD (v3.9.0).
|
|
51
54
|
- Seven domain rule packs (banking, healthcare, insurance, retail, gov, education, telecom) — ~140 industry-specific patterns total.
|
|
@@ -354,14 +357,15 @@ output/
|
|
|
354
357
|
| v3.9.0 | Telemetry | `artefacts/llm-stats.json` sidecar — per-call latency + tokens + cache hit rate + estimated cost. Makes v3.5 batching ROI measurable per scaffold. |
|
|
355
358
|
| v3.10.0 | Heal stats | `bdd2pw heal-stats <repo>` CLI consumes `artefacts/heal-events.jsonl` and writes `heal-stats.json` with heal rate, top failing fields, top error patterns, retry latency, candidate-selector promotions. Self-healing ROI per test run. |
|
|
356
359
|
| v3.11.0 | OpenAI provider | `LLMClientOptions.provider: "openai"` lands with cache + governance + batching + telemetry parity. Default model `gpt-4o-mini` (~17x cheaper than `gpt-4o` for structured-JSON tasks). |
|
|
357
|
-
|
|
|
360
|
+
| v3.12.0 | Gemini provider | `LLMClientOptions.provider: "gemini"` lands with full parity. Default model `gemini-2.5-flash` ($0.10/M input — cheapest across all three providers). Three-provider parity complete. |
|
|
361
|
+
| **v4.0.0 (current)** | Data-driven scaffolds | `--data <path>` (CSV/JSON/XLSX) and `--gen-data --schema <path>` (Faker + LLM) inject Examples rows into Scenario Outlines. `LLMClient.generateText()` added to all three providers. **Additive only — no breaking changes.** |
|
|
358
362
|
|
|
359
363
|
### Next 6 months (Jun 2026 → Nov 2026, ~2 releases/month)
|
|
360
364
|
|
|
361
365
|
| Target | Version | Theme | Headline |
|
|
362
366
|
|---|---|---|---|
|
|
363
367
|
| Aug 2026 | **v3.13.0** | Auto-rules | `bdd2pw apply-proposals --interactive` — walks the human through each v3.6 proposal, validates the regex compiles + matches the sample texts, optionally appends to `stepMatcher.ts`. Closes the propose-rules loop. |
|
|
364
|
-
| Aug 2026 | **v4.
|
|
368
|
+
| Aug 2026 | **v4.1.0** | Modern defaults | Bump default models, retire v2.x deprecated APIs, flip opt-in defaults (domains, llm-stats, healing) to opt-out. Migration guide ships alongside. |
|
|
365
369
|
| Sep 2026 | **v4.1.0** | sel2pw merge | sel2pw migrated onto `@vijaypjavvadi/pw-emit` — three packages share one emitter. All future v3.x emitter improvements automatically flow to Selenium users. |
|
|
366
370
|
| Sep 2026 | **v4.2.0** | Domain packs | Three more opt-in packs: **fintech** (KYC, AML, trading desks), **real-estate** (MLS, listings, escrow), **hospitality** (PMS, reservations, OTA). ~60 more rules. |
|
|
367
371
|
| Oct 2026 | **v4.3.0** | API v2 | WebSocket assertion rules, multipart file-upload patterns, GraphQL query / mutation / subscription rules. Extends v3.0's API testing surface. |
|
package/dist/cli.js
CHANGED
|
@@ -77,6 +77,17 @@ program
|
|
|
77
77
|
.option("--force", "Overwrite existing spec files", false)
|
|
78
78
|
.option("--self-healing", "Wrap emitted locators in healOrThrow() and generate lib/heal.ts + tsconfig path alias. Locator events are logged to artefacts/heal-events.jsonl for the offline self-heal pipeline. Action-time healing is v1.2.", false)
|
|
79
79
|
.option("--llm-stats", "v3.9.0 — write <repo>/artefacts/llm-stats.json with per-call latency, token counts, cache hit rate, and estimated cost.", false)
|
|
80
|
+
// v3.4.0 — domain rule packs. Comma-separated list of any of:
|
|
81
|
+
// banking, healthcare, insurance, retail, gov, education, telecom.
|
|
82
|
+
// Enables the corresponding deterministic rule packs for industry-
|
|
83
|
+
// specific phrasings (currency, account numbers, NHS numbers, etc).
|
|
84
|
+
.option("--domains <list>", "v3.4.0 — comma-separated industry rule packs to enable. Any of: banking, healthcare, insurance, retail, gov, education, telecom.")
|
|
85
|
+
// v4.0.0 — data-driven Examples injection.
|
|
86
|
+
.option("--data <path>", "v4.0.0 — load CSV / JSON / XLSX file and inject rows into every Scenario Outline's Examples table. Inline Examples are overridden when this is set. Failures fall back to inline Examples + warn in BDD_REVIEW.md.")
|
|
87
|
+
.option("--gen-data", "v4.0.0 — generate synthetic Examples rows via Faker + LLM. Requires --schema. Combine with --rows to set row count.", false)
|
|
88
|
+
.option("--schema <path>", "v4.0.0 — JSON schema for --gen-data. Object of {column: source} where source is 'faker.X.Y', 'llm:<prompt>', or a literal string.")
|
|
89
|
+
.option("--rows <n>", "v4.0.0 — row count for --gen-data. Default 20.", "20")
|
|
90
|
+
.option("--seed <n>", "v4.0.0 — Faker RNG seed for --gen-data reproducibility. Default 42.", "42")
|
|
80
91
|
.action(async (feature, opts) => {
|
|
81
92
|
try {
|
|
82
93
|
// v2.0 — wire the actual LLM config when --llm is passed. The legacy
|
|
@@ -107,6 +118,14 @@ program
|
|
|
107
118
|
: undefined,
|
|
108
119
|
})
|
|
109
120
|
: undefined;
|
|
121
|
+
// v4.0.0 — warn if user passed both data sources. --data wins.
|
|
122
|
+
if (opts.data && opts.genData) {
|
|
123
|
+
console.warn("[bdd2pw] both --data and --gen-data passed; --data wins. --gen-data ignored.");
|
|
124
|
+
}
|
|
125
|
+
// v4.0.0 — warn if --gen-data without --schema.
|
|
126
|
+
if (opts.genData && !opts.schema) {
|
|
127
|
+
console.warn("[bdd2pw] --gen-data requires --schema <path>. Ignoring --gen-data.");
|
|
128
|
+
}
|
|
110
129
|
const result = await (0, index_1.scaffold)({
|
|
111
130
|
feature: path.resolve(feature),
|
|
112
131
|
url: opts.url,
|
|
@@ -127,8 +146,30 @@ program
|
|
|
127
146
|
// Commander negates --no-discovery into opts.discovery=false
|
|
128
147
|
noDiscovery: opts.discovery === false,
|
|
129
148
|
selfHealing: opts.selfHealing,
|
|
149
|
+
// v3.4.0 — domain rule packs. Empty array if --domains not passed.
|
|
150
|
+
domains: opts.domains
|
|
151
|
+
? opts.domains
|
|
152
|
+
.split(",")
|
|
153
|
+
.map((s) => s.trim())
|
|
154
|
+
.filter(Boolean)
|
|
155
|
+
: undefined,
|
|
130
156
|
// v3.9.0 — telemetry sidecar
|
|
131
157
|
llmStats: opts.llmStats === true,
|
|
158
|
+
// v4.0.0 — data-driven Examples injection. --data wins over
|
|
159
|
+
// --gen-data when both are passed (and we warn in stderr so the
|
|
160
|
+
// user sees what happened).
|
|
161
|
+
dataSource: opts.data
|
|
162
|
+
? { type: "file", path: path.resolve(opts.data) }
|
|
163
|
+
: opts.genData
|
|
164
|
+
? {
|
|
165
|
+
type: "synthetic",
|
|
166
|
+
schemaPath: opts.schema
|
|
167
|
+
? path.resolve(opts.schema)
|
|
168
|
+
: undefined,
|
|
169
|
+
rows: opts.rows ? Number(opts.rows) : undefined,
|
|
170
|
+
seed: opts.seed ? Number(opts.seed) : undefined,
|
|
171
|
+
}
|
|
172
|
+
: undefined,
|
|
132
173
|
});
|
|
133
174
|
logger_1.logger.info({ result }, "scaffold complete");
|
|
134
175
|
}
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;AACA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yCAAoC;AACpC,2CAA6B;AAC7B,mCAAuD;AACvD,+BAAqC;AACrC,mDAAuD;AACvD,2CAAwC;AAExC,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,QAAQ,CAAC;KACd,WAAW,CACV,4EAA4E,CAC7E;KACA,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC;AAE/C,OAAO;KACJ,OAAO,CAAC,UAAU,CAAC;KACnB,WAAW,CACV,iFAAiF,CAClF;KACA,QAAQ,CAAC,WAAW,EAAE,iCAAiC,CAAC;KACxD,cAAc,CAAC,aAAa,EAAE,4BAA4B,CAAC;KAC3D,cAAc,CAAC,eAAe,EAAE,qCAAqC,CAAC;KACtE,cAAc,CAAC,cAAc,EAAE,gDAAgD,CAAC;KAChF,MAAM,CAAC,gBAAgB,EAAE,sDAAsD,CAAC;KAChF,MAAM,CAAC,wBAAwB,EAAE,sCAAsC,CAAC;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|
+
* Normalization contract:
|
|
8
|
+
* - All values are coerced to strings (Gherkin Examples tables are
|
|
9
|
+
* always string-typed; the test code does the parsing).
|
|
10
|
+
* - Headers are trimmed; empty headers are rejected up-front so the
|
|
11
|
+
* placeholder-to-column matching downstream is deterministic.
|
|
12
|
+
* - Empty rows (all-blank cells) are dropped silently — they're
|
|
13
|
+
* a frequent artifact of hand-edited CSVs.
|
|
14
|
+
*
|
|
15
|
+
* Format detection is by file extension. .xlsx loading is lazy via
|
|
16
|
+
* the `xlsx` optional dep — if missing, the user gets a clear
|
|
17
|
+
* `npm install xlsx` error instead of a module-resolution crash.
|
|
18
|
+
*
|
|
19
|
+
* Error model: every loader function throws `DataLoaderError` with
|
|
20
|
+
* a human-readable message. The orchestrator in `scaffold()` catches
|
|
21
|
+
* this and surfaces it as a `ReviewItem` so the failure shows up in
|
|
22
|
+
* BDD_REVIEW.md alongside other diagnostics — not just on stderr.
|
|
23
|
+
*/
|
|
24
|
+
/** One row of data. All values are strings (Gherkin convention). */
|
|
25
|
+
export type DataRow = Record<string, string>;
|
|
26
|
+
export declare class DataLoaderError extends Error {
|
|
27
|
+
readonly file?: string | undefined;
|
|
28
|
+
constructor(message: string, file?: string | undefined);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Entry point. Routes by extension to the right parser.
|
|
32
|
+
*
|
|
33
|
+
* @param filePath Absolute or relative path to a .csv / .json / .xlsx file.
|
|
34
|
+
* @returns Array of rows, each a string-keyed dict.
|
|
35
|
+
* @throws DataLoaderError on any read / parse / shape error.
|
|
36
|
+
*/
|
|
37
|
+
export declare function loadDataFile(filePath: string): DataRow[];
|
|
38
|
+
/**
|
|
39
|
+
* CSV parser — RFC 4180 compliant for the practical subset:
|
|
40
|
+
* - Quoted fields with embedded commas
|
|
41
|
+
* - Quoted fields with embedded newlines
|
|
42
|
+
* - Escaped quotes (`""` inside a quoted field)
|
|
43
|
+
* - Mixed CRLF / LF line endings
|
|
44
|
+
*
|
|
45
|
+
* Does NOT delegate to papaparse — keeping this dependency-free since
|
|
46
|
+
* the format is small enough to handle inline and we want bdd2pw to
|
|
47
|
+
* scaffold without an `npm install` step on the user's machine.
|
|
48
|
+
*/
|
|
49
|
+
export declare function parseCsv(text: string, fileLabel?: string): DataRow[];
|
|
50
|
+
/**
|
|
51
|
+
* JSON parser — accepts either:
|
|
52
|
+
* 1. Array of objects: `[{a:1,b:2}, {a:3,b:4}]` — most natural shape.
|
|
53
|
+
* 2. Object with `rows`: `{rows: [{...}, {...}]}` — useful for files
|
|
54
|
+
* that also carry metadata (generator seed, source URL, etc).
|
|
55
|
+
*
|
|
56
|
+
* Numbers and booleans are stringified for Gherkin Examples compatibility.
|
|
57
|
+
* Null values become empty strings.
|
|
58
|
+
*/
|
|
59
|
+
export declare function parseJson(text: string, fileLabel?: string): DataRow[];
|
|
60
|
+
/**
|
|
61
|
+
* XLSX parser — uses the optional `xlsx` dep. Reads the FIRST sheet
|
|
62
|
+
* only; users with multi-sheet workbooks should export the sheet they
|
|
63
|
+
* want to CSV.
|
|
64
|
+
*
|
|
65
|
+
* Lazy-loaded so users who never use XLSX don't need the dep installed.
|
|
66
|
+
*/
|
|
67
|
+
export declare function parseXlsx(absPath: string, fileLabel?: string): DataRow[];
|
|
68
|
+
/**
|
|
69
|
+
* Validates that the loaded data rows have every column the Scenario
|
|
70
|
+
* Outline placeholders reference. Returns the list of missing column
|
|
71
|
+
* names; empty array means OK.
|
|
72
|
+
*
|
|
73
|
+
* Called by the scaffold orchestrator after parsing the .feature file.
|
|
74
|
+
* If anything is missing, the orchestrator surfaces it as a
|
|
75
|
+
* `ReviewItem` and skips Examples injection for that scenario rather
|
|
76
|
+
* than producing a broken spec.
|
|
77
|
+
*/
|
|
78
|
+
export declare function validateColumnsForPlaceholders(rows: DataRow[], placeholders: string[]): string[];
|