@redrockswebdevelopment/formstack-form-testing 0.1.0 → 0.1.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/dist/index.d.ts +553 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2245 -11
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,10 @@ export interface PlaywrightLikeLocator {
|
|
|
3
3
|
locator(selector: string): PlaywrightLikeLocator;
|
|
4
4
|
first(): PlaywrightLikeLocator;
|
|
5
5
|
fill(value: string): Promise<void>;
|
|
6
|
-
click(
|
|
6
|
+
click(options?: {
|
|
7
|
+
readonly timeout?: number;
|
|
8
|
+
readonly force?: boolean;
|
|
9
|
+
}): Promise<void>;
|
|
7
10
|
check(): Promise<void>;
|
|
8
11
|
uncheck(): Promise<void>;
|
|
9
12
|
selectOption(value: string | readonly string[]): Promise<void>;
|
|
@@ -27,6 +30,9 @@ export interface PlaywrightResponseLike {
|
|
|
27
30
|
status(): number;
|
|
28
31
|
request(): PlaywrightRequestLike;
|
|
29
32
|
}
|
|
33
|
+
export interface PlaywrightEvaluateLikePage {
|
|
34
|
+
evaluate<ReturnValue, Arg>(pageFunction: (arg: Arg) => ReturnValue | Promise<ReturnValue>, arg: Arg): Promise<ReturnValue>;
|
|
35
|
+
}
|
|
30
36
|
export interface PlaywrightLikePage {
|
|
31
37
|
goto(url: string): Promise<unknown>;
|
|
32
38
|
locator(selector: string): PlaywrightLikeLocator;
|
|
@@ -40,6 +46,327 @@ export interface PlaywrightLikePage {
|
|
|
40
46
|
off?(event: "response", handler: (response: PlaywrightResponseLike) => void): void;
|
|
41
47
|
waitForLoadState?(state?: "domcontentloaded" | "load" | "networkidle"): Promise<void>;
|
|
42
48
|
}
|
|
49
|
+
export type LiveFormProbeEventKind = "probe-installed" | "fs-api-ready" | "fs-api-timeout" | "dom-event" | "form-event" | "api-action" | "quiet-wait" | "field-snapshot" | "validation-result" | "validation-error" | "submit-invoked" | "submit-error";
|
|
50
|
+
export interface LiveFormProbeEvent {
|
|
51
|
+
readonly kind: LiveFormProbeEventKind;
|
|
52
|
+
readonly at: number;
|
|
53
|
+
readonly elapsedMs: number;
|
|
54
|
+
readonly detail: Record<string, unknown>;
|
|
55
|
+
}
|
|
56
|
+
export interface LiveFormFieldProbeTarget {
|
|
57
|
+
readonly fieldId?: FormstackFieldRef;
|
|
58
|
+
readonly internalLabel?: string;
|
|
59
|
+
readonly label?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface LiveFormFieldReadinessTarget extends LiveFormFieldProbeTarget {
|
|
62
|
+
readonly required?: boolean;
|
|
63
|
+
readonly requiredValuePaths?: readonly string[];
|
|
64
|
+
}
|
|
65
|
+
export interface LiveFormLifecycleProbeOptions {
|
|
66
|
+
readonly waitForApiTimeoutMs?: number;
|
|
67
|
+
readonly postRunSettleMs?: number;
|
|
68
|
+
readonly postRunQuietMs?: number;
|
|
69
|
+
readonly postRunQuietTimeoutMs?: number;
|
|
70
|
+
readonly eventTypes?: readonly string[];
|
|
71
|
+
readonly formEventTypes?: readonly string[];
|
|
72
|
+
readonly fieldTargets?: readonly LiveFormFieldProbeTarget[];
|
|
73
|
+
readonly includeAllFields?: boolean;
|
|
74
|
+
readonly validate?: boolean;
|
|
75
|
+
readonly submit?: boolean;
|
|
76
|
+
}
|
|
77
|
+
export interface LiveFormLifecycleProbeReport {
|
|
78
|
+
readonly apiAvailable: boolean;
|
|
79
|
+
readonly events: readonly LiveFormProbeEvent[];
|
|
80
|
+
readonly fieldSnapshots: readonly LiveFormProbeEvent[];
|
|
81
|
+
readonly validation?: LiveFormProbeEvent;
|
|
82
|
+
readonly submit?: LiveFormProbeEvent;
|
|
83
|
+
}
|
|
84
|
+
export interface RunWithLiveFormLifecycleProbeResult<T> {
|
|
85
|
+
readonly result: T;
|
|
86
|
+
readonly report: LiveFormLifecycleProbeReport;
|
|
87
|
+
}
|
|
88
|
+
export interface WaitForLiveFormEventOptions {
|
|
89
|
+
readonly eventTypes: readonly string[];
|
|
90
|
+
readonly target?: LiveFormFieldProbeTarget;
|
|
91
|
+
readonly dataType?: string;
|
|
92
|
+
readonly timeoutMs?: number;
|
|
93
|
+
}
|
|
94
|
+
export interface WaitForLiveFormEventReport {
|
|
95
|
+
readonly matched: boolean;
|
|
96
|
+
readonly timedOut: boolean;
|
|
97
|
+
readonly elapsedMs: number;
|
|
98
|
+
readonly targetFieldId?: string | number | null;
|
|
99
|
+
readonly event?: {
|
|
100
|
+
readonly type: string;
|
|
101
|
+
readonly formId: unknown;
|
|
102
|
+
readonly data: unknown;
|
|
103
|
+
readonly hasPreventDefault: boolean;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
export interface LiveFormReadinessOptions {
|
|
107
|
+
readonly waitForApiTimeoutMs?: number;
|
|
108
|
+
readonly fieldTargets?: readonly LiveFormFieldReadinessTarget[];
|
|
109
|
+
readonly includeAllFields?: boolean;
|
|
110
|
+
}
|
|
111
|
+
export interface ReadLiveFormFieldValueOptions {
|
|
112
|
+
readonly target: LiveFormFieldProbeTarget;
|
|
113
|
+
readonly waitForApiTimeoutMs?: number;
|
|
114
|
+
readonly valuePath?: string;
|
|
115
|
+
readonly expectedValue?: unknown;
|
|
116
|
+
}
|
|
117
|
+
export interface LiveFormFieldValueReport {
|
|
118
|
+
readonly apiAvailable: boolean;
|
|
119
|
+
readonly fieldAvailable: boolean;
|
|
120
|
+
readonly id: string | number | null;
|
|
121
|
+
readonly value: unknown;
|
|
122
|
+
readonly selectedValue: unknown;
|
|
123
|
+
readonly valuePath?: string;
|
|
124
|
+
readonly expectedValue?: unknown;
|
|
125
|
+
readonly valueMatched?: boolean;
|
|
126
|
+
readonly isEmpty: boolean;
|
|
127
|
+
}
|
|
128
|
+
export interface WaitForLiveFormFieldValueOptions extends ReadLiveFormFieldValueOptions {
|
|
129
|
+
readonly timeoutMs?: number;
|
|
130
|
+
readonly intervalMs?: number;
|
|
131
|
+
}
|
|
132
|
+
export interface LiveFormReadinessField {
|
|
133
|
+
readonly target: LiveFormFieldReadinessTarget;
|
|
134
|
+
readonly available: boolean;
|
|
135
|
+
readonly id: string | number | null;
|
|
136
|
+
readonly value: unknown;
|
|
137
|
+
readonly required: boolean;
|
|
138
|
+
readonly apiHidden: boolean;
|
|
139
|
+
readonly hidden: boolean;
|
|
140
|
+
readonly domVisible: boolean | null;
|
|
141
|
+
readonly requiredValuePaths: readonly string[];
|
|
142
|
+
readonly missingValuePaths: readonly string[];
|
|
143
|
+
readonly isComplete: boolean;
|
|
144
|
+
readonly isBlocking: boolean;
|
|
145
|
+
}
|
|
146
|
+
export interface LiveFormReadinessReport {
|
|
147
|
+
readonly apiAvailable: boolean;
|
|
148
|
+
readonly fields: readonly LiveFormReadinessField[];
|
|
149
|
+
readonly blockingFieldCount: number;
|
|
150
|
+
readonly isReady: boolean;
|
|
151
|
+
}
|
|
152
|
+
export interface WaitForLiveFormReadinessOptions extends LiveFormReadinessOptions {
|
|
153
|
+
readonly timeoutMs?: number;
|
|
154
|
+
readonly intervalMs?: number;
|
|
155
|
+
}
|
|
156
|
+
export interface WaitForLiveFormQuietOptions {
|
|
157
|
+
readonly waitForApiTimeoutMs?: number;
|
|
158
|
+
readonly quietMs?: number;
|
|
159
|
+
readonly timeoutMs?: number;
|
|
160
|
+
readonly eventTypes?: readonly string[];
|
|
161
|
+
readonly formEventTypes?: readonly string[];
|
|
162
|
+
readonly includeEvents?: boolean;
|
|
163
|
+
}
|
|
164
|
+
export interface LiveFormQuietEvent {
|
|
165
|
+
readonly kind: "dom-event" | "form-event";
|
|
166
|
+
readonly type: string;
|
|
167
|
+
readonly elapsedMs: number;
|
|
168
|
+
readonly detail: Record<string, unknown>;
|
|
169
|
+
}
|
|
170
|
+
export interface WaitForLiveFormQuietReport {
|
|
171
|
+
readonly apiAvailable: boolean;
|
|
172
|
+
readonly quiet: boolean;
|
|
173
|
+
readonly timedOut: boolean;
|
|
174
|
+
readonly elapsedMs: number;
|
|
175
|
+
readonly quietForMs: number;
|
|
176
|
+
readonly eventCount: number;
|
|
177
|
+
readonly events?: readonly LiveFormQuietEvent[];
|
|
178
|
+
}
|
|
179
|
+
export interface LiveFormValidationGuardTarget extends LiveFormFieldProbeTarget {
|
|
180
|
+
readonly controlIds?: readonly string[];
|
|
181
|
+
readonly controlSelectors?: readonly string[];
|
|
182
|
+
}
|
|
183
|
+
export interface InstallLiveFormInitialValidationGuardOptions {
|
|
184
|
+
readonly waitForApiTimeoutMs?: number;
|
|
185
|
+
readonly restoreDelayMs?: number;
|
|
186
|
+
readonly restoreOnFirstFocusout?: boolean;
|
|
187
|
+
readonly targets: readonly LiveFormValidationGuardTarget[];
|
|
188
|
+
}
|
|
189
|
+
export interface InstallLiveFormInitialValidationGuardReport {
|
|
190
|
+
readonly apiAvailable: boolean;
|
|
191
|
+
readonly installed: boolean;
|
|
192
|
+
readonly guardedFieldCount: number;
|
|
193
|
+
readonly missingTargets: readonly LiveFormValidationGuardTarget[];
|
|
194
|
+
}
|
|
195
|
+
export interface SetLiveFormFieldValueOptions {
|
|
196
|
+
readonly target: LiveFormFieldProbeTarget;
|
|
197
|
+
readonly value: unknown;
|
|
198
|
+
readonly notify?: boolean;
|
|
199
|
+
readonly waitForValue?: boolean;
|
|
200
|
+
readonly timeoutMs?: number;
|
|
201
|
+
readonly intervalMs?: number;
|
|
202
|
+
readonly settleMs?: number;
|
|
203
|
+
}
|
|
204
|
+
export interface DispatchLiveFormFieldDomEventsOptions {
|
|
205
|
+
readonly target: LiveFormFieldProbeTarget;
|
|
206
|
+
readonly eventTypes?: readonly string[];
|
|
207
|
+
readonly onlyCheckedChoices?: boolean;
|
|
208
|
+
}
|
|
209
|
+
export interface DispatchLiveFormFieldDomEventsReport {
|
|
210
|
+
readonly matchedControlCount: number;
|
|
211
|
+
readonly dispatchedEventCount: number;
|
|
212
|
+
readonly controls: readonly LiveFormDomControlSnapshot[];
|
|
213
|
+
}
|
|
214
|
+
export interface SetLiveFormFieldValueReport {
|
|
215
|
+
readonly apiAvailable: boolean;
|
|
216
|
+
readonly fieldAvailable: boolean;
|
|
217
|
+
readonly id: string | number | null;
|
|
218
|
+
readonly previousValue: unknown;
|
|
219
|
+
readonly expectedValue: unknown;
|
|
220
|
+
readonly finalValue: unknown;
|
|
221
|
+
readonly valueMatched: boolean;
|
|
222
|
+
readonly notified: boolean;
|
|
223
|
+
readonly notifyResult?: unknown;
|
|
224
|
+
}
|
|
225
|
+
export interface SetLiveFormFieldValueTransactionOptions {
|
|
226
|
+
readonly write: SetLiveFormFieldValueOptions;
|
|
227
|
+
readonly waitForEvent?: boolean | WaitForLiveFormEventOptions;
|
|
228
|
+
readonly dispatchDomEvents?: boolean | Omit<DispatchLiveFormFieldDomEventsOptions, "target">;
|
|
229
|
+
readonly readiness?: WaitForLiveFormReadinessOptions;
|
|
230
|
+
readonly snapshot?: boolean | SnapshotLiveFormDomFieldsOptions;
|
|
231
|
+
}
|
|
232
|
+
export interface SetLiveFormFieldValueTransactionReport {
|
|
233
|
+
readonly write: SetLiveFormFieldValueReport;
|
|
234
|
+
readonly event?: WaitForLiveFormEventReport;
|
|
235
|
+
readonly domDispatch?: DispatchLiveFormFieldDomEventsReport;
|
|
236
|
+
readonly readiness?: LiveFormReadinessReport;
|
|
237
|
+
readonly domFields?: readonly LiveFormDomFieldSnapshot[];
|
|
238
|
+
}
|
|
239
|
+
export interface SetLiveFormFieldValuesTransactionOptions {
|
|
240
|
+
readonly writes: readonly SetLiveFormFieldValueOptions[];
|
|
241
|
+
readonly waitForEvents?: boolean;
|
|
242
|
+
readonly dispatchDomEvents?: boolean | Omit<DispatchLiveFormFieldDomEventsOptions, "target">;
|
|
243
|
+
readonly readiness?: WaitForLiveFormReadinessOptions;
|
|
244
|
+
readonly snapshot?: boolean | SnapshotLiveFormDomFieldsOptions;
|
|
245
|
+
}
|
|
246
|
+
export interface SetLiveFormFieldValuesTransactionReport {
|
|
247
|
+
readonly writes: readonly SetLiveFormFieldValueReport[];
|
|
248
|
+
readonly events: readonly WaitForLiveFormEventReport[];
|
|
249
|
+
readonly domDispatches: readonly DispatchLiveFormFieldDomEventsReport[];
|
|
250
|
+
readonly readiness?: LiveFormReadinessReport;
|
|
251
|
+
readonly domFields?: readonly LiveFormDomFieldSnapshot[];
|
|
252
|
+
}
|
|
253
|
+
export interface LiveFormDomControlSnapshot {
|
|
254
|
+
readonly tagName: string;
|
|
255
|
+
readonly type: string | null;
|
|
256
|
+
readonly id: string | null;
|
|
257
|
+
readonly name: string | null;
|
|
258
|
+
readonly value: string | null;
|
|
259
|
+
readonly currentValue: string | null;
|
|
260
|
+
readonly checked: boolean | null;
|
|
261
|
+
}
|
|
262
|
+
export interface LiveFormDomFieldSnapshot {
|
|
263
|
+
readonly internalLabel: string | null;
|
|
264
|
+
readonly id: string;
|
|
265
|
+
readonly text: string;
|
|
266
|
+
readonly controls: readonly LiveFormDomControlSnapshot[];
|
|
267
|
+
}
|
|
268
|
+
export interface SnapshotLiveFormDomFieldsOptions {
|
|
269
|
+
readonly selector?: string;
|
|
270
|
+
readonly textMaxLength?: number;
|
|
271
|
+
}
|
|
272
|
+
export interface ReadLiveFormDomFieldStateOptions extends LiveFormFieldProbeTarget {
|
|
273
|
+
readonly selector?: string;
|
|
274
|
+
readonly controlSelector?: string;
|
|
275
|
+
readonly expectedValue?: string;
|
|
276
|
+
readonly expectedChecked?: boolean;
|
|
277
|
+
}
|
|
278
|
+
export interface LiveFormDomFieldStateReport {
|
|
279
|
+
readonly matched: boolean;
|
|
280
|
+
readonly fieldMatched: boolean;
|
|
281
|
+
readonly controlMatched: boolean;
|
|
282
|
+
readonly field: LiveFormDomFieldSnapshot | null;
|
|
283
|
+
readonly controls: readonly LiveFormDomControlSnapshot[];
|
|
284
|
+
readonly expectedValue?: string;
|
|
285
|
+
readonly expectedChecked?: boolean;
|
|
286
|
+
}
|
|
287
|
+
export interface WaitForLiveFormDomFieldStateOptions extends ReadLiveFormDomFieldStateOptions {
|
|
288
|
+
readonly timeoutMs?: number;
|
|
289
|
+
readonly intervalMs?: number;
|
|
290
|
+
}
|
|
291
|
+
export interface WindowMessageRecord {
|
|
292
|
+
readonly origin: string;
|
|
293
|
+
readonly data: unknown;
|
|
294
|
+
}
|
|
295
|
+
export interface InstallWindowMessageRecorderOptions {
|
|
296
|
+
readonly propertyName?: string;
|
|
297
|
+
readonly allowedOrigins?: readonly string[];
|
|
298
|
+
}
|
|
299
|
+
export interface InstallWindowMessageRecorderReport {
|
|
300
|
+
readonly installed: boolean;
|
|
301
|
+
readonly propertyName: string;
|
|
302
|
+
}
|
|
303
|
+
export interface PostMessageToIframeOptions {
|
|
304
|
+
readonly iframeSelector: string;
|
|
305
|
+
readonly message: unknown;
|
|
306
|
+
readonly targetOrigin: string;
|
|
307
|
+
}
|
|
308
|
+
export interface FormstackIframeBridgeMessage<Payload = unknown> {
|
|
309
|
+
readonly channel: string;
|
|
310
|
+
readonly requestId: string;
|
|
311
|
+
readonly type: string;
|
|
312
|
+
readonly payload?: Payload;
|
|
313
|
+
}
|
|
314
|
+
export interface WaitForWindowMessageOptions {
|
|
315
|
+
readonly propertyName?: string;
|
|
316
|
+
readonly channel?: string;
|
|
317
|
+
readonly requestId?: string;
|
|
318
|
+
readonly type?: string;
|
|
319
|
+
readonly timeoutMs?: number;
|
|
320
|
+
}
|
|
321
|
+
export interface WaitForWindowMessageReport {
|
|
322
|
+
readonly matched: boolean;
|
|
323
|
+
readonly timedOut: boolean;
|
|
324
|
+
readonly elapsedMs: number;
|
|
325
|
+
readonly record?: WindowMessageRecord;
|
|
326
|
+
}
|
|
327
|
+
export interface SendFormstackIframeBridgeMessageOptions<Payload = unknown> {
|
|
328
|
+
readonly iframeSelector: string;
|
|
329
|
+
readonly targetOrigin: string;
|
|
330
|
+
readonly channel: string;
|
|
331
|
+
readonly requestId: string;
|
|
332
|
+
readonly type: string;
|
|
333
|
+
readonly payload?: Payload;
|
|
334
|
+
readonly responseType?: string;
|
|
335
|
+
readonly propertyName?: string;
|
|
336
|
+
readonly allowedOrigins?: readonly string[];
|
|
337
|
+
readonly timeoutMs?: number;
|
|
338
|
+
}
|
|
339
|
+
export interface SendFormstackIframeBridgeMessageReport {
|
|
340
|
+
readonly posted: boolean;
|
|
341
|
+
readonly response: WaitForWindowMessageReport;
|
|
342
|
+
}
|
|
343
|
+
export interface WaitForConsoleMessageOptions {
|
|
344
|
+
readonly type?: PlaywrightConsoleType;
|
|
345
|
+
readonly text?: string | RegExp;
|
|
346
|
+
readonly timeoutMs?: number;
|
|
347
|
+
}
|
|
348
|
+
export interface WaitForConsoleMessageReport {
|
|
349
|
+
readonly matched: boolean;
|
|
350
|
+
readonly timedOut: boolean;
|
|
351
|
+
readonly elapsedMs: number;
|
|
352
|
+
readonly message?: {
|
|
353
|
+
readonly type: PlaywrightConsoleType;
|
|
354
|
+
readonly text: string;
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
export interface WaitForWindowFlagOptions {
|
|
358
|
+
readonly path: string;
|
|
359
|
+
readonly expectedValue?: unknown;
|
|
360
|
+
readonly timeoutMs?: number;
|
|
361
|
+
readonly intervalMs?: number;
|
|
362
|
+
}
|
|
363
|
+
export interface WaitForWindowFlagReport {
|
|
364
|
+
readonly matched: boolean;
|
|
365
|
+
readonly timedOut: boolean;
|
|
366
|
+
readonly elapsedMs: number;
|
|
367
|
+
readonly path: string;
|
|
368
|
+
readonly value: unknown;
|
|
369
|
+
}
|
|
43
370
|
export interface ConsoleDiagnostic {
|
|
44
371
|
readonly kind: "console";
|
|
45
372
|
readonly level: PlaywrightConsoleType;
|
|
@@ -105,10 +432,39 @@ export interface DateTimeFieldValue {
|
|
|
105
432
|
readonly seconds?: string;
|
|
106
433
|
readonly ampm?: string;
|
|
107
434
|
}
|
|
435
|
+
export interface LiveFormDateTimeValue {
|
|
436
|
+
readonly M?: string;
|
|
437
|
+
readonly D?: string;
|
|
438
|
+
readonly Y?: string;
|
|
439
|
+
readonly H?: string;
|
|
440
|
+
readonly I?: string;
|
|
441
|
+
readonly S?: string;
|
|
442
|
+
readonly A?: string;
|
|
443
|
+
}
|
|
108
444
|
export interface ProductFieldValue {
|
|
109
445
|
readonly fixedAmount?: string;
|
|
110
446
|
readonly quantity?: string;
|
|
111
447
|
}
|
|
448
|
+
export interface LiveFormProductValue {
|
|
449
|
+
readonly fixedAmount?: string;
|
|
450
|
+
readonly quantity?: string;
|
|
451
|
+
readonly value?: string;
|
|
452
|
+
}
|
|
453
|
+
export interface ChoiceFieldValue {
|
|
454
|
+
readonly value: string;
|
|
455
|
+
readonly otherValue?: string;
|
|
456
|
+
}
|
|
457
|
+
export type CheckboxFieldValue = Record<string, string | null>;
|
|
458
|
+
export interface MatrixFieldSelection {
|
|
459
|
+
readonly row: string | number;
|
|
460
|
+
readonly column: string | number;
|
|
461
|
+
}
|
|
462
|
+
export interface LiveFormMatrixValue {
|
|
463
|
+
readonly value: readonly string[];
|
|
464
|
+
}
|
|
465
|
+
export interface LiveFormRatingValue {
|
|
466
|
+
readonly value: string;
|
|
467
|
+
}
|
|
112
468
|
export interface FormTestHarness {
|
|
113
469
|
readonly page: PlaywrightLikePage;
|
|
114
470
|
readonly options: FormTestHarnessOptions;
|
|
@@ -147,6 +503,12 @@ export interface FormScenarioStepObject {
|
|
|
147
503
|
readonly run: FormScenarioStepRun;
|
|
148
504
|
}
|
|
149
505
|
export type FormScenarioStep = FormScenarioStepRun | FormScenarioStepObject;
|
|
506
|
+
export interface LiveFormApiRecipeOptions {
|
|
507
|
+
readonly notify?: boolean;
|
|
508
|
+
readonly dispatchDomEvents?: boolean | Omit<DispatchLiveFormFieldDomEventsOptions, "target">;
|
|
509
|
+
readonly waitForEvent?: boolean | WaitForLiveFormEventOptions;
|
|
510
|
+
readonly waitForQuiet?: boolean | WaitForLiveFormQuietOptions;
|
|
511
|
+
}
|
|
150
512
|
export interface FormTestScenario {
|
|
151
513
|
readonly name: string;
|
|
152
514
|
readonly url?: string;
|
|
@@ -157,21 +519,211 @@ export interface RunFormScenarioOptions extends FormTestHarnessOptions {
|
|
|
157
519
|
readonly diagnostics?: FormBrowserDiagnosticsOptions;
|
|
158
520
|
readonly throwOnDiagnostics?: boolean;
|
|
159
521
|
readonly waitForLoadState?: "domcontentloaded" | "load" | "networkidle";
|
|
522
|
+
readonly artifacts?: readonly FormScenarioArtifact[];
|
|
160
523
|
}
|
|
161
524
|
export interface FormScenarioStepResult {
|
|
162
525
|
readonly name: string;
|
|
526
|
+
readonly status?: "passed" | "failed";
|
|
527
|
+
readonly startedAt?: string;
|
|
528
|
+
readonly endedAt?: string;
|
|
529
|
+
readonly durationMs?: number;
|
|
530
|
+
readonly error?: {
|
|
531
|
+
readonly name: string;
|
|
532
|
+
readonly message: string;
|
|
533
|
+
readonly stack?: string;
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
export interface FormScenarioArtifact {
|
|
537
|
+
readonly kind: "json" | "har" | "screenshot" | "video" | "trace" | "other";
|
|
538
|
+
readonly path: string;
|
|
539
|
+
readonly label?: string;
|
|
163
540
|
}
|
|
164
541
|
export interface FormScenarioResult {
|
|
165
542
|
readonly name: string;
|
|
543
|
+
readonly status?: "passed" | "failed";
|
|
544
|
+
readonly startedAt?: string;
|
|
545
|
+
readonly endedAt?: string;
|
|
546
|
+
readonly durationMs?: number;
|
|
166
547
|
readonly steps: readonly FormScenarioStepResult[];
|
|
167
548
|
readonly diagnostics: FormBrowserDiagnosticsReport;
|
|
549
|
+
readonly artifacts?: readonly FormScenarioArtifact[];
|
|
550
|
+
}
|
|
551
|
+
export declare class FormScenarioRunError extends Error {
|
|
552
|
+
readonly result: FormScenarioResult;
|
|
553
|
+
constructor(result: FormScenarioResult);
|
|
554
|
+
}
|
|
555
|
+
export interface ReadLiveFormValidationStateOptions {
|
|
556
|
+
readonly validate?: boolean;
|
|
557
|
+
readonly includeEmptyErrors?: boolean;
|
|
558
|
+
readonly includeHiddenErrors?: boolean;
|
|
559
|
+
}
|
|
560
|
+
export interface LiveFormValidationStateReport {
|
|
561
|
+
readonly apiAvailable: boolean;
|
|
562
|
+
readonly validated: boolean;
|
|
563
|
+
readonly result: unknown;
|
|
564
|
+
readonly inlineErrors: readonly {
|
|
565
|
+
readonly id: string | null;
|
|
566
|
+
readonly text: string;
|
|
567
|
+
}[];
|
|
568
|
+
}
|
|
569
|
+
export interface WaitForLiveFormValidationStateOptions extends ReadLiveFormValidationStateOptions {
|
|
570
|
+
readonly expectedErrorCount?: number;
|
|
571
|
+
readonly errorText?: string | RegExp;
|
|
572
|
+
readonly expectNoErrors?: boolean;
|
|
573
|
+
readonly timeoutMs?: number;
|
|
574
|
+
readonly intervalMs?: number;
|
|
575
|
+
}
|
|
576
|
+
export interface WaitForLiveFormVisibilityTarget extends LiveFormFieldProbeTarget {
|
|
577
|
+
readonly selector?: string;
|
|
578
|
+
readonly visible: boolean;
|
|
579
|
+
}
|
|
580
|
+
export interface WaitForLiveFormVisibilityOptions {
|
|
581
|
+
readonly targets: readonly WaitForLiveFormVisibilityTarget[];
|
|
582
|
+
readonly timeoutMs?: number;
|
|
583
|
+
readonly intervalMs?: number;
|
|
584
|
+
}
|
|
585
|
+
export interface LiveFormVisibilityField {
|
|
586
|
+
readonly target: WaitForLiveFormVisibilityTarget;
|
|
587
|
+
readonly id: string | number | null;
|
|
588
|
+
readonly visible: boolean | null;
|
|
589
|
+
readonly matched: boolean;
|
|
590
|
+
}
|
|
591
|
+
export interface WaitForLiveFormVisibilityReport {
|
|
592
|
+
readonly matched: boolean;
|
|
593
|
+
readonly timedOut: boolean;
|
|
594
|
+
readonly fields: readonly LiveFormVisibilityField[];
|
|
595
|
+
}
|
|
596
|
+
export interface LiveFormStateDriftIssue {
|
|
597
|
+
readonly internalLabel: string | null;
|
|
598
|
+
readonly fieldId: string | number | null;
|
|
599
|
+
readonly kind: "visibility" | "missing-dom" | "missing-api";
|
|
600
|
+
readonly message: string;
|
|
601
|
+
}
|
|
602
|
+
export interface LiveFormStateDriftReport {
|
|
603
|
+
readonly readiness: LiveFormReadinessReport;
|
|
604
|
+
readonly domFields: readonly LiveFormDomFieldSnapshot[];
|
|
605
|
+
readonly issues: readonly LiveFormStateDriftIssue[];
|
|
606
|
+
readonly hasDrift: boolean;
|
|
607
|
+
}
|
|
608
|
+
export interface DiscoverLiveFormFieldShapesOptions {
|
|
609
|
+
readonly selector?: string;
|
|
610
|
+
readonly includeValues?: boolean;
|
|
611
|
+
}
|
|
612
|
+
export interface LiveFormFieldShape {
|
|
613
|
+
readonly internalLabel: string | null;
|
|
614
|
+
readonly fieldId: string | number | null;
|
|
615
|
+
readonly domId: string;
|
|
616
|
+
readonly labelText: string;
|
|
617
|
+
readonly apiAvailable: boolean;
|
|
618
|
+
readonly apiValue?: unknown;
|
|
619
|
+
readonly apiHidden?: boolean;
|
|
620
|
+
readonly domVisible: boolean;
|
|
621
|
+
readonly controlCount: number;
|
|
622
|
+
readonly controlTypes: readonly string[];
|
|
623
|
+
readonly inferredKind: "address" | "checkbox" | "date" | "embed" | "email" | "file" | "matrix" | "name" | "number" | "phone" | "product" | "radio" | "rating" | "section" | "select" | "signature" | "textarea" | "text" | "unknown";
|
|
624
|
+
readonly controls: readonly LiveFormDomControlSnapshot[];
|
|
625
|
+
}
|
|
626
|
+
export interface DiscoverLiveFormFieldShapesReport {
|
|
627
|
+
readonly apiAvailable: boolean;
|
|
628
|
+
readonly fields: readonly LiveFormFieldShape[];
|
|
629
|
+
}
|
|
630
|
+
export interface SubmitWithLiveFormLifecycleProbeOptions extends LiveFormLifecycleProbeOptions {
|
|
631
|
+
readonly submitSelector?: string;
|
|
632
|
+
readonly throwOnClickFailure?: boolean;
|
|
633
|
+
readonly clickTimeoutMs?: number;
|
|
634
|
+
}
|
|
635
|
+
export interface SubmitWithLiveFormLifecycleProbeActionReport {
|
|
636
|
+
readonly clicked: boolean;
|
|
637
|
+
readonly error?: string;
|
|
168
638
|
}
|
|
169
639
|
export declare function createFormBrowserMonitor(page: PlaywrightLikePage, options?: FormBrowserDiagnosticsOptions): {
|
|
170
640
|
readonly report: () => FormBrowserDiagnosticsReport;
|
|
171
641
|
readonly assertNoErrors: () => void;
|
|
172
642
|
readonly detach: () => void;
|
|
173
643
|
};
|
|
644
|
+
export declare function readValuePath(value: unknown, path: string): unknown;
|
|
645
|
+
export declare function isLiveFormFieldValueEmpty(value: unknown): boolean;
|
|
646
|
+
export declare function buildLiveFormNameValue(value: NameFieldValue, current?: unknown): NameFieldValue;
|
|
647
|
+
export declare function buildLiveFormAddressValue(value: AddressFieldValue, current?: unknown): AddressFieldValue;
|
|
648
|
+
export declare function buildLiveFormChoiceValue(value: string, otherValue?: string): ChoiceFieldValue;
|
|
649
|
+
export declare function buildLiveFormSelectValue(value: string): Pick<ChoiceFieldValue, "value">;
|
|
650
|
+
export declare function buildLiveFormCheckboxValue(values: readonly string[], otherValue?: string | null): CheckboxFieldValue;
|
|
651
|
+
export declare function buildLiveFormDateTimeValue(value: DateTimeFieldValue, current?: unknown): LiveFormDateTimeValue;
|
|
652
|
+
export declare function buildLiveFormProductValue(value: ProductFieldValue, current?: unknown): LiveFormProductValue;
|
|
653
|
+
export declare function buildLiveFormRatingValue(value: string | number): LiveFormRatingValue;
|
|
654
|
+
export declare function buildLiveFormMatrixValue(selections: readonly (string | MatrixFieldSelection)[]): LiveFormMatrixValue;
|
|
655
|
+
export declare function readLiveFormFieldValue(page: PlaywrightLikePage, options: ReadLiveFormFieldValueOptions): Promise<LiveFormFieldValueReport>;
|
|
656
|
+
export declare function waitForLiveFormFieldValue(page: PlaywrightLikePage, options: WaitForLiveFormFieldValueOptions): Promise<LiveFormFieldValueReport>;
|
|
657
|
+
export declare function readLiveFormReadiness(page: PlaywrightLikePage, options?: LiveFormReadinessOptions): Promise<LiveFormReadinessReport>;
|
|
658
|
+
export declare function waitForLiveFormReadiness(page: PlaywrightLikePage, options?: WaitForLiveFormReadinessOptions): Promise<LiveFormReadinessReport>;
|
|
659
|
+
export declare function waitForLiveFormQuiet(page: PlaywrightLikePage, options?: WaitForLiveFormQuietOptions): Promise<WaitForLiveFormQuietReport>;
|
|
660
|
+
export declare function installLiveFormInitialValidationGuard(page: PlaywrightLikePage, options: InstallLiveFormInitialValidationGuardOptions): Promise<InstallLiveFormInitialValidationGuardReport>;
|
|
661
|
+
export declare function setLiveFormFieldValue(page: PlaywrightLikePage, options: SetLiveFormFieldValueOptions): Promise<SetLiveFormFieldValueReport>;
|
|
662
|
+
export declare function snapshotLiveFormDomFields(page: PlaywrightLikePage, options?: SnapshotLiveFormDomFieldsOptions): Promise<readonly LiveFormDomFieldSnapshot[]>;
|
|
663
|
+
export declare function readLiveFormDomFieldState(page: PlaywrightLikePage, options: ReadLiveFormDomFieldStateOptions): Promise<LiveFormDomFieldStateReport>;
|
|
664
|
+
export declare function waitForLiveFormDomFieldState(page: PlaywrightLikePage, options: WaitForLiveFormDomFieldStateOptions): Promise<LiveFormDomFieldStateReport>;
|
|
665
|
+
export declare function dispatchLiveFormFieldDomEvents(page: PlaywrightLikePage, options: DispatchLiveFormFieldDomEventsOptions): Promise<DispatchLiveFormFieldDomEventsReport>;
|
|
666
|
+
export declare function installWindowMessageRecorder(page: PlaywrightLikePage, options?: InstallWindowMessageRecorderOptions): Promise<InstallWindowMessageRecorderReport>;
|
|
667
|
+
export declare function readWindowMessageRecords(page: PlaywrightLikePage, propertyName?: string): Promise<readonly WindowMessageRecord[]>;
|
|
668
|
+
export declare function clearWindowMessageRecords(page: PlaywrightLikePage, propertyName?: string): Promise<void>;
|
|
669
|
+
export declare function postMessageToIframe(page: PlaywrightLikePage, options: PostMessageToIframeOptions): Promise<boolean>;
|
|
670
|
+
export declare function buildFormstackIframeBridgeMessage<Payload = unknown>(message: FormstackIframeBridgeMessage<Payload>): FormstackIframeBridgeMessage<Payload>;
|
|
671
|
+
export declare function waitForWindowMessage(page: PlaywrightLikePage, options?: WaitForWindowMessageOptions): Promise<WaitForWindowMessageReport>;
|
|
672
|
+
export declare function sendFormstackIframeBridgeMessage<Payload = unknown>(page: PlaywrightLikePage, options: SendFormstackIframeBridgeMessageOptions<Payload>): Promise<SendFormstackIframeBridgeMessageReport>;
|
|
673
|
+
export declare function waitForConsoleMessage(page: PlaywrightLikePage, options?: WaitForConsoleMessageOptions): Promise<WaitForConsoleMessageReport>;
|
|
674
|
+
export declare function waitForWindowFlag(page: PlaywrightLikePage, options: WaitForWindowFlagOptions): Promise<WaitForWindowFlagReport>;
|
|
675
|
+
export declare function readLiveFormValidationState(page: PlaywrightLikePage, options?: ReadLiveFormValidationStateOptions): Promise<LiveFormValidationStateReport>;
|
|
676
|
+
export declare function waitForLiveFormValidationState(page: PlaywrightLikePage, options?: WaitForLiveFormValidationStateOptions): Promise<LiveFormValidationStateReport>;
|
|
677
|
+
export declare function waitForLiveFormVisibility(page: PlaywrightLikePage, options: WaitForLiveFormVisibilityOptions): Promise<WaitForLiveFormVisibilityReport>;
|
|
678
|
+
export declare function readLiveFormStateDrift(page: PlaywrightLikePage, options?: LiveFormReadinessOptions & {
|
|
679
|
+
readonly snapshot?: SnapshotLiveFormDomFieldsOptions;
|
|
680
|
+
}): Promise<LiveFormStateDriftReport>;
|
|
681
|
+
export declare function discoverLiveFormFieldShapes(page: PlaywrightLikePage, options?: DiscoverLiveFormFieldShapesOptions): Promise<DiscoverLiveFormFieldShapesReport>;
|
|
682
|
+
export declare function submitWithLiveFormLifecycleProbe(page: PlaywrightLikePage, options?: SubmitWithLiveFormLifecycleProbeOptions): Promise<RunWithLiveFormLifecycleProbeResult<SubmitWithLiveFormLifecycleProbeActionReport>>;
|
|
683
|
+
export declare function probeLiveFormLifecycle(page: PlaywrightLikePage, options?: LiveFormLifecycleProbeOptions): Promise<LiveFormLifecycleProbeReport>;
|
|
684
|
+
export declare function runWithLiveFormLifecycleProbe<T>(page: PlaywrightLikePage, options: LiveFormLifecycleProbeOptions, run: () => Promise<T> | T): Promise<RunWithLiveFormLifecycleProbeResult<T>>;
|
|
685
|
+
export declare function waitForLiveFormEvent(page: PlaywrightLikePage, options: WaitForLiveFormEventOptions): Promise<WaitForLiveFormEventReport>;
|
|
686
|
+
export declare function setLiveFormFieldValueTransaction(page: PlaywrightLikePage, options: SetLiveFormFieldValueTransactionOptions): Promise<SetLiveFormFieldValueTransactionReport>;
|
|
687
|
+
export declare function setLiveFormFieldValuesTransaction(page: PlaywrightLikePage, options: SetLiveFormFieldValuesTransactionOptions): Promise<SetLiveFormFieldValuesTransactionReport>;
|
|
174
688
|
export declare function createFormTestHarness(page: PlaywrightLikePage, options?: FormTestHarnessOptions): FormTestHarness;
|
|
175
689
|
export declare function runFormScenario(page: PlaywrightLikePage, scenario: FormTestScenario, options?: RunFormScenarioOptions): Promise<FormScenarioResult>;
|
|
176
690
|
export declare function defineFormScenario<const Scenario extends FormTestScenario>(scenario: Scenario): Scenario;
|
|
691
|
+
export declare const liveFormScenarioSteps: {
|
|
692
|
+
writeField: (name: string, options: SetLiveFormFieldValueTransactionOptions) => FormScenarioStepObject;
|
|
693
|
+
writeFields: (name: string, options: SetLiveFormFieldValuesTransactionOptions) => FormScenarioStepObject;
|
|
694
|
+
expectReady: (name: string, options: WaitForLiveFormReadinessOptions) => FormScenarioStepObject;
|
|
695
|
+
waitForQuiet: (name: string, options?: WaitForLiveFormQuietOptions) => FormScenarioStepObject;
|
|
696
|
+
expectFieldValue: (name: string, options: WaitForLiveFormFieldValueOptions) => FormScenarioStepObject;
|
|
697
|
+
expectDomFieldState: (name: string, options: WaitForLiveFormDomFieldStateOptions) => FormScenarioStepObject;
|
|
698
|
+
expectValidationErrors: (name: string, options?: WaitForLiveFormValidationStateOptions) => FormScenarioStepObject;
|
|
699
|
+
expectNoValidationErrors: (name: string, options?: Omit<WaitForLiveFormValidationStateOptions, "expectNoErrors">) => FormScenarioStepObject;
|
|
700
|
+
expectConsoleMessage: (name: string, options?: WaitForConsoleMessageOptions) => FormScenarioStepObject;
|
|
701
|
+
expectWindowFlag: (name: string, options: WaitForWindowFlagOptions) => FormScenarioStepObject;
|
|
702
|
+
expectVisibility: (name: string, options: WaitForLiveFormVisibilityOptions) => FormScenarioStepObject;
|
|
703
|
+
expectNoStateDrift: (name: string, options: LiveFormReadinessOptions & {
|
|
704
|
+
readonly snapshot?: SnapshotLiveFormDomFieldsOptions;
|
|
705
|
+
}) => FormScenarioStepObject;
|
|
706
|
+
submitAndProbe: (name: string, options?: SubmitWithLiveFormLifecycleProbeOptions) => FormScenarioStepObject;
|
|
707
|
+
};
|
|
708
|
+
export declare const liveFormFieldRecipes: {
|
|
709
|
+
fillTextDom: (name: string, internalLabel: string, value: string) => FormScenarioStepObject;
|
|
710
|
+
fillNameDom: (name: string, internalLabel: string, value: NameFieldValue) => FormScenarioStepObject;
|
|
711
|
+
fillAddressDom: (name: string, internalLabel: string, value: AddressFieldValue) => FormScenarioStepObject;
|
|
712
|
+
chooseRadioDom: (name: string, internalLabel: string, value: string | number) => FormScenarioStepObject;
|
|
713
|
+
setCheckboxDom: (name: string, internalLabel: string, value: string | number, checked: boolean) => FormScenarioStepObject;
|
|
714
|
+
selectMatrixCellDom: (name: string, fieldId: FormstackFieldRef, row: number, column: number) => FormScenarioStepObject;
|
|
715
|
+
setRatingDom: (name: string, fieldId: FormstackFieldRef, zeroBasedIndex: number) => FormScenarioStepObject;
|
|
716
|
+
uploadFileDom: (name: string, internalLabel: string, files: string | readonly string[]) => FormScenarioStepObject;
|
|
717
|
+
setNameApi: (name: string, internalLabel: string, value: NameFieldValue, options?: LiveFormApiRecipeOptions) => FormScenarioStepObject;
|
|
718
|
+
setAddressApi: (name: string, internalLabel: string, value: AddressFieldValue, options?: LiveFormApiRecipeOptions) => FormScenarioStepObject;
|
|
719
|
+
setChoiceApi: (name: string, internalLabel: string, value: string, options?: LiveFormApiRecipeOptions) => FormScenarioStepObject;
|
|
720
|
+
setSelectApi: (name: string, internalLabel: string, value: string, options?: LiveFormApiRecipeOptions) => FormScenarioStepObject;
|
|
721
|
+
setCheckboxesApi: (name: string, internalLabel: string, values: readonly string[], options?: LiveFormApiRecipeOptions) => FormScenarioStepObject;
|
|
722
|
+
setDateTimeApi: (name: string, internalLabel: string, value: DateTimeFieldValue, options?: LiveFormApiRecipeOptions) => FormScenarioStepObject;
|
|
723
|
+
setMatrixApi: (name: string, internalLabel: string, selections: readonly (string | MatrixFieldSelection)[], options?: LiveFormApiRecipeOptions) => FormScenarioStepObject;
|
|
724
|
+
setRatingApi: (name: string, internalLabel: string, value: string | number, options?: LiveFormApiRecipeOptions) => FormScenarioStepObject;
|
|
725
|
+
setProductApi: (name: string, internalLabel: string, value: ProductFieldValue, options?: LiveFormApiRecipeOptions) => FormScenarioStepObject;
|
|
726
|
+
setNameApiAndDispatch: (name: string, internalLabel: string, value: NameFieldValue, options?: Omit<LiveFormApiRecipeOptions, "dispatchDomEvents">) => FormScenarioStepObject;
|
|
727
|
+
setChoiceApiAndDispatch: (name: string, internalLabel: string, value: string, options?: Omit<LiveFormApiRecipeOptions, "dispatchDomEvents">) => FormScenarioStepObject;
|
|
728
|
+
};
|
|
177
729
|
//# sourceMappingURL=index.d.ts.map
|