@taqwright/lime-cli 0.29.0 → 0.31.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.
- package/README.md +50 -2
- package/dist/index.js +362 -264
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -243,6 +243,36 @@ under test are always applied last and **cannot** be overridden from the file.
|
|
|
243
243
|
Run `lime-cli --help` for the full flag list. Exit codes: `0` done/help, `1`
|
|
244
244
|
stuck/error/cancelled, `2` bad invocation.
|
|
245
245
|
|
|
246
|
+
### Test data from your own API (goal hooks)
|
|
247
|
+
|
|
248
|
+
A goal can create the data it needs before the journey starts — a fresh user, a coupon,
|
|
249
|
+
a listing — by calling a step declared in `.lime/hooks.json`:
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
lime-cli --goal 'Call createCoupon with percentOff 25, add a dress to the cart, apply ${PROMO_CODE} and verify the total is 25% lower' …
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
```json
|
|
256
|
+
{
|
|
257
|
+
"createCoupon": {
|
|
258
|
+
"params": { "percentOff": { "type": "integer", "min": 1, "max": 100 } },
|
|
259
|
+
"http": { "method": "POST", "url": "https://api.example.com/coupons",
|
|
260
|
+
"headers": { "X-Api-Key": "${env.TEST_DATA_KEY}" },
|
|
261
|
+
"body": { "percentOff": "${percentOff}" } },
|
|
262
|
+
"outputs": { "PROMO_CODE": "code" }
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
lime-cli runs the request on your machine (or CI runner) after LIME has checked the goal
|
|
268
|
+
and **before** connecting the device, then passes each output as a secret `${NAME}` for
|
|
269
|
+
the rest of the goal. Only the declarations (names, params, output names) are sent to
|
|
270
|
+
LIME — never the URL, headers or key; the key is read from the environment
|
|
271
|
+
(`${env.NAME}`) at the moment of the call. A parameter counts only when the goal writes
|
|
272
|
+
it. `lime-cli hooks check` validates the file; `lime-cli hooks --help` has the details.
|
|
273
|
+
|
|
274
|
+
Goal hooks need the `goal_hooks` feature on your LIME account.
|
|
275
|
+
|
|
246
276
|
## Making the test fit your project (`adapt` / `verify`)
|
|
247
277
|
|
|
248
278
|
LIME's recorded spec is plain and self-contained: it runs, but it does not know your
|
|
@@ -282,6 +312,19 @@ test fails it; `--diff <file>` takes a unified diff for CI.
|
|
|
282
312
|
flagging direct device use. It is the repo owner's declaration, committed and reviewed; the
|
|
283
313
|
recording rule and the assertion rule still apply.
|
|
284
314
|
|
|
315
|
+
**Your own locator helpers** are read too. A one-line wrapper over an Appium call
|
|
316
|
+
(`By hint(String v) { return AppiumBy.xpath("//*[@hint='" + v + "']"); }`) is picked up from the
|
|
317
|
+
repo's Java/Kotlin, so `hint("Username")` is checked as the xpath it builds, and the brief tells
|
|
318
|
+
the agent to write locators the same way. A helper lime-cli cannot read is declared in `lime.json`:
|
|
319
|
+
|
|
320
|
+
```json
|
|
321
|
+
{ "locatorHelpers": { "byLabel": "accessibility id",
|
|
322
|
+
"byHint": { "using": "xpath", "template": "//*[@hint='{0}']" } } }
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
A new locator written through a helper that is neither inferred nor declared **fails** `check`:
|
|
326
|
+
a locator that could not be read was not checked, and `check` never says it was.
|
|
327
|
+
|
|
285
328
|
`--lime-dir` writes `.lime/` next to your project: the recorded steps the agent converts
|
|
286
329
|
from, a `run.json` of what was recorded (goal, platform, cloud device), and the briefs.
|
|
287
330
|
**No credential is ever written there** — cloud credentials are re-read from
|
|
@@ -298,8 +341,8 @@ make that a failure instead, or `--agent none` to skip adaptation deliberately.
|
|
|
298
341
|
|
|
299
342
|
### Your suite is not taqwright
|
|
300
343
|
|
|
301
|
-
`lime-cli export` handles any of the frameworks LIME supports — pytest, JUnit 5,
|
|
302
|
-
WebdriverIO, C# NUnit, taqwright — and works the rest out from the repo itself:
|
|
344
|
+
`lime-cli export` handles any of the frameworks LIME supports — pytest, JUnit 5, Java +
|
|
345
|
+
Cucumber, RSpec, WebdriverIO, C# NUnit, taqwright — and works the rest out from the repo itself:
|
|
303
346
|
|
|
304
347
|
```sh
|
|
305
348
|
cd your-test-repo
|
|
@@ -318,6 +361,11 @@ claude -p "Read .lime/ADAPT.md and follow it exactly." \
|
|
|
318
361
|
--output-format stream-json --verbose --permission-mode acceptEdits
|
|
319
362
|
```
|
|
320
363
|
|
|
364
|
+
On a **Cucumber** suite the test is a scenario in a `.feature` file: the brief lists every step
|
|
365
|
+
the project already defines so the agent reuses them, puts new steps beside the existing step
|
|
366
|
+
classes and keeps locators in page objects. `lime-cli check` treats the scenario and its step
|
|
367
|
+
definitions as the test, and `lime-cli verify` runs only the new scenario, by name.
|
|
368
|
+
|
|
321
369
|
Override anything it guessed with `--framework` and `--dest`. If you would rather lime-cli drive
|
|
322
370
|
the agent for you, that is `lime-cli adapt`.
|
|
323
371
|
|