@bubblegum-ai/node 0.0.6-alpha.5 → 0.0.6-alpha.7
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/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/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.7",
|
|
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": {
|