@capagents/forgeqe 2.10.4 → 2.10.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.
Files changed (142) hide show
  1. package/HOW_TO_USE.md +36 -7
  2. package/README.md +1 -1
  3. package/THIRD_PARTY_NOTICES.md +1 -0
  4. package/dist/docs-site/docs/architecture/index.html +1 -0
  5. package/dist/docs-site/docs/cost-architecture/index.html +1 -1
  6. package/dist/docs-site/docs/index.html +91 -14
  7. package/dist/docs-site/docs/mobile/index.html +38 -2
  8. package/dist/docs-site/docs/search.js +1 -1
  9. package/dist/forgeqe.js +1963 -1806
  10. package/dist/web/assets/Agent-bSVNDlcU.js +8 -0
  11. package/dist/web/assets/ApiTests-DOxGgoZC.js +10 -0
  12. package/dist/web/assets/Browse-CG8jzqR1.js +2 -0
  13. package/dist/web/assets/Chat-DzufzeGg.js +5 -0
  14. package/dist/web/assets/CommandPalette-D7ufvlUN.js +1 -0
  15. package/dist/web/assets/Compare-6vHuAaKv.js +1 -0
  16. package/dist/web/assets/Cost-DGZ5t-Q_.js +1 -0
  17. package/dist/web/assets/Data-DqGA1ZtQ.js +6 -0
  18. package/dist/web/assets/Desktop-CSOFE8cN.js +1 -0
  19. package/dist/web/assets/DesktopReview-BWtionFH.js +1 -0
  20. package/dist/web/assets/Evidence-D8pLFcbr.js +1 -0
  21. package/dist/web/assets/Explore-TtfTWmGW.js +2 -0
  22. package/dist/web/assets/Features-DazoSiEi.js +1 -0
  23. package/dist/web/assets/Flags-Brja-ZXF.js +2 -0
  24. package/dist/web/assets/Flaky-jJlHFFCa.js +1 -0
  25. package/dist/web/assets/Impact-b60dmhJK.js +3 -0
  26. package/dist/web/assets/Jobs-Y9W9nBgx.js +5 -0
  27. package/dist/web/assets/KindPage-Y72w2UwG.js +6 -0
  28. package/dist/web/assets/Migration-CvIeTB9p.js +2 -0
  29. package/dist/web/assets/Product-BEe2GyO6.js +7 -0
  30. package/dist/web/assets/Production-D2qmPFYy.js +1 -0
  31. package/dist/web/assets/Quality-C4Aak_hw.js +1 -0
  32. package/dist/web/assets/Readiness-ClXnnmLo.js +1 -0
  33. package/dist/web/assets/Record-LaLYhQgk.js +2 -0
  34. package/dist/web/assets/Regression-DKz05MC_.js +5 -0
  35. package/dist/web/assets/{RelationGraph-D_ZVeOBh.js → RelationGraph-DLeEarQd.js} +1 -1
  36. package/dist/web/assets/Reports-ClSAzQOh.js +2 -0
  37. package/dist/web/assets/Response-De60pk_7.js +10 -0
  38. package/dist/web/assets/RunDiff-0ibEcmI5.js +1 -0
  39. package/dist/web/assets/Runs-T8yF8Hi0.js +2 -0
  40. package/dist/web/assets/Steps-CB30w6BA.js +2 -0
  41. package/dist/web/assets/TestCases-Ba6bUE4i.js +1 -0
  42. package/dist/web/assets/TestData-DefDzeMW.js +2 -0
  43. package/dist/web/assets/TestDebt-zohltDHp.js +1 -0
  44. package/dist/web/assets/Tosca-jAtdiG28.js +3 -0
  45. package/dist/web/assets/WhatsNew-D7n48IsG.js +1 -0
  46. package/dist/web/assets/capture.worklet-C2TjBQ56.js +11 -0
  47. package/dist/web/assets/capture.worklet-UcNywATd.js +1 -0
  48. package/dist/web/assets/dataParts-CZAcb4L_.js +3 -0
  49. package/dist/web/assets/{families-zlLgApNV.js → families-D2ygriY6.js} +1 -1
  50. package/dist/web/assets/filters-CYaF2RvC.js +1 -0
  51. package/dist/web/assets/fold-BhYvId2X.js +1 -0
  52. package/dist/web/assets/frame-DeJBYtBX.js +11 -0
  53. package/dist/web/assets/index-CYlacOTX.css +2 -0
  54. package/dist/web/assets/index-DXpBYobT.js +67 -0
  55. package/dist/web/assets/{line-icons-CQ-3V8ax.js → line-icons-DBwNPSmu.js} +1 -1
  56. package/dist/web/assets/{logos-DfCytw3-.js → logos-DmK40tlV.js} +1 -1
  57. package/dist/web/assets/{markdown-nTIj9lyp.js → markdown-Bej6qyls.js} +7 -7
  58. package/dist/web/assets/paletteCommands-CKBMmhb4.js +1 -0
  59. package/dist/web/assets/parts-BOpbd90H.js +1 -0
  60. package/dist/web/assets/{productParts-DK3ULNpv.js → productParts-B3_FGd-T.js} +1 -1
  61. package/dist/web/assets/qualityParts-B8yJRVpP.js +1 -0
  62. package/dist/web/assets/{recordTest-CqxnF953.js → recordTest-CZUrGm8I.js} +1 -1
  63. package/dist/web/assets/rows-BcG6gFCy.js +1 -0
  64. package/dist/web/assets/segmented-ffWUfF8N.js +1 -0
  65. package/dist/web/assets/{usePageChat-Dl2aUtHP.js → usePageChat-T6vQY_1C.js} +1 -1
  66. package/dist/web/index.html +6 -6
  67. package/docs/ARCHITECTURE.md +1 -0
  68. package/docs/COST_ARCHITECTURE.md +1 -1
  69. package/docs/MOBILE.md +40 -0
  70. package/docs/user-guide.html +91 -14
  71. package/evals/prompts/brain/browser-narrow-with-filters.yaml +20 -0
  72. package/forgeqe.example.yaml +11 -1
  73. package/package.json +2 -1
  74. package/prompts/brain.md +4 -0
  75. package/prompts/browser-goal-verification.md +2 -0
  76. package/prompts/refine.md +2 -0
  77. package/prompts/test-reviewer.md +2 -1
  78. package/prompts/test-rules.md +3 -0
  79. package/py/forgeqe_desktop/workflow.py +6 -4
  80. package/py/forgeqe_engine/capture.py +5 -4
  81. package/py/forgeqe_engine/diagnostics.py +2 -2
  82. package/py/forgeqe_engine/lenient_json.py +96 -0
  83. package/py/forgeqe_engine/llm.py +4 -0
  84. package/py/forgeqe_engine/network.py +93 -15
  85. package/py/forgeqe_engine/neutral_log.py +16 -1
  86. package/py/forgeqe_engine/recordsession.py +54 -1
  87. package/py/forgeqe_engine/service.py +22 -3
  88. package/py/forgeqe_mobile/appium_driver.py +9 -0
  89. package/py/forgeqe_mobile/apps.py +4 -0
  90. package/py/forgeqe_mobile/maestro.py +3 -0
  91. package/py/forgeqe_mobile/record.py +610 -0
  92. package/py/forgeqe_mobile/service.py +37 -7
  93. package/py/forgeqe_voice/worker.py +121 -0
  94. package/skills/dotnet-nunit-playwright/SKILL.md +1 -0
  95. package/skills/playwright-typescript/SKILL.md +1 -1
  96. package/dist/web/assets/Agent-DaA5WhAY.js +0 -8
  97. package/dist/web/assets/ApiTests-B7xsTGyo.js +0 -10
  98. package/dist/web/assets/Browse-ByYCyAwd.js +0 -2
  99. package/dist/web/assets/Chat-D1-cYNBr.js +0 -3
  100. package/dist/web/assets/CommandPalette-DbxKJJJB.js +0 -1
  101. package/dist/web/assets/Compare-CYLFEtJl.js +0 -1
  102. package/dist/web/assets/Cost-Csz0jMHo.js +0 -1
  103. package/dist/web/assets/Data-BWTme_Yw.js +0 -6
  104. package/dist/web/assets/Desktop-rZ0vB6Ie.js +0 -1
  105. package/dist/web/assets/DesktopReview-_Xha22_d.js +0 -1
  106. package/dist/web/assets/Evidence-DmUyZy9F.js +0 -1
  107. package/dist/web/assets/Explore-2wzgwz3J.js +0 -2
  108. package/dist/web/assets/Features-DazEWqYu.js +0 -1
  109. package/dist/web/assets/Flags-BTt0-pqd.js +0 -2
  110. package/dist/web/assets/Flaky-CjkQp73T.js +0 -1
  111. package/dist/web/assets/Impact-De87sv5J.js +0 -3
  112. package/dist/web/assets/Jobs-aiNGBVHL.js +0 -5
  113. package/dist/web/assets/KindPage-CrGoFeSa.js +0 -6
  114. package/dist/web/assets/Migration-BAhQ1DZO.js +0 -2
  115. package/dist/web/assets/Product-DpK-PIxV.js +0 -7
  116. package/dist/web/assets/Production-D6A89rZZ.js +0 -1
  117. package/dist/web/assets/Quality-Bc5wCsog.js +0 -1
  118. package/dist/web/assets/Readiness-CoVgZw2X.js +0 -1
  119. package/dist/web/assets/Record-DcgBatJJ.js +0 -2
  120. package/dist/web/assets/Regression-BJLYrqST.js +0 -5
  121. package/dist/web/assets/Reports-DYfyfEDy.js +0 -2
  122. package/dist/web/assets/Response-CNLi9Dqu.js +0 -4
  123. package/dist/web/assets/RunDiff-BMTdRhii.js +0 -1
  124. package/dist/web/assets/Runs-lb78rvPV.js +0 -2
  125. package/dist/web/assets/Steps-BDSeIznj.js +0 -2
  126. package/dist/web/assets/TestCases-CfUwd67O.js +0 -1
  127. package/dist/web/assets/TestData-DP7cvW48.js +0 -2
  128. package/dist/web/assets/TestDebt-CqARxL7k.js +0 -1
  129. package/dist/web/assets/Tosca-CLAz9tWT.js +0 -3
  130. package/dist/web/assets/WhatsNew-1lhTRE5Z.js +0 -1
  131. package/dist/web/assets/dataParts-DI_OJhy5.js +0 -3
  132. package/dist/web/assets/filters-CflRmNDz.js +0 -1
  133. package/dist/web/assets/fold-pOBiaSlF.js +0 -1
  134. package/dist/web/assets/frame-CYYiRu5P.js +0 -4
  135. package/dist/web/assets/index-CNDoTeRV.css +0 -2
  136. package/dist/web/assets/index-D4a0w3Vl.js +0 -67
  137. package/dist/web/assets/palette-Cj4CUs0K.js +0 -1
  138. package/dist/web/assets/parts-C53RxMcR.js +0 -1
  139. package/dist/web/assets/qualityParts-C9FItsTg.js +0 -1
  140. package/dist/web/assets/rows-D6rPRkHl.js +0 -1
  141. package/dist/web/assets/segmented-CAf_qz5Z.js +0 -1
  142. package/dist/web/assets/thread-DQdyL3Sv.js +0 -5
@@ -31,6 +31,7 @@ from types import SimpleNamespace
31
31
  from typing import Any, Awaitable, Callable, Dict, List, Optional, Tuple
32
32
 
33
33
  from .capture import capture_element, locate_check
34
+ from .network import NetworkCapture
34
35
  from .memory import BASE, KEPT_ATTRS, candidate_locators, confidence, looks_generated, state_class, within_locator
35
36
  from . import dynamic
36
37
  from .varying import SeenElements, mark as mark_varying
@@ -181,6 +182,9 @@ class RecordSession:
181
182
  self.shot_at: Dict[int, str] = {}
182
183
  # The page's own API calls after each step (method, path, status), for checks of them in the review.
183
184
  self.calls: Dict[int, List[Dict[str, Any]]] = {}
185
+ # The application's API calls in full (network.json, as an agent's run keeps them: bodies redacted by field
186
+ # name, and every saved login's values replaced before it is written), for API tests. Off with api.capture: false.
187
+ self.network: Optional[NetworkCapture] = NetworkCapture(payload.get("keep_headers")) if payload.get("network") is not False else None
184
188
  self._requests: Dict[str, str] = {}
185
189
  # Sites that asked for the browser's own sign-in (basic auth), by origin: the saved login that signs in there.
186
190
  self.logins: List[Any] = []
@@ -291,6 +295,8 @@ class RecordSession:
291
295
  reg.Browser.downloadProgress(self._queue("download_progress"))
292
296
  reg.Network.requestWillBeSent(self._queue("request"))
293
297
  reg.Network.responseReceived(self._queue("response"))
298
+ reg.Network.loadingFinished(self._queue("finished"))
299
+ reg.Network.loadingFailed(self._queue("failed"))
294
300
  await self.send("Target.setAutoAttach", {"autoAttach": True, "waitForDebuggerOnStart": True, "flatten": True})
295
301
  # A window a page opens (a link with target=_blank, window.open) is not attached by the browser on its own:
296
302
  # told of each new tab, the recorder attaches to it, and the steps go on there.
@@ -371,6 +377,10 @@ class RecordSession:
371
377
  if self.released:
372
378
  return
373
379
  self.released = True
380
+ # The bodies of the last calls are read from the browser: before it closes.
381
+ if self.network is not None:
382
+ with contextlib.suppress(Exception):
383
+ await self.network.settle(3.0)
374
384
  sid, self._video_sid = self._video_sid, None
375
385
  if self.video is not None and sid and sid in self.pages:
376
386
  with contextlib.suppress(Exception):
@@ -487,12 +497,21 @@ class RecordSession:
487
497
  elif kind in ("navigated", "navigated_same"):
488
498
  await self._navigated(event, sid, same=kind == "navigated_same")
489
499
  elif kind == "request":
500
+ self._capture_request(event, sid)
490
501
  if event.get("type") in ("XHR", "Fetch") and event.get("requestId"):
491
502
  if len(self._requests) > 2000:
492
503
  self._requests.clear()
493
504
  self._requests[str(event["requestId"])] = str((event.get("request") or {}).get("method") or "GET")
494
505
  elif kind == "response":
506
+ if self.network is not None:
507
+ self.network.on_response(event, sid)
495
508
  self._response(event, sid)
509
+ elif kind == "finished":
510
+ if self.network is not None:
511
+ self.network.on_finished(event, sid, send=self._send_quiet)
512
+ elif kind == "failed":
513
+ if self.network is not None:
514
+ self.network.on_failed(event, sid)
496
515
  elif kind == "download_begin":
497
516
  if len(self._downloading) > 50:
498
517
  self._downloading.clear()
@@ -586,6 +605,39 @@ class RecordSession:
586
605
  self.active = tab
587
606
  self._changed(msg)
588
607
 
608
+ def _capture_request(self, event: Dict[str, Any], sid: Optional[str]) -> None:
609
+ """A request of a recorded page, for network.json: never while paused, each call with the step it came after."""
610
+ net, rec = self.network, self.rec
611
+ if net is None or rec is None:
612
+ return
613
+ if self.paused and event.get("type") != "Document":
614
+ return
615
+ net.on_request(event, sid)
616
+ call = net._pending.get(str(event.get("requestId") or ""))
617
+ if call is not None:
618
+ call["step"] = max(1, len(rec.steps))
619
+
620
+ async def _send_quiet(self, method: str, params: Dict[str, Any], sid: Optional[str]) -> Any:
621
+ """A body read for network.json: given up on when the browser is closed or the page gone."""
622
+ if self.client is None:
623
+ return {}
624
+ return await self.send(method, params, sid)
625
+
626
+ def _write_network(self) -> Optional[str]:
627
+ """network.json in the recording's folder, every saved login's values replaced first."""
628
+ net = self.network
629
+ if net is None:
630
+ return None
631
+ values = [os.environ.get(env, "") for l in self.logins for env in (getattr(l, "username_env", None), getattr(l, "password_env", None)) if env]
632
+ if self.rec is not None:
633
+ values += [str(v) for v in getattr(self.rec, "login_values", {}).values()]
634
+ net.scrub(values)
635
+ try:
636
+ return net.write(self.out_dir, documents=False)
637
+ except Exception as ex:
638
+ logger.warning("record: network.json not written: %s", ex)
639
+ return None
640
+
589
641
  def _response(self, event: Dict[str, Any], sid: Optional[str]) -> None:
590
642
  if event.get("type") == "Document":
591
643
  self._http_auth(event)
@@ -1746,7 +1798,8 @@ class RecordSession:
1746
1798
  }
1747
1799
  if not ok:
1748
1800
  run["error"] = summary
1749
- files = [str((self.out_dir / "run.json").resolve()), *([yaml_path] if yaml_path else []), str((self.out_dir / "trace.md").resolve()), *([video] if video else [])]
1801
+ network = self._write_network() if ok else None
1802
+ files = [str((self.out_dir / "run.json").resolve()), *([yaml_path] if yaml_path else []), str((self.out_dir / "trace.md").resolve()), *([video] if video else []), *([network] if network else [])]
1750
1803
  if video:
1751
1804
  run["video"] = Path(video).name
1752
1805
  run["files"] = files
@@ -142,6 +142,8 @@ class RunRequest:
142
142
  prompts: Dict[str, str] = field(default_factory=dict)
143
143
  # The application's API calls (network.json), for API and contract tests.
144
144
  network: bool = True
145
+ # More headers to keep on those calls (api.keep_headers): checked again by network.extra_headers.
146
+ keep_headers: List[str] = field(default_factory=list)
145
147
  # axe-core for the accessibility checks: {"script": path to axe.min.js, "tags": [...]}; empty: the built-in checks.
146
148
  axe: Dict[str, Any] = field(default_factory=dict)
147
149
  # Core Web Vitals and load timings of each page (performance.json).
@@ -178,6 +180,7 @@ class RunRequest:
178
180
  accessibility=d.get("accessibility") is not False,
179
181
  overlay=d.get("overlay") is not False,
180
182
  network=d.get("network") is not False,
183
+ keep_headers=[str(h) for h in (d.get("keep_headers") or [])[:20] if isinstance(h, str)] if isinstance(d.get("keep_headers"), list) else [],
181
184
  prompts={str(k): str(v) for k, v in (d.get("prompts") or {}).items()} if isinstance(d.get("prompts"), dict) else {},
182
185
  axe=dict(d["axe"]) if isinstance(d.get("axe"), dict) else {},
183
186
  vitals=d.get("vitals") is not False,
@@ -202,6 +205,17 @@ class RunRequest:
202
205
  )
203
206
 
204
207
 
208
+ def task_goal(req: Any) -> str:
209
+ """The whole task a run is part of: a resumed run's is the goal of the run it carried on from (and of that run's)."""
210
+ resume = getattr(req, "resume", None) or {}
211
+ if resume.get("steps"):
212
+ for key in ("task_goal", "goal"):
213
+ value = resume.get(key)
214
+ if isinstance(value, str) and value.strip():
215
+ return value.strip()[:4000]
216
+ return req.goal
217
+
218
+
205
219
  def _build_initial_navigate_actions(url: str) -> List[Dict[str, Any]]:
206
220
  """The library's registry action for deterministic first navigation."""
207
221
  return [{"navigate": {"url": url, "new_tab": False}}]
@@ -255,7 +269,9 @@ You MUST call done with success=true only when all parts of the goal are true on
255
269
  - Each field MUST show exactly what the goal tells you. Sites fill in some fields before you start, and keep earlier selections. You MUST remove each value that the goal does not ask for.
256
270
  - You MUST apply each setting that the goal names (sort order, filters, dates, options) through the controls of the page. The page MUST show the setting. To look through results that are not sorted is not the same as to apply the sort.
257
271
  - You MUST read from the page all that the goal tells you to find or check. Your final answer MUST say what you saw.
272
+ - For items that meet a condition (a price limit, a rating), you SHOULD first apply the page's filter for it, or else sort by it. You SHOULD NOT look through many pages of results.
258
273
  - You SHOULD read the items that the page lists (result cards, rows, prices, scores) from that list in one step. Open an item only when the goal needs data that the list does not show.
274
+ - When a script (evaluate) does not read a list in two tries, you MUST use extract.
259
275
  - A tab can look empty immediately after it opens because it is loading. You MUST wait for it one time before you think that it is empty.
260
276
 
261
277
  When a part is not true and you cannot make it true, you MUST call done with success=false, and name that part.
@@ -975,7 +991,7 @@ def _write_artifacts(
975
991
  resume_path = out_dir / "resume.json"
976
992
  if (out["memory"] or {}).get("resume") and mem.resume:
977
993
  resume_path.write_text(
978
- json.dumps({"goal": req.goal, "start_url": start_url or "", **mem.resume}, indent=2), encoding="utf-8"
994
+ json.dumps({"goal": req.goal, "task_goal": task_goal(req), "start_url": start_url or "", **mem.resume}, indent=2), encoding="utf-8"
979
995
  )
980
996
  files.append(str(resume_path.resolve()))
981
997
  out["memory"]["resume"]["file"] = str(resume_path.resolve())
@@ -1017,6 +1033,9 @@ def _write_artifacts(
1017
1033
  run_path = out_dir / "run.json"
1018
1034
  slim = {k: v for k, v in out.items() if k != "result_markdown"}
1019
1035
  slim["goal"] = req.goal
1036
+ # A run that carried on from a failed one (resume_from): its goal says "continue"; the task is the first run's.
1037
+ if task_goal(req) != req.goal:
1038
+ slim["task_goal"] = task_goal(req)
1020
1039
  slim["start_url"] = start_url or ""
1021
1040
  slim["driver"] = "engine"
1022
1041
  slim["run_id"] = out_dir.name
@@ -1084,7 +1103,7 @@ async def run_browser_task(req: RunRequest, emit: Emit, cancel_event: asyncio.Ev
1084
1103
  llm_calls: List[Tuple[float, float]] = []
1085
1104
  _time_llm_calls(llm, llm_calls, lambda c: emit({"type": "call", **c}))
1086
1105
  use_prompts(req.prompts)
1087
- diag = Diagnostics(accessibility=req.accessibility, network=req.network, axe=req.axe or None, vitals=req.vitals, visual=req.visual)
1106
+ diag = Diagnostics(accessibility=req.accessibility, network=req.network, axe=req.axe or None, vitals=req.vitals, visual=req.visual, keep_headers=req.keep_headers)
1088
1107
 
1089
1108
  browser_cfg = req.browser if isinstance(req.browser, dict) else {}
1090
1109
  browser_provider = str(browser_cfg.get("provider") or "local")
@@ -1609,7 +1628,7 @@ async def run_browser_task(req: RunRequest, emit: Emit, cancel_event: asyncio.Ev
1609
1628
  point = mem.checkpoint()
1610
1629
  if point:
1611
1630
  (out_dir / "resume.json").write_text(
1612
- json.dumps({"goal": req.goal, "start_url": normalized_initial or "", **point}, indent=2), encoding="utf-8"
1631
+ json.dumps({"goal": req.goal, "task_goal": task_goal(req), "start_url": normalized_initial or "", **point}, indent=2), encoding="utf-8"
1613
1632
  )
1614
1633
  except Exception as ex:
1615
1634
  logger.warning("memory: could not save the checkpoint: %s", ex)
@@ -549,6 +549,15 @@ class AppiumDriver:
549
549
  break
550
550
  return out
551
551
 
552
+ def source(self) -> str:
553
+ """The screen's page source (XML), as Appium gives it: the app's own text, so data."""
554
+ source = self._call("GET", self._s("/source")) or ""
555
+ return source if isinstance(source, str) else ""
556
+
557
+ def window_size(self) -> Dict[str, int]:
558
+ r = self._call("GET", self._s("/window/rect")) or {}
559
+ return {"width": int(r.get("width", 0)), "height": int(r.get("height", 0))} if isinstance(r, dict) else {"width": 0, "height": 0}
560
+
552
561
  def screenshot_png(self) -> Optional[bytes]:
553
562
  if not self.session:
554
563
  return None
@@ -37,6 +37,10 @@ class MobileAppSpec:
37
37
  caps: Dict[str, Any] = {"platformName": "Android", "appium:automationName": "UiAutomator2", "appium:appPackage": self.app_id}
38
38
  if self.activity:
39
39
  caps["appium:appActivity"] = self.activity
40
+ # Any screen the app opens counts as started: many apps hand their launcher over at once (a splash, then a
41
+ # sign-in: WooCommerce's MainActivity opens LoginActivity), and Appium would wait for the launcher forever.
42
+ # mobile.appium.capabilities can set it back.
43
+ caps["appium:appWaitActivity"] = "*"
40
44
  else:
41
45
  caps = {"platformName": "iOS", "appium:automationName": "XCUITest", "appium:bundleId": self.app_id}
42
46
  if self.app:
@@ -113,6 +113,9 @@ def to_flow(workflow: Mapping[str, Any], app_id: str, variables: Optional[Mappin
113
113
  cmds.append({{"tap": "tapOn", "double_tap": "doubleTapOn", "long_press": "longPressOn"}[op]: _selector(step["target"])})
114
114
  elif op == "type":
115
115
  cmds += [{"tapOn": _selector(step["target"])}, "eraseText", {"inputText": text(step["text"])}]
116
+ elif op == "select":
117
+ # Open the drop-down, then tap the item by the text it shows.
118
+ cmds += [{"tapOn": _selector(step["target"])}, {"tapOn": {"text": text(step["value"])}}]
116
119
  elif op == "expect":
117
120
  cmds.append({"assertVisible": _selector(step["target"], text(step["text"]) if "text" in step else None)})
118
121
  elif op == "wait_for":