@ripplo/testing 0.7.0 → 0.7.2

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/DSL.md CHANGED
@@ -160,19 +160,19 @@ export const renameTask = test("Rename a task"); // STUB — no body; gated unti
160
160
 
161
161
  Each returns a step; chain `.expect(...predicates)` to assert after it runs.
162
162
 
163
- | action | signature | example |
164
- | ---------- | ------------------------------ | ----------------------------------------- |
165
- | `goto` | `` goto`/path/${handle.id}` `` | `` goto`/projects/${p.id}` `` |
166
- | `click` | `click(locator)` | `click(button("Save"))` |
167
- | `dblclick` | `dblclick(locator)` | `dblclick(testId\`row-${r.id}\`)` |
168
- | `fill` | `fill(locator, value)` | `fill(textbox("Name"), "Acme")` |
169
- | `clear` | `clear(locator)` | `clear(textbox("Name"))` |
170
- | `select` | `select(locator, value)` | `select(role("combobox", "Plan"), "pro")` |
171
- | `check` | `check(locator)` | `check(role("checkbox", "Agree"))` |
172
- | `uncheck` | `uncheck(locator)` | `uncheck(role("checkbox", "Agree"))` |
173
- | `hover` | `hover(locator)` | `hover(button("More"))` |
174
- | `upload` | `upload(locator, files)` | `upload(testId\`avatar\`, ["face.png"])` |
175
- | `press` | `press(key, locator?)` | `press("Enter", textbox("Search"))` |
163
+ | action | signature | example |
164
+ | ---------- | ------------------------------ | ---------------------------------------- |
165
+ | `goto` | `` goto`/path/${handle.id}` `` | `` goto`/projects/${p.id}` `` |
166
+ | `click` | `click(locator)` | `click(button("Save"))` |
167
+ | `dblclick` | `dblclick(locator)` | `dblclick(testId\`row-${r.id}\`)` |
168
+ | `fill` | `fill(locator, value)` | `fill(textbox("Name"), "Acme")` |
169
+ | `clear` | `clear(locator)` | `clear(textbox("Name"))` |
170
+ | `select` | `select(locator, value)` | `select(combobox("Plan"), "pro")` |
171
+ | `check` | `check(locator)` | `check(checkbox("Agree"))` |
172
+ | `uncheck` | `uncheck(locator)` | `uncheck(checkbox("Agree"))` |
173
+ | `hover` | `hover(locator)` | `hover(button("More"))` |
174
+ | `upload` | `upload(locator, files)` | `upload(testId\`avatar\`, ["face.png"])` |
175
+ | `press` | `press(key, locator?)` | `press("Enter", textbox("Search"))` |
176
176
 
177
177
  `fill`/`select`/`value`/`text` accept a literal string or a `Binding<string>` (e.g. `arbitrary(...)` or a handle field). `goto`/`testId` are template literals — interpolate handle ids directly.
178
178
 
@@ -194,13 +194,15 @@ fill(textbox("Title"), title)
194
194
 
195
195
  Named locators — `(name, ...bindings)`, accessible name **required**:
196
196
 
197
- `button` `cell` `checkbox` `combobox` `dialog` `heading` `img` `link` `listitem` `menuitem` `option` `radio` `row` `searchbox` `tab` `textbox`
197
+ `alertdialog` `button` `cell` `checkbox` `columnheader` `combobox` `dialog` `heading` `img` `link` `listitem` `menuitem` `option` `radio` `row` `searchbox` `slider` `spinbutton` `switchControl` (role `switch` — `switch` is a JS keyword) `tab` `textbox` `treeitem`
198
198
 
199
199
  Container/landmark locators — `(name?, ...bindings)`, name optional (often unique per page):
200
200
 
201
- `alert` `banner` `complementary` `contentinfo` `form` `list` `main` `menu` `navigation` `region` `status` `table` `tablist`
201
+ `alert` `banner` `complementary` `contentinfo` `form` `grid` `group` `list` `main` `menu` `navigation` `progressbar` `radiogroup` `region` `status` `table` `tablist` `tabpanel` `toolbar`
202
202
 
203
- Anything else: `role("switch", name)` — every ARIA role works through `role()`.
203
+ Anything else: `role("menubar", name)` — every ARIA role works through `role()`. Prefer the named sugar above when one exists.
204
+
205
+ Radix/shadcn gotchas: toggles render role `switch` (use `switchControl`, not `checkbox`); confirm dialogs render role `alertdialog` (use `alertdialog`, not `dialog`).
204
206
 
205
207
  Names are matched **exactly** — no `contains`/regex. If the app lacks an accessible name, add one to the app rather than falling back to `testId`. Container rows/dialogs usually need an explicit `aria-label` to be scopable — add it to the app.
206
208
 
@@ -279,8 +279,6 @@ type Predicate = {
279
279
  readonly key: Record<string, WhereValue>;
280
280
  readonly kind: "state";
281
281
  readonly wait: Budget | undefined;
282
- } | {
283
- readonly kind: "jsErrors";
284
282
  } | {
285
283
  readonly kind: "not";
286
284
  readonly predicate: Predicate;
@@ -382,7 +380,6 @@ declare const testSchema: z.ZodObject<{
382
380
  }, z.core.$strip>>>;
383
381
  exclusive: z.ZodDefault<z.ZodArray<z.ZodString>>;
384
382
  intent: z.ZodString;
385
- invariants: z.ZodDefault<z.ZodArray<z.ZodType<Predicate, unknown, z.core.$ZodTypeInternals<Predicate, unknown>>>>;
386
383
  maybe: z.ZodDefault<z.ZodArray<z.ZodObject<{
387
384
  as: z.ZodString;
388
385
  entity: z.ZodString;
@@ -544,7 +541,6 @@ declare const lockfileSchema: z.ZodObject<{
544
541
  }, z.core.$strip>>>;
545
542
  exclusive: z.ZodDefault<z.ZodArray<z.ZodString>>;
546
543
  intent: z.ZodString;
547
- invariants: z.ZodDefault<z.ZodArray<z.ZodType<Predicate, unknown, z.core.$ZodTypeInternals<Predicate, unknown>>>>;
548
544
  maybe: z.ZodDefault<z.ZodArray<z.ZodObject<{
549
545
  as: z.ZodString;
550
546
  entity: z.ZodString;
package/dist/express.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Router } from 'express';
2
- import { E as Engine } from './engine-BT7hUouB.js';
2
+ import { E as Engine } from './engine-BfvzXgLg.js';
3
3
  import 'neverthrow';
4
4
  import 'zod';
5
5
 
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-BT7hUouB.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-BT7hUouB.js';
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';
3
3
  import 'neverthrow';
4
4
  import 'zod';
5
5
 
@@ -49,9 +49,11 @@ type ContainerLocator = (name?: LocatorName, ...bindings: ReadonlyArray<AnyBindi
49
49
  declare function role(roleName: string, name?: LocatorName, ...bindings: ReadonlyArray<AnyBinding>): Locator;
50
50
  declare function inside(scope: Locator, target: Locator): Locator;
51
51
  declare function testId(value: string | TemplateStringsArray, ...bindings: ReadonlyArray<AnyBinding>): Locator;
52
+ declare const alertdialog: NamedLocator;
52
53
  declare const button: NamedLocator;
53
54
  declare const cell: NamedLocator;
54
55
  declare const checkbox: NamedLocator;
56
+ declare const columnheader: NamedLocator;
55
57
  declare const combobox: NamedLocator;
56
58
  declare const dialog: NamedLocator;
57
59
  declare const heading: NamedLocator;
@@ -63,21 +65,31 @@ declare const option: NamedLocator;
63
65
  declare const radio: NamedLocator;
64
66
  declare const row: NamedLocator;
65
67
  declare const searchbox: NamedLocator;
68
+ declare const slider: NamedLocator;
69
+ declare const spinbutton: NamedLocator;
70
+ declare const switchControl: NamedLocator;
66
71
  declare const tab: NamedLocator;
67
72
  declare const textbox: NamedLocator;
73
+ declare const treeitem: NamedLocator;
68
74
  declare const alert: ContainerLocator;
69
75
  declare const banner: ContainerLocator;
70
76
  declare const complementary: ContainerLocator;
71
77
  declare const contentinfo: ContainerLocator;
72
78
  declare const form: ContainerLocator;
79
+ declare const grid: ContainerLocator;
80
+ declare const group: ContainerLocator;
73
81
  declare const list: ContainerLocator;
74
82
  declare const main: ContainerLocator;
75
83
  declare const menu: ContainerLocator;
76
84
  declare const navigation: ContainerLocator;
85
+ declare const progressbar: ContainerLocator;
86
+ declare const radiogroup: ContainerLocator;
77
87
  declare const region: ContainerLocator;
78
88
  declare const status: ContainerLocator;
79
89
  declare const table: ContainerLocator;
80
90
  declare const tablist: ContainerLocator;
91
+ declare const tabpanel: ContainerLocator;
92
+ declare const toolbar: ContainerLocator;
81
93
 
82
94
  interface BrowserSingletonDef<Name extends BrowserSingleton> {
83
95
  readonly name: Name;
@@ -119,4 +131,4 @@ interface MountClientEngineOptions {
119
131
  }
120
132
  declare function mountClientEngine<R extends DeclSource>(ripplo: R, impls: ClientEngineImpls<R>, { enabled }: MountClientEngineOptions): void;
121
133
 
122
- 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, arbitrary, banner, button, cell, check, checkbox, clear, click, combobox, complementary, contentinfo, createClientEngine, createRipplo, dblclick, dialog, fill, form, goto, heading, hover, img, inside, link, list, listitem, main, menu, menuitem, mountClientEngine, navigation, option, press, radio, region, role, row, searchbox, select, status, tab, table, tablist, test, testId, textbox, title, 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 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 };
package/dist/index.js CHANGED
@@ -412,9 +412,11 @@ function testId(value2, ...bindings) {
412
412
  }
413
413
  return { by: "testId", value: stringValueFromTemplate(value2, bindings) };
414
414
  }
415
+ var alertdialog = named("alertdialog");
415
416
  var button = named("button");
416
417
  var cell = named("cell");
417
418
  var checkbox = named("checkbox");
419
+ var columnheader = named("columnheader");
418
420
  var combobox = named("combobox");
419
421
  var dialog = named("dialog");
420
422
  var heading = named("heading");
@@ -426,21 +428,31 @@ var option = named("option");
426
428
  var radio = named("radio");
427
429
  var row = named("row");
428
430
  var searchbox = named("searchbox");
431
+ var slider = named("slider");
432
+ var spinbutton = named("spinbutton");
433
+ var switchControl = named("switch");
429
434
  var tab = named("tab");
430
435
  var textbox = named("textbox");
436
+ var treeitem = named("treeitem");
431
437
  var alert = container("alert");
432
438
  var banner = container("banner");
433
439
  var complementary = container("complementary");
434
440
  var contentinfo = container("contentinfo");
435
441
  var form = container("form");
442
+ var grid = container("grid");
443
+ var group = container("group");
436
444
  var list = container("list");
437
445
  var main = container("main");
438
446
  var menu = container("menu");
439
447
  var navigation = container("navigation");
448
+ var progressbar = container("progressbar");
449
+ var radiogroup = container("radiogroup");
440
450
  var region = container("region");
441
451
  var status = container("status");
442
452
  var table = container("table");
443
453
  var tablist = container("tablist");
454
+ var tabpanel = container("tabpanel");
455
+ var toolbar = container("toolbar");
444
456
  function named(roleName) {
445
457
  return (name, ...bindings) => role(roleName, name, ...bindings);
446
458
  }
@@ -1711,6 +1723,7 @@ export {
1711
1723
  CLIENT_MOUNT_KEY,
1712
1724
  CLIENT_SEED_KEY,
1713
1725
  alert,
1726
+ alertdialog,
1714
1727
  and,
1715
1728
  arbitrary,
1716
1729
  banner,
@@ -1721,6 +1734,7 @@ export {
1721
1734
  checkbox,
1722
1735
  clear,
1723
1736
  click,
1737
+ columnheader,
1724
1738
  combobox,
1725
1739
  complementary,
1726
1740
  contentinfo,
@@ -1738,6 +1752,8 @@ export {
1738
1752
  focused,
1739
1753
  form,
1740
1754
  goto,
1755
+ grid,
1756
+ group,
1741
1757
  heading,
1742
1758
  hover,
1743
1759
  id,
@@ -1755,22 +1771,30 @@ export {
1755
1771
  not,
1756
1772
  option,
1757
1773
  press,
1774
+ progressbar,
1758
1775
  radio,
1776
+ radiogroup,
1759
1777
  region,
1760
1778
  role,
1761
1779
  row,
1762
1780
  searchbox,
1763
1781
  select,
1764
1782
  singleton,
1783
+ slider,
1784
+ spinbutton,
1765
1785
  status,
1786
+ switchControl,
1766
1787
  tab,
1767
1788
  table,
1768
1789
  tablist,
1790
+ tabpanel,
1769
1791
  test,
1770
1792
  testId,
1771
1793
  text,
1772
1794
  textbox,
1773
1795
  title,
1796
+ toolbar,
1797
+ treeitem,
1774
1798
  uncheck,
1775
1799
  upload,
1776
1800
  url,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ripplo/testing",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "Typed test DSL for Ripplo — declare entities and user flows, compile to a lockfile",
5
5
  "homepage": "https://ripplo.ai",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -43,8 +43,8 @@
43
43
  "tsup": "^8.5.1",
44
44
  "typescript": "^5.9.3",
45
45
  "vitest": "^4.1.4",
46
- "@ripplo/eslint-config": "0.0.0",
47
- "@ripplo/spec": "^0.0.0"
46
+ "@ripplo/spec": "^0.0.0",
47
+ "@ripplo/eslint-config": "0.0.0"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "tsup",