@ripplo/testing 0.6.1 → 0.7.0

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.
Files changed (44) hide show
  1. package/DSL.md +355 -0
  2. package/LICENSE.md +1 -0
  3. package/README.md +47 -273
  4. package/dist/engine-BT7hUouB.d.ts +1095 -0
  5. package/dist/express.d.ts +7 -9
  6. package/dist/express.js +422 -48
  7. package/dist/index.d.ts +122 -59
  8. package/dist/index.js +1630 -1126
  9. package/package.json +31 -113
  10. package/dist/actions.d.ts +0 -260
  11. package/dist/actions.js +0 -177
  12. package/dist/assert.d.ts +0 -188
  13. package/dist/assert.js +0 -111
  14. package/dist/builder-SsgqYqSC.d.ts +0 -156
  15. package/dist/chunk-2YLI7VD4.js +0 -65
  16. package/dist/chunk-4MGIQFAJ.js +0 -16
  17. package/dist/chunk-DCJBLS2U.js +0 -26
  18. package/dist/chunk-MGATMMCZ.js +0 -16
  19. package/dist/chunk-XO36IU66.js +0 -88
  20. package/dist/chunk-YFOTJIVF.js +0 -134
  21. package/dist/chunk-YQAEOH5W.js +0 -111
  22. package/dist/compiler.d.ts +0 -32
  23. package/dist/compiler.js +0 -8
  24. package/dist/control.d.ts +0 -45
  25. package/dist/control.js +0 -17
  26. package/dist/elysia.d.ts +0 -78
  27. package/dist/elysia.js +0 -114
  28. package/dist/engine-BOqzK_go.d.ts +0 -61
  29. package/dist/fastify.d.ts +0 -14
  30. package/dist/fastify.js +0 -79
  31. package/dist/hono.d.ts +0 -19
  32. package/dist/hono.js +0 -89
  33. package/dist/koa.d.ts +0 -14
  34. package/dist/koa.js +0 -135
  35. package/dist/locators.d.ts +0 -40
  36. package/dist/locators.js +0 -11
  37. package/dist/lockfile.d.ts +0 -722
  38. package/dist/lockfile.js +0 -707
  39. package/dist/nestjs.d.ts +0 -17
  40. package/dist/nestjs.js +0 -139
  41. package/dist/nextjs.d.ts +0 -14
  42. package/dist/nextjs.js +0 -137
  43. package/dist/step-De52hTLd.d.ts +0 -19
  44. package/dist/types-BzZrl65Z.d.ts +0 -115
package/dist/index.d.ts CHANGED
@@ -1,59 +1,122 @@
1
- export { C as CoverageRegistry, O as ObserverImplFn, a as ObserverRegistry, P as PreconditionImpl, b as PreconditionRecord, c as PreconditionRegistry, d as PreconditionSetupItem, e as PreconditionTeardownItem, R as ResolveDeps, f as RipploBuilder, g as RipploInstance, h as RipploRegistries, i as createRipplo, o as observer, p as precondition, t as test } from './builder-SsgqYqSC.js';
2
- import { CompileResult } from './compiler.js';
3
- export { CompiledTest, compile } from './compiler.js';
4
- import { E as EngineRunResult, T as TeardownRunResult$1 } from './engine-BOqzK_go.js';
5
- export { a as EngineImpls, b as ExecuteBatchItem, c as ExecuteBatchOptions, N as NotImplemented, O as ObserverImplFnFor, P as PreconditionImplFor, R as RipploEngine, d as TEST_ID_PREFIX, e as TeardownBatchItem, f as createEngine, n as notImplemented } from './engine-BOqzK_go.js';
6
- import { C as CookieEntry } from './types-BzZrl65Z.js';
7
- export { c as CookieOptions, D as DEFAULT_IGNORE_PATHS, d as DEFAULT_WATCH_PATHS, e as ObserverContext, f as ObserverDefinition, O as ObserverHandle, a as ObserverInput, g as ObserverOutcome, h as Precondition, i as PreconditionDeps, P as Primitive, S as SetupContext, T as TeardownContext, j as TestDefinition, k as TestValue } from './types-BzZrl65Z.js';
8
- export { D as DslNodeInput } from './step-De52hTLd.js';
9
- import '@ripplo/spec';
10
-
11
- interface LintDiagnostic {
12
- readonly message: string;
13
- readonly rule: string;
14
- readonly step: string | undefined;
15
- readonly test: string;
16
- }
17
- interface LintResult {
18
- readonly diagnostics: ReadonlyArray<LintDiagnostic>;
19
- }
20
- declare function lint(result: CompileResult): LintResult;
21
-
22
- declare function readAdapterWebhookSecret(): string;
23
- interface SerializedCookie {
24
- readonly domain: string | undefined;
25
- readonly expires: number | undefined;
26
- readonly httpOnly: boolean | undefined;
27
- readonly name: string;
28
- readonly path: string | undefined;
29
- readonly sameSite: "lax" | "none" | "strict" | undefined;
30
- readonly secure: boolean | undefined;
31
- readonly value: string;
32
- }
33
- type BatchRunResult = {
34
- readonly cookies: ReadonlyArray<SerializedCookie>;
35
- readonly data: Record<string, Record<string, string | number | boolean>>;
36
- readonly executed: ReadonlyArray<string>;
37
- readonly ok: true;
38
- readonly runId: string;
39
- } | {
40
- readonly error: string;
41
- readonly ok: false;
42
- readonly runId: string;
43
- };
44
- type TeardownRunResult = {
45
- readonly error: string | undefined;
46
- readonly ok: boolean;
47
- readonly runId: string;
48
- };
49
- interface WebhookHeaders {
50
- readonly "webhook-id": string | undefined;
51
- readonly "webhook-signature": string | undefined;
52
- readonly "webhook-timestamp": string | undefined;
53
- }
54
- declare function verifyWebhookSignature(payload: string, headers: WebhookHeaders, secret: string): boolean;
55
- declare function serializeCookie(cookie: CookieEntry): SerializedCookie;
56
- declare function toBatchRunResults(results: ReadonlyArray<EngineRunResult>): ReadonlyArray<BatchRunResult>;
57
- declare function toTeardownResults(results: ReadonlyArray<TeardownRunResult$1>): ReadonlyArray<TeardownRunResult>;
58
-
59
- export { CompileResult, CookieEntry, EngineRunResult, type LintDiagnostic, type LintResult, type SerializedCookie, TeardownRunResult$1 as TeardownRunResult, lint, readAdapterWebhookSecret, serializeCookie, toBatchRunResults, toTeardownResults, verifyWebhookSignature };
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';
3
+ import 'neverthrow';
4
+ import 'zod';
5
+
6
+ interface StepBuilder {
7
+ readonly captures: ReadonlyArray<Capture>;
8
+ readonly step: Step;
9
+ readonly expect: (...predicates: ReadonlyArray<PredicateInput>) => StepBuilder;
10
+ }
11
+ declare function goto(strings: TemplateStringsArray, ...values: readonly AnyBinding[]): StepBuilder;
12
+ declare function click(locator: Locator): StepBuilder;
13
+ declare function dblclick(locator: Locator): StepBuilder;
14
+ declare function fill(locator: Locator, binding: Binding<string> | string): StepBuilder;
15
+ declare function clear(locator: Locator): StepBuilder;
16
+ declare function select(locator: Locator, binding: Binding<string> | string): StepBuilder;
17
+ declare function check(locator: Locator): StepBuilder;
18
+ declare function uncheck(locator: Locator): StepBuilder;
19
+ declare function hover(locator: Locator): StepBuilder;
20
+ declare function upload(locator: Locator, files: ReadonlyArray<string>): StepBuilder;
21
+ declare function press(pressKey: string, locator?: Locator): StepBuilder;
22
+
23
+ interface TestBody {
24
+ readonly given: ReadonlyArray<GivenItem>;
25
+ readonly steps: ReadonlyArray<StepBuilder>;
26
+ }
27
+
28
+ interface RipploTest {
29
+ readonly spec: Test;
30
+ }
31
+ declare function test(intent: string, fn?: () => TestBody): RipploTest;
32
+
33
+ interface RipploInput<S extends EntityList, Sg extends SingletonList> {
34
+ readonly entities: S & UniqueNames<S>;
35
+ readonly singletons: Sg;
36
+ readonly tests: ReadonlyArray<RipploTest>;
37
+ }
38
+ interface Ripplo<S extends EntityList, Sg extends SingletonList> {
39
+ readonly entities: S;
40
+ readonly lockfile: Lockfile;
41
+ readonly singletons: Sg;
42
+ readonly tests: ReadonlyArray<RipploTest>;
43
+ }
44
+ declare function createRipplo<const S extends EntityList, const Sg extends SingletonList>(input: RipploInput<S, Sg>): Ripplo<S, Sg>;
45
+
46
+ type LocatorName = string | Binding<string> | TemplateStringsArray;
47
+ type NamedLocator = (name: LocatorName, ...bindings: ReadonlyArray<AnyBinding>) => Locator;
48
+ type ContainerLocator = (name?: LocatorName, ...bindings: ReadonlyArray<AnyBinding>) => Locator;
49
+ declare function role(roleName: string, name?: LocatorName, ...bindings: ReadonlyArray<AnyBinding>): Locator;
50
+ declare function inside(scope: Locator, target: Locator): Locator;
51
+ declare function testId(value: string | TemplateStringsArray, ...bindings: ReadonlyArray<AnyBinding>): Locator;
52
+ declare const button: NamedLocator;
53
+ declare const cell: NamedLocator;
54
+ declare const checkbox: NamedLocator;
55
+ declare const combobox: NamedLocator;
56
+ declare const dialog: NamedLocator;
57
+ declare const heading: NamedLocator;
58
+ declare const img: NamedLocator;
59
+ declare const link: NamedLocator;
60
+ declare const listitem: NamedLocator;
61
+ declare const menuitem: NamedLocator;
62
+ declare const option: NamedLocator;
63
+ declare const radio: NamedLocator;
64
+ declare const row: NamedLocator;
65
+ declare const searchbox: NamedLocator;
66
+ declare const tab: NamedLocator;
67
+ declare const textbox: NamedLocator;
68
+ declare const alert: ContainerLocator;
69
+ declare const banner: ContainerLocator;
70
+ declare const complementary: ContainerLocator;
71
+ declare const contentinfo: ContainerLocator;
72
+ declare const form: ContainerLocator;
73
+ declare const list: ContainerLocator;
74
+ declare const main: ContainerLocator;
75
+ declare const menu: ContainerLocator;
76
+ declare const navigation: ContainerLocator;
77
+ declare const region: ContainerLocator;
78
+ declare const status: ContainerLocator;
79
+ declare const table: ContainerLocator;
80
+ declare const tablist: ContainerLocator;
81
+
82
+ interface BrowserSingletonDef<Name extends BrowserSingleton> {
83
+ readonly name: Name;
84
+ readonly is: (strings: TemplateStringsArray, ...values: readonly Binding<string>[]) => LeafPredicate;
85
+ }
86
+ declare const url: BrowserSingletonDef<"url">;
87
+ declare const title: BrowserSingletonDef<"title">;
88
+ declare const viewport: BrowserSingletonDef<"viewport">;
89
+
90
+ declare function arbitrary<T extends Primitive>(field: FieldHandle<T>, example?: T): Binding<T>;
91
+
92
+ interface ClientSingletonImpl<T extends Primitive$1> {
93
+ readonly read: () => T | null;
94
+ readonly seed: (value: T) => void;
95
+ }
96
+ interface ClientEntityImpl {
97
+ readonly read: () => ReadonlyArray<Row>;
98
+ }
99
+ type ValueOf<D> = D extends SingletonDef<string, infer T> ? T : Primitive$1;
100
+ interface ClientEngineImpls<R extends DeclSource> {
101
+ readonly entities: {
102
+ readonly [D in Extract<R["entities"][number], {
103
+ readonly source: "client";
104
+ }> as D["name"]]: ClientEntityImpl;
105
+ };
106
+ readonly singletons: {
107
+ readonly [D in Extract<R["singletons"][number], {
108
+ readonly source: "client";
109
+ }> as D["name"]]: ClientSingletonImpl<ValueOf<D>>;
110
+ };
111
+ }
112
+ interface ClientEngineMount {
113
+ readonly readEntity: (name: string) => ReadonlyArray<Row>;
114
+ readonly readSingleton: (name: string) => Primitive$1 | null;
115
+ }
116
+ declare function createClientEngine<R extends DeclSource>(_ripplo: R, impls: ClientEngineImpls<R>): ClientEngineMount;
117
+ interface MountClientEngineOptions {
118
+ readonly enabled: boolean;
119
+ }
120
+ declare function mountClientEngine<R extends DeclSource>(ripplo: R, impls: ClientEngineImpls<R>, { enabled }: MountClientEngineOptions): void;
121
+
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 };