ccqa 1.40.3 → 1.40.5

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/dist/bin/ccqa.mjs CHANGED
@@ -15204,25 +15204,26 @@ function actionToLine(action) {
15204
15204
  return `// [warn] replay-unstable: dropped over-assertion (${action.assert ?? "assert"} ${sel}) — selector not present on replay`;
15205
15205
  }
15206
15206
  const locator = action.locator ? locatorToPlaywright(action.locator, action.index) : null;
15207
+ const subject = locator !== null && action.index === void 0 ? `${locator}.first()` : locator;
15207
15208
  switch (action.action) {
15208
15209
  case "navigate": return `await page.goto(${jExpr(action.value ?? "")});`;
15209
- case "click": return locator ? `await ${locator}.click();` : droppedActionMarker(action);
15210
- case "dblclick": return locator ? `await ${locator}.dblclick();` : droppedActionMarker(action);
15210
+ case "click": return subject ? `await ${subject}.click();` : droppedActionMarker(action);
15211
+ case "dblclick": return subject ? `await ${subject}.dblclick();` : droppedActionMarker(action);
15211
15212
  case "fill":
15212
- case "type": return locator ? `await ${locator}.fill(${jExpr(action.value ?? "")});` : droppedActionMarker(action);
15213
- case "press": return locator ? `await ${locator}.press(${jExpr(action.value ?? "")});` : `await page.keyboard.press(${jExpr(action.value ?? "")});`;
15214
- case "check": return locator ? `await ${locator}.check();` : droppedActionMarker(action);
15215
- case "uncheck": return locator ? `await ${locator}.uncheck();` : droppedActionMarker(action);
15216
- case "select": return locator ? `await ${locator}.selectOption(${jExpr(action.value ?? "")});` : droppedActionMarker(action);
15217
- case "hover": return locator ? `await ${locator}.hover();` : droppedActionMarker(action);
15218
- case "focus": return locator ? `await ${locator}.focus();` : droppedActionMarker(action);
15213
+ case "type": return subject ? `await ${subject}.fill(${jExpr(action.value ?? "")});` : droppedActionMarker(action);
15214
+ case "press": return subject ? `await ${subject}.press(${jExpr(action.value ?? "")});` : `await page.keyboard.press(${jExpr(action.value ?? "")});`;
15215
+ case "check": return subject ? `await ${subject}.check();` : droppedActionMarker(action);
15216
+ case "uncheck": return subject ? `await ${subject}.uncheck();` : droppedActionMarker(action);
15217
+ case "select": return subject ? `await ${subject}.selectOption(${jExpr(action.value ?? "")});` : droppedActionMarker(action);
15218
+ case "hover": return subject ? `await ${subject}.hover();` : droppedActionMarker(action);
15219
+ case "focus": return subject ? `await ${subject}.focus();` : droppedActionMarker(action);
15219
15220
  case "drag":
15220
- if (!locator || !action.target) return droppedActionMarker(action);
15221
- return `await ${locator}.dragTo(${locatorToPlaywright(action.target)});`;
15221
+ if (!subject || !action.target) return droppedActionMarker(action);
15222
+ return `await ${subject}.dragTo(${locatorToPlaywright(action.target)}.first());`;
15222
15223
  case "upload": {
15223
15224
  const files = action.files ?? [];
15224
- if (!locator || files.length === 0) return droppedActionMarker(action);
15225
- return `await ${locator}.setInputFiles([${files.map(jExpr).join(", ")}]);`;
15225
+ if (!subject || files.length === 0) return droppedActionMarker(action);
15226
+ return `await ${subject}.setInputFiles([${files.map(jExpr).join(", ")}]);`;
15226
15227
  }
15227
15228
  case "scroll": return scrollToLine(action);
15228
15229
  case "wait": return waitToLine(action, locator);
@@ -17808,12 +17809,14 @@ find nth <index> "<ALLOWED-css>" <action>
17808
17809
  3. \`find last\` is reliable only when the layout guarantees "the target is the bottom-most match" (e.g. the most-recently-sent chat message). Be explicit in the AB_ACTION label.
17809
17810
  4. Argument order is \`<value> <action> [flags]\` — flags after the action. Putting \`--name\` / \`--exact\` before the action makes agent-browser fail with "Unknown subaction".
17810
17811
  5. \`--name "<n>"\` is **role-only**. Never pass it to \`find text\`, \`find label\`, etc.
17811
- 6. \`find\` includes its own wait; do not chain a \`wait\` before it.
17812
+ 6. \`--name\` matches by substring. Add \`--exact\` whenever the name you read from the snapshot is the element's whole accessible name — without it a short name such as "Log in" also matches "Log in with Google" and "Log in with SSO", and the recording silently pins the first of them.
17813
+ 7. \`find\` includes its own wait; do not chain a \`wait\` before it.
17812
17814
 
17813
17815
  **Examples:**
17814
17816
 
17815
17817
  - ✓ \`find last "[data-testid='reply-link']" click\` — specific attribute + layout-guaranteed last match
17816
17818
  - ✓ \`find role button click --name "Submit"\` — role + accessible name (flags after action)
17819
+ - ✓ \`find role button click --name "Log in" --exact\` — short name needs \`--exact\`, or "Log in with SSO" matches too
17817
17820
  - ✗ \`find role button --name "Submit" click\` — wrong order
17818
17821
  - ✗ \`find last "button" click\` — bare tag
17819
17822
 
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccqa",
3
- "version": "1.40.3",
3
+ "version": "1.40.5",
4
4
  "type": "module",
5
5
  "description": "Browser test recorder powered by Claude Code and agent-browser",
6
6
  "repository": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccqa",
3
- "version": "1.40.3",
3
+ "version": "1.40.5",
4
4
  "type": "module",
5
5
  "description": "Browser test recorder powered by Claude Code and agent-browser",
6
6
  "repository": {