waygraph 0.13.6 → 0.14.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.
Files changed (297) hide show
  1. package/README.md +820 -232
  2. package/assets/stubs/stub.mp4 +0 -0
  3. package/assets/stubs/stub.pdf +32 -0
  4. package/assets/stubs/stub.png +0 -0
  5. package/dist/agent-dive.d.ts +9 -0
  6. package/dist/agent-dive.js +32 -0
  7. package/dist/auto-explore-run.d.ts +20 -2
  8. package/dist/auto-explore-run.js +9 -8
  9. package/dist/auto-explore.js +22 -2
  10. package/dist/auto-session-ipc.d.ts +123 -0
  11. package/dist/auto-session-ipc.js +381 -0
  12. package/dist/auto-session.d.ts +342 -0
  13. package/dist/auto-session.js +760 -0
  14. package/dist/cli.js +417 -51
  15. package/dist/engine.d.ts +40 -1
  16. package/dist/engine.js +82 -0
  17. package/dist/graph.d.ts +18 -0
  18. package/dist/graph.js +65 -2
  19. package/dist/highlights.d.ts +20 -1
  20. package/dist/highlights.js +60 -0
  21. package/dist/index.d.ts +8 -4
  22. package/dist/index.js +5 -3
  23. package/dist/pilot-overlay.d.ts +88 -0
  24. package/dist/pilot-overlay.js +363 -0
  25. package/dist/pilot.d.ts +49 -0
  26. package/dist/pilot.js +53 -0
  27. package/dist/trait.d.ts +22 -0
  28. package/dist/trait.js +60 -3
  29. package/examples/routed-demo/package.json +26 -0
  30. package/examples/routed-demo/playwright.config.ts +20 -0
  31. package/examples/routed-demo/scripts/fixture-server.mjs +37 -0
  32. package/examples/routed-demo/scripts/with-fixture.mjs +70 -0
  33. package/examples/routed-demo/src/flows/routed-demo.flow.ts +12 -0
  34. package/examples/routed-demo/src/pages/dashboard.html +10 -0
  35. package/examples/routed-demo/src/pages/docs.html +8 -0
  36. package/examples/routed-demo/src/routes/(base_app)/dashboard/dashboard.sel.ts +10 -0
  37. package/examples/routed-demo/src/routes/(base_app)/dashboard/methods/click-widget.block.ts +23 -0
  38. package/examples/routed-demo/src/routes/(base_app)/dashboard/nav.block.ts +18 -0
  39. package/examples/routed-demo/src/routes/(base_app)/dashboard/page.block.ts +22 -0
  40. package/examples/routed-demo/src/routes/(external)/docs/docs.sel.ts +7 -0
  41. package/examples/routed-demo/src/routes/(external)/docs/nav.block.ts +21 -0
  42. package/examples/routed-demo/src/routes/(external)/docs/page.block.ts +15 -0
  43. package/examples/routed-demo/src/states/routed-demo.states.ts +10 -0
  44. package/examples/routed-demo/tests/routed-demo.spec.ts +75 -0
  45. package/examples/routed-demo/tsconfig.json +18 -0
  46. package/examples/routed-demo-consumer/package.json +18 -0
  47. package/examples/saucedemo/.waygraph-auto/010dd92b.log +0 -0
  48. package/examples/saucedemo/.waygraph-auto/011ad671.log +0 -0
  49. package/examples/saucedemo/.waygraph-auto/01b45645.log +0 -0
  50. package/examples/saucedemo/.waygraph-auto/03764153.log +0 -0
  51. package/examples/saucedemo/.waygraph-auto/0593587e.log +0 -0
  52. package/examples/saucedemo/.waygraph-auto/06d12823.log +0 -0
  53. package/examples/saucedemo/.waygraph-auto/0b1f5b26.json +8 -0
  54. package/examples/saucedemo/.waygraph-auto/0c00f25f.log +0 -0
  55. package/examples/saucedemo/.waygraph-auto/0e480591.log +0 -0
  56. package/examples/saucedemo/.waygraph-auto/110958b8.log +0 -0
  57. package/examples/saucedemo/.waygraph-auto/138107c1.log +0 -0
  58. package/examples/saucedemo/.waygraph-auto/159d541b.log +0 -0
  59. package/examples/saucedemo/.waygraph-auto/16aa2c01.log +0 -0
  60. package/examples/saucedemo/.waygraph-auto/16c35dd5.log +0 -0
  61. package/examples/saucedemo/.waygraph-auto/1706547d.log +0 -0
  62. package/examples/saucedemo/.waygraph-auto/17537e42.log +0 -0
  63. package/examples/saucedemo/.waygraph-auto/17ede493.log +0 -0
  64. package/examples/saucedemo/.waygraph-auto/1fe2414f.log +0 -0
  65. package/examples/saucedemo/.waygraph-auto/1fe2e3b8.log +0 -0
  66. package/examples/saucedemo/.waygraph-auto/25f68ada.log +0 -0
  67. package/examples/saucedemo/.waygraph-auto/26ca9cd8.log +0 -0
  68. package/examples/saucedemo/.waygraph-auto/2bb6c4e8.log +0 -0
  69. package/examples/saucedemo/.waygraph-auto/2d425004.log +0 -0
  70. package/examples/saucedemo/.waygraph-auto/2f5b3ea6.log +0 -0
  71. package/examples/saucedemo/.waygraph-auto/31bb303d.log +0 -0
  72. package/examples/saucedemo/.waygraph-auto/31f2042f.log +0 -0
  73. package/examples/saucedemo/.waygraph-auto/36551ec1.log +0 -0
  74. package/examples/saucedemo/.waygraph-auto/36a1c274.log +0 -0
  75. package/examples/saucedemo/.waygraph-auto/381aa338.log +0 -0
  76. package/examples/saucedemo/.waygraph-auto/3882bce1.log +0 -0
  77. package/examples/saucedemo/.waygraph-auto/38acd1dc.log +0 -0
  78. package/examples/saucedemo/.waygraph-auto/3b8b77b9.log +0 -0
  79. package/examples/saucedemo/.waygraph-auto/4028d2a2.log +0 -0
  80. package/examples/saucedemo/.waygraph-auto/4168b208.log +0 -0
  81. package/examples/saucedemo/.waygraph-auto/43ab66ce.log +0 -0
  82. package/examples/saucedemo/.waygraph-auto/43f66838.log +0 -0
  83. package/examples/saucedemo/.waygraph-auto/442171d4.log +0 -0
  84. package/examples/saucedemo/.waygraph-auto/453b1ce1.log +0 -0
  85. package/examples/saucedemo/.waygraph-auto/457322bd.log +0 -0
  86. package/examples/saucedemo/.waygraph-auto/46197027.log +0 -0
  87. package/examples/saucedemo/.waygraph-auto/46889468.log +0 -0
  88. package/examples/saucedemo/.waygraph-auto/4890da1c.log +0 -0
  89. package/examples/saucedemo/.waygraph-auto/4893a63b.log +0 -0
  90. package/examples/saucedemo/.waygraph-auto/4af71440.log +0 -0
  91. package/examples/saucedemo/.waygraph-auto/4f7496d1.log +0 -0
  92. package/examples/saucedemo/.waygraph-auto/50e8baaa.log +0 -0
  93. package/examples/saucedemo/.waygraph-auto/52b3a455.log +0 -0
  94. package/examples/saucedemo/.waygraph-auto/532dd9b8.log +0 -0
  95. package/examples/saucedemo/.waygraph-auto/5391ce40.log +0 -0
  96. package/examples/saucedemo/.waygraph-auto/57dbddb3.log +0 -0
  97. package/examples/saucedemo/.waygraph-auto/5897f501.log +0 -0
  98. package/examples/saucedemo/.waygraph-auto/59c0b57d.log +0 -0
  99. package/examples/saucedemo/.waygraph-auto/5b511794.log +0 -0
  100. package/examples/saucedemo/.waygraph-auto/5c47910f.log +0 -0
  101. package/examples/saucedemo/.waygraph-auto/5eda8273.log +0 -0
  102. package/examples/saucedemo/.waygraph-auto/621518ad.log +0 -0
  103. package/examples/saucedemo/.waygraph-auto/632b7118.log +0 -0
  104. package/examples/saucedemo/.waygraph-auto/64314c2b.log +0 -0
  105. package/examples/saucedemo/.waygraph-auto/66516213.log +0 -0
  106. package/examples/saucedemo/.waygraph-auto/66c17079.log +0 -0
  107. package/examples/saucedemo/.waygraph-auto/69bf0b80.log +0 -0
  108. package/examples/saucedemo/.waygraph-auto/69c2347a.log +0 -0
  109. package/examples/saucedemo/.waygraph-auto/6d22bdb0.log +0 -0
  110. package/examples/saucedemo/.waygraph-auto/7103bebb.log +0 -0
  111. package/examples/saucedemo/.waygraph-auto/740c9faa.log +0 -0
  112. package/examples/saucedemo/.waygraph-auto/74872fc5.log +0 -0
  113. package/examples/saucedemo/.waygraph-auto/75846ca9.log +0 -0
  114. package/examples/saucedemo/.waygraph-auto/7626c85b.log +0 -0
  115. package/examples/saucedemo/.waygraph-auto/76308eec.log +0 -0
  116. package/examples/saucedemo/.waygraph-auto/76c1650e.log +0 -0
  117. package/examples/saucedemo/.waygraph-auto/7861f38f.log +0 -0
  118. package/examples/saucedemo/.waygraph-auto/7af224ed.log +0 -0
  119. package/examples/saucedemo/.waygraph-auto/7c3be585.log +0 -0
  120. package/examples/saucedemo/.waygraph-auto/7ed55a2c.log +0 -0
  121. package/examples/saucedemo/.waygraph-auto/80086ba2.log +0 -0
  122. package/examples/saucedemo/.waygraph-auto/80206369.log +0 -0
  123. package/examples/saucedemo/.waygraph-auto/847f1092.log +0 -0
  124. package/examples/saucedemo/.waygraph-auto/8581abfa.log +0 -0
  125. package/examples/saucedemo/.waygraph-auto/87b7e0fd.log +0 -0
  126. package/examples/saucedemo/.waygraph-auto/87c79256.log +0 -0
  127. package/examples/saucedemo/.waygraph-auto/88af2495.log +0 -0
  128. package/examples/saucedemo/.waygraph-auto/8c04a403.log +0 -0
  129. package/examples/saucedemo/.waygraph-auto/8c9ab09e.log +0 -0
  130. package/examples/saucedemo/.waygraph-auto/8cc5db51.log +0 -0
  131. package/examples/saucedemo/.waygraph-auto/8ea3a69c.log +0 -0
  132. package/examples/saucedemo/.waygraph-auto/9150f913.log +0 -0
  133. package/examples/saucedemo/.waygraph-auto/929a4313.log +0 -0
  134. package/examples/saucedemo/.waygraph-auto/95a599e4.log +0 -0
  135. package/examples/saucedemo/.waygraph-auto/96c45350.log +0 -0
  136. package/examples/saucedemo/.waygraph-auto/986030e6.log +0 -0
  137. package/examples/saucedemo/.waygraph-auto/99787abb.log +0 -0
  138. package/examples/saucedemo/.waygraph-auto/99ddb62c.log +0 -0
  139. package/examples/saucedemo/.waygraph-auto/a63a2d20.log +0 -0
  140. package/examples/saucedemo/.waygraph-auto/a78befb7.log +0 -0
  141. package/examples/saucedemo/.waygraph-auto/a84d9b79.log +0 -0
  142. package/examples/saucedemo/.waygraph-auto/a9270890.log +0 -0
  143. package/examples/saucedemo/.waygraph-auto/aa440153.log +0 -0
  144. package/examples/saucedemo/.waygraph-auto/ab7561e0.log +0 -0
  145. package/examples/saucedemo/.waygraph-auto/ac19ae60.log +0 -0
  146. package/examples/saucedemo/.waygraph-auto/ae21ad8e.log +0 -0
  147. package/examples/saucedemo/.waygraph-auto/af09042f.log +0 -0
  148. package/examples/saucedemo/.waygraph-auto/b1684126.log +0 -0
  149. package/examples/saucedemo/.waygraph-auto/b21e9d12.log +0 -0
  150. package/examples/saucedemo/.waygraph-auto/b5a838be.log +0 -0
  151. package/examples/saucedemo/.waygraph-auto/b603549d.log +0 -0
  152. package/examples/saucedemo/.waygraph-auto/b83e6259.log +0 -0
  153. package/examples/saucedemo/.waygraph-auto/b9cb2796.log +0 -0
  154. package/examples/saucedemo/.waygraph-auto/bb0a0018.log +0 -0
  155. package/examples/saucedemo/.waygraph-auto/bc0bdd0e.log +0 -0
  156. package/examples/saucedemo/.waygraph-auto/bc7d4a83.log +0 -0
  157. package/examples/saucedemo/.waygraph-auto/bd8e082a.log +0 -0
  158. package/examples/saucedemo/.waygraph-auto/bea0c93e.log +0 -0
  159. package/examples/saucedemo/.waygraph-auto/bf35201a.log +0 -0
  160. package/examples/saucedemo/.waygraph-auto/bffa3a7a.log +0 -0
  161. package/examples/saucedemo/.waygraph-auto/c4afb8bc.log +0 -0
  162. package/examples/saucedemo/.waygraph-auto/c916a654.log +0 -0
  163. package/examples/saucedemo/.waygraph-auto/c9b8d69e.log +0 -0
  164. package/examples/saucedemo/.waygraph-auto/d02e5e7e.log +0 -0
  165. package/examples/saucedemo/.waygraph-auto/d09aff71.log +0 -0
  166. package/examples/saucedemo/.waygraph-auto/d0e41396.log +0 -0
  167. package/examples/saucedemo/.waygraph-auto/d1370d76.log +0 -0
  168. package/examples/saucedemo/.waygraph-auto/d3714ae4.log +0 -0
  169. package/examples/saucedemo/.waygraph-auto/da0685dc.log +0 -0
  170. package/examples/saucedemo/.waygraph-auto/da894ad8.log +0 -0
  171. package/examples/saucedemo/.waygraph-auto/daa2f922.log +0 -0
  172. package/examples/saucedemo/.waygraph-auto/daefb614.log +0 -0
  173. package/examples/saucedemo/.waygraph-auto/db97e833.log +0 -0
  174. package/examples/saucedemo/.waygraph-auto/e101d19a.log +0 -0
  175. package/examples/saucedemo/.waygraph-auto/e207c989.log +0 -0
  176. package/examples/saucedemo/.waygraph-auto/e633e545.log +0 -0
  177. package/examples/saucedemo/.waygraph-auto/e69aec68.log +0 -0
  178. package/examples/saucedemo/.waygraph-auto/e70e2d06.log +0 -0
  179. package/examples/saucedemo/.waygraph-auto/ebad3410.log +0 -0
  180. package/examples/saucedemo/.waygraph-auto/ecbb0966.log +0 -0
  181. package/examples/saucedemo/.waygraph-auto/ecdee753.log +0 -0
  182. package/examples/saucedemo/.waygraph-auto/ed888783.log +0 -0
  183. package/examples/saucedemo/.waygraph-auto/ed931dac.log +0 -0
  184. package/examples/saucedemo/.waygraph-auto/ef655a3f.log +0 -0
  185. package/examples/saucedemo/.waygraph-auto/f3c29b21.log +0 -0
  186. package/examples/saucedemo/.waygraph-auto/f53f7cfc.log +0 -0
  187. package/examples/saucedemo/.waygraph-auto/f5ad5830.log +0 -0
  188. package/examples/saucedemo/.waygraph-auto/faed36dd.log +0 -0
  189. package/examples/saucedemo/docs/CONVENTION.md +25 -5
  190. package/examples/saucedemo/docs/HELPERS.md +15 -4
  191. package/examples/saucedemo/scripts/capture-wrong-login.mjs +8 -2
  192. package/examples/saucedemo/scripts/prove-wrong-login-runtime.mjs +8 -2
  193. package/examples/saucedemo/src/blocks/SITE-MAP.md +14 -3
  194. package/examples/saucedemo/src/blocks/saucedemo-web/NAV.md +15 -1
  195. package/examples/saucedemo/src/blocks/saucedemo-web/cart/NAV.md +1 -0
  196. package/examples/saucedemo/src/blocks/saucedemo-web/cart/cart.sel.ts +9 -0
  197. package/examples/saucedemo/src/blocks/saucedemo-web/cart/nav-cart.block.ts +3 -2
  198. package/examples/saucedemo/src/blocks/saucedemo-web/cart/nav-checkout-info.block.ts +2 -1
  199. package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-one/NAV.md +6 -1
  200. package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-one/methods/checkout-info.sel.ts +11 -0
  201. package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-one/methods/fill-first-name.method.block.ts +22 -0
  202. package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-one/methods/fill-last-name.method.block.ts +21 -0
  203. package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-one/methods/fill-postal-code.method.block.ts +21 -0
  204. package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-one/methods/submit-checkout-info.method.block.ts +6 -7
  205. package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-two/NAV.md +2 -0
  206. package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-two/methods/checkout-overview.sel.ts +9 -0
  207. package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-two/methods/finish-order.method.block.ts +7 -6
  208. package/examples/saucedemo/src/blocks/saucedemo-web/ff-owner-auth.block.ts +7 -2
  209. package/examples/saucedemo/src/blocks/saucedemo-web/inventory-item/NAV.md +1 -0
  210. package/examples/saucedemo/src/blocks/saucedemo-web/inventory-item/item-detail.sel.ts +9 -0
  211. package/examples/saucedemo/src/blocks/saucedemo-web/inventory-item/nav-back-to-inventory.block.ts +2 -1
  212. package/examples/saucedemo/src/blocks/saucedemo-web/inventory-item/nav-back-to-products.block.ts +2 -1
  213. package/examples/saucedemo/src/blocks/saucedemo-web/inventory-item/nav-continue-shopping.block.ts +2 -1
  214. package/examples/saucedemo/src/blocks/saucedemo-web/methods/fill-password.method.block.ts +51 -0
  215. package/examples/saucedemo/src/blocks/saucedemo-web/methods/fill-username.method.block.ts +69 -0
  216. package/examples/saucedemo/src/blocks/saucedemo-web/methods/login.sel.ts +13 -0
  217. package/examples/saucedemo/src/blocks/saucedemo-web/methods/submit-login-for-flow.ts +4 -4
  218. package/examples/saucedemo/src/blocks/saucedemo-web/methods/submit-login.method.block.ts +13 -51
  219. package/examples/saucedemo/src/blocks/saucedemo-web/methods/submit-logout.method.block.ts +4 -3
  220. package/examples/saucedemo/src/blocks/saucedemo-web/nav-login.block.ts +14 -6
  221. package/examples/saucedemo/src/flows/checkout-then-browse-again.flow.ts +15 -0
  222. package/examples/saucedemo/src/flows/checkout.flow.ts +20 -2
  223. package/examples/saucedemo/src/flows/device-showcase.flow.ts +4 -0
  224. package/examples/saucedemo/src/flows/login.flow.ts +3 -1
  225. package/examples/saucedemo/src/flows/shop.flow.ts +6 -0
  226. package/examples/saucedemo/src/flows/smoke.flow.ts +13 -7
  227. package/examples/saucedemo/src/flows/stub-on-error.flow.ts +4 -2
  228. package/examples/saucedemo/src/flows/viewer-blocked.flow.ts +6 -2
  229. package/examples/saucedemo/tests/flow-block-verify.spec.ts +3 -3
  230. package/examples/saucedemo/tests/submit-login-branch.spec.ts +5 -3
  231. package/package.json +2 -1
  232. package/templates/agents/waygraph-author.agent.md +43 -5
  233. package/templates/agents/waygraph-planner.agent.md +33 -2
  234. package/templates/quickstart/src/blocks/saucedemo-web/NAV.md +15 -1
  235. package/templates/quickstart/src/blocks/saucedemo-web/cart/NAV.md +1 -0
  236. package/templates/quickstart/src/blocks/saucedemo-web/cart/cart.sel.ts +9 -0
  237. package/templates/quickstart/src/blocks/saucedemo-web/cart/nav-cart.block.ts +19 -15
  238. package/templates/quickstart/src/blocks/saucedemo-web/cart/nav-checkout-info.block.ts +2 -1
  239. package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-one/NAV.md +6 -1
  240. package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-one/methods/checkout-info.sel.ts +11 -0
  241. package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-one/methods/fill-first-name.method.block.ts +22 -0
  242. package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-one/methods/fill-last-name.method.block.ts +21 -0
  243. package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-one/methods/fill-postal-code.method.block.ts +21 -0
  244. package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-one/methods/submit-checkout-info.method.block.ts +6 -7
  245. package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-two/NAV.md +2 -0
  246. package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-two/methods/checkout-overview.sel.ts +9 -0
  247. package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-two/methods/finish-order.method.block.ts +7 -6
  248. package/templates/quickstart/src/blocks/saucedemo-web/ff-owner-auth.block.ts +7 -2
  249. package/templates/quickstart/src/blocks/saucedemo-web/inventory/methods/add-to-cart.effect.block.ts +24 -16
  250. package/templates/quickstart/src/blocks/saucedemo-web/inventory/nav-item-detail.block.ts +3 -3
  251. package/templates/quickstart/src/blocks/saucedemo-web/inventory-item/NAV.md +1 -0
  252. package/templates/quickstart/src/blocks/saucedemo-web/inventory-item/item-detail.sel.ts +9 -0
  253. package/templates/quickstart/src/blocks/saucedemo-web/inventory-item/nav-back-to-inventory.block.ts +2 -1
  254. package/templates/quickstart/src/blocks/saucedemo-web/inventory-item/nav-back-to-products.block.ts +2 -1
  255. package/templates/quickstart/src/blocks/saucedemo-web/inventory-item/nav-continue-shopping.block.ts +2 -1
  256. package/templates/quickstart/src/blocks/saucedemo-web/methods/fill-password.method.block.ts +51 -0
  257. package/templates/quickstart/src/blocks/saucedemo-web/methods/fill-username.method.block.ts +69 -0
  258. package/templates/quickstart/src/blocks/saucedemo-web/methods/login.sel.ts +13 -0
  259. package/templates/quickstart/src/blocks/saucedemo-web/methods/submit-login-for-flow.ts +4 -4
  260. package/templates/quickstart/src/blocks/saucedemo-web/methods/submit-login.method.block.ts +35 -63
  261. package/templates/quickstart/src/blocks/saucedemo-web/methods/submit-logout.method.block.ts +4 -3
  262. package/templates/quickstart/src/blocks/saucedemo-web/nav-login.block.ts +14 -6
  263. package/templates/quickstart/src/flows/checkout-then-browse-again.flow.ts +15 -0
  264. package/templates/quickstart/src/flows/checkout.flow.ts +29 -2
  265. package/templates/quickstart/src/flows/device-showcase.flow.ts +4 -0
  266. package/templates/quickstart/src/flows/login.flow.ts +3 -1
  267. package/templates/quickstart/src/flows/shop.flow.ts +6 -0
  268. package/templates/quickstart/src/flows/smoke.flow.ts +13 -7
  269. package/templates/quickstart/src/flows/viewer-blocked.flow.ts +6 -2
  270. package/templates/quickstart/tests/chain-flow.spec.ts +8 -1
  271. package/templates/scaffold/STRUCTURE.md +23 -3
  272. package/templates/scaffold/src/blocks/demo-external/mailpit/mailpit-inbox.page.block.ts +30 -0
  273. package/templates/scaffold/src/blocks/demo-external/mailpit/mailpit-sel.ts +5 -0
  274. package/templates/scaffold/src/blocks/demo-external/mailpit/methods/assert-email-content.method.block.ts +48 -0
  275. package/templates/scaffold/src/blocks/demo-external/mailpit/methods/assert-email-received.method.block.ts +49 -0
  276. package/templates/scaffold/src/blocks/demo-external/mailpit/methods/extract-email-link.method.block.ts +41 -0
  277. package/templates/scaffold/src/blocks/demo-external/mailpit/methods/open-message.method.block.ts +39 -0
  278. package/templates/scaffold/src/blocks/demo-external/mailpit/nav-mailpit-inbox.block.ts +20 -0
  279. package/templates/scaffold/src/blocks/demo-web/demo-sel.ts +1 -0
  280. package/templates/scaffold/src/blocks/demo-web/docs.html +8 -0
  281. package/templates/scaffold/src/blocks/demo-web/home.html +4 -0
  282. package/templates/scaffold/src/blocks/demo-web/methods/assert-hello.method.block.ts +34 -38
  283. package/templates/scaffold/src/blocks/demo-web/methods/assert-item-added.method.block.ts +38 -0
  284. package/templates/scaffold/src/blocks/demo-web/nav-verification-link.block.ts +34 -0
  285. package/templates/scaffold/src/flows/mail-verify.flow.ts +85 -0
  286. package/templates/scaffold/src/flows/routes-demo.flow.ts +14 -0
  287. package/templates/scaffold/src/flows/shop.flow.ts +19 -2
  288. package/templates/scaffold/src/routes/(external)/docs/docs.sel.ts +7 -0
  289. package/templates/scaffold/src/routes/(external)/docs/nav.block.ts +21 -0
  290. package/templates/scaffold/src/routes/(external)/docs/page.block.ts +15 -0
  291. package/templates/scaffold/src/states/demo.mem-keys.ts +25 -1
  292. package/templates/scaffold/src/states/demo.states.ts +13 -0
  293. package/templates/scaffold/test-results/.last-run.json +4 -0
  294. package/templates/scaffold/tests/mail-verify.spec.ts +191 -0
  295. package/templates/skills/waygraph-blind-pilot.skill.md +61 -0
  296. package/templates/skills/waygraph-pilot.skill.md +108 -0
  297. package/templates/quickstart/README-saucedemo-commands.md +0 -72
@@ -1,6 +1,8 @@
1
1
  import { Engine, start, end, withTitle, withSessionReset, withExpectedFailure } from "waygraph";
2
2
  import { NavLoginBlock } from "../blocks/saucedemo-web/nav-login.block.js";
3
- import { SubmitLoginActionBlock } from "../blocks/saucedemo-web/methods/submit-login.method.block.js";
3
+ import { FillUsernameBlock } from "../blocks/saucedemo-web/methods/fill-username.method.block.js";
4
+ import { FillPasswordBlock } from "../blocks/saucedemo-web/methods/fill-password.method.block.js";
5
+ import { SubmitLoginBlock } from "../blocks/saucedemo-web/methods/submit-login.method.block.js";
4
6
 
5
7
  const engine = new Engine();
6
8
 
@@ -22,7 +24,9 @@ const engine = new Engine();
22
24
  // "expected outcome" panel (branching no longer throws).
23
25
  export const viewerBlockedFlow = withExpectedFailure(
24
26
  withTitle(
25
- withSessionReset(engine.defineFlow([start, NavLoginBlock, SubmitLoginActionBlock, end])),
27
+ withSessionReset(
28
+ engine.defineFlow([start, NavLoginBlock, FillUsernameBlock, FillPasswordBlock, SubmitLoginBlock, end]),
29
+ ),
26
30
  "Viewer: Blocked Login Attempt",
27
31
  ),
28
32
  "locked_out_user stays on LoginPage with the error banner - this is the product working as intended.",
@@ -1,7 +1,7 @@
1
1
  import { test, expect } from "@playwright/test";
2
2
  import { MemPage, checkpoint, Trait } from "waygraph";
3
3
  import { checkoutFlow } from "../src/flows/checkout.flow.js";
4
- import { SubmitLoginActionBlock } from "../src/blocks/saucedemo-web/methods/submit-login.method.block.js";
4
+ import { SubmitLoginBlock } from "../src/blocks/saucedemo-web/methods/submit-login.method.block.js";
5
5
  import { LoginCreds, SelectedItem } from "../src/states/checkout.mem-keys.js";
6
6
 
7
7
  // checkoutFlow.withBlockVerify/modBlockVerify - a spec that only imports the
@@ -31,9 +31,9 @@ test("withBlockVerify: replacing login's verify with an extra real check still p
31
31
  mem.set(LoginCreds({ username: "standard_user", password: "secret_sauce" }));
32
32
  mem.set(SelectedItem({ id: "sauce-labs-backpack", name: "Sauce Labs Backpack" }));
33
33
 
34
- // Addressed by the actual SubmitLoginActionBlock reference - the preferred
34
+ // Addressed by the actual SubmitLoginBlock reference - the preferred
35
35
  // form: no typo risk, refactor-safe, jump-to-definition works.
36
- const patched = checkoutFlow.withBlockVerify(SubmitLoginActionBlock, [
36
+ const patched = checkoutFlow.withBlockVerify(SubmitLoginBlock, [
37
37
  Trait.url({ pathname: "/inventory.html" }),
38
38
  Trait.visible(".inventory_list"),
39
39
  ]);
@@ -1,7 +1,9 @@
1
1
  import { test, expect } from "@playwright/test";
2
2
  import { MemPage, Engine, start, end } from "waygraph";
3
3
  import { NavLoginBlock } from "../src/blocks/saucedemo-web/nav-login.block.js";
4
- import { SubmitLoginActionBlock } from "../src/blocks/saucedemo-web/methods/submit-login.method.block.js";
4
+ import { FillUsernameBlock } from "../src/blocks/saucedemo-web/methods/fill-username.method.block.js";
5
+ import { FillPasswordBlock } from "../src/blocks/saucedemo-web/methods/fill-password.method.block.js";
6
+ import { SubmitLoginBlock } from "../src/blocks/saucedemo-web/methods/submit-login.method.block.js";
5
7
  import { LoginCreds } from "../src/states/checkout.mem-keys.js";
6
8
 
7
9
  test("submit-login: wrong password branches to LoginPage with error banner", async () => {
@@ -9,7 +11,7 @@ test("submit-login: wrong password branches to LoginPage with error banner", asy
9
11
  mem.set(LoginCreds({ username: "standard_user", password: "wrong-password" }));
10
12
 
11
13
  const engine = new Engine();
12
- const flow = engine.defineFlow([start, NavLoginBlock, SubmitLoginActionBlock, end]);
14
+ const flow = engine.defineFlow([start, NavLoginBlock, FillUsernameBlock, FillPasswordBlock, SubmitLoginBlock, end]);
13
15
  const result = await flow.run(mem);
14
16
 
15
17
  expect(result.__state).toBe("LoginPage");
@@ -20,7 +22,7 @@ test("submit-login: good password branches to LoggedIn", async () => {
20
22
  mem.set(LoginCreds({ username: "standard_user", password: "secret_sauce" }));
21
23
 
22
24
  const engine = new Engine();
23
- const flow = engine.defineFlow([start, NavLoginBlock, SubmitLoginActionBlock, end]);
25
+ const flow = engine.defineFlow([start, NavLoginBlock, FillUsernameBlock, FillPasswordBlock, SubmitLoginBlock, end]);
24
26
  const result = await flow.run(mem);
25
27
 
26
28
  expect(result.__state).toBe("LoggedIn");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waygraph",
3
- "version": "0.13.6",
3
+ "version": "0.14.0",
4
4
  "type": "module",
5
5
  "description": "A typed graph of reusable Blocks for driving a browser through E2E flows.",
6
6
  "license": "MIT",
@@ -20,6 +20,7 @@
20
20
  "bin",
21
21
  "templates",
22
22
  "examples",
23
+ "assets",
23
24
  "!examples/**/.tmp",
24
25
  "!examples/**/.tmp/**",
25
26
  "!examples/**/.waygraph-traverse",
@@ -13,11 +13,43 @@ You are a waygraph block author. Implement Blocks and Flows that match the consu
13
13
  ## Rules
14
14
 
15
15
  1. One concern per file: `nav-*.block.ts`, `*.page.block.ts`, `*.method.block.ts`, `*.effect.block.ts`, `*.flow.ts`.
16
- 2. Navigation only inside `defineNavBlock` / `defineNavClickBlock`. Regular Method/Effect `act` uses ActionPage (no goto).
17
- 3. Effects that appear in `waygraph auto` menus need `instanceOptions` that scan the live DOM (or mem) for labeled rows.
18
- 4. Stubs: `stubBefore` / `stubAfter` / `stubOnError` for demo narration; YAP slides on Methods when useful; flow fixtures via `withHighlightFixtures` when AC copy is flow-specific.
19
- 5. Mem: `requires` lists keys the block needs; seed via `--data` / `WAYGRAPH_DATA` / project defaults — never assume saucedemo creds for email keys.
20
- 6. External Mailpit/MailHog: nav to inbox URL from env; Methods open message / click verify link; never put mail UI under `*-web/`.
16
+ 2. **One distinct action per Block - hard rule, not a style preference.** A Method/Effect that
17
+ fills form fields *and* submits, or that drives a multi-step sequence inside one `act()`,
18
+ is wrong even if it "works" - split it into separate atomic Blocks. Concretely: a login
19
+ form is `fill-username` (self-loop) + `fill-password` (self-loop) + `submit-login` (the
20
+ real transition), never one Block doing all three. See `examples/saucedemo/src/blocks/saucedemo-web/methods/`
21
+ (`fill-username.method.block.ts`, `fill-password.method.block.ts`,
22
+ `submit-login.method.block.ts`) for the canonical before/after shape - `submit-login`
23
+ used to also fill both fields; now it only clicks. A Block that only asserts something on
24
+ the current page (no state change) is `defineAssertBlock({ name, checkpoint, verify,
25
+ requires? })` - self-loop and `resolve` are generated for you, so there is no hand-written
26
+ `act`/`resolve` to accidentally make do two things. Give it an explicit type argument
27
+ (`defineAssertBlock<LoggedIn>({...})`) whenever it is not the last Block before `end` -
28
+ without one it defaults to wildcard `Checkpoint<string>`, which breaks `defineFlow`'s
29
+ tuple typing once the assert sits between two specifically-typed Blocks.
30
+ 3. Navigation only inside `defineNavBlock` / `defineNavClickBlock`. Regular Method/Effect `act` uses ActionPage (no goto).
31
+ 4. Effects that appear in `waygraph auto` menus need `instanceOptions` that scan the live DOM (or mem) for labeled rows.
32
+ 5. Stubs: `stubBefore` / `stubAfter` / `stubOnError` for demo narration; YAP slides on Methods when useful; flow fixtures via `withHighlightFixtures` when AC copy is flow-specific.
33
+ 6. Mem: `requires` lists keys the block needs; seed via `--data` / `WAYGRAPH_DATA` / project defaults - never assume saucedemo creds for email keys. A key an *earlier Block in the same chain* produces (not the caller) is never declared under `requires` - `requires` means externally supplied, and preflight checks the whole chain up front, before any Block runs.
34
+ 7. **External Mailpit/MailHog: nav to inbox URL from env; Methods open message / read or click
35
+ the link; never put mail UI under `*-web/`.** Read the message via `page.locator`/
36
+ `page.frameLocator` DOM calls, never the catcher's REST API - zero new engine surface, and
37
+ it's narratable in `waygraph demo`/`auto`. Live, proven reference:
38
+ `templates/scaffold/src/blocks/demo-external/mailpit/` + `mail-verify.flow.ts`. Match a
39
+ specific inbox row by a mem-supplied recipient, not inbox position (a shared inbox across
40
+ runs can hold mail for more than one recipient). **Build the mail-reading Blocks
41
+ scenario-agnostic from the start**, not one Block set per email type: put the
42
+ link-matching pattern and expected body copy in mem too (alongside the recipient), so the
43
+ same fixed Blocks serve signup confirmation, password reset, magic link, etc. - a Block
44
+ named for one scenario (`extract-verification-link`) is a sign it should instead be named
45
+ for its mechanism (`extract-email-link`) and driven by mem. For asserting the message
46
+ *body* content (not just that a link exists), the top-level page's own `Trait.text`/
47
+ `Trait.visible` cannot see inside the preview iframe at all - use `Trait.frameVisible`/
48
+ `Trait.frameText`/`Trait.frameContains` (or a bespoke mem-aware `{ name, check(page, mem) }`
49
+ Trait when the expected value itself must vary per run).
50
+ 8. `verify`/`defineAssertBlock` selectors live in a `*Sel` object next to the route, never
51
+ inlined as a literal string in `Trait.visible(...)`/`Trait.text(...)` - `waygraph check`
52
+ warns on this (see below); fix by moving the string into that route's `*Sel`.
21
53
 
22
54
  ## Verify locally
23
55
 
@@ -31,6 +63,12 @@ npx playwright test
31
63
  npm run auto # or: npx waygraph auto --cli
32
64
  ```
33
65
 
66
+ **Do not report this work done until `waygraph check .` shows zero orphan Blocks and zero
67
+ inline-selector warnings, and zero nav-escape warnings for anything you touched.** A nonzero
68
+ count in any of those three is not an informational note to mention and move past - it means
69
+ go fix it first (wire the orphan into a `.flow.ts`, move the inline selector into `*Sel`, or
70
+ move the escaping navigation into a `defineNavBlock`), then re-run `check`.
71
+
34
72
  ## Output
35
73
 
36
74
  Ship compiling TypeScript under `src/blocks/` + `src/flows/` + `src/states/`. Update NAV.md when edges change. Keep STRUCTURE / SITE-MAP honest.
@@ -17,7 +17,12 @@ You are a waygraph planner. Your job is to dive an existing app and produce a SI
17
17
  3. **Block kinds:**
18
18
  - Nav — `defineNavBlock` / `defineNavClickBlock` — only place for `page.goto` / click-nav
19
19
  - Page — `definePageBlock` hub + `methods` registry
20
- - Method — forms, asserts, same-URL actions without instance menus
20
+ - Method - one same-URL action (a single form field fill, a single submit/click) - never
21
+ "fill several fields and submit" in one Block; each of those is its own Method
22
+ - Assert - `defineAssertBlock` - a same-URL check with no state change (self-loop);
23
+ prefer this over a hand-written Method for pure assertions, since `resolve` is generated
24
+ for you. Accepts `requires` like every other helper, for a mem-aware Trait's externally
25
+ -supplied input.
21
26
  - Effect — `defineEffectBlock` + `instanceOptions` for per-row auto menus (add/remove/toggle)
22
27
  4. **Mem keys:** typed `key` / `keyGroup`. Never rely on substring `"login"` defaults — email keys like `login-email` stay strings; credential objects use exact names such as `saucedemo.credentials` / `login-credentials`.
23
28
  5. Prefer `click` NavBlocks when the product has a real control; use `url` for deep links / email tokens.
@@ -27,9 +32,35 @@ You are a waygraph planner. Your job is to dive an existing app and produce a SI
27
32
  1. Read the app router (Next.js `app/`, etc.) and list real page URLs.
28
33
  2. Draft `src/blocks/SITE-MAP.md` with namespaces + route folders.
29
34
  3. For each route: list nav-to edges, methods/effects, checkpoints, mem keys in `NAV.md` (plan only).
30
- 4. Call out external surfaces (Mailpit inbox, magic-link verify) under `*-external/`.
35
+ 4. Call out external surfaces (Mailpit inbox, magic-link verify) under `*-external/`. Plan
36
+ these Blocks as reusable across every email-driven scenario the product has (signup
37
+ confirmation, password reset, magic link, ...) via mem (recipient, link pattern, expected
38
+ copy), not as a separate Block set per scenario - see
39
+ `templates/scaffold/src/blocks/demo-external/mailpit/` for the live, proven shape.
31
40
  5. Propose 1-3 starter flows (happy path, login/verify, one feature) — do not implement unless asked.
32
41
 
42
+ ## Blind mode (no frontend source)
43
+
44
+ When there is no app codebase to read - a production target, or a deliberately
45
+ codebase-blind engagement - discover the route/interaction structure live instead, using the
46
+ `waygraph auto` session tools rather than skipping planning:
47
+
48
+ 1. `waygraph auto --cli --detach [--base-url <url>]` against a throwaway project dir (or the
49
+ target project once a `src/blocks/` tree exists) - starts a driveable session, prints
50
+ `{sessionId, socketPath}`.
51
+ 2. `waygraph auto status <sessionId>` to read the current menu (what Blocks/edges are already
52
+ discoverable) and `waygraph auto dom <sessionId>` (default `aria` mode) to see the live
53
+ page's actual interactive elements by role/name - this is how you find real routes and
54
+ controls without reading a single line of frontend source.
55
+ 3. `waygraph auto send <sessionId> "<pick>"` to move to the next screen once you know what is
56
+ there; repeat status/dom/send to walk the app and build the same SITE-MAP/NAV.md picture
57
+ step 1-4 above describe, just discovered live instead of read from source.
58
+ 4. `waygraph auto trace <sessionId>` at the end to get the Checkpoint/Block sequence you just
59
+ walked as a JSON record - useful as a starting outline for the flows step 5 asks for.
60
+ 5. `waygraph auto send <sessionId> q` to end the session when done exploring.
61
+
62
+ Same output contract as sighted planning: a SITE-MAP/NAV.md plan, not implemented Blocks.
63
+
33
64
  ## Output
34
65
 
35
66
  Write/update markdown under `src/blocks/` (`SITE-MAP.md`, route `NAV.md` stubs). ASCII only. No localhost ports in shared docs.
@@ -16,11 +16,25 @@ Login page for Swag Labs. This folder is the namespace root (`/` in the browser)
16
16
 
17
17
  | File | Kind | Notes |
18
18
  |------|------|-------|
19
- | `methods/submit-login.method.block.ts` | Method | Form submit; branches LoggedIn vs LoginPage |
19
+ | `methods/fill-username.method.block.ts` | Method | Fills username only; self-loop on LoginPage |
20
+ | `methods/fill-password.method.block.ts` | Method | Fills password only; self-loop on LoginPage |
21
+ | `methods/submit-login.method.block.ts` | Method | Click Login only; branches LoggedIn vs LoginPage |
20
22
  | `methods/submit-login-for-flow.ts` | helper | Typed alias for linear Flows |
21
23
  | `methods/submit-logout.method.block.ts` | Method | Burger menu logout -> LoginPage |
24
+ | `methods/login.sel.ts` | helper | `LoginSel` (not a Block) |
25
+
26
+ Fill and submit are three separate Blocks (not one that fills both fields and
27
+ clicks Login) so the graph/demo show each as its own step - no Block does
28
+ more than one distinct action.
29
+
30
+ ## Other
31
+
32
+ | File | Kind | Notes |
33
+ |------|------|-------|
34
+ | `ff-owner-auth.block.ts` | FFCompose | Collapses nav-login + fill-username + fill-password + submit-login into one opaque demo/run step (`--ff-expand` shows all 4 again) |
22
35
 
23
36
  ## Related mem keys / checkpoints
24
37
 
25
38
  - Mem: `saucedemo.credentials` (`LoginCreds`)
26
39
  - Checkpoints: `LoginPage`, `LoggedIn` (success path of submit-login)
40
+ - Sel: `LoginSel` (`methods/login.sel.ts`) - DOM only, not mem
@@ -20,3 +20,4 @@ Shopping cart page and checkout entry.
20
20
  ## Related mem keys / checkpoints
21
21
 
22
22
  - Checkpoints: `CartPage`, `CheckoutInfoPage`, `ItemInCart` / `LoggedIn` (cart contents)
23
+ - Sel: `CartSel` (`cart.sel.ts`) - DOM only, not mem
@@ -0,0 +1,9 @@
1
+ /**
2
+ * DOM selectors for the cart route (`/cart.html`) and its outbound nav
3
+ * controls. Convention: DOM strings live in `*Sel` next to the page, not
4
+ * inlined in each Block.
5
+ */
6
+ export const CartSel = {
7
+ cartLink: ".shopping_cart_link",
8
+ checkoutBtn: "#checkout",
9
+ };
@@ -2,6 +2,7 @@ import { defineNavClickBlock, Trait } from "waygraph";
2
2
  import type { StubCtx } from "waygraph";
3
3
  import type { CartPage } from "../../../states/checkout.states.js";
4
4
  import { InventorySel } from "../inventory/methods/inventory-items.js";
5
+ import { CartSel } from "./cart.sel.js";
5
6
 
6
7
  /**
7
8
  * Kind: Nav
@@ -14,29 +15,32 @@ export const NavCartBlock = defineNavClickBlock<CartPage>({
14
15
  name: "nav-cart",
15
16
  description: "Clicks the cart link in the header.",
16
17
  checkpoint: "CartPage",
17
- click: ".shopping_cart_link",
18
+ click: CartSel.cartLink,
18
19
  verify: [Trait.url({ pathname: "/cart.html" })],
19
20
  stubBefore: (ctx: StubCtx) => {
20
21
  ctx.title("Open cart · landscape");
21
- // Device showcase: rotate tablet to landscape before the cart tap.
22
22
  ctx.landscape();
23
- ctx.todoId("saucedemo-cart");
24
- ctx.todos([
25
- { id: "cart-find", text: "Find the product" },
26
- { id: "cart-add", text: "Add to cart" },
27
- { id: "cart-open", text: "Open cart" },
28
- ]);
29
- ctx.todoIndex(2);
23
+ ctx.todos(
24
+ "saucedemo",
25
+ [
26
+ { id: "login-user", text: "Enter username", done: true },
27
+ { id: "login-pass", text: "Enter password", done: true },
28
+ { id: "login-submit", text: "Tap Login", done: true },
29
+ { id: "cart-find", text: "Find the product", done: true },
30
+ { id: "cart-add", text: "Add to cart", done: true },
31
+ { id: "cart-open", text: "Open cart" },
32
+ ],
33
+ { title: "Device showcase", index: 5 },
34
+ );
30
35
  ctx.zoom(1.4);
31
36
  ctx.zoomOut(false);
32
37
  ctx.highlights({
33
38
  cart: {
34
- selector: ".shopping_cart_link",
39
+ selector: CartSel.cartLink,
35
40
  label: "Cart",
36
- detail: "Zoom cart chrome",
41
+ detail: "Open cart",
37
42
  focus: true,
38
43
  color: "#c9a6ff",
39
- zoom: 1.55,
40
44
  zoomOut: false,
41
45
  followMouse: false,
42
46
  weight: "bold",
@@ -46,16 +50,16 @@ export const NavCartBlock = defineNavClickBlock<CartPage>({
46
50
  },
47
51
  stubAfter: (ctx: StubCtx) => {
48
52
  ctx.banner("Your cart · desktop");
49
- // Showcase finale: back to desktop.
50
53
  ctx.clearDevice();
51
- ctx.zoomOut(false);
54
+ ctx.hideTodos();
55
+ ctx.zoomOut(true);
52
56
  ctx.ring("items", {
53
57
  selector: InventorySel.cartItem,
54
58
  label: "Cart items",
55
59
  detail: "Product landed in cart",
56
60
  focus: true,
57
61
  color: "#86efac",
58
- zoom: 1.4,
62
+ zoomOut: true,
59
63
  followMouse: false,
60
64
  duration: true,
61
65
  });
@@ -1,5 +1,6 @@
1
1
  import { defineNavClickBlock, Trait } from "waygraph";
2
2
  import type { CheckoutInfoPage } from "../../../states/checkout.states.js";
3
+ import { CartSel } from "./cart.sel.js";
3
4
 
4
5
  /**
5
6
  * Kind: Nav
@@ -12,6 +13,6 @@ export const NavCheckoutInfoBlock = defineNavClickBlock<CheckoutInfoPage>({
12
13
  name: "nav-checkout-info",
13
14
  description: "Clicks 'Checkout' on the cart page.",
14
15
  checkpoint: "CheckoutInfoPage",
15
- click: "#checkout",
16
+ click: CartSel.checkoutBtn,
16
17
  verify: [Trait.url({ pathname: "/checkout-step-one.html" })],
17
18
  });
@@ -14,8 +14,13 @@ Shipping info form before order overview.
14
14
 
15
15
  | File | Kind | Notes |
16
16
  |------|------|-------|
17
- | `methods/submit-checkout-info.method.block.ts` | Method | Fill form + Continue -> overview |
17
+ | `methods/fill-first-name.method.block.ts` | Method | Fills first name only; self-loop on CheckoutInfoPage |
18
+ | `methods/fill-last-name.method.block.ts` | Method | Fills last name only; self-loop on CheckoutInfoPage |
19
+ | `methods/fill-postal-code.method.block.ts` | Method | Fills postal code only; self-loop on CheckoutInfoPage |
20
+ | `methods/submit-checkout-info.method.block.ts` | Method | Click Continue only -> overview |
21
+ | `methods/checkout-info.sel.ts` | helper | `CheckoutInfoSel` (not a Block) |
18
22
 
19
23
  ## Related mem keys / checkpoints
20
24
 
21
25
  - Checkpoints: `CheckoutInfoPage`, `CheckoutOverviewPage`
26
+ - Sel: `CheckoutInfoSel` (`methods/checkout-info.sel.ts`) - DOM only, not mem
@@ -0,0 +1,11 @@
1
+ /**
2
+ * DOM selectors for the shipping info form (`/checkout-step-one.html`).
3
+ * Convention: DOM strings live in `*Sel` next to the page, not inlined in
4
+ * each Block.
5
+ */
6
+ export const CheckoutInfoSel = {
7
+ firstName: "#first-name",
8
+ lastName: "#last-name",
9
+ postalCode: "#postal-code",
10
+ continueBtn: "#continue",
11
+ };
@@ -0,0 +1,22 @@
1
+ import { defineMethodBlock, checkpoint } from "waygraph";
2
+ import type { CheckoutInfoPage } from "../../../../states/checkout.states.js";
3
+ import { CheckoutInfoSel } from "./checkout-info.sel.js";
4
+
5
+ /**
6
+ * Kind: Method
7
+ * Helper: defineMethodBlock
8
+ * Route: saucedemo-web/checkout-step-one/methods/ (= /checkout-step-one.html)
9
+ *
10
+ * Fills the first name field only - self-loop on CheckoutInfoPage. Continue
11
+ * is its own Block (submit-checkout-info.method.block.ts).
12
+ */
13
+ export const FillFirstNameBlock = defineMethodBlock<CheckoutInfoPage, CheckoutInfoPage>({
14
+ name: "fill-first-name",
15
+ description: "Fills the first name field on the shipping info form.",
16
+ instruction: {
17
+ async act(page) {
18
+ await page.locator(CheckoutInfoSel.firstName).fill("Ada");
19
+ },
20
+ resolve: () => checkpoint("CheckoutInfoPage"),
21
+ },
22
+ });
@@ -0,0 +1,21 @@
1
+ import { defineMethodBlock, checkpoint } from "waygraph";
2
+ import type { CheckoutInfoPage } from "../../../../states/checkout.states.js";
3
+ import { CheckoutInfoSel } from "./checkout-info.sel.js";
4
+
5
+ /**
6
+ * Kind: Method
7
+ * Helper: defineMethodBlock
8
+ * Route: saucedemo-web/checkout-step-one/methods/ (= /checkout-step-one.html)
9
+ *
10
+ * Fills the last name field only - self-loop on CheckoutInfoPage.
11
+ */
12
+ export const FillLastNameBlock = defineMethodBlock<CheckoutInfoPage, CheckoutInfoPage>({
13
+ name: "fill-last-name",
14
+ description: "Fills the last name field on the shipping info form.",
15
+ instruction: {
16
+ async act(page) {
17
+ await page.locator(CheckoutInfoSel.lastName).fill("Lovelace");
18
+ },
19
+ resolve: () => checkpoint("CheckoutInfoPage"),
20
+ },
21
+ });
@@ -0,0 +1,21 @@
1
+ import { defineMethodBlock, checkpoint } from "waygraph";
2
+ import type { CheckoutInfoPage } from "../../../../states/checkout.states.js";
3
+ import { CheckoutInfoSel } from "./checkout-info.sel.js";
4
+
5
+ /**
6
+ * Kind: Method
7
+ * Helper: defineMethodBlock
8
+ * Route: saucedemo-web/checkout-step-one/methods/ (= /checkout-step-one.html)
9
+ *
10
+ * Fills the postal code field only - self-loop on CheckoutInfoPage.
11
+ */
12
+ export const FillPostalCodeBlock = defineMethodBlock<CheckoutInfoPage, CheckoutInfoPage>({
13
+ name: "fill-postal-code",
14
+ description: "Fills the postal code field on the shipping info form.",
15
+ instruction: {
16
+ async act(page) {
17
+ await page.locator(CheckoutInfoSel.postalCode).fill("1000");
18
+ },
19
+ resolve: () => checkpoint("CheckoutInfoPage"),
20
+ },
21
+ });
@@ -1,23 +1,22 @@
1
1
  import { defineMethodBlock, checkpoint, Trait } from "waygraph";
2
2
  import type { CheckoutInfoPage, CheckoutOverviewPage } from "../../../../states/checkout.states.js";
3
+ import { CheckoutInfoSel } from "./checkout-info.sel.js";
3
4
 
4
5
  /**
5
6
  * Kind: Method
6
7
  * Helper: defineMethodBlock
7
8
  * Route: saucedemo-web/checkout-step-one/methods/ (= /checkout-step-one.html)
8
9
  *
9
- * Fills shipping form and continues - never navigates itself
10
- * (nav-checkout-info already got here).
10
+ * Clicks Continue only - fields are filled by fill-first-name /
11
+ * fill-last-name / fill-postal-code (each its own Block). One Block, one
12
+ * action: submit.
11
13
  */
12
14
  export const SubmitCheckoutInfoBlock = defineMethodBlock<CheckoutInfoPage, CheckoutOverviewPage>({
13
15
  name: "submit-checkout-info",
14
- description: "Fills in the shipping info form and continues to the order overview.",
16
+ description: "Continues from the shipping info form to the order overview.",
15
17
  instruction: {
16
18
  async act(page) {
17
- await page.locator("#first-name").fill("Ada");
18
- await page.locator("#last-name").fill("Lovelace");
19
- await page.locator("#postal-code").fill("1000");
20
- await page.locator("#continue").click();
19
+ await page.locator(CheckoutInfoSel.continueBtn).click();
21
20
  },
22
21
  resolve: () => checkpoint("CheckoutOverviewPage"),
23
22
  verify: [Trait.url({ pathname: "/checkout-step-two.html" })],
@@ -15,7 +15,9 @@ Order overview / finish page.
15
15
  | File | Kind | Notes |
16
16
  |------|------|-------|
17
17
  | `methods/finish-order.method.block.ts` | Method | Finish -> thank-you / OrderComplete |
18
+ | `methods/checkout-overview.sel.ts` | helper | `CheckoutOverviewSel` (not a Block) |
18
19
 
19
20
  ## Related mem keys / checkpoints
20
21
 
21
22
  - Checkpoints: `CheckoutOverviewPage`, `OrderComplete`
23
+ - Sel: `CheckoutOverviewSel` (`methods/checkout-overview.sel.ts`) - DOM only, not mem
@@ -0,0 +1,9 @@
1
+ /**
2
+ * DOM selectors for the order overview / completion page
3
+ * (`/checkout-step-two.html`). Convention: DOM strings live in `*Sel` next
4
+ * to the page, not inlined in each Block.
5
+ */
6
+ export const CheckoutOverviewSel = {
7
+ finishBtn: "#finish",
8
+ completeHeader: ".complete-header",
9
+ };
@@ -1,5 +1,6 @@
1
1
  import { defineMethodBlock, checkpoint, Trait, narrate } from "waygraph";
2
2
  import type { CheckoutOverviewPage, OrderComplete } from "../../../../states/checkout.states.js";
3
+ import { CheckoutOverviewSel } from "./checkout-overview.sel.js";
3
4
 
4
5
  /**
5
6
  * Kind: Method
@@ -13,17 +14,17 @@ export const FinishOrderBlock = defineMethodBlock<CheckoutOverviewPage, OrderCom
13
14
  description: "Places the order and confirms the 'Thank you for your order!' completion page.",
14
15
  instruction: {
15
16
  async act(page) {
16
- const finishButton = page.locator("#finish");
17
+ const finishButton = page.locator(CheckoutOverviewSel.finishBtn);
17
18
  await narrate(finishButton, "Placing the order", () => finishButton.click());
18
19
  },
19
20
  resolve: () => checkpoint("OrderComplete"),
20
- verify: [Trait.text(".complete-header", "Thank you for your order!")],
21
+ verify: [Trait.text(CheckoutOverviewSel.completeHeader, "Thank you for your order!")],
21
22
  stubBefore: {
22
- finish: { selector: "#finish", label: "Finish" },
23
+ finish: { selector: CheckoutOverviewSel.finishBtn, label: "Finish" },
23
24
  },
24
25
  stubAfter: {
25
26
  thanks: {
26
- selector: ".complete-header",
27
+ selector: CheckoutOverviewSel.completeHeader,
27
28
  label: "Order confirmed",
28
29
  detail: "Thank you for your order!",
29
30
  duration: true,
@@ -42,7 +43,7 @@ export const FinishOrderBlock = defineMethodBlock<CheckoutOverviewPage, OrderCom
42
43
  caption: "Completion page is the durable proof",
43
44
  detail: "The thank-you header is what verify asserts on.",
44
45
  tag: "YAP",
45
- selector: ".complete-header",
46
+ selector: CheckoutOverviewSel.completeHeader,
46
47
  duration: 2500,
47
48
  fastMode: 700,
48
49
  },
@@ -50,7 +51,7 @@ export const FinishOrderBlock = defineMethodBlock<CheckoutOverviewPage, OrderCom
50
51
  caption: "Episode continues after this yap",
51
52
  detail: "Next step rings the same banner, then you move on.",
52
53
  tag: "YAP",
53
- selector: ".complete-header",
54
+ selector: CheckoutOverviewSel.completeHeader,
54
55
  duration: true,
55
56
  fastMode: 500,
56
57
  },
@@ -1,5 +1,7 @@
1
1
  import { fastForwardComposeBlock } from "waygraph";
2
2
  import { NavLoginBlock } from "./nav-login.block.js";
3
+ import { FillUsernameBlock } from "./methods/fill-username.method.block.js";
4
+ import { FillPasswordBlock } from "./methods/fill-password.method.block.js";
3
5
  import { SubmitLoginForFlow } from "./methods/submit-login-for-flow.js";
4
6
 
5
7
  /**
@@ -7,11 +9,14 @@ import { SubmitLoginForFlow } from "./methods/submit-login-for-flow.js";
7
9
  * Helper: fastForwardComposeBlock
8
10
  * Route: saucedemo-web/ (auth prefix)
9
11
  *
10
- * Collapses nav-login + submit-login into one opaque demo/run step so
11
- * checkout demos skip watching auth. Use --ff-expand to gate inners again.
12
+ * Collapses nav-login + fill-username + fill-password + submit-login into
13
+ * one opaque demo/run step so checkout demos skip watching auth. Use
14
+ * --ff-expand to gate inners again (they show as 4 separate steps).
12
15
  * loginFlow stays expanded for Sign In episode narration.
13
16
  */
14
17
  export const FfOwnerAuthBlock = fastForwardComposeBlock("ff-owner-auth", [
15
18
  NavLoginBlock,
19
+ FillUsernameBlock,
20
+ FillPasswordBlock,
16
21
  SubmitLoginForFlow,
17
22
  ]);
@@ -37,16 +37,20 @@ export const AddToCartBlock = defineEffectBlock<Checkpoint<string>, ItemInCart>(
37
37
  // Demo: zoom product -> add (stay zoomed), then badge after act.
38
38
  stubBefore: (ctx: StubCtx) => {
39
39
  ctx.title("Pick a product · tablet");
40
- // Device showcase: tablet portrait (toast + lerp from mobile landscape).
41
40
  ctx.device("tablet");
42
41
  ctx.portrait();
43
- ctx.todoId("saucedemo-cart");
44
- ctx.todos([
45
- { id: "cart-find", text: "Find the product" },
46
- { id: "cart-add", text: "Add to cart" },
47
- { id: "cart-open", text: "Open cart" },
48
- ]);
49
- ctx.todoIndex(0);
42
+ ctx.todos(
43
+ "saucedemo",
44
+ [
45
+ { id: "login-user", text: "Enter username", done: true },
46
+ { id: "login-pass", text: "Enter password", done: true },
47
+ { id: "login-submit", text: "Tap Login", done: true },
48
+ { id: "cart-find", text: "Find the product" },
49
+ { id: "cart-add", text: "Add to cart" },
50
+ { id: "cart-open", text: "Open cart" },
51
+ ],
52
+ { title: "Device showcase", index: 3 },
53
+ );
50
54
  ctx.zoom(1.35);
51
55
  ctx.zoomOut(false);
52
56
  ctx.highlights({
@@ -72,13 +76,18 @@ export const AddToCartBlock = defineEffectBlock<Checkpoint<string>, ItemInCart>(
72
76
  },
73
77
  stubAfter: (ctx: StubCtx) => {
74
78
  ctx.banner("In the cart");
75
- ctx.todoId("saucedemo-cart");
76
- ctx.todos([
77
- { id: "cart-find", text: "Find the product" },
78
- { id: "cart-add", text: "Add to cart" },
79
- { id: "cart-open", text: "Open cart" },
80
- ]);
81
- ctx.todoIndex(1);
79
+ ctx.todos(
80
+ "saucedemo",
81
+ [
82
+ { id: "login-user", text: "Enter username", done: true },
83
+ { id: "login-pass", text: "Enter password", done: true },
84
+ { id: "login-submit", text: "Tap Login", done: true },
85
+ { id: "cart-find", text: "Find the product", done: true },
86
+ { id: "cart-add", text: "Add to cart" },
87
+ { id: "cart-open", text: "Open cart" },
88
+ ],
89
+ { title: "Device showcase", index: 4 },
90
+ );
82
91
  ctx.zoomOut(false);
83
92
  ctx.ring("badge", {
84
93
  selector: InventorySel.cartBadge,
@@ -86,7 +95,6 @@ export const AddToCartBlock = defineEffectBlock<Checkpoint<string>, ItemInCart>(
86
95
  detail: "Item count updated",
87
96
  focus: true,
88
97
  color: "#86efac",
89
- zoom: 1.6,
90
98
  zoomOut: false,
91
99
  duration: true,
92
100
  });