@bubblegum-ai/node 0.0.6-alpha.1 → 0.0.6-alpha.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/README.md +26 -4
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/session.d.ts +133 -0
- package/dist/cjs/session.d.ts.map +1 -1
- package/dist/cjs/session.js +124 -0
- package/dist/cjs/session.js.map +1 -1
- package/dist/cjs/types.d.ts +8 -1
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/session.d.ts +133 -0
- package/dist/esm/session.d.ts.map +1 -1
- package/dist/esm/session.js +124 -0
- package/dist/esm/session.js.map +1 -1
- package/dist/esm/types.d.ts +8 -1
- package/dist/esm/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -63,24 +63,46 @@ const r = await bg.recover({ failedSelector: "#login-btn", intent: "Click Login"
|
|
|
63
63
|
// r.status === "recovered" when Bubblegum healed it
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
###
|
|
66
|
+
### Dynamic-value tokens (dates/times + uniqueness)
|
|
67
67
|
|
|
68
|
-
For
|
|
69
|
-
|
|
68
|
+
For any field that needs a value computed at run time, drop a `{{ ... }}` token
|
|
69
|
+
into the step value instead of a literal that goes stale or collides.
|
|
70
|
+
|
|
71
|
+
**Relative dates/times** — date pickers and any date field:
|
|
70
72
|
|
|
71
73
|
```ts
|
|
72
|
-
// Relative date in the app's display format:
|
|
73
74
|
await bg.act('Enter "{{today+7d|%d/%m/%Y}}" into Start date'); // -> 23/06/2026
|
|
74
75
|
await bg.act('Enter "{{now+2h|%d/%m/%Y %H:%M}}" into Appointment'); // -> 16/06/2026 04:00
|
|
75
76
|
await bg.act('Enter "{{tomorrow|%d/%m/%Y}}" into End date');
|
|
77
|
+
await bg.act('Enter "{{today+2d@07:00|%d/%m/%Y %H:%M}}" into Start'); // -> 05/07/2026 07:00
|
|
76
78
|
```
|
|
77
79
|
|
|
78
80
|
- **Bases:** `today`, `now`, `tomorrow`, `yesterday`.
|
|
79
81
|
- **Offsets (chainable, signed):** `+7d` `-3d` `+2w` `+1mo` `-1y` `+2h` `+30min` `+45s`
|
|
80
82
|
(`mo` = months, `min` = minutes — spelled out so a bare `m` is never ambiguous).
|
|
83
|
+
- **Absolute time (`@`, after offsets):** `@07:00` `@7am` `@9:30pm` `@23:59` `@07:00:00`
|
|
84
|
+
— pins a specific clock time (e.g. "2 days out at 7am"). With `@` and no `|`
|
|
85
|
+
format, output defaults to `%Y-%m-%d %H:%M`.
|
|
81
86
|
- **Format:** anything after `|` is a `strftime` pattern. Defaults are
|
|
82
87
|
`%Y-%m-%d` for date bases and `%Y-%m-%d %H:%M` for `now`.
|
|
83
88
|
|
|
89
|
+
**Uniqueness** — for a field whose value must differ on every run (a badge
|
|
90
|
+
name, an email, any create-form field with a unique constraint):
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
await bg.act('Enter "Badge_{{timestamp}}" into Display Name'); // -> Badge_1751558400
|
|
94
|
+
await bg.act('Enter "Badge_{{timestamp|%Y%m%d%H%M%S}}" into Display Name'); // -> Badge_20260703153012
|
|
95
|
+
await bg.act('Enter "user_{{uuid:8}}@test.com" into Email'); // -> user_3f9a1c02@test.com
|
|
96
|
+
await bg.act('Enter "SKU-{{random:6}}" into Code'); // -> SKU-402913
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
- **`timestamp`** — Unix epoch **seconds**; `:ms` for milliseconds (tighter
|
|
100
|
+
uniqueness in fast loops), or a `|` `strftime` for a readable stamp such as
|
|
101
|
+
`{{timestamp|%Y%m%d%H%M%S}}`.
|
|
102
|
+
- **`uuid`** — a random UUID hex string (32 chars); `:N` keeps the first `N`
|
|
103
|
+
chars, e.g. `{{uuid:8}}`. Unique regardless of the clock.
|
|
104
|
+
- **`random`** — a run of random digits, default 6; `:N` for `N` digits.
|
|
105
|
+
|
|
84
106
|
Token-free values (and any `{{...}}` that isn't a recognised expression) are
|
|
85
107
|
passed through unchanged, so existing literal steps are unaffected. Expansion
|
|
86
108
|
happens engine-side, so it works identically for web, mobile, and CDP attach.
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* a thin, typed proxy. See ../../docs/distribution-npm-and-pypi.md.
|
|
8
8
|
*/
|
|
9
9
|
export { Bubblegum } from "./session.js";
|
|
10
|
-
export type { Channel, LaunchOptions, AttachOptions, RecoverArgs } from "./session.js";
|
|
10
|
+
export type { Channel, LaunchOptions, AttachOptions, MobileAttachOptions, RecoverArgs } from "./session.js";
|
|
11
11
|
export { BridgeClient, spawnBridgeTransport } from "./client.js";
|
|
12
12
|
export type { Transport, SpawnOptions, BridgeClientOptions } from "./client.js";
|
|
13
13
|
export { BridgeError } from "./errors.js";
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE5G,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACjE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEhF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhE,YAAY,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,SAAS,EACT,cAAc,EACd,WAAW,EACX,aAAa,EACb,YAAY,GACb,MAAM,YAAY,CAAC"}
|
package/dist/cjs/session.d.ts
CHANGED
|
@@ -23,11 +23,64 @@ export interface LaunchOptions extends BridgeClientOptions {
|
|
|
23
23
|
cdpEndpoint?: string;
|
|
24
24
|
/** Which existing page to attach to when using `cdpEndpoint` (default 0). */
|
|
25
25
|
pageIndex?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Mobile client-owned mode: attach the engine to an Appium session another
|
|
28
|
+
* test already created, by its session id (e.g. WebdriverIO's
|
|
29
|
+
* `browser.sessionId`). Cloud device farms allow only one session per device,
|
|
30
|
+
* so an in-test fallback must reuse the running session rather than open a
|
|
31
|
+
* new one. The engine reuses it and never quits it. Requires the engine to
|
|
32
|
+
* advertise the `channel.mobile.attach` capability.
|
|
33
|
+
*/
|
|
34
|
+
existingSessionId?: string;
|
|
26
35
|
}
|
|
27
36
|
/** Options for {@link Bubblegum.attach} — `cdpEndpoint` is required. */
|
|
28
37
|
export interface AttachOptions extends Omit<LaunchOptions, "channel"> {
|
|
29
38
|
cdpEndpoint: string;
|
|
30
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Options for {@link Bubblegum.attachMobile} — attach to an Appium session your
|
|
42
|
+
* test already drives. `appiumUrl` + `existingSessionId` are required.
|
|
43
|
+
*/
|
|
44
|
+
export interface MobileAttachOptions extends Omit<LaunchOptions, "channel" | "cdpEndpoint" | "pageIndex"> {
|
|
45
|
+
appiumUrl: string;
|
|
46
|
+
existingSessionId: string;
|
|
47
|
+
}
|
|
48
|
+
/** One step's outcome from {@link Bubblegum.preflight}. */
|
|
49
|
+
export interface PreflightResult {
|
|
50
|
+
instruction: string;
|
|
51
|
+
/** Engine status: "dry_run" when it resolved, "failed" when it didn't. */
|
|
52
|
+
status: StepResult["status"];
|
|
53
|
+
/** True when the step resolved to a target (dry_run / passed / recovered). */
|
|
54
|
+
ok: boolean;
|
|
55
|
+
confidence: number;
|
|
56
|
+
resolver: string | null;
|
|
57
|
+
ref: string | null;
|
|
58
|
+
error: string | null;
|
|
59
|
+
}
|
|
60
|
+
/** Arguments for {@link Bubblegum.clickInTable}. */
|
|
61
|
+
export interface TableCellTarget {
|
|
62
|
+
/** Column header that identifies the cell. */
|
|
63
|
+
column: string;
|
|
64
|
+
/** Row selector: 1-based index, -1 = last, or a word like "first" / "last". */
|
|
65
|
+
row?: number | string;
|
|
66
|
+
/** Locate the row by another column's value instead of an index (e.g. a DB key). */
|
|
67
|
+
rowMatch?: Record<string, string>;
|
|
68
|
+
/** Per-call timeout. */
|
|
69
|
+
timeoutMs?: number;
|
|
70
|
+
}
|
|
71
|
+
/** Arguments for {@link Bubblegum.verifyTable}. */
|
|
72
|
+
export interface TableAssertion {
|
|
73
|
+
/** Column headers that must all be present. */
|
|
74
|
+
columns?: string[];
|
|
75
|
+
/** Column -> value used to locate the row(s) (e.g. a key sourced from a DB). */
|
|
76
|
+
row?: Record<string, string>;
|
|
77
|
+
/** Column -> expected value asserted in the matched row(s). */
|
|
78
|
+
cell?: Record<string, string>;
|
|
79
|
+
/** Optional human-readable step label for the report. */
|
|
80
|
+
description?: string;
|
|
81
|
+
/** Per-call timeout; the assertion polls the table until it holds or this elapses. */
|
|
82
|
+
timeoutMs?: number;
|
|
83
|
+
}
|
|
31
84
|
export interface RecoverArgs {
|
|
32
85
|
failedSelector: string;
|
|
33
86
|
intent: string;
|
|
@@ -68,11 +121,91 @@ export declare class Bubblegum {
|
|
|
68
121
|
* ```
|
|
69
122
|
*/
|
|
70
123
|
static attach(opts: AttachOptions): Promise<Bubblegum>;
|
|
124
|
+
/**
|
|
125
|
+
* Attach the engine to a mobile (Appium) session your test already drives,
|
|
126
|
+
* by its session id. Cloud device farms (pCloudy, BrowserStack, …) allow only
|
|
127
|
+
* one Appium session per device, so an in-test Bubblegum fallback must reuse
|
|
128
|
+
* the running session instead of opening a new one. The engine shares the
|
|
129
|
+
* session and never quits it — your test keeps ownership of teardown.
|
|
130
|
+
*
|
|
131
|
+
* ```ts
|
|
132
|
+
* // Inside a WebdriverIO test, when a normal locator click fails:
|
|
133
|
+
* const bg = await Bubblegum.attachMobile({
|
|
134
|
+
* appiumUrl: "https://ship-hats.pcloudy.com/appiumcloud/wd/hub",
|
|
135
|
+
* existingSessionId: browser.sessionId,
|
|
136
|
+
* capabilities: { platformName: "iOS" },
|
|
137
|
+
* });
|
|
138
|
+
* try {
|
|
139
|
+
* await bg.act("Tap View daily summary");
|
|
140
|
+
* } finally {
|
|
141
|
+
* await bg.close(); // closes the engine wrapper only; device session stays up
|
|
142
|
+
* }
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
static attachMobile(opts: MobileAttachOptions): Promise<Bubblegum>;
|
|
71
146
|
/** The bridge client (for advanced use / capability checks). */
|
|
72
147
|
get bridge(): BridgeClient;
|
|
73
148
|
act(instruction: string, options?: StepOptions): Promise<StepResult>;
|
|
149
|
+
/**
|
|
150
|
+
* Dry-run a list of steps against the *current* page and report whether each
|
|
151
|
+
* one resolves — without executing anything. Lets you validate a script (or a
|
|
152
|
+
* page's worth of steps) in one batch instead of discovering failures one run
|
|
153
|
+
* at a time.
|
|
154
|
+
*
|
|
155
|
+
* Because nothing executes, steps are all checked against the page as it is
|
|
156
|
+
* now (no navigation between them) — so call it once per page (e.g. after
|
|
157
|
+
* landing on each screen) with that screen's steps.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* const report = await bg.preflight([
|
|
161
|
+
* 'Select "Active" from the Participant status dropdown',
|
|
162
|
+
* 'Select "Change of mind" from the Reason dropdown',
|
|
163
|
+
* 'Click the Submit button',
|
|
164
|
+
* ]);
|
|
165
|
+
* console.table(report); // see status / confidence / resolver per step
|
|
166
|
+
* if (report.some(r => !r.ok)) throw new Error("preflight found unresolved steps");
|
|
167
|
+
*/
|
|
168
|
+
preflight(steps: Array<string | {
|
|
169
|
+
instruction: string;
|
|
170
|
+
options?: StepOptions;
|
|
171
|
+
}>, options?: StepOptions): Promise<PreflightResult[]>;
|
|
74
172
|
verify(instruction: string, options?: StepOptions): Promise<StepResult>;
|
|
75
173
|
extract(instruction: string, options?: StepOptions): Promise<StepResult>;
|
|
174
|
+
/**
|
|
175
|
+
* Click an element inside a table cell, addressed by column + row.
|
|
176
|
+
*
|
|
177
|
+
* The cell's clickable child (a link / button) is clicked when present — ideal
|
|
178
|
+
* when the visible text is dynamic (a UUID, a DB id) and so can't be named.
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* await bg.clickInTable({ column: "PPHID", row: "first" });
|
|
182
|
+
* await bg.clickInTable({ column: "PPHID", rowMatch: { Name: dbName } });
|
|
183
|
+
*/
|
|
184
|
+
clickInTable(spec: TableCellTarget): Promise<StepResult>;
|
|
185
|
+
/**
|
|
186
|
+
* Click a link by its text (exact, then case-insensitive, then substring).
|
|
187
|
+
* Handy when the link label is a dynamic value pulled from a DB.
|
|
188
|
+
*/
|
|
189
|
+
clickLink(text: string, options?: {
|
|
190
|
+
exact?: boolean;
|
|
191
|
+
timeoutMs?: number;
|
|
192
|
+
}): Promise<StepResult>;
|
|
193
|
+
/**
|
|
194
|
+
* Assert columns / cell values in a data table (Ant Design / native / ARIA).
|
|
195
|
+
*
|
|
196
|
+
* - `columns`: header names that must all be present.
|
|
197
|
+
* - `row`: column -> value used to locate the row(s) (e.g. a key from your DB).
|
|
198
|
+
* - `cell`: column -> expected value asserted in the matched row(s).
|
|
199
|
+
*
|
|
200
|
+
* At least one of `columns` / `cell` should be provided. Matching is
|
|
201
|
+
* whitespace-normalised, case-insensitive, and tolerates a value rendered
|
|
202
|
+
* inside a badge (expected is matched as a substring of the cell).
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* await bg.verifyTable({ columns: ["PPHID", "Account Status", "Profile Status"] });
|
|
206
|
+
* await bg.verifyTable({ row: { Name: dbName }, cell: { "Account Status": dbStatus } });
|
|
207
|
+
*/
|
|
208
|
+
verifyTable(spec: TableAssertion): Promise<StepResult>;
|
|
76
209
|
recover(args: RecoverArgs): Promise<StepResult>;
|
|
77
210
|
isVisible(target: string): Promise<boolean>;
|
|
78
211
|
isChecked(target: string): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGhE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAElG,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEvC,MAAM,WAAW,aAAc,SAAQ,mBAAmB;IACxD,mCAAmC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8BAA8B;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oCAAoC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/session.ts"],"names":[],"mappings":"AAAA,OA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M,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAQ3C,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQ9C,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQnD,OAAO,IAAI,OAAO,CAAC,cAAc,CAAC;IAIlC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IA2BlD,iEAAiE;IAC3D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAO7B"}
|
package/dist/cjs/session.js
CHANGED
|
@@ -36,6 +36,10 @@ class Bubblegum {
|
|
|
36
36
|
if (opts.cdpEndpoint && !client.hasCapability("channel.web.cdp")) {
|
|
37
37
|
throw new errors_js_1.BridgeError(protocol_js_1.ErrorCodes.Unsupported, "this engine does not support CDP attach (channel.web.cdp); upgrade bubblegum-ai");
|
|
38
38
|
}
|
|
39
|
+
if (opts.existingSessionId && !client.hasCapability("channel.mobile.attach")) {
|
|
40
|
+
throw new errors_js_1.BridgeError(protocol_js_1.ErrorCodes.Unsupported, "this engine does not support attaching to an existing Appium session " +
|
|
41
|
+
"(channel.mobile.attach); upgrade bubblegum-ai");
|
|
42
|
+
}
|
|
39
43
|
const { session_id } = await client.request("session.open", {
|
|
40
44
|
channel: opts.channel ?? "web",
|
|
41
45
|
url: opts.url,
|
|
@@ -45,6 +49,7 @@ class Bubblegum {
|
|
|
45
49
|
capabilities: opts.capabilities,
|
|
46
50
|
cdp_endpoint: opts.cdpEndpoint,
|
|
47
51
|
page_index: opts.pageIndex,
|
|
52
|
+
existing_session_id: opts.existingSessionId,
|
|
48
53
|
});
|
|
49
54
|
return new Bubblegum(client, session_id);
|
|
50
55
|
}
|
|
@@ -67,6 +72,30 @@ class Bubblegum {
|
|
|
67
72
|
static attach(opts) {
|
|
68
73
|
return Bubblegum.launch({ ...opts, channel: "web" });
|
|
69
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Attach the engine to a mobile (Appium) session your test already drives,
|
|
77
|
+
* by its session id. Cloud device farms (pCloudy, BrowserStack, …) allow only
|
|
78
|
+
* one Appium session per device, so an in-test Bubblegum fallback must reuse
|
|
79
|
+
* the running session instead of opening a new one. The engine shares the
|
|
80
|
+
* session and never quits it — your test keeps ownership of teardown.
|
|
81
|
+
*
|
|
82
|
+
* ```ts
|
|
83
|
+
* // Inside a WebdriverIO test, when a normal locator click fails:
|
|
84
|
+
* const bg = await Bubblegum.attachMobile({
|
|
85
|
+
* appiumUrl: "https://ship-hats.pcloudy.com/appiumcloud/wd/hub",
|
|
86
|
+
* existingSessionId: browser.sessionId,
|
|
87
|
+
* capabilities: { platformName: "iOS" },
|
|
88
|
+
* });
|
|
89
|
+
* try {
|
|
90
|
+
* await bg.act("Tap View daily summary");
|
|
91
|
+
* } finally {
|
|
92
|
+
* await bg.close(); // closes the engine wrapper only; device session stays up
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
static attachMobile(opts) {
|
|
97
|
+
return Bubblegum.launch({ ...opts, channel: "mobile" });
|
|
98
|
+
}
|
|
70
99
|
/** The bridge client (for advanced use / capability checks). */
|
|
71
100
|
get bridge() {
|
|
72
101
|
return this.client;
|
|
@@ -78,6 +107,43 @@ class Bubblegum {
|
|
|
78
107
|
options,
|
|
79
108
|
});
|
|
80
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* Dry-run a list of steps against the *current* page and report whether each
|
|
112
|
+
* one resolves — without executing anything. Lets you validate a script (or a
|
|
113
|
+
* page's worth of steps) in one batch instead of discovering failures one run
|
|
114
|
+
* at a time.
|
|
115
|
+
*
|
|
116
|
+
* Because nothing executes, steps are all checked against the page as it is
|
|
117
|
+
* now (no navigation between them) — so call it once per page (e.g. after
|
|
118
|
+
* landing on each screen) with that screen's steps.
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* const report = await bg.preflight([
|
|
122
|
+
* 'Select "Active" from the Participant status dropdown',
|
|
123
|
+
* 'Select "Change of mind" from the Reason dropdown',
|
|
124
|
+
* 'Click the Submit button',
|
|
125
|
+
* ]);
|
|
126
|
+
* console.table(report); // see status / confidence / resolver per step
|
|
127
|
+
* if (report.some(r => !r.ok)) throw new Error("preflight found unresolved steps");
|
|
128
|
+
*/
|
|
129
|
+
async preflight(steps, options) {
|
|
130
|
+
const out = [];
|
|
131
|
+
for (const step of steps) {
|
|
132
|
+
const instruction = typeof step === "string" ? step : step.instruction;
|
|
133
|
+
const perStep = typeof step === "string" ? undefined : step.options;
|
|
134
|
+
const r = await this.act(instruction, { ...options, ...perStep, dry_run: true });
|
|
135
|
+
out.push({
|
|
136
|
+
instruction,
|
|
137
|
+
status: r.status,
|
|
138
|
+
ok: r.status === "dry_run" || r.status === "passed" || r.status === "recovered",
|
|
139
|
+
confidence: r.confidence,
|
|
140
|
+
resolver: r.target?.resolver_name ?? null,
|
|
141
|
+
ref: r.target?.ref ?? null,
|
|
142
|
+
error: r.error?.message ?? null,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return out;
|
|
146
|
+
}
|
|
81
147
|
verify(instruction, options) {
|
|
82
148
|
return this.client.request("verify", {
|
|
83
149
|
session_id: this.sessionId,
|
|
@@ -92,6 +158,61 @@ class Bubblegum {
|
|
|
92
158
|
options,
|
|
93
159
|
});
|
|
94
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* Click an element inside a table cell, addressed by column + row.
|
|
163
|
+
*
|
|
164
|
+
* The cell's clickable child (a link / button) is clicked when present — ideal
|
|
165
|
+
* when the visible text is dynamic (a UUID, a DB id) and so can't be named.
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* await bg.clickInTable({ column: "PPHID", row: "first" });
|
|
169
|
+
* await bg.clickInTable({ column: "PPHID", rowMatch: { Name: dbName } });
|
|
170
|
+
*/
|
|
171
|
+
clickInTable(spec) {
|
|
172
|
+
const { column, row, rowMatch, timeoutMs } = spec;
|
|
173
|
+
const options = { action_type: "click", column };
|
|
174
|
+
if (rowMatch)
|
|
175
|
+
options.row_match = rowMatch;
|
|
176
|
+
else if (row !== undefined)
|
|
177
|
+
options.row = row;
|
|
178
|
+
if (timeoutMs !== undefined)
|
|
179
|
+
options.timeout_ms = timeoutMs;
|
|
180
|
+
return this.act(`click the ${column} cell`, options);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Click a link by its text (exact, then case-insensitive, then substring).
|
|
184
|
+
* Handy when the link label is a dynamic value pulled from a DB.
|
|
185
|
+
*/
|
|
186
|
+
clickLink(text, options) {
|
|
187
|
+
const opts = { action_type: "click", link_text: text };
|
|
188
|
+
if (options?.exact !== undefined)
|
|
189
|
+
opts.exact = options.exact;
|
|
190
|
+
if (options?.timeoutMs !== undefined)
|
|
191
|
+
opts.timeout_ms = options.timeoutMs;
|
|
192
|
+
return this.act(`click the link "${text}"`, opts);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Assert columns / cell values in a data table (Ant Design / native / ARIA).
|
|
196
|
+
*
|
|
197
|
+
* - `columns`: header names that must all be present.
|
|
198
|
+
* - `row`: column -> value used to locate the row(s) (e.g. a key from your DB).
|
|
199
|
+
* - `cell`: column -> expected value asserted in the matched row(s).
|
|
200
|
+
*
|
|
201
|
+
* At least one of `columns` / `cell` should be provided. Matching is
|
|
202
|
+
* whitespace-normalised, case-insensitive, and tolerates a value rendered
|
|
203
|
+
* inside a badge (expected is matched as a substring of the cell).
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* await bg.verifyTable({ columns: ["PPHID", "Account Status", "Profile Status"] });
|
|
207
|
+
* await bg.verifyTable({ row: { Name: dbName }, cell: { "Account Status": dbStatus } });
|
|
208
|
+
*/
|
|
209
|
+
verifyTable(spec) {
|
|
210
|
+
const { description, timeoutMs, ...rest } = spec;
|
|
211
|
+
const options = { assertion_type: "table", ...rest };
|
|
212
|
+
if (timeoutMs !== undefined)
|
|
213
|
+
options.timeout_ms = timeoutMs;
|
|
214
|
+
return this.verify(description ?? "table assertion", options);
|
|
215
|
+
}
|
|
95
216
|
recover(args) {
|
|
96
217
|
return this.client.request("recover", {
|
|
97
218
|
session_id: this.sessionId,
|
|
@@ -152,6 +273,7 @@ class Bubblegum {
|
|
|
152
273
|
const json = resolve(opts.json, "bubblegum_report.json");
|
|
153
274
|
const junit = resolve(opts.junit, "bubblegum_report.xml");
|
|
154
275
|
const allure = resolve(opts.allure, "allure-results");
|
|
276
|
+
const summary = resolve(opts.summary, "bubblegum-summary.html");
|
|
155
277
|
if (html)
|
|
156
278
|
params.html = html;
|
|
157
279
|
if (json)
|
|
@@ -160,6 +282,8 @@ class Bubblegum {
|
|
|
160
282
|
params.junit = junit;
|
|
161
283
|
if (allure)
|
|
162
284
|
params.allure = allure;
|
|
285
|
+
if (summary)
|
|
286
|
+
params.summary = summary;
|
|
163
287
|
if (opts.title)
|
|
164
288
|
params.title = opts.title;
|
|
165
289
|
if (opts.suiteName)
|
package/dist/cjs/session.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/session.ts"],"names":[],"mappings":";;;AAAA,2CAAgE;AAChE,2CAA0C;AAC1C,+CAA2C;
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/session.ts"],"names":[],"mappings":";;;AAAA,2CAAgE;AAChE,2CAA0C;AAC1C,+CAA2C;AAiG3C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAa,SAAS;IAED;IACA;IAFnB,YACmB,MAAoB,EACpB,SAAiB;QADjB,WAAM,GAAN,MAAM,CAAc;QACpB,cAAS,GAAT,SAAS,CAAQ;IACjC,CAAC;IAEJ,iFAAiF;IACjF,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAsB,EAAE;QAC1C,MAAM,MAAM,GAAG,IAAI,wBAAY,CAAC,IAAI,CAAC,CAAC;QACtC,IA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E,CAAC;QAC5B,CAAC;IACH,CAAC;CACF;AAvSD,8BAuSC"}
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -54,9 +54,16 @@ export interface ReportOptions {
|
|
|
54
54
|
junit?: string | boolean;
|
|
55
55
|
/** Allure 2 results *directory* (view with `allure serve <dir>`). */
|
|
56
56
|
allure?: string | boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Cross-run suite summary HTML. Each test run upserts itself (keyed by
|
|
59
|
+
* `suiteName`) into a sibling `*.json` manifest, so several independently-run
|
|
60
|
+
* tests aggregate into one overview (per-test pass/fail + grand totals)
|
|
61
|
+
* instead of overwriting each other. Pass a distinct `suiteName` per test.
|
|
62
|
+
*/
|
|
63
|
+
summary?: string | boolean;
|
|
57
64
|
/** Report title (HTML/JSON). */
|
|
58
65
|
title?: string;
|
|
59
|
-
/** Suite name (Allure/JUnit). */
|
|
66
|
+
/** Suite / test name (Allure/JUnit, and the summary manifest key). */
|
|
60
67
|
suiteName?: string;
|
|
61
68
|
}
|
|
62
69
|
/** Result of {@link Bubblegum.report}: resolved paths written, and step count. */
|
package/dist/cjs/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;AAEnF,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC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qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,kFAAkF;AAClF,MAAM,WAAW,YAAY;IAC3B,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;CACf"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* a thin, typed proxy. See ../../docs/distribution-npm-and-pypi.md.
|
|
8
8
|
*/
|
|
9
9
|
export { Bubblegum } from "./session.js";
|
|
10
|
-
export type { Channel, LaunchOptions, AttachOptions, RecoverArgs } from "./session.js";
|
|
10
|
+
export type { Channel, LaunchOptions, AttachOptions, MobileAttachOptions, RecoverArgs } from "./session.js";
|
|
11
11
|
export { BridgeClient, spawnBridgeTransport } from "./client.js";
|
|
12
12
|
export type { Transport, SpawnOptions, BridgeClientOptions } from "./client.js";
|
|
13
13
|
export { BridgeError } from "./errors.js";
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE5G,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACjE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEhF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhE,YAAY,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,SAAS,EACT,cAAc,EACd,WAAW,EACX,aAAa,EACb,YAAY,GACb,MAAM,YAAY,CAAC"}
|
package/dist/esm/session.d.ts
CHANGED
|
@@ -23,11 +23,64 @@ export interface LaunchOptions extends BridgeClientOptions {
|
|
|
23
23
|
cdpEndpoint?: string;
|
|
24
24
|
/** Which existing page to attach to when using `cdpEndpoint` (default 0). */
|
|
25
25
|
pageIndex?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Mobile client-owned mode: attach the engine to an Appium session another
|
|
28
|
+
* test already created, by its session id (e.g. WebdriverIO's
|
|
29
|
+
* `browser.sessionId`). Cloud device farms allow only one session per device,
|
|
30
|
+
* so an in-test fallback must reuse the running session rather than open a
|
|
31
|
+
* new one. The engine reuses it and never quits it. Requires the engine to
|
|
32
|
+
* advertise the `channel.mobile.attach` capability.
|
|
33
|
+
*/
|
|
34
|
+
existingSessionId?: string;
|
|
26
35
|
}
|
|
27
36
|
/** Options for {@link Bubblegum.attach} — `cdpEndpoint` is required. */
|
|
28
37
|
export interface AttachOptions extends Omit<LaunchOptions, "channel"> {
|
|
29
38
|
cdpEndpoint: string;
|
|
30
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Options for {@link Bubblegum.attachMobile} — attach to an Appium session your
|
|
42
|
+
* test already drives. `appiumUrl` + `existingSessionId` are required.
|
|
43
|
+
*/
|
|
44
|
+
export interface MobileAttachOptions extends Omit<LaunchOptions, "channel" | "cdpEndpoint" | "pageIndex"> {
|
|
45
|
+
appiumUrl: string;
|
|
46
|
+
existingSessionId: string;
|
|
47
|
+
}
|
|
48
|
+
/** One step's outcome from {@link Bubblegum.preflight}. */
|
|
49
|
+
export interface PreflightResult {
|
|
50
|
+
instruction: string;
|
|
51
|
+
/** Engine status: "dry_run" when it resolved, "failed" when it didn't. */
|
|
52
|
+
status: StepResult["status"];
|
|
53
|
+
/** True when the step resolved to a target (dry_run / passed / recovered). */
|
|
54
|
+
ok: boolean;
|
|
55
|
+
confidence: number;
|
|
56
|
+
resolver: string | null;
|
|
57
|
+
ref: string | null;
|
|
58
|
+
error: string | null;
|
|
59
|
+
}
|
|
60
|
+
/** Arguments for {@link Bubblegum.clickInTable}. */
|
|
61
|
+
export interface TableCellTarget {
|
|
62
|
+
/** Column header that identifies the cell. */
|
|
63
|
+
column: string;
|
|
64
|
+
/** Row selector: 1-based index, -1 = last, or a word like "first" / "last". */
|
|
65
|
+
row?: number | string;
|
|
66
|
+
/** Locate the row by another column's value instead of an index (e.g. a DB key). */
|
|
67
|
+
rowMatch?: Record<string, string>;
|
|
68
|
+
/** Per-call timeout. */
|
|
69
|
+
timeoutMs?: number;
|
|
70
|
+
}
|
|
71
|
+
/** Arguments for {@link Bubblegum.verifyTable}. */
|
|
72
|
+
export interface TableAssertion {
|
|
73
|
+
/** Column headers that must all be present. */
|
|
74
|
+
columns?: string[];
|
|
75
|
+
/** Column -> value used to locate the row(s) (e.g. a key sourced from a DB). */
|
|
76
|
+
row?: Record<string, string>;
|
|
77
|
+
/** Column -> expected value asserted in the matched row(s). */
|
|
78
|
+
cell?: Record<string, string>;
|
|
79
|
+
/** Optional human-readable step label for the report. */
|
|
80
|
+
description?: string;
|
|
81
|
+
/** Per-call timeout; the assertion polls the table until it holds or this elapses. */
|
|
82
|
+
timeoutMs?: number;
|
|
83
|
+
}
|
|
31
84
|
export interface RecoverArgs {
|
|
32
85
|
failedSelector: string;
|
|
33
86
|
intent: string;
|
|
@@ -68,11 +121,91 @@ export declare class Bubblegum {
|
|
|
68
121
|
* ```
|
|
69
122
|
*/
|
|
70
123
|
static attach(opts: AttachOptions): Promise<Bubblegum>;
|
|
124
|
+
/**
|
|
125
|
+
* Attach the engine to a mobile (Appium) session your test already drives,
|
|
126
|
+
* by its session id. Cloud device farms (pCloudy, BrowserStack, …) allow only
|
|
127
|
+
* one Appium session per device, so an in-test Bubblegum fallback must reuse
|
|
128
|
+
* the running session instead of opening a new one. The engine shares the
|
|
129
|
+
* session and never quits it — your test keeps ownership of teardown.
|
|
130
|
+
*
|
|
131
|
+
* ```ts
|
|
132
|
+
* // Inside a WebdriverIO test, when a normal locator click fails:
|
|
133
|
+
* const bg = await Bubblegum.attachMobile({
|
|
134
|
+
* appiumUrl: "https://ship-hats.pcloudy.com/appiumcloud/wd/hub",
|
|
135
|
+
* existingSessionId: browser.sessionId,
|
|
136
|
+
* capabilities: { platformName: "iOS" },
|
|
137
|
+
* });
|
|
138
|
+
* try {
|
|
139
|
+
* await bg.act("Tap View daily summary");
|
|
140
|
+
* } finally {
|
|
141
|
+
* await bg.close(); // closes the engine wrapper only; device session stays up
|
|
142
|
+
* }
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
static attachMobile(opts: MobileAttachOptions): Promise<Bubblegum>;
|
|
71
146
|
/** The bridge client (for advanced use / capability checks). */
|
|
72
147
|
get bridge(): BridgeClient;
|
|
73
148
|
act(instruction: string, options?: StepOptions): Promise<StepResult>;
|
|
149
|
+
/**
|
|
150
|
+
* Dry-run a list of steps against the *current* page and report whether each
|
|
151
|
+
* one resolves — without executing anything. Lets you validate a script (or a
|
|
152
|
+
* page's worth of steps) in one batch instead of discovering failures one run
|
|
153
|
+
* at a time.
|
|
154
|
+
*
|
|
155
|
+
* Because nothing executes, steps are all checked against the page as it is
|
|
156
|
+
* now (no navigation between them) — so call it once per page (e.g. after
|
|
157
|
+
* landing on each screen) with that screen's steps.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* const report = await bg.preflight([
|
|
161
|
+
* 'Select "Active" from the Participant status dropdown',
|
|
162
|
+
* 'Select "Change of mind" from the Reason dropdown',
|
|
163
|
+
* 'Click the Submit button',
|
|
164
|
+
* ]);
|
|
165
|
+
* console.table(report); // see status / confidence / resolver per step
|
|
166
|
+
* if (report.some(r => !r.ok)) throw new Error("preflight found unresolved steps");
|
|
167
|
+
*/
|
|
168
|
+
preflight(steps: Array<string | {
|
|
169
|
+
instruction: string;
|
|
170
|
+
options?: StepOptions;
|
|
171
|
+
}>, options?: StepOptions): Promise<PreflightResult[]>;
|
|
74
172
|
verify(instruction: string, options?: StepOptions): Promise<StepResult>;
|
|
75
173
|
extract(instruction: string, options?: StepOptions): Promise<StepResult>;
|
|
174
|
+
/**
|
|
175
|
+
* Click an element inside a table cell, addressed by column + row.
|
|
176
|
+
*
|
|
177
|
+
* The cell's clickable child (a link / button) is clicked when present — ideal
|
|
178
|
+
* when the visible text is dynamic (a UUID, a DB id) and so can't be named.
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* await bg.clickInTable({ column: "PPHID", row: "first" });
|
|
182
|
+
* await bg.clickInTable({ column: "PPHID", rowMatch: { Name: dbName } });
|
|
183
|
+
*/
|
|
184
|
+
clickInTable(spec: TableCellTarget): Promise<StepResult>;
|
|
185
|
+
/**
|
|
186
|
+
* Click a link by its text (exact, then case-insensitive, then substring).
|
|
187
|
+
* Handy when the link label is a dynamic value pulled from a DB.
|
|
188
|
+
*/
|
|
189
|
+
clickLink(text: string, options?: {
|
|
190
|
+
exact?: boolean;
|
|
191
|
+
timeoutMs?: number;
|
|
192
|
+
}): Promise<StepResult>;
|
|
193
|
+
/**
|
|
194
|
+
* Assert columns / cell values in a data table (Ant Design / native / ARIA).
|
|
195
|
+
*
|
|
196
|
+
* - `columns`: header names that must all be present.
|
|
197
|
+
* - `row`: column -> value used to locate the row(s) (e.g. a key from your DB).
|
|
198
|
+
* - `cell`: column -> expected value asserted in the matched row(s).
|
|
199
|
+
*
|
|
200
|
+
* At least one of `columns` / `cell` should be provided. Matching is
|
|
201
|
+
* whitespace-normalised, case-insensitive, and tolerates a value rendered
|
|
202
|
+
* inside a badge (expected is matched as a substring of the cell).
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* await bg.verifyTable({ columns: ["PPHID", "Account Status", "Profile Status"] });
|
|
206
|
+
* await bg.verifyTable({ row: { Name: dbName }, cell: { "Account Status": dbStatus } });
|
|
207
|
+
*/
|
|
208
|
+
verifyTable(spec: TableAssertion): Promise<StepResult>;
|
|
76
209
|
recover(args: RecoverArgs): Promise<StepResult>;
|
|
77
210
|
isVisible(target: string): Promise<boolean>;
|
|
78
211
|
isChecked(target: string): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGhE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAElG,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEvC,MAAM,WAAW,aAAc,SAAQ,mBAAmB;IACxD,mCAAmC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8BAA8B;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oCAAoC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,YAAY,CAAC,EAAE,MAAM,C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ACH,WAAW,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAOtD,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IASzC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAQ3C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAQ3C,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQ9C,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQnD,OAAO,IAAI,OAAO,CAAC,cAAc,CAAC;IAIlC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IA2BlD,iEAAiE;IAC3D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAO7B"}
|
package/dist/esm/session.js
CHANGED
|
@@ -33,6 +33,10 @@ export class Bubblegum {
|
|
|
33
33
|
if (opts.cdpEndpoint && !client.hasCapability("channel.web.cdp")) {
|
|
34
34
|
throw new BridgeError(ErrorCodes.Unsupported, "this engine does not support CDP attach (channel.web.cdp); upgrade bubblegum-ai");
|
|
35
35
|
}
|
|
36
|
+
if (opts.existingSessionId && !client.hasCapability("channel.mobile.attach")) {
|
|
37
|
+
throw new BridgeError(ErrorCodes.Unsupported, "this engine does not support attaching to an existing Appium session " +
|
|
38
|
+
"(channel.mobile.attach); upgrade bubblegum-ai");
|
|
39
|
+
}
|
|
36
40
|
const { session_id } = await client.request("session.open", {
|
|
37
41
|
channel: opts.channel ?? "web",
|
|
38
42
|
url: opts.url,
|
|
@@ -42,6 +46,7 @@ export class Bubblegum {
|
|
|
42
46
|
capabilities: opts.capabilities,
|
|
43
47
|
cdp_endpoint: opts.cdpEndpoint,
|
|
44
48
|
page_index: opts.pageIndex,
|
|
49
|
+
existing_session_id: opts.existingSessionId,
|
|
45
50
|
});
|
|
46
51
|
return new Bubblegum(client, session_id);
|
|
47
52
|
}
|
|
@@ -64,6 +69,30 @@ export class Bubblegum {
|
|
|
64
69
|
static attach(opts) {
|
|
65
70
|
return Bubblegum.launch({ ...opts, channel: "web" });
|
|
66
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Attach the engine to a mobile (Appium) session your test already drives,
|
|
74
|
+
* by its session id. Cloud device farms (pCloudy, BrowserStack, …) allow only
|
|
75
|
+
* one Appium session per device, so an in-test Bubblegum fallback must reuse
|
|
76
|
+
* the running session instead of opening a new one. The engine shares the
|
|
77
|
+
* session and never quits it — your test keeps ownership of teardown.
|
|
78
|
+
*
|
|
79
|
+
* ```ts
|
|
80
|
+
* // Inside a WebdriverIO test, when a normal locator click fails:
|
|
81
|
+
* const bg = await Bubblegum.attachMobile({
|
|
82
|
+
* appiumUrl: "https://ship-hats.pcloudy.com/appiumcloud/wd/hub",
|
|
83
|
+
* existingSessionId: browser.sessionId,
|
|
84
|
+
* capabilities: { platformName: "iOS" },
|
|
85
|
+
* });
|
|
86
|
+
* try {
|
|
87
|
+
* await bg.act("Tap View daily summary");
|
|
88
|
+
* } finally {
|
|
89
|
+
* await bg.close(); // closes the engine wrapper only; device session stays up
|
|
90
|
+
* }
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
static attachMobile(opts) {
|
|
94
|
+
return Bubblegum.launch({ ...opts, channel: "mobile" });
|
|
95
|
+
}
|
|
67
96
|
/** The bridge client (for advanced use / capability checks). */
|
|
68
97
|
get bridge() {
|
|
69
98
|
return this.client;
|
|
@@ -75,6 +104,43 @@ export class Bubblegum {
|
|
|
75
104
|
options,
|
|
76
105
|
});
|
|
77
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Dry-run a list of steps against the *current* page and report whether each
|
|
109
|
+
* one resolves — without executing anything. Lets you validate a script (or a
|
|
110
|
+
* page's worth of steps) in one batch instead of discovering failures one run
|
|
111
|
+
* at a time.
|
|
112
|
+
*
|
|
113
|
+
* Because nothing executes, steps are all checked against the page as it is
|
|
114
|
+
* now (no navigation between them) — so call it once per page (e.g. after
|
|
115
|
+
* landing on each screen) with that screen's steps.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* const report = await bg.preflight([
|
|
119
|
+
* 'Select "Active" from the Participant status dropdown',
|
|
120
|
+
* 'Select "Change of mind" from the Reason dropdown',
|
|
121
|
+
* 'Click the Submit button',
|
|
122
|
+
* ]);
|
|
123
|
+
* console.table(report); // see status / confidence / resolver per step
|
|
124
|
+
* if (report.some(r => !r.ok)) throw new Error("preflight found unresolved steps");
|
|
125
|
+
*/
|
|
126
|
+
async preflight(steps, options) {
|
|
127
|
+
const out = [];
|
|
128
|
+
for (const step of steps) {
|
|
129
|
+
const instruction = typeof step === "string" ? step : step.instruction;
|
|
130
|
+
const perStep = typeof step === "string" ? undefined : step.options;
|
|
131
|
+
const r = await this.act(instruction, { ...options, ...perStep, dry_run: true });
|
|
132
|
+
out.push({
|
|
133
|
+
instruction,
|
|
134
|
+
status: r.status,
|
|
135
|
+
ok: r.status === "dry_run" || r.status === "passed" || r.status === "recovered",
|
|
136
|
+
confidence: r.confidence,
|
|
137
|
+
resolver: r.target?.resolver_name ?? null,
|
|
138
|
+
ref: r.target?.ref ?? null,
|
|
139
|
+
error: r.error?.message ?? null,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
return out;
|
|
143
|
+
}
|
|
78
144
|
verify(instruction, options) {
|
|
79
145
|
return this.client.request("verify", {
|
|
80
146
|
session_id: this.sessionId,
|
|
@@ -89,6 +155,61 @@ export class Bubblegum {
|
|
|
89
155
|
options,
|
|
90
156
|
});
|
|
91
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* Click an element inside a table cell, addressed by column + row.
|
|
160
|
+
*
|
|
161
|
+
* The cell's clickable child (a link / button) is clicked when present — ideal
|
|
162
|
+
* when the visible text is dynamic (a UUID, a DB id) and so can't be named.
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* await bg.clickInTable({ column: "PPHID", row: "first" });
|
|
166
|
+
* await bg.clickInTable({ column: "PPHID", rowMatch: { Name: dbName } });
|
|
167
|
+
*/
|
|
168
|
+
clickInTable(spec) {
|
|
169
|
+
const { column, row, rowMatch, timeoutMs } = spec;
|
|
170
|
+
const options = { action_type: "click", column };
|
|
171
|
+
if (rowMatch)
|
|
172
|
+
options.row_match = rowMatch;
|
|
173
|
+
else if (row !== undefined)
|
|
174
|
+
options.row = row;
|
|
175
|
+
if (timeoutMs !== undefined)
|
|
176
|
+
options.timeout_ms = timeoutMs;
|
|
177
|
+
return this.act(`click the ${column} cell`, options);
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Click a link by its text (exact, then case-insensitive, then substring).
|
|
181
|
+
* Handy when the link label is a dynamic value pulled from a DB.
|
|
182
|
+
*/
|
|
183
|
+
clickLink(text, options) {
|
|
184
|
+
const opts = { action_type: "click", link_text: text };
|
|
185
|
+
if (options?.exact !== undefined)
|
|
186
|
+
opts.exact = options.exact;
|
|
187
|
+
if (options?.timeoutMs !== undefined)
|
|
188
|
+
opts.timeout_ms = options.timeoutMs;
|
|
189
|
+
return this.act(`click the link "${text}"`, opts);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Assert columns / cell values in a data table (Ant Design / native / ARIA).
|
|
193
|
+
*
|
|
194
|
+
* - `columns`: header names that must all be present.
|
|
195
|
+
* - `row`: column -> value used to locate the row(s) (e.g. a key from your DB).
|
|
196
|
+
* - `cell`: column -> expected value asserted in the matched row(s).
|
|
197
|
+
*
|
|
198
|
+
* At least one of `columns` / `cell` should be provided. Matching is
|
|
199
|
+
* whitespace-normalised, case-insensitive, and tolerates a value rendered
|
|
200
|
+
* inside a badge (expected is matched as a substring of the cell).
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* await bg.verifyTable({ columns: ["PPHID", "Account Status", "Profile Status"] });
|
|
204
|
+
* await bg.verifyTable({ row: { Name: dbName }, cell: { "Account Status": dbStatus } });
|
|
205
|
+
*/
|
|
206
|
+
verifyTable(spec) {
|
|
207
|
+
const { description, timeoutMs, ...rest } = spec;
|
|
208
|
+
const options = { assertion_type: "table", ...rest };
|
|
209
|
+
if (timeoutMs !== undefined)
|
|
210
|
+
options.timeout_ms = timeoutMs;
|
|
211
|
+
return this.verify(description ?? "table assertion", options);
|
|
212
|
+
}
|
|
92
213
|
recover(args) {
|
|
93
214
|
return this.client.request("recover", {
|
|
94
215
|
session_id: this.sessionId,
|
|
@@ -149,6 +270,7 @@ export class Bubblegum {
|
|
|
149
270
|
const json = resolve(opts.json, "bubblegum_report.json");
|
|
150
271
|
const junit = resolve(opts.junit, "bubblegum_report.xml");
|
|
151
272
|
const allure = resolve(opts.allure, "allure-results");
|
|
273
|
+
const summary = resolve(opts.summary, "bubblegum-summary.html");
|
|
152
274
|
if (html)
|
|
153
275
|
params.html = html;
|
|
154
276
|
if (json)
|
|
@@ -157,6 +279,8 @@ export class Bubblegum {
|
|
|
157
279
|
params.junit = junit;
|
|
158
280
|
if (allure)
|
|
159
281
|
params.allure = allure;
|
|
282
|
+
if (summary)
|
|
283
|
+
params.summary = summary;
|
|
160
284
|
if (opts.title)
|
|
161
285
|
params.title = opts.title;
|
|
162
286
|
if (opts.suiteName)
|
package/dist/esm/session.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,aAAa,CAAC;AAChE,OAAO,EAA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AAS;YAAE,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC;QAEvD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAe,cAAc,EAAE,MAAM,CAAC,CAAC;IACnE,CAAC;IAED,iEAAiE;IACjE,KAAK,CAAC,KAAK;QACT,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;QAC7E,CAAC;gBAAS,CAAC;YACT,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC;CACF"}
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -54,9 +54,16 @@ export interface ReportOptions {
|
|
|
54
54
|
junit?: string | boolean;
|
|
55
55
|
/** Allure 2 results *directory* (view with `allure serve <dir>`). */
|
|
56
56
|
allure?: string | boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Cross-run suite summary HTML. Each test run upserts itself (keyed by
|
|
59
|
+
* `suiteName`) into a sibling `*.json` manifest, so several independently-run
|
|
60
|
+
* tests aggregate into one overview (per-test pass/fail + grand totals)
|
|
61
|
+
* instead of overwriting each other. Pass a distinct `suiteName` per test.
|
|
62
|
+
*/
|
|
63
|
+
summary?: string | boolean;
|
|
57
64
|
/** Report title (HTML/JSON). */
|
|
58
65
|
title?: string;
|
|
59
|
-
/** Suite name (Allure/JUnit). */
|
|
66
|
+
/** Suite / test name (Allure/JUnit, and the summary manifest key). */
|
|
60
67
|
suiteName?: string;
|
|
61
68
|
}
|
|
62
69
|
/** Result of {@link Bubblegum.report}: resolved paths written, and step count. */
|
package/dist/esm/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG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AAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,uFAAuF;AACvF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,+BAA+B;IAC/B,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,kFAAkF;AAClF,MAAM,WAAW,YAAY;IAC3B,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;CACf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bubblegum-ai/node",
|
|
3
|
-
"version": "0.0.6-alpha.
|
|
3
|
+
"version": "0.0.6-alpha.11",
|
|
4
4
|
"description": "Node/TypeScript client for the Bubblegum engine — drive AI-powered, natural-language Playwright/Appium test steps from JS/TS via the Bubblegum JSON-RPC bridge.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|