@ripplo/testing 0.7.9 → 0.7.11

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/express.js CHANGED
@@ -124,6 +124,32 @@ var withinSchema = z2.object({
124
124
  selection: selectionSchema
125
125
  });
126
126
  var wait = z2.union([budgetSchema, z2.undefined()]).optional().transform((value) => value);
127
+ var singletonPredicateSchema = z2.object({
128
+ assertion: singletonAssertionSchema,
129
+ kind: z2.literal("singleton"),
130
+ singleton: z2.string().min(1),
131
+ wait
132
+ });
133
+ var countPredicateSchema = z2.object({
134
+ entity: z2.string().min(1),
135
+ kind: z2.literal("count"),
136
+ value: z2.number().int().nonnegative()
137
+ });
138
+ var conditionSchema = z2.lazy(
139
+ () => z2.discriminatedUnion("kind", [
140
+ singletonPredicateSchema,
141
+ countPredicateSchema,
142
+ z2.object({ kind: z2.literal("not"), predicate: conditionSchema }),
143
+ z2.object({ kind: z2.literal("and"), predicates: z2.array(conditionSchema) })
144
+ ])
145
+ );
146
+ var whenBranchSchema = z2.lazy(
147
+ () => z2.object({
148
+ condition: z2.union([conditionSchema, z2.undefined()]).optional().transform((value) => value),
149
+ consequence: predicateSchema,
150
+ name: z2.string().min(1)
151
+ })
152
+ );
127
153
  var predicateSchema = z2.lazy(
128
154
  () => z2.discriminatedUnion("kind", [
129
155
  z2.object({ kind: z2.literal("visible"), locator: locatorSchema, wait }),
@@ -132,12 +158,7 @@ var predicateSchema = z2.lazy(
132
158
  z2.object({ kind: z2.literal("focused"), locator: locatorSchema, wait }),
133
159
  z2.object({ kind: z2.literal("value"), locator: locatorSchema, value: stringValueSchema, wait }),
134
160
  z2.object({ kind: z2.literal("text"), locator: locatorSchema, value: stringValueSchema, wait }),
135
- z2.object({
136
- assertion: singletonAssertionSchema,
137
- kind: z2.literal("singleton"),
138
- singleton: z2.string().min(1),
139
- wait
140
- }),
161
+ singletonPredicateSchema,
141
162
  z2.object({
142
163
  kind: z2.literal("browser"),
143
164
  name: browserSingletonSchema,
@@ -153,17 +174,8 @@ var predicateSchema = z2.lazy(
153
174
  }),
154
175
  z2.object({ kind: z2.literal("not"), predicate: predicateSchema }),
155
176
  z2.object({ kind: z2.literal("and"), predicates: z2.array(predicateSchema) }),
156
- z2.object({
157
- entity: z2.string().min(1),
158
- kind: z2.literal("count"),
159
- value: z2.number().int().nonnegative()
160
- }),
161
- z2.object({
162
- condition: predicateSchema,
163
- consequence: predicateSchema,
164
- kind: z2.literal("when"),
165
- otherwise: z2.union([predicateSchema, z2.undefined()]).optional().transform((value) => value)
166
- })
177
+ countPredicateSchema,
178
+ z2.object({ branches: z2.array(whenBranchSchema), kind: z2.literal("when") })
167
179
  ])
168
180
  );
169
181
 
@@ -248,7 +260,6 @@ var stepSchema = z4.object({
248
260
  expect: z4.array(predicateSchema).default([])
249
261
  });
250
262
  var paramSchema = z4.object({
251
- example: primitiveSchema.optional(),
252
263
  valueSpace: z4.string().min(1)
253
264
  });
254
265
  var setupSchema = z4.object({
@@ -260,7 +271,19 @@ var absenceSchema = z4.object({
260
271
  entity: z4.string().min(1),
261
272
  where: z4.record(z4.string().min(1), setValueSchema)
262
273
  });
263
- var testSchema = z4.object({
274
+ var resolvedTestSchema = z4.object({
275
+ absent: z4.array(absenceSchema).default([]),
276
+ exclusive: z4.array(z4.string().min(1)).default([]),
277
+ intent: z4.string().min(1),
278
+ name: z4.string().min(1),
279
+ params: z4.record(z4.string().min(1), paramSchema),
280
+ singletons: z4.record(z4.string().min(1), setValueSchema).default({}),
281
+ slug: z4.string().min(1),
282
+ steps: z4.array(stepSchema).default([]),
283
+ workflow: z4.string().min(1),
284
+ world: z4.array(setupSchema).default([])
285
+ });
286
+ var workflowSchema = z4.object({
264
287
  absent: z4.array(absenceSchema).default([]),
265
288
  exclusive: z4.array(z4.string().min(1)).default([]),
266
289
  intent: z4.string().min(1),
@@ -271,6 +294,7 @@ var testSchema = z4.object({
271
294
  sourcePath: z4.string().min(1).optional(),
272
295
  steps: z4.array(stepSchema).default([]),
273
296
  stub: z4.boolean().default(false),
297
+ tests: z4.array(resolvedTestSchema).default([]),
274
298
  world: z4.array(setupSchema).default([])
275
299
  });
276
300
  var fixtureEntrySchema = z4.object({
@@ -281,8 +305,8 @@ var lockfileSchema = z4.object({
281
305
  entities: z4.array(entitySchemaSchema),
282
306
  fixtures: z4.record(z4.string().min(1), fixtureEntrySchema).default({}),
283
307
  singletons: z4.array(singletonSchemaSchema).default([]),
284
- tests: z4.array(testSchema),
285
- valueSpaces: z4.array(valueSpaceSchema)
308
+ valueSpaces: z4.array(valueSpaceSchema),
309
+ workflows: z4.array(workflowSchema)
286
310
  });
287
311
  var lockfileCodec = defineCodec({ name: "ripplo-lockfile", schema: lockfileSchema });
288
312
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as Capture, S as Step, P as PredicateInput, L as Locator, B as Binding, A as AnyBinding, G as GivenItem, T as Test, a as EntityList, b as SingletonList, c as Lockfile, U as UniqueNames, d as BrowserSingleton, e as LeafPredicate, f as Primitive, F as FieldHandle, D as DeclSource, R as Row, g as Primitive$1, h as SingletonDef } from './engine-BfvzXgLg.js';
2
- export { i as AbsenceHandle, j as CLIENT_MOUNT_KEY, k as CLIENT_SEED_KEY, l as ConditionInput, m as ConditionPredicate, n as CountCondition, o as DuplicateEntityName, E as Engine, p as EngineError, q as EngineImpls, r as EngineRead, s as EntityDef, t as EntityHandle, u as EntityImpl, v as FieldOptions, w as Fields, H as Handle, x as Selection, y as SingletonConfig, z as SingletonImpl, I as SingletonValue, W as WhenClause, J as WithinMatcher, K as and, M as changed, N as count, O as createEngine, Q as disabled, V as enabled, X as entity, Y as field, Z as focused, _ as id, $ as key, a0 as not, a1 as singleton, a2 as text, a3 as v, a4 as value, a5 as visible, a6 as when, a7 as within } from './engine-BfvzXgLg.js';
1
+ import { C as Capture, S as Step, P as PredicateInput, L as Locator, B as Binding, A as AnyBinding, G as GivenItem, W as Workflow, a as EntityList, b as SingletonList, c as Lockfile, U as UniqueNames, d as BrowserSingleton, e as LeafPredicate, f as Primitive, F as FieldHandle, D as DeclSource, R as Row, g as Primitive$1, h as SingletonDef } from './engine-Dv3trweR.js';
2
+ export { i as AbsenceHandle, j as BranchInput, k as CLIENT_MOUNT_KEY, l as CLIENT_SEED_KEY, m as ConditionInput, n as ConditionPredicate, o as ConditionedBranch, p as CountCondition, q as DuplicateEntityName, E as Engine, r as EngineError, s as EngineImpls, t as EngineRead, u as EntityDef, v as EntityHandle, w as EntityImpl, x as FieldOptions, y as Fields, H as Handle, N as NamedBranch, z as Selection, I as SingletonConfig, J as SingletonImpl, K as SingletonValue, M as WithinMatcher, O as and, Q as branch, T as changed, V as count, X as createEngine, Y as disabled, Z as enabled, _ as entity, $ as field, a0 as focused, a1 as id, a2 as key, a3 as not, a4 as singleton, a5 as text, a6 as v, a7 as value, a8 as visible, a9 as when, aa as within } from './engine-Dv3trweR.js';
3
3
  import 'neverthrow';
4
4
  import 'zod';
5
5
 
@@ -20,26 +20,26 @@ declare function hover(locator: Locator): StepBuilder;
20
20
  declare function upload(locator: Locator, files: ReadonlyArray<string>): StepBuilder;
21
21
  declare function press(pressKey: string, locator?: Locator): StepBuilder;
22
22
 
23
- interface TestBody {
23
+ interface WorkflowBody {
24
24
  readonly given: ReadonlyArray<GivenItem>;
25
25
  readonly steps: ReadonlyArray<StepBuilder>;
26
26
  }
27
27
 
28
- interface RipploTest {
29
- readonly spec: Test;
28
+ interface RipploWorkflow {
29
+ readonly spec: Workflow;
30
30
  }
31
- declare function test(intent: string, fn?: () => TestBody): RipploTest;
31
+ declare function workflow(intent: string, fn?: () => WorkflowBody): RipploWorkflow;
32
32
 
33
33
  interface RipploInput<S extends EntityList, Sg extends SingletonList> {
34
34
  readonly entities: S & UniqueNames<S>;
35
35
  readonly singletons: Sg;
36
- readonly tests: ReadonlyArray<RipploTest>;
36
+ readonly workflows: ReadonlyArray<RipploWorkflow>;
37
37
  }
38
38
  interface Ripplo<S extends EntityList, Sg extends SingletonList> {
39
39
  readonly entities: S;
40
40
  readonly lockfile: Lockfile;
41
41
  readonly singletons: Sg;
42
- readonly tests: ReadonlyArray<RipploTest>;
42
+ readonly workflows: ReadonlyArray<RipploWorkflow>;
43
43
  }
44
44
  declare function createRipplo<const S extends EntityList, const Sg extends SingletonList>(input: RipploInput<S, Sg>): Ripplo<S, Sg>;
45
45
 
@@ -99,7 +99,7 @@ declare const url: BrowserSingletonDef<"url">;
99
99
  declare const title: BrowserSingletonDef<"title">;
100
100
  declare const viewport: BrowserSingletonDef<"viewport">;
101
101
 
102
- declare function arbitrary<T extends Primitive>(field: FieldHandle<T>, example?: T): Binding<T>;
102
+ declare function arbitrary<T extends Primitive>(field: FieldHandle<T>): Binding<T>;
103
103
 
104
104
  interface ClientSingletonImpl<T extends Primitive$1> {
105
105
  readonly read: () => T | null;
@@ -131,4 +131,4 @@ interface MountClientEngineOptions {
131
131
  }
132
132
  declare function mountClientEngine<R extends DeclSource>(ripplo: R, impls: ClientEngineImpls<R>, { enabled }: MountClientEngineOptions): void;
133
133
 
134
- export { AnyBinding, Binding, type BrowserSingletonDef, type ClientEngineImpls, type ClientEngineMount, type ClientEntityImpl, type ClientSingletonImpl, type ContainerLocator, EntityList, FieldHandle, GivenItem, type LocatorName, type MountClientEngineOptions, type NamedLocator, Primitive, type Ripplo, type RipploTest, SingletonDef, SingletonList, type TestBody, UniqueNames, alert, alertdialog, arbitrary, banner, button, cell, check, checkbox, clear, click, columnheader, combobox, complementary, contentinfo, createClientEngine, createRipplo, dblclick, dialog, fill, form, goto, grid, group, heading, hover, img, inside, link, list, listitem, main, menu, menuitem, mountClientEngine, navigation, option, press, progressbar, radio, radiogroup, region, role, row, searchbox, select, slider, spinbutton, status, switchControl, tab, table, tablist, tabpanel, test, testId, textbox, title, toolbar, treeitem, uncheck, upload, url, viewport };
134
+ export { AnyBinding, Binding, type BrowserSingletonDef, type ClientEngineImpls, type ClientEngineMount, type ClientEntityImpl, type ClientSingletonImpl, type ContainerLocator, EntityList, FieldHandle, GivenItem, type LocatorName, type MountClientEngineOptions, type NamedLocator, Primitive, type Ripplo, type RipploWorkflow, SingletonDef, SingletonList, UniqueNames, type WorkflowBody, alert, alertdialog, arbitrary, banner, button, cell, check, checkbox, clear, click, columnheader, combobox, complementary, contentinfo, createClientEngine, createRipplo, dblclick, dialog, fill, form, goto, grid, group, heading, hover, img, inside, link, list, listitem, main, menu, menuitem, mountClientEngine, navigation, option, press, progressbar, radio, radiogroup, region, role, row, searchbox, select, slider, spinbutton, status, switchControl, tab, table, tablist, tabpanel, testId, textbox, title, toolbar, treeitem, uncheck, upload, url, viewport, workflow };