@limrun/playwright-core 1.56.1-lim.1 → 1.61.0-lim.1

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 (378) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +5 -0
  3. package/ThirdPartyNotices.txt +7 -1496
  4. package/bin/install_webkit_wsl.ps1 +1 -3
  5. package/bin/reinstall_chrome_beta_linux.sh +1 -1
  6. package/bin/reinstall_chrome_beta_mac.sh +1 -1
  7. package/bin/reinstall_chrome_stable_linux.sh +1 -1
  8. package/bin/reinstall_chrome_stable_mac.sh +1 -1
  9. package/bin/reinstall_msedge_beta_linux.sh +1 -1
  10. package/bin/reinstall_msedge_beta_mac.sh +1 -1
  11. package/bin/reinstall_msedge_dev_linux.sh +1 -1
  12. package/bin/reinstall_msedge_dev_mac.sh +1 -1
  13. package/bin/reinstall_msedge_stable_linux.sh +1 -1
  14. package/bin/reinstall_msedge_stable_mac.sh +1 -1
  15. package/browsers.json +23 -22
  16. package/cli.js +4 -1
  17. package/index.js +2 -17
  18. package/lib/bootstrap.js +88 -0
  19. package/lib/coreBundle.js +73385 -0
  20. package/lib/entry/cliDaemon.js +5 -0
  21. package/lib/entry/dashboardApp.js +3 -0
  22. package/lib/entry/mcp.js +10 -0
  23. package/lib/entry/oopBrowserDownload.js +3 -0
  24. package/lib/{server/deviceDescriptors.js → package.js} +18 -7
  25. package/lib/server/deviceDescriptorsSource.json +1142 -182
  26. package/lib/server/electron/loader.js +99 -13
  27. package/lib/serverRegistry.js +7343 -0
  28. package/lib/serverRegistry.js.LICENSE +354 -0
  29. package/lib/tools/cli-client/channelSessions.js +141 -0
  30. package/lib/tools/cli-client/cli.js +6 -0
  31. package/lib/tools/cli-client/help.json +693 -0
  32. package/lib/tools/cli-client/minimist.js +128 -0
  33. package/lib/tools/cli-client/output.js +343 -0
  34. package/lib/tools/cli-client/program.js +404 -0
  35. package/lib/tools/cli-client/registry.js +176 -0
  36. package/lib/tools/cli-client/session.js +254 -0
  37. package/lib/tools/cli-client/skill/SKILL.md +404 -0
  38. package/lib/tools/cli-client/skill/references/element-attributes.md +23 -0
  39. package/lib/tools/cli-client/skill/references/playwright-tests.md +39 -0
  40. package/lib/tools/cli-client/skill/references/request-mocking.md +87 -0
  41. package/lib/tools/cli-client/skill/references/running-code.md +241 -0
  42. package/lib/tools/cli-client/skill/references/session-management.md +225 -0
  43. package/lib/tools/cli-client/skill/references/spec-driven-testing.md +305 -0
  44. package/lib/tools/cli-client/skill/references/storage-state.md +275 -0
  45. package/lib/tools/cli-client/skill/references/test-generation.md +134 -0
  46. package/lib/tools/cli-client/skill/references/tracing.md +139 -0
  47. package/lib/tools/cli-client/skill/references/video-recording.md +143 -0
  48. package/lib/tools/dashboard/appIcon.png +0 -0
  49. package/lib/tools/trace/SKILL.md +171 -0
  50. package/lib/{server/utils/profiler.js → tools/utils/extension.js} +42 -29
  51. package/lib/tools/utils/socketConnection.js +108 -0
  52. package/lib/utilsBundle.js +86695 -68
  53. package/lib/utilsBundle.js.LICENSE +2056 -0
  54. package/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
  55. package/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +1 -0
  56. package/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +1 -0
  57. package/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +1 -0
  58. package/lib/vite/dashboard/assets/index-BY2S1tHT.css +1 -0
  59. package/lib/vite/dashboard/assets/index-C_5TMfeg.js +52 -0
  60. package/lib/vite/dashboard/assets/safari-na3_-uQk.svg +1 -0
  61. package/lib/vite/dashboard/index.html +29 -0
  62. package/lib/vite/dashboard/playwright-logo.svg +24 -0
  63. package/lib/vite/htmlReport/index.html +2 -70
  64. package/lib/vite/htmlReport/report.css +1 -0
  65. package/lib/vite/htmlReport/report.js +72 -0
  66. package/lib/vite/{traceViewer/codeMirrorModule.C3UTv-Ge.css → recorder/assets/codeMirrorModule-DYBRYzYX.css} +1 -1
  67. package/lib/vite/recorder/assets/codeMirrorModule-DeBYQozu.js +32 -0
  68. package/lib/vite/recorder/assets/index-4ZiSSCmn.css +1 -0
  69. package/lib/vite/recorder/assets/index-Bq-mQf8S.js +193 -0
  70. package/lib/vite/recorder/index.html +2 -2
  71. package/lib/vite/traceViewer/assets/codeMirrorModule-LEHpjmcn.js +32 -0
  72. package/lib/vite/traceViewer/assets/defaultSettingsView-BNmKHKpQ.js +264 -0
  73. package/lib/vite/traceViewer/assets/urlMatch-BYQrIQwR.js +1 -0
  74. package/lib/vite/{recorder/assets/codeMirrorModule-C3UTv-Ge.css → traceViewer/codeMirrorModule.DYBRYzYX.css} +1 -1
  75. package/lib/vite/traceViewer/defaultSettingsView.CjdS-WJx.css +1 -0
  76. package/lib/vite/traceViewer/index.CzXZzn5A.css +1 -0
  77. package/lib/vite/traceViewer/index.DEBl1tfz.js +2 -0
  78. package/lib/vite/traceViewer/index.html +7 -6
  79. package/lib/vite/traceViewer/manifest.webmanifest +16 -0
  80. package/lib/vite/traceViewer/snapshot.html +4 -15
  81. package/lib/vite/traceViewer/snapshot.v8KI4P3m.js +2 -0
  82. package/lib/vite/traceViewer/sw.bundle.js +5 -3
  83. package/lib/vite/traceViewer/uiMode.BZQ54Kgt.css +1 -0
  84. package/lib/vite/traceViewer/uiMode.Ut8wwJNp.js +6 -0
  85. package/lib/vite/traceViewer/uiMode.html +5 -4
  86. package/package.json +4 -12
  87. package/types/protocol.d.ts +2101 -602
  88. package/types/types.d.ts +6183 -4591
  89. package/lib/androidServerImpl.js +0 -65
  90. package/lib/browserServerImpl.js +0 -120
  91. package/lib/cli/driver.js +0 -97
  92. package/lib/cli/program.js +0 -633
  93. package/lib/cli/programWithTestStub.js +0 -74
  94. package/lib/client/accessibility.js +0 -49
  95. package/lib/client/android.js +0 -361
  96. package/lib/client/api.js +0 -137
  97. package/lib/client/artifact.js +0 -79
  98. package/lib/client/browser.js +0 -163
  99. package/lib/client/browserContext.js +0 -529
  100. package/lib/client/browserType.js +0 -184
  101. package/lib/client/cdpSession.js +0 -51
  102. package/lib/client/channelOwner.js +0 -194
  103. package/lib/client/clientHelper.js +0 -64
  104. package/lib/client/clientInstrumentation.js +0 -55
  105. package/lib/client/clientStackTrace.js +0 -69
  106. package/lib/client/clock.js +0 -68
  107. package/lib/client/connection.js +0 -314
  108. package/lib/client/consoleMessage.js +0 -54
  109. package/lib/client/coverage.js +0 -44
  110. package/lib/client/dialog.js +0 -56
  111. package/lib/client/download.js +0 -62
  112. package/lib/client/electron.js +0 -138
  113. package/lib/client/elementHandle.js +0 -281
  114. package/lib/client/errors.js +0 -77
  115. package/lib/client/eventEmitter.js +0 -314
  116. package/lib/client/events.js +0 -99
  117. package/lib/client/fetch.js +0 -369
  118. package/lib/client/fileChooser.js +0 -46
  119. package/lib/client/fileUtils.js +0 -34
  120. package/lib/client/frame.js +0 -408
  121. package/lib/client/harRouter.js +0 -87
  122. package/lib/client/input.js +0 -84
  123. package/lib/client/jsHandle.js +0 -109
  124. package/lib/client/jsonPipe.js +0 -39
  125. package/lib/client/localUtils.js +0 -60
  126. package/lib/client/locator.js +0 -366
  127. package/lib/client/network.js +0 -747
  128. package/lib/client/page.js +0 -721
  129. package/lib/client/platform.js +0 -74
  130. package/lib/client/playwright.js +0 -75
  131. package/lib/client/selectors.js +0 -55
  132. package/lib/client/stream.js +0 -39
  133. package/lib/client/timeoutSettings.js +0 -79
  134. package/lib/client/tracing.js +0 -117
  135. package/lib/client/types.js +0 -28
  136. package/lib/client/video.js +0 -59
  137. package/lib/client/waiter.js +0 -142
  138. package/lib/client/webError.js +0 -39
  139. package/lib/client/webSocket.js +0 -93
  140. package/lib/client/worker.js +0 -63
  141. package/lib/client/writableStream.js +0 -39
  142. package/lib/generated/bindingsControllerSource.js +0 -28
  143. package/lib/generated/clockSource.js +0 -28
  144. package/lib/generated/injectedScriptSource.js +0 -28
  145. package/lib/generated/pollingRecorderSource.js +0 -28
  146. package/lib/generated/storageScriptSource.js +0 -28
  147. package/lib/generated/utilityScriptSource.js +0 -28
  148. package/lib/generated/webSocketMockSource.js +0 -336
  149. package/lib/inProcessFactory.js +0 -62
  150. package/lib/inprocess.js +0 -3
  151. package/lib/outofprocess.js +0 -76
  152. package/lib/protocol/serializers.js +0 -192
  153. package/lib/protocol/validator.js +0 -2912
  154. package/lib/protocol/validatorPrimitives.js +0 -193
  155. package/lib/remote/playwrightConnection.js +0 -129
  156. package/lib/remote/playwrightServer.js +0 -335
  157. package/lib/server/accessibility.js +0 -69
  158. package/lib/server/android/android.js +0 -465
  159. package/lib/server/android/backendAdb.js +0 -177
  160. package/lib/server/artifact.js +0 -127
  161. package/lib/server/bidi/bidiBrowser.js +0 -490
  162. package/lib/server/bidi/bidiChromium.js +0 -153
  163. package/lib/server/bidi/bidiConnection.js +0 -212
  164. package/lib/server/bidi/bidiExecutionContext.js +0 -221
  165. package/lib/server/bidi/bidiFirefox.js +0 -130
  166. package/lib/server/bidi/bidiInput.js +0 -146
  167. package/lib/server/bidi/bidiNetworkManager.js +0 -383
  168. package/lib/server/bidi/bidiOverCdp.js +0 -102
  169. package/lib/server/bidi/bidiPage.js +0 -552
  170. package/lib/server/bidi/bidiPdf.js +0 -106
  171. package/lib/server/bidi/third_party/bidiCommands.d.js +0 -22
  172. package/lib/server/bidi/third_party/bidiDeserializer.js +0 -98
  173. package/lib/server/bidi/third_party/bidiKeyboard.js +0 -256
  174. package/lib/server/bidi/third_party/bidiProtocol.js +0 -24
  175. package/lib/server/bidi/third_party/bidiProtocolCore.js +0 -179
  176. package/lib/server/bidi/third_party/bidiProtocolPermissions.js +0 -42
  177. package/lib/server/bidi/third_party/bidiSerializer.js +0 -148
  178. package/lib/server/bidi/third_party/firefoxPrefs.js +0 -259
  179. package/lib/server/browser.js +0 -149
  180. package/lib/server/browserContext.js +0 -696
  181. package/lib/server/browserType.js +0 -328
  182. package/lib/server/callLog.js +0 -82
  183. package/lib/server/chromium/chromium.js +0 -391
  184. package/lib/server/chromium/chromiumSwitches.js +0 -95
  185. package/lib/server/chromium/crAccessibility.js +0 -263
  186. package/lib/server/chromium/crBrowser.js +0 -502
  187. package/lib/server/chromium/crConnection.js +0 -202
  188. package/lib/server/chromium/crCoverage.js +0 -235
  189. package/lib/server/chromium/crDevTools.js +0 -113
  190. package/lib/server/chromium/crDragDrop.js +0 -131
  191. package/lib/server/chromium/crExecutionContext.js +0 -146
  192. package/lib/server/chromium/crInput.js +0 -187
  193. package/lib/server/chromium/crNetworkManager.js +0 -666
  194. package/lib/server/chromium/crPage.js +0 -1069
  195. package/lib/server/chromium/crPdf.js +0 -121
  196. package/lib/server/chromium/crProtocolHelper.js +0 -145
  197. package/lib/server/chromium/crServiceWorker.js +0 -123
  198. package/lib/server/chromium/defaultFontFamilies.js +0 -162
  199. package/lib/server/chromium/protocol.d.js +0 -16
  200. package/lib/server/chromium/videoRecorder.js +0 -113
  201. package/lib/server/clock.js +0 -149
  202. package/lib/server/codegen/csharp.js +0 -327
  203. package/lib/server/codegen/java.js +0 -274
  204. package/lib/server/codegen/javascript.js +0 -270
  205. package/lib/server/codegen/jsonl.js +0 -52
  206. package/lib/server/codegen/language.js +0 -132
  207. package/lib/server/codegen/languages.js +0 -68
  208. package/lib/server/codegen/python.js +0 -279
  209. package/lib/server/codegen/types.js +0 -16
  210. package/lib/server/console.js +0 -53
  211. package/lib/server/cookieStore.js +0 -206
  212. package/lib/server/debugController.js +0 -191
  213. package/lib/server/debugger.js +0 -119
  214. package/lib/server/dialog.js +0 -116
  215. package/lib/server/dispatchers/androidDispatcher.js +0 -325
  216. package/lib/server/dispatchers/artifactDispatcher.js +0 -118
  217. package/lib/server/dispatchers/browserContextDispatcher.js +0 -364
  218. package/lib/server/dispatchers/browserDispatcher.js +0 -118
  219. package/lib/server/dispatchers/browserTypeDispatcher.js +0 -64
  220. package/lib/server/dispatchers/cdpSessionDispatcher.js +0 -44
  221. package/lib/server/dispatchers/debugControllerDispatcher.js +0 -78
  222. package/lib/server/dispatchers/dialogDispatcher.js +0 -47
  223. package/lib/server/dispatchers/dispatcher.js +0 -371
  224. package/lib/server/dispatchers/electronDispatcher.js +0 -89
  225. package/lib/server/dispatchers/elementHandlerDispatcher.js +0 -181
  226. package/lib/server/dispatchers/frameDispatcher.js +0 -227
  227. package/lib/server/dispatchers/jsHandleDispatcher.js +0 -85
  228. package/lib/server/dispatchers/jsonPipeDispatcher.js +0 -58
  229. package/lib/server/dispatchers/localUtilsDispatcher.js +0 -149
  230. package/lib/server/dispatchers/networkDispatchers.js +0 -213
  231. package/lib/server/dispatchers/pageDispatcher.js +0 -401
  232. package/lib/server/dispatchers/playwrightDispatcher.js +0 -112
  233. package/lib/server/dispatchers/streamDispatcher.js +0 -67
  234. package/lib/server/dispatchers/tracingDispatcher.js +0 -68
  235. package/lib/server/dispatchers/webSocketRouteDispatcher.js +0 -165
  236. package/lib/server/dispatchers/writableStreamDispatcher.js +0 -79
  237. package/lib/server/dom.js +0 -806
  238. package/lib/server/download.js +0 -70
  239. package/lib/server/electron/electron.js +0 -270
  240. package/lib/server/errors.js +0 -69
  241. package/lib/server/fetch.js +0 -621
  242. package/lib/server/fileChooser.js +0 -43
  243. package/lib/server/fileUploadUtils.js +0 -84
  244. package/lib/server/firefox/ffAccessibility.js +0 -238
  245. package/lib/server/firefox/ffBrowser.js +0 -428
  246. package/lib/server/firefox/ffConnection.js +0 -147
  247. package/lib/server/firefox/ffExecutionContext.js +0 -150
  248. package/lib/server/firefox/ffInput.js +0 -159
  249. package/lib/server/firefox/ffNetworkManager.js +0 -256
  250. package/lib/server/firefox/ffPage.js +0 -503
  251. package/lib/server/firefox/firefox.js +0 -105
  252. package/lib/server/firefox/protocol.d.js +0 -16
  253. package/lib/server/formData.js +0 -147
  254. package/lib/server/frameSelectors.js +0 -156
  255. package/lib/server/frames.js +0 -1448
  256. package/lib/server/har/harRecorder.js +0 -147
  257. package/lib/server/har/harTracer.js +0 -607
  258. package/lib/server/harBackend.js +0 -157
  259. package/lib/server/helper.js +0 -96
  260. package/lib/server/index.js +0 -58
  261. package/lib/server/input.js +0 -273
  262. package/lib/server/instrumentation.js +0 -69
  263. package/lib/server/javascript.js +0 -291
  264. package/lib/server/launchApp.js +0 -128
  265. package/lib/server/localUtils.js +0 -218
  266. package/lib/server/macEditingCommands.js +0 -143
  267. package/lib/server/network.js +0 -629
  268. package/lib/server/page.js +0 -870
  269. package/lib/server/pipeTransport.js +0 -89
  270. package/lib/server/playwright.js +0 -71
  271. package/lib/server/progress.js +0 -112
  272. package/lib/server/protocolError.js +0 -52
  273. package/lib/server/recorder/chat.js +0 -161
  274. package/lib/server/recorder/recorderApp.js +0 -387
  275. package/lib/server/recorder/recorderRunner.js +0 -138
  276. package/lib/server/recorder/recorderSignalProcessor.js +0 -83
  277. package/lib/server/recorder/recorderUtils.js +0 -157
  278. package/lib/server/recorder/throttledFile.js +0 -57
  279. package/lib/server/recorder.js +0 -498
  280. package/lib/server/registry/browserFetcher.js +0 -175
  281. package/lib/server/registry/dependencies.js +0 -371
  282. package/lib/server/registry/index.js +0 -1333
  283. package/lib/server/registry/nativeDeps.js +0 -1280
  284. package/lib/server/registry/oopDownloadBrowserMain.js +0 -120
  285. package/lib/server/screenshotter.js +0 -333
  286. package/lib/server/selectors.js +0 -112
  287. package/lib/server/socksClientCertificatesInterceptor.js +0 -383
  288. package/lib/server/socksInterceptor.js +0 -95
  289. package/lib/server/trace/recorder/snapshotter.js +0 -147
  290. package/lib/server/trace/recorder/snapshotterInjected.js +0 -541
  291. package/lib/server/trace/recorder/tracing.js +0 -602
  292. package/lib/server/trace/test/inMemorySnapshotter.js +0 -87
  293. package/lib/server/trace/viewer/traceViewer.js +0 -240
  294. package/lib/server/transport.js +0 -181
  295. package/lib/server/types.js +0 -28
  296. package/lib/server/usKeyboardLayout.js +0 -145
  297. package/lib/server/utils/ascii.js +0 -44
  298. package/lib/server/utils/comparators.js +0 -161
  299. package/lib/server/utils/crypto.js +0 -216
  300. package/lib/server/utils/debug.js +0 -42
  301. package/lib/server/utils/debugLogger.js +0 -122
  302. package/lib/server/utils/env.js +0 -73
  303. package/lib/server/utils/eventsHelper.js +0 -39
  304. package/lib/server/utils/expectUtils.js +0 -38
  305. package/lib/server/utils/fileUtils.js +0 -191
  306. package/lib/server/utils/happyEyeballs.js +0 -207
  307. package/lib/server/utils/hostPlatform.js +0 -111
  308. package/lib/server/utils/httpServer.js +0 -218
  309. package/lib/server/utils/image_tools/colorUtils.js +0 -89
  310. package/lib/server/utils/image_tools/compare.js +0 -109
  311. package/lib/server/utils/image_tools/imageChannel.js +0 -78
  312. package/lib/server/utils/image_tools/stats.js +0 -102
  313. package/lib/server/utils/linuxUtils.js +0 -71
  314. package/lib/server/utils/network.js +0 -227
  315. package/lib/server/utils/nodePlatform.js +0 -148
  316. package/lib/server/utils/pipeTransport.js +0 -84
  317. package/lib/server/utils/processLauncher.js +0 -241
  318. package/lib/server/utils/socksProxy.js +0 -511
  319. package/lib/server/utils/spawnAsync.js +0 -41
  320. package/lib/server/utils/task.js +0 -51
  321. package/lib/server/utils/userAgent.js +0 -98
  322. package/lib/server/utils/wsServer.js +0 -121
  323. package/lib/server/utils/zipFile.js +0 -74
  324. package/lib/server/utils/zones.js +0 -57
  325. package/lib/server/webkit/protocol.d.js +0 -16
  326. package/lib/server/webkit/webkit.js +0 -119
  327. package/lib/server/webkit/wkAccessibility.js +0 -237
  328. package/lib/server/webkit/wkBrowser.js +0 -339
  329. package/lib/server/webkit/wkConnection.js +0 -149
  330. package/lib/server/webkit/wkExecutionContext.js +0 -154
  331. package/lib/server/webkit/wkInput.js +0 -181
  332. package/lib/server/webkit/wkInterceptableRequest.js +0 -169
  333. package/lib/server/webkit/wkPage.js +0 -1134
  334. package/lib/server/webkit/wkProvisionalPage.js +0 -83
  335. package/lib/server/webkit/wkWorkers.js +0 -104
  336. package/lib/server/webkit/wsl/webkit-wsl-transport-client.js +0 -74
  337. package/lib/server/webkit/wsl/webkit-wsl-transport-server.js +0 -113
  338. package/lib/third_party/pixelmatch.js +0 -255
  339. package/lib/utils/isomorphic/ariaSnapshot.js +0 -392
  340. package/lib/utils/isomorphic/assert.js +0 -31
  341. package/lib/utils/isomorphic/colors.js +0 -72
  342. package/lib/utils/isomorphic/cssParser.js +0 -245
  343. package/lib/utils/isomorphic/cssTokenizer.js +0 -1051
  344. package/lib/utils/isomorphic/headers.js +0 -53
  345. package/lib/utils/isomorphic/locatorGenerators.js +0 -673
  346. package/lib/utils/isomorphic/locatorParser.js +0 -176
  347. package/lib/utils/isomorphic/locatorUtils.js +0 -81
  348. package/lib/utils/isomorphic/manualPromise.js +0 -114
  349. package/lib/utils/isomorphic/mimeType.js +0 -459
  350. package/lib/utils/isomorphic/multimap.js +0 -80
  351. package/lib/utils/isomorphic/protocolFormatter.js +0 -78
  352. package/lib/utils/isomorphic/protocolMetainfo.js +0 -321
  353. package/lib/utils/isomorphic/rtti.js +0 -43
  354. package/lib/utils/isomorphic/selectorParser.js +0 -386
  355. package/lib/utils/isomorphic/semaphore.js +0 -54
  356. package/lib/utils/isomorphic/stackTrace.js +0 -158
  357. package/lib/utils/isomorphic/stringUtils.js +0 -155
  358. package/lib/utils/isomorphic/time.js +0 -49
  359. package/lib/utils/isomorphic/timeoutRunner.js +0 -66
  360. package/lib/utils/isomorphic/traceUtils.js +0 -58
  361. package/lib/utils/isomorphic/types.js +0 -16
  362. package/lib/utils/isomorphic/urlMatch.js +0 -176
  363. package/lib/utils/isomorphic/utilityScriptSerializers.js +0 -251
  364. package/lib/utils.js +0 -107
  365. package/lib/utilsBundleImpl/index.js +0 -218
  366. package/lib/vite/recorder/assets/codeMirrorModule-RJCXzfmE.js +0 -24
  367. package/lib/vite/recorder/assets/index-Ri0uHF7I.css +0 -1
  368. package/lib/vite/recorder/assets/index-Y-X2TGJv.js +0 -193
  369. package/lib/vite/traceViewer/assets/codeMirrorModule-eyVcHN77.js +0 -24
  370. package/lib/vite/traceViewer/assets/defaultSettingsView-w0zYjHsW.js +0 -265
  371. package/lib/vite/traceViewer/defaultSettingsView.TQ8_7ybu.css +0 -1
  372. package/lib/vite/traceViewer/index.Bx16ehp1.js +0 -2
  373. package/lib/vite/traceViewer/index.I8N9v4jT.css +0 -1
  374. package/lib/vite/traceViewer/uiMode.Btcz36p_.css +0 -1
  375. package/lib/vite/traceViewer/uiMode.DRQ310U5.js +0 -5
  376. package/lib/zipBundle.js +0 -34
  377. package/lib/zipBundleImpl.js +0 -5
  378. /package/lib/{utilsBundleImpl/xdg-open → xdg-open} +0 -0
@@ -0,0 +1,305 @@
1
+ # Spec-driven testing (plan → generate → heal)
2
+
3
+ End-to-end workflow for authoring and maintaining Playwright tests using `playwright-cli`. The three sections below can be used independently:
4
+
5
+ - **Planning** — explore the app, produce a spec file describing what to test.
6
+ - **Generate** — turn a spec into Playwright test files. Update the spec if it's vague or stale.
7
+ - **Heal** — diagnose failing tests, fix the code, reconcile the spec with reality.
8
+
9
+ All three lean on the same mechanic: run `npx playwright test --debug=cli` in the background, then `playwright-cli attach tw-XXXX` to drive the paused page interactively. See [playwright-tests.md](playwright-tests.md) for the debug/attach mechanics and [test-generation.md](test-generation.md) for how every `playwright-cli` action emits Playwright TypeScript.
10
+
11
+ ---
12
+
13
+ ## 1. Planning
14
+
15
+ Goal: produce a spec file (e.g. `specs/<feature>.plan.md`) that enumerates the scenarios to test. **Always** write the spec to a file.
16
+
17
+ ### 1.1 Prerequisite: workspace
18
+
19
+ Check the workspace has Playwright installed before anything else:
20
+
21
+ ```bash
22
+ # Either of these confirms a workspace:
23
+ test -f playwright.config.ts || test -f playwright.config.js
24
+ npx --no-install playwright --version
25
+ ```
26
+
27
+ If there is no Playwright install, bootstrap one and let the user pick the defaults:
28
+
29
+ ```bash
30
+ npm init playwright@latest
31
+ ```
32
+
33
+ ### 1.2 Prerequisite: seed test
34
+
35
+ A **seed test** is a minimal test that lands the page in the state every scenario starts from: navigation to the app, any required login, feature flags, etc. Scenarios assume a fresh start *after* the seed. `--debug=cli` pauses *inside* this test, so the seed is where every planning and generation session begins.
36
+
37
+ Minimum viable seed:
38
+
39
+ ```ts
40
+ // tests/seed.spec.ts
41
+ import { test } from '@playwright/test';
42
+
43
+ test('seed', async ({ page }) => {
44
+ await page.goto('https://example.com/');
45
+ });
46
+ ```
47
+
48
+ Preferred — push navigation into a fixture so scenario tests reuse it:
49
+
50
+ ```ts
51
+ // tests/fixtures.ts
52
+ import { test as baseTest } from '@playwright/test';
53
+ export { expect } from '@playwright/test';
54
+
55
+ export const test = baseTest.extend({
56
+ page: async ({ page }, use) => {
57
+ await page.goto('https://example.com/');
58
+ await use(page);
59
+ },
60
+ });
61
+ ```
62
+
63
+ ```ts
64
+ // tests/seed.spec.ts
65
+ import { test } from './fixtures';
66
+
67
+ test('seed', async ({ page }) => {
68
+ // Fixture already navigates. This empty body tells agents where to start.
69
+ });
70
+ ```
71
+
72
+ If no seed exists, create one that at least navigates to the app.
73
+
74
+ ### 1.3 Explore the app
75
+
76
+ Launch the app via the seed in the background and attach:
77
+
78
+ ```bash
79
+ PLAYWRIGHT_HTML_OPEN=never npx playwright test tests/seed.spec.ts --debug=cli
80
+ # wait for "Debugging Instructions" and the session name tw-XXXX
81
+ playwright-cli attach tw-XXXX
82
+ ```
83
+
84
+ Resume so the seed runs, then probe the app:
85
+
86
+ ```bash
87
+ playwright-cli resume # resume so that seed test runs fully
88
+ playwright-cli snapshot # inventory of interactive elements
89
+ playwright-cli click e5 # follow a flow
90
+ playwright-cli eval "location.href" # read URL / state
91
+ playwright-cli show --annotate # ask the user to point at something
92
+ ```
93
+
94
+ Map out:
95
+
96
+ - Interactive surfaces (forms, buttons, lists, filters, modals).
97
+ - Primary user journeys end-to-end.
98
+ - Edge cases: empty states, validation errors, very long input, boundary values.
99
+ - Persistence: reload, local/session storage, URL fragments.
100
+ - Navigation: which controls change the URL, back/forward behaviour.
101
+
102
+ **Important**: Do not just open the app url with playwright-cli, always go through the test to capture any custom setup done there.
103
+ **Important**: Stop the background test when done exploring.
104
+
105
+ ### 1.4 Write the spec file
106
+
107
+ Save under `specs/<feature>.plan.md`. Use this structure:
108
+
109
+ ```markdown
110
+ # <Feature> Test Plan
111
+
112
+ ## Application Overview
113
+
114
+ <One paragraph describing what the feature does and why it matters.>
115
+
116
+ ## Test Scenarios
117
+
118
+ ### 1. <Group Name>
119
+
120
+ **Seed:** `tests/seed.spec.ts`
121
+
122
+ #### 1.1. <kebab-case-scenario-name>
123
+
124
+ **File:** `tests/<group>/<kebab-case-scenario-name>.spec.ts`
125
+
126
+ **Steps:**
127
+ 1. <Concrete user step>
128
+ - expect: <observable outcome>
129
+ - expect: <another observable outcome>
130
+ 2. <Next step>
131
+ - expect: <outcome>
132
+
133
+ #### 1.2. <next-scenario>
134
+ ...
135
+
136
+ ### 2. <Next Group>
137
+
138
+ **Seed:** `tests/seed.spec.ts`
139
+ ...
140
+ ```
141
+
142
+ Guidelines:
143
+
144
+ - Each scenario is independent and starts from the seed's fresh state — never chain scenarios.
145
+ - Scenario names are kebab-case and match the test file name (`should-add-single-todo` → `should-add-single-todo.spec.ts`).
146
+ - Cover happy path, edge cases, validation, negative flows, persistence.
147
+ - Write steps at the user level ("Type 'Buy milk' into the input"), not the API level ("call `fill`").
148
+ - Put observable outcomes in `- expect:` bullets; each becomes an assertion during generation.
149
+
150
+ ---
151
+
152
+ ## 2. Generate
153
+
154
+ Goal: take a spec file and produce Playwright test files. Optionally update the spec if it has drifted.
155
+
156
+ ### 2.1 Inputs
157
+
158
+ - **Spec file**, e.g. `specs/basic-operations.plan.md`.
159
+ - **Target**: either a single scenario (e.g. `1.2`), a whole group (`1`), or all.
160
+ - **Seed file**, read from the `**Seed:**` line of the scenario's group.
161
+
162
+ ### 2.2 Generate one scenario
163
+
164
+ For each target scenario, in sequence (never in parallel — scenarios share the seed session):
165
+
166
+ ```bash
167
+ PLAYWRIGHT_HTML_OPEN=never npx playwright test <seed-file> --debug=cli # background
168
+ playwright-cli attach tw-XXXX
169
+ # resume
170
+ ```
171
+
172
+ **Do not** just open the app url with playwright-cli, always go through the test to capture any custom setup done there.
173
+
174
+ Walk the scenario's `Steps:` one by one with `playwright-cli`, treating the spec as the plan and the live app as the source of truth. If a step is vague ("click the button" — which button?), references an element that no longer exists, or contradicts the app's actual behaviour, use your judgement: update the spec to match what the app really does, then keep going. Editing the spec mid-generation is expected.
175
+
176
+ Every action prints the equivalent Playwright TypeScript (see [test-generation.md](test-generation.md)):
177
+
178
+ ```bash
179
+ playwright-cli snapshot # find refs
180
+ playwright-cli fill e3 "John Doe" # -> page.getByRole('textbox', {...}).fill(...)
181
+ playwright-cli press Enter
182
+ playwright-cli click e7
183
+ ```
184
+
185
+ For each `- expect:` bullet, add an explicit assertion. See [test-generation.md](test-generation.md) for details.
186
+
187
+ Collect the generated code and write the test file at the path given in the spec:
188
+
189
+ ```ts
190
+ // spec: specs/basic-operations.plan.md
191
+ // seed: tests/seed.spec.ts
192
+ import { test, expect } from './fixtures'; // or '@playwright/test' if no fixtures file
193
+
194
+ test.describe('Signing in and out', () => {
195
+ test('should sign in', async ({ page }) => {
196
+ // 1. Navigate to the application
197
+ // (handled by the seed fixture)
198
+
199
+ // 2. Type 'John Doe' into the username field
200
+ await page.getByRole('textbox', { name: 'username' }).fill('John Doe');
201
+
202
+ // 3. Type password
203
+ await page.getByRole('textbox', { name: 'password' }).fill('TestPassword');
204
+
205
+ // 4. Press Enter to submit
206
+ await page.getByRole('textbox', { name: 'password' }).press('Enter');
207
+
208
+ await expect(page.getByRole('heading')).toContainText('Welcome, John Doe!');
209
+ });
210
+ });
211
+ ```
212
+
213
+ Rules:
214
+
215
+ - **One test per file.** File path, describe name, and test name come verbatim from the spec (minus the ordinal).
216
+ - Prefix each numbered step with a `// N. <step text>` comment before its actions.
217
+ - Use the describe group name verbatim from the spec (no `1.` ordinal).
218
+ - Import from `./fixtures` if the project has one; otherwise `@playwright/test`.
219
+ - **Important**: close the CLI session and stop the background test before moving to the next scenario.
220
+
221
+ ### 2.3 Generate multiple scenarios
222
+
223
+ Loop 2.2 over the targeted scenarios one at a time, restarting the seed between each so every test starts from a clean page. This is safe to parallelise due to unique generated session names - just make sure each test run is stopped.
224
+
225
+ ### 2.4 Run generated tests
226
+
227
+ After generation, run the new tests once:
228
+
229
+ ```bash
230
+ PLAYWRIGHT_HTML_OPEN=never npx playwright test tests/<group>/<scenario>.spec.ts
231
+ ```
232
+
233
+ Any failure goes to Section 3.
234
+
235
+ ---
236
+
237
+ ## 3. Heal
238
+
239
+ Goal: fix failing tests, and update the spec if the app's intended behaviour changed.
240
+
241
+ ### 3.1 Find failing tests
242
+
243
+ ```bash
244
+ PLAYWRIGHT_HTML_OPEN=never npx playwright test
245
+ ```
246
+
247
+ Record the list of failing `<file>:<line>` entries and process them one at a time. Do not attempt parallel fixes — shared state and the single CLI session make that fragile.
248
+
249
+ ### 3.2 Debug one failure
250
+
251
+ Run the single failing test in debug mode in the background, then attach:
252
+
253
+ ```bash
254
+ PLAYWRIGHT_HTML_OPEN=never npx playwright test tests/<group>/<scenario>.spec.ts:<line> --debug=cli
255
+ # wait for "Debugging Instructions" and the tw-XXXX session name
256
+ playwright-cli attach tw-XXXX
257
+ ```
258
+
259
+ The test is paused at the start. Step forward or run to until just before the failing action or assertion, then diagnose:
260
+
261
+ ```bash
262
+ playwright-cli snapshot # did the element change / move / rename?
263
+ playwright-cli console # app-side errors?
264
+ playwright-cli requests # failed request? wrong payload?
265
+ playwright-cli show --annotate # ask the user to point somewhere
266
+ ```
267
+
268
+ Common causes: selector drift, new wrapper element, label/ARIA rename, timing (transition, async load), assertion text updated in the app, test data leaking between runs.
269
+
270
+ Rehearse the corrected interaction with `playwright-cli` — the generated code in the output is what you paste back into the test.
271
+
272
+ ### 3.3 Apply the fix
273
+
274
+ Edit the test file: update the locator, assertion, step order, or inputs to match the corrected behaviour. Stop the background debug run. Rerun the single test to confirm green.
275
+
276
+ Never skip hooks or add sleeps as a fix. Never use `networkidle`.
277
+
278
+ ### 3.4 Reconcile with the spec
279
+
280
+ Open the spec referenced by the `// spec:` header in the test file and locate the scenario that matches the test.
281
+
282
+ - **Fix was purely technical** (locator drift, better assertion shape) and the spec's user-level behaviour still matches the app → leave the spec alone.
283
+ - **Fix changed user-visible steps, inputs, order, or expected outcomes** that the spec describes → update the spec to match reality. Keep the scenario id and file path stable; only the step / expect lines change.
284
+ - **Unclear whether the app change is intentional** (spec is stale) **or a regression** (test was right, app is wrong) → **stop and ask the user**. Provide:
285
+ - the scenario id (e.g. `2.3`),
286
+ - the spec lines that no longer match,
287
+ - the observed app behaviour (quote a snapshot excerpt or a concrete outcome).
288
+
289
+ Only after the user answers, either update the spec (intentional change) or file/flag the test as covering a bug (regression).
290
+
291
+ ### 3.5 Iteration and giving up
292
+
293
+ - Fix failures one at a time; rerun after each.
294
+ - If after thorough investigation you are confident the test is correct but the app is wrong *and* the user has confirmed it's a bug: mark the test `test.fixme(...)` with a comment pointing at the user's decision or issue link. Never silently skip.
295
+
296
+ ---
297
+
298
+ ## Cross-references
299
+
300
+ | For... | See |
301
+ |---|---|
302
+ | `--debug=cli` / attach mechanics | [playwright-tests.md](playwright-tests.md) |
303
+ | How `playwright-cli` actions become TS | [test-generation.md](test-generation.md) |
304
+ | Mocking requests during exploration/generation | [request-mocking.md](request-mocking.md) |
305
+ | Managing the CLI browser session | [session-management.md](session-management.md) |
@@ -0,0 +1,275 @@
1
+ # Storage Management
2
+
3
+ Manage cookies, localStorage, sessionStorage, and browser storage state.
4
+
5
+ ## Storage State
6
+
7
+ Save and restore complete browser state including cookies and storage.
8
+
9
+ ### Save Storage State
10
+
11
+ ```bash
12
+ # Save to auto-generated filename (storage-state-{timestamp}.json)
13
+ playwright-cli state-save
14
+
15
+ # Save to specific filename
16
+ playwright-cli state-save my-auth-state.json
17
+ ```
18
+
19
+ ### Restore Storage State
20
+
21
+ ```bash
22
+ # Load storage state from file
23
+ playwright-cli state-load my-auth-state.json
24
+
25
+ # Reload page to apply cookies
26
+ playwright-cli open https://example.com
27
+ ```
28
+
29
+ ### Storage State File Format
30
+
31
+ The saved file contains:
32
+
33
+ ```json
34
+ {
35
+ "cookies": [
36
+ {
37
+ "name": "session_id",
38
+ "value": "abc123",
39
+ "domain": "example.com",
40
+ "path": "/",
41
+ "expires": 1893456000,
42
+ "httpOnly": true,
43
+ "secure": true,
44
+ "sameSite": "Lax"
45
+ }
46
+ ],
47
+ "origins": [
48
+ {
49
+ "origin": "https://example.com",
50
+ "localStorage": [
51
+ { "name": "theme", "value": "dark" },
52
+ { "name": "user_id", "value": "12345" }
53
+ ]
54
+ }
55
+ ]
56
+ }
57
+ ```
58
+
59
+ ## Cookies
60
+
61
+ ### List All Cookies
62
+
63
+ ```bash
64
+ playwright-cli cookie-list
65
+ ```
66
+
67
+ ### Filter Cookies by Domain
68
+
69
+ ```bash
70
+ playwright-cli cookie-list --domain=example.com
71
+ ```
72
+
73
+ ### Filter Cookies by Path
74
+
75
+ ```bash
76
+ playwright-cli cookie-list --path=/api
77
+ ```
78
+
79
+ ### Get Specific Cookie
80
+
81
+ ```bash
82
+ playwright-cli cookie-get session_id
83
+ ```
84
+
85
+ ### Set a Cookie
86
+
87
+ ```bash
88
+ # Basic cookie
89
+ playwright-cli cookie-set session abc123
90
+
91
+ # Cookie with options
92
+ playwright-cli cookie-set session abc123 --domain=example.com --path=/ --httpOnly --secure --sameSite=Lax
93
+
94
+ # Cookie with expiration (Unix timestamp)
95
+ playwright-cli cookie-set remember_me token123 --expires=1893456000
96
+ ```
97
+
98
+ ### Delete a Cookie
99
+
100
+ ```bash
101
+ playwright-cli cookie-delete session_id
102
+ ```
103
+
104
+ ### Clear All Cookies
105
+
106
+ ```bash
107
+ playwright-cli cookie-clear
108
+ ```
109
+
110
+ ### Advanced: Multiple Cookies or Custom Options
111
+
112
+ For complex scenarios like adding multiple cookies at once, use `run-code`:
113
+
114
+ ```bash
115
+ playwright-cli run-code "async page => {
116
+ await page.context().addCookies([
117
+ { name: 'session_id', value: 'sess_abc123', domain: 'example.com', path: '/', httpOnly: true },
118
+ { name: 'preferences', value: JSON.stringify({ theme: 'dark' }), domain: 'example.com', path: '/' }
119
+ ]);
120
+ }"
121
+ ```
122
+
123
+ ## Local Storage
124
+
125
+ ### List All localStorage Items
126
+
127
+ ```bash
128
+ playwright-cli localstorage-list
129
+ ```
130
+
131
+ ### Get Single Value
132
+
133
+ ```bash
134
+ playwright-cli localstorage-get token
135
+ ```
136
+
137
+ ### Set Value
138
+
139
+ ```bash
140
+ playwright-cli localstorage-set theme dark
141
+ ```
142
+
143
+ ### Set JSON Value
144
+
145
+ ```bash
146
+ playwright-cli localstorage-set user_settings '{"theme":"dark","language":"en"}'
147
+ ```
148
+
149
+ ### Delete Single Item
150
+
151
+ ```bash
152
+ playwright-cli localstorage-delete token
153
+ ```
154
+
155
+ ### Clear All localStorage
156
+
157
+ ```bash
158
+ playwright-cli localstorage-clear
159
+ ```
160
+
161
+ ### Advanced: Multiple Operations
162
+
163
+ For complex scenarios like setting multiple values at once, use `run-code`:
164
+
165
+ ```bash
166
+ playwright-cli run-code "async page => {
167
+ await page.evaluate(() => {
168
+ localStorage.setItem('token', 'jwt_abc123');
169
+ localStorage.setItem('user_id', '12345');
170
+ localStorage.setItem('expires_at', Date.now() + 3600000);
171
+ });
172
+ }"
173
+ ```
174
+
175
+ ## Session Storage
176
+
177
+ ### List All sessionStorage Items
178
+
179
+ ```bash
180
+ playwright-cli sessionstorage-list
181
+ ```
182
+
183
+ ### Get Single Value
184
+
185
+ ```bash
186
+ playwright-cli sessionstorage-get form_data
187
+ ```
188
+
189
+ ### Set Value
190
+
191
+ ```bash
192
+ playwright-cli sessionstorage-set step 3
193
+ ```
194
+
195
+ ### Delete Single Item
196
+
197
+ ```bash
198
+ playwright-cli sessionstorage-delete step
199
+ ```
200
+
201
+ ### Clear sessionStorage
202
+
203
+ ```bash
204
+ playwright-cli sessionstorage-clear
205
+ ```
206
+
207
+ ## IndexedDB
208
+
209
+ ### List Databases
210
+
211
+ ```bash
212
+ playwright-cli run-code "async page => {
213
+ return await page.evaluate(async () => {
214
+ const databases = await indexedDB.databases();
215
+ return databases;
216
+ });
217
+ }"
218
+ ```
219
+
220
+ ### Delete Database
221
+
222
+ ```bash
223
+ playwright-cli run-code "async page => {
224
+ await page.evaluate(() => {
225
+ indexedDB.deleteDatabase('myDatabase');
226
+ });
227
+ }"
228
+ ```
229
+
230
+ ## Common Patterns
231
+
232
+ ### Authentication State Reuse
233
+
234
+ ```bash
235
+ # Step 1: Login and save state
236
+ playwright-cli open https://app.example.com/login
237
+ playwright-cli snapshot
238
+ playwright-cli fill e1 "user@example.com"
239
+ playwright-cli fill e2 "password123"
240
+ playwright-cli click e3
241
+
242
+ # Save the authenticated state
243
+ playwright-cli state-save auth.json
244
+
245
+ # Step 2: Later, restore state and skip login
246
+ playwright-cli state-load auth.json
247
+ playwright-cli open https://app.example.com/dashboard
248
+ # Already logged in!
249
+ ```
250
+
251
+ ### Save and Restore Roundtrip
252
+
253
+ ```bash
254
+ # Set up authentication state
255
+ playwright-cli open https://example.com
256
+ playwright-cli eval "() => { document.cookie = 'session=abc123'; localStorage.setItem('user', 'john'); }"
257
+
258
+ # Save state to file
259
+ playwright-cli state-save my-session.json
260
+
261
+ # ... later, in a new session ...
262
+
263
+ # Restore state
264
+ playwright-cli state-load my-session.json
265
+ playwright-cli open https://example.com
266
+ # Cookies and localStorage are restored!
267
+ ```
268
+
269
+ ## Security Notes
270
+
271
+ - Never commit storage state files containing auth tokens
272
+ - Add `*.auth-state.json` to `.gitignore`
273
+ - Delete state files after automation completes
274
+ - Use environment variables for sensitive data
275
+ - By default, sessions run in-memory mode which is safer for sensitive operations
@@ -0,0 +1,134 @@
1
+ # Test Generation
2
+
3
+ Generate Playwright test code automatically as you interact with the browser.
4
+
5
+ ## How It Works
6
+
7
+ Every action you perform with `playwright-cli` generates corresponding Playwright TypeScript code.
8
+ This code appears in the output and can be copied directly into your test files.
9
+
10
+ ## Example Workflow
11
+
12
+ ```bash
13
+ # Start a session
14
+ playwright-cli open https://example.com/login
15
+
16
+ # Take a snapshot to see elements
17
+ playwright-cli snapshot
18
+ # Output shows: e1 [textbox "Email"], e2 [textbox "Password"], e3 [button "Sign In"]
19
+
20
+ # Fill form fields - generates code automatically
21
+ playwright-cli fill e1 "user@example.com"
22
+ # Ran Playwright code:
23
+ # await page.getByRole('textbox', { name: 'Email' }).fill('user@example.com');
24
+
25
+ playwright-cli fill e2 "password123"
26
+ # Ran Playwright code:
27
+ # await page.getByRole('textbox', { name: 'Password' }).fill('password123');
28
+
29
+ playwright-cli click e3
30
+ # Ran Playwright code:
31
+ # await page.getByRole('button', { name: 'Sign In' }).click();
32
+ ```
33
+
34
+ ## Building a Test File
35
+
36
+ Collect the generated code into a Playwright test:
37
+
38
+ ```typescript
39
+ import { test, expect } from '@playwright/test';
40
+
41
+ test('login flow', async ({ page }) => {
42
+ // Generated code from playwright-cli session:
43
+ await page.goto('https://example.com/login');
44
+ await page.getByRole('textbox', { name: 'Email' }).fill('user@example.com');
45
+ await page.getByRole('textbox', { name: 'Password' }).fill('password123');
46
+ await page.getByRole('button', { name: 'Sign In' }).click();
47
+
48
+ // Add assertions
49
+ await expect(page).toHaveURL(/.*dashboard/);
50
+ });
51
+ ```
52
+
53
+ ## Best Practices
54
+
55
+ ### 1. Use Semantic Locators
56
+
57
+ The generated code uses role-based locators when possible, which are more resilient:
58
+
59
+ ```typescript
60
+ // Generated (good - semantic)
61
+ await page.getByRole('button', { name: 'Submit' }).click();
62
+
63
+ // Avoid (fragile - CSS selectors)
64
+ await page.locator('#submit-btn').click();
65
+ ```
66
+
67
+ ### 2. Explore Before Recording
68
+
69
+ Take snapshots to understand the page structure before recording actions:
70
+
71
+ ```bash
72
+ playwright-cli open https://example.com
73
+ playwright-cli snapshot
74
+ # Review the element structure
75
+ playwright-cli click e5
76
+ ```
77
+
78
+ ### 3. Add Assertions Manually
79
+
80
+ Generated code captures actions but not assertions. Add expectations in your test using one of the recommended matchers:
81
+
82
+ - `toBeVisible()` — element is rendered and visible
83
+ - `toHaveText(text)` — element text content matches
84
+ - `toHaveValue(value) / toBeEmpty()` — input/select value matches
85
+ - `toBeChecked() / toBeUnchecked()` — checkbox state matches
86
+ - `toMatchAriaSnapshot(snapshot)` — page (or locator) matches a partial accessibility snapshot
87
+
88
+ Use `playwright-cli generate-locator <target>` to produce the locator expression for the assertion, and the snapshot/eval commands to capture the expected value.
89
+
90
+ When asserting text content, make sure that generated locator does not contain text from the element itself. `getByTestId()` or `getByLabel()` usually work well with asserting text. When locator is text-based, prefer `toBeVisible()` instead.
91
+
92
+ Snapshot to be matched does not have to contain all the information - only capture what's necessary for the assertion. You can use regular expressions for unstable values.
93
+
94
+ ```bash
95
+ # Get a stable locator for an element ref to use in the assertion
96
+ playwright-cli --raw generate-locator e5
97
+ # getByRole('button', { name: 'Submit' })
98
+
99
+ # Capture expected text content for toHaveText
100
+ playwright-cli --raw eval "el => el.textContent" e5
101
+
102
+ # Capture expected input value for toHaveValue/toBeEmpty
103
+ playwright-cli --raw eval "el => el.value" e5
104
+
105
+ # Capture expected aria snapshot for toMatchAriaSnapshot/toBeChecked
106
+ # (whole page, or use a ref to scope to a region)
107
+ playwright-cli --raw snapshot
108
+ playwright-cli --raw snapshot e5
109
+ ```
110
+
111
+ ```typescript
112
+ // Generated action
113
+ await page.getByRole('button', { name: 'Submit' }).click();
114
+
115
+ // Manual assertions using the outputs above:
116
+ await expect(page.getByRole('alert', { name: 'Success' })).toBeVisible();
117
+ await expect(page.getByTestId('main-header')).toHaveText('Welcome, user');
118
+ await expect(page.getByRole('textbox', { name: 'Email' })).toHaveValue('user@example.com');
119
+ await expect(page.getByRole('checkbox', { name: 'Enable notifications' })).toBeChecked();
120
+
121
+ // toMatchAriaSnapshot on the whole page, finds a matching region
122
+ await expect(page).toMatchAriaSnapshot(`
123
+ - heading "Welcome, user"
124
+ - link /\\d+ new messages?/
125
+ - button "Sign out"
126
+ `);
127
+
128
+ // toMatchAriaSnapshot scoped to a region
129
+ await expect(page.getByRole('navigation')).toMatchAriaSnapshot(`
130
+ - link "Home"
131
+ - link /\\d+ new messages?/
132
+ - link "Profile"
133
+ `);
134
+ ```