@checkly/playwright-core 1.48.22 → 1.51.11-beta.2

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 (307) hide show
  1. package/ThirdPartyNotices.txt +60 -48
  2. package/bin/reinstall_chrome_beta_linux.sh +10 -8
  3. package/bin/reinstall_chrome_stable_linux.sh +10 -8
  4. package/bin/reinstall_msedge_beta_linux.sh +17 -9
  5. package/bin/reinstall_msedge_dev_linux.sh +17 -9
  6. package/bin/reinstall_msedge_stable_linux.sh +17 -9
  7. package/browsers.json +33 -12
  8. package/index.js +0 -1
  9. package/lib/androidServerImpl.js +5 -5
  10. package/lib/browserServerImpl.js +18 -9
  11. package/lib/checkly/secretsFilter.js +1 -1
  12. package/lib/cli/driver.js +6 -6
  13. package/lib/cli/program.js +38 -43
  14. package/lib/cli/programWithTestStub.js +2 -1
  15. package/lib/client/android.js +37 -58
  16. package/lib/client/artifact.js +4 -7
  17. package/lib/client/browser.js +10 -15
  18. package/lib/client/browserContext.js +69 -62
  19. package/lib/client/browserType.js +30 -64
  20. package/lib/client/channelOwner.js +53 -68
  21. package/lib/client/clientHelper.js +4 -6
  22. package/lib/client/clientInstrumentation.js +2 -0
  23. package/lib/client/clientStackTrace.js +65 -0
  24. package/lib/client/connection.js +48 -41
  25. package/lib/client/consoleMessage.js +4 -7
  26. package/lib/client/electron.js +10 -10
  27. package/lib/client/elementHandle.js +32 -33
  28. package/lib/client/errors.js +2 -2
  29. package/lib/client/eventEmitter.js +5 -8
  30. package/lib/client/fetch.js +61 -62
  31. package/lib/client/fileUtils.js +31 -0
  32. package/lib/client/frame.js +22 -23
  33. package/lib/client/harRouter.js +7 -9
  34. package/lib/client/jsHandle.js +3 -4
  35. package/lib/client/localUtils.js +24 -0
  36. package/lib/client/locator.js +27 -13
  37. package/lib/client/network.js +44 -37
  38. package/lib/client/page.js +50 -41
  39. package/lib/client/platform.js +71 -0
  40. package/lib/client/playwright.js +21 -1
  41. package/lib/client/selectors.js +8 -2
  42. package/lib/client/stream.js +2 -21
  43. package/lib/client/timeoutSettings.js +65 -0
  44. package/lib/client/tracing.js +29 -7
  45. package/lib/client/video.js +2 -2
  46. package/lib/client/waiter.js +19 -16
  47. package/lib/client/webSocket.js +106 -0
  48. package/lib/client/worker.js +4 -4
  49. package/lib/client/writableStream.js +2 -21
  50. package/lib/generated/consoleApiSource.js +1 -1
  51. package/lib/generated/injectedScriptSource.js +1 -1
  52. package/lib/generated/pollingRecorderSource.js +1 -1
  53. package/lib/generated/recorderSource.js +7 -0
  54. package/lib/generated/webSocketMockSource.js +1 -1
  55. package/lib/inProcessFactory.js +8 -3
  56. package/lib/outofprocess.js +12 -8
  57. package/lib/protocol/debug.js +1 -1
  58. package/lib/protocol/validator.js +77 -11
  59. package/lib/protocol/validatorPrimitives.js +1 -2
  60. package/lib/remote/playwrightConnection.js +21 -12
  61. package/lib/remote/playwrightServer.js +22 -8
  62. package/lib/server/android/android.js +17 -14
  63. package/lib/server/android/backendAdb.js +14 -14
  64. package/lib/server/artifact.js +3 -3
  65. package/lib/server/bidi/bidiBrowser.js +11 -8
  66. package/lib/server/bidi/bidiChromium.js +5 -4
  67. package/lib/server/bidi/bidiConnection.js +1 -3
  68. package/lib/server/bidi/bidiExecutionContext.js +71 -25
  69. package/lib/server/bidi/bidiFirefox.js +4 -3
  70. package/lib/server/bidi/bidiInput.js +11 -12
  71. package/lib/server/bidi/bidiNetworkManager.js +11 -12
  72. package/lib/server/bidi/bidiOverCdp.js +2 -2
  73. package/lib/server/bidi/bidiPage.js +39 -66
  74. package/lib/server/bidi/third_party/bidiKeyboard.js +9 -7
  75. package/lib/server/bidi/third_party/firefoxPrefs.js +19 -3
  76. package/lib/server/browser.js +2 -2
  77. package/lib/server/browserContext.js +60 -55
  78. package/lib/server/browserType.js +22 -18
  79. package/lib/server/callLog.js +79 -0
  80. package/lib/server/chromium/chromium.js +20 -16
  81. package/lib/server/chromium/chromiumSwitches.js +32 -9
  82. package/lib/server/chromium/crBrowser.js +25 -24
  83. package/lib/server/chromium/crConnection.js +2 -2
  84. package/lib/server/chromium/crCoverage.js +1 -1
  85. package/lib/server/chromium/crDevTools.js +1 -1
  86. package/lib/server/chromium/crDragDrop.js +1 -1
  87. package/lib/server/chromium/crExecutionContext.js +26 -35
  88. package/lib/server/chromium/crInput.js +17 -6
  89. package/lib/server/chromium/crNetworkManager.js +3 -3
  90. package/lib/server/chromium/crPage.js +43 -55
  91. package/lib/server/chromium/crPdf.js +1 -1
  92. package/lib/server/chromium/crProtocolHelper.js +3 -3
  93. package/lib/server/chromium/crServiceWorker.js +2 -2
  94. package/lib/server/chromium/videoRecorder.js +2 -2
  95. package/lib/server/clock.js +1 -1
  96. package/lib/server/codegen/csharp.js +21 -16
  97. package/lib/server/codegen/java.js +17 -9
  98. package/lib/server/codegen/javascript.js +37 -7
  99. package/lib/server/codegen/jsonl.js +1 -1
  100. package/lib/server/codegen/languages.js +2 -2
  101. package/lib/server/codegen/python.js +14 -17
  102. package/lib/server/debugController.js +23 -45
  103. package/lib/server/debugger.js +1 -1
  104. package/lib/server/deviceDescriptors.js +1 -1
  105. package/lib/server/deviceDescriptorsSource.json +131 -131
  106. package/lib/server/dispatchers/androidDispatcher.js +14 -3
  107. package/lib/server/dispatchers/artifactDispatcher.js +3 -3
  108. package/lib/server/dispatchers/browserContextDispatcher.js +21 -32
  109. package/lib/server/dispatchers/browserTypeDispatcher.js +1 -1
  110. package/lib/server/dispatchers/cdpSessionDispatcher.js +1 -1
  111. package/lib/server/dispatchers/debugControllerDispatcher.js +5 -3
  112. package/lib/server/dispatchers/dispatcher.js +27 -25
  113. package/lib/server/dispatchers/electronDispatcher.js +3 -3
  114. package/lib/server/dispatchers/elementHandlerDispatcher.js +7 -2
  115. package/lib/server/dispatchers/frameDispatcher.js +9 -3
  116. package/lib/server/dispatchers/jsonPipeDispatcher.js +2 -2
  117. package/lib/server/dispatchers/localUtilsDispatcher.js +25 -291
  118. package/lib/server/dispatchers/networkDispatchers.js +3 -3
  119. package/lib/server/dispatchers/pageDispatcher.js +10 -8
  120. package/lib/server/dispatchers/playwrightDispatcher.js +5 -5
  121. package/lib/server/dispatchers/streamDispatcher.js +4 -3
  122. package/lib/server/dispatchers/tracingDispatcher.js +10 -0
  123. package/lib/server/dispatchers/webSocketRouteDispatcher.js +18 -18
  124. package/lib/server/dispatchers/writableStreamDispatcher.js +5 -6
  125. package/lib/server/dom.js +102 -48
  126. package/lib/server/download.js +1 -1
  127. package/lib/server/electron/electron.js +17 -16
  128. package/lib/server/errors.js +1 -1
  129. package/lib/server/fetch.js +49 -33
  130. package/lib/server/fileUploadUtils.js +7 -4
  131. package/lib/server/firefox/ffBrowser.js +17 -9
  132. package/lib/server/firefox/ffConnection.js +1 -1
  133. package/lib/server/firefox/ffExecutionContext.js +25 -29
  134. package/lib/server/firefox/ffInput.js +15 -4
  135. package/lib/server/firefox/ffNetworkManager.js +3 -3
  136. package/lib/server/firefox/ffPage.js +29 -50
  137. package/lib/server/firefox/firefox.js +7 -9
  138. package/lib/server/frameSelectors.js +1 -1
  139. package/lib/server/frames.js +65 -55
  140. package/lib/server/har/harRecorder.js +4 -4
  141. package/lib/server/har/harTracer.js +8 -9
  142. package/lib/server/harBackend.js +157 -0
  143. package/lib/server/helper.js +2 -2
  144. package/lib/server/index.js +1 -14
  145. package/lib/server/input.js +3 -4
  146. package/lib/server/instrumentation.js +2 -2
  147. package/lib/server/isomorphic/utilityScriptSerializers.js +3 -0
  148. package/lib/server/javascript.js +26 -33
  149. package/lib/server/launchApp.js +7 -7
  150. package/lib/server/localUtils.js +203 -0
  151. package/lib/server/network.js +5 -5
  152. package/lib/server/page.js +76 -37
  153. package/lib/server/pipeTransport.js +1 -1
  154. package/lib/server/playwright.js +5 -5
  155. package/lib/server/progress.js +1 -4
  156. package/lib/server/protocolError.js +1 -1
  157. package/lib/server/recorder/chat.js +177 -0
  158. package/lib/server/recorder/codeGenerator.js +154 -0
  159. package/lib/server/recorder/contextRecorder.js +9 -18
  160. package/lib/server/recorder/csharp.js +311 -0
  161. package/lib/server/recorder/java.js +249 -0
  162. package/lib/server/recorder/javascript.js +230 -0
  163. package/lib/server/recorder/jsonl.js +48 -0
  164. package/lib/server/recorder/language.js +45 -0
  165. package/lib/server/recorder/python.js +276 -0
  166. package/lib/server/recorder/recorderActions.js +6 -0
  167. package/lib/server/recorder/recorderApp.js +25 -28
  168. package/lib/server/recorder/recorderCollection.js +9 -21
  169. package/lib/server/recorder/recorderInTraceViewer.js +1 -1
  170. package/lib/server/recorder/recorderRunner.js +7 -3
  171. package/lib/server/recorder/recorderUtils.js +5 -28
  172. package/lib/server/recorder/throttledFile.js +3 -4
  173. package/lib/server/recorder/utils.js +46 -0
  174. package/lib/server/recorder.js +83 -43
  175. package/lib/server/registry/browserFetcher.js +10 -8
  176. package/lib/server/registry/dependencies.js +20 -20
  177. package/lib/server/registry/index.js +215 -61
  178. package/lib/server/registry/nativeDeps.js +10 -4
  179. package/lib/server/registry/oopDownloadBrowserMain.js +3 -3
  180. package/lib/server/screenshotter.js +1 -1
  181. package/lib/server/selectors.js +3 -3
  182. package/lib/server/socksClientCertificatesInterceptor.js +8 -8
  183. package/lib/server/socksInterceptor.js +8 -5
  184. package/lib/server/storageScript.js +160 -0
  185. package/lib/server/timeoutSettings.js +74 -0
  186. package/lib/server/trace/recorder/snapshotter.js +10 -20
  187. package/lib/server/trace/recorder/snapshotterInjected.js +26 -1
  188. package/lib/server/trace/recorder/tracing.js +108 -45
  189. package/lib/server/trace/test/inMemorySnapshotter.js +6 -6
  190. package/lib/server/trace/viewer/traceViewer.js +21 -7
  191. package/lib/server/transport.js +3 -2
  192. package/lib/server/utils/ascii.js +31 -0
  193. package/lib/server/utils/comparators.js +159 -0
  194. package/lib/server/utils/crypto.js +171 -0
  195. package/lib/server/utils/debug.js +38 -0
  196. package/lib/server/utils/debugLogger.js +93 -0
  197. package/lib/server/utils/env.js +53 -0
  198. package/lib/server/utils/eventsHelper.js +38 -0
  199. package/lib/server/utils/expectUtils.js +33 -0
  200. package/lib/server/utils/fileUtils.js +204 -0
  201. package/lib/server/utils/happyEyeballs.js +207 -0
  202. package/lib/server/utils/hostPlatform.js +145 -0
  203. package/lib/server/utils/httpServer.js +233 -0
  204. package/lib/server/utils/image_tools/colorUtils.js +98 -0
  205. package/lib/server/utils/image_tools/compare.js +108 -0
  206. package/lib/server/utils/image_tools/imageChannel.js +70 -0
  207. package/lib/server/utils/image_tools/stats.js +102 -0
  208. package/lib/server/utils/linuxUtils.js +58 -0
  209. package/lib/server/utils/network.js +160 -0
  210. package/lib/server/utils/nodePlatform.js +140 -0
  211. package/lib/server/utils/pipeTransport.js +82 -0
  212. package/lib/server/utils/processLauncher.js +248 -0
  213. package/lib/server/utils/profiler.js +52 -0
  214. package/lib/server/utils/socksProxy.js +570 -0
  215. package/lib/server/utils/spawnAsync.js +45 -0
  216. package/lib/server/utils/task.js +58 -0
  217. package/lib/server/utils/userAgent.js +91 -0
  218. package/lib/server/utils/wsServer.js +128 -0
  219. package/lib/server/utils/zipFile.js +75 -0
  220. package/lib/server/utils/zones.js +54 -0
  221. package/lib/server/webkit/webkit.js +4 -4
  222. package/lib/server/webkit/wkBrowser.js +10 -10
  223. package/lib/server/webkit/wkConnection.js +1 -1
  224. package/lib/server/webkit/wkExecutionContext.js +26 -30
  225. package/lib/server/webkit/wkInput.js +17 -7
  226. package/lib/server/webkit/wkInterceptableRequest.js +2 -2
  227. package/lib/server/webkit/wkPage.js +80 -66
  228. package/lib/server/webkit/wkProvisionalPage.js +1 -1
  229. package/lib/server/webkit/wkWorkers.js +2 -2
  230. package/lib/utils/fileUtils.js +1 -1
  231. package/lib/utils/glob.js +84 -0
  232. package/lib/utils/isomorphic/ariaSnapshot.js +392 -0
  233. package/lib/utils/isomorphic/assert.js +25 -0
  234. package/lib/utils/isomorphic/colors.js +65 -0
  235. package/lib/utils/isomorphic/cssParser.js +5 -5
  236. package/lib/utils/isomorphic/headers.js +52 -0
  237. package/lib/utils/isomorphic/locatorGenerators.js +38 -8
  238. package/lib/utils/isomorphic/locatorParser.js +19 -13
  239. package/lib/utils/isomorphic/manualPromise.js +107 -0
  240. package/lib/utils/isomorphic/mimeType.js +11 -3
  241. package/lib/utils/isomorphic/multimap.js +73 -0
  242. package/lib/utils/isomorphic/rtti.js +41 -0
  243. package/lib/utils/isomorphic/semaphore.js +51 -0
  244. package/lib/utils/isomorphic/stackTrace.js +169 -0
  245. package/lib/utils/isomorphic/stringUtils.js +31 -1
  246. package/lib/utils/isomorphic/time.js +25 -0
  247. package/lib/utils/isomorphic/timeoutRunner.js +66 -0
  248. package/lib/utils/isomorphic/traceUtils.js +23 -0
  249. package/lib/utils/isomorphic/types.js +5 -0
  250. package/lib/utils/isomorphic/urlMatch.js +7 -5
  251. package/lib/utils/mimeType.js +30 -0
  252. package/lib/utils/stackTrace.js +1 -1
  253. package/lib/utils.js +447 -0
  254. package/lib/utilsBundle.js +4 -29
  255. package/lib/utilsBundleImpl/index.js +188 -33
  256. package/lib/vite/htmlReport/index.html +20 -17
  257. package/lib/vite/recorder/assets/codeMirrorModule-B9YMkrwa.js +24 -0
  258. package/lib/vite/recorder/assets/index-ELPgmkwA.js +184 -0
  259. package/lib/vite/recorder/assets/{index-BW-aOBcL.css → index-eHBmevrY.css} +1 -1
  260. package/lib/vite/recorder/index.html +2 -2
  261. package/lib/vite/traceViewer/assets/codeMirrorModule-gU1OOCQO.js +24 -0
  262. package/lib/vite/traceViewer/assets/defaultSettingsView-B5n_FjMx.js +1 -0
  263. package/lib/vite/traceViewer/assets/inspectorTab-6Tru8Mn_.js +235 -0
  264. package/lib/vite/traceViewer/assets/workbench-B_Nj4NA2.js +25 -0
  265. package/lib/vite/traceViewer/assets/{xtermModule-BeNbaIVa.js → xtermModule-BoAIEibi.js} +7 -7
  266. package/lib/vite/traceViewer/defaultSettingsView.CO3FR0CX.css +1 -0
  267. package/lib/vite/traceViewer/{embedded.BkvOrz5Z.js → embedded.DpNPH6mk.js} +2 -2
  268. package/lib/vite/traceViewer/embedded.html +6 -6
  269. package/lib/vite/traceViewer/index.CuE3SYGw.js +2 -0
  270. package/lib/vite/traceViewer/index.html +27 -9
  271. package/lib/vite/traceViewer/inspectorTab.CXDulcFG.css +1 -0
  272. package/lib/vite/traceViewer/{recorder.DNMfnSiu.js → recorder.BD-uZJs7.js} +2 -2
  273. package/lib/vite/traceViewer/recorder.html +4 -4
  274. package/lib/vite/traceViewer/sw.bundle.js +7888 -3
  275. package/lib/vite/traceViewer/{uiMode.CAYqod-m.css → uiMode.BatfzHMG.css} +1 -1
  276. package/lib/vite/traceViewer/uiMode.DHrNgddz.js +5 -0
  277. package/lib/vite/traceViewer/uiMode.html +8 -7
  278. package/lib/vite/traceViewer/workbench.B9vIAzH9.css +1 -0
  279. package/lib/zipBundleImpl.js +4 -4
  280. package/package.json +7 -7
  281. package/types/protocol.d.ts +820 -153
  282. package/types/types.d.ts +285 -82
  283. package/bin/PrintDeps.exe +0 -0
  284. package/bin/README.md +0 -2
  285. package/lib/vite/recorder/assets/codeMirrorModule-d0KhC1qL.js +0 -24
  286. package/lib/vite/recorder/assets/index-Bxxcmxlu.js +0 -42
  287. package/lib/vite/traceViewer/assets/codeMirrorModule-pBPtArIT.js +0 -24
  288. package/lib/vite/traceViewer/assets/codeMirrorModule-tzBrK1V4.js +0 -24
  289. package/lib/vite/traceViewer/assets/inspectorTab-BuJ3wAX_.js +0 -64
  290. package/lib/vite/traceViewer/assets/inspectorTab-Soeeuvzv.js +0 -64
  291. package/lib/vite/traceViewer/assets/testServerConnection-DeE2kSzz.js +0 -1
  292. package/lib/vite/traceViewer/assets/workbench-DdmJ9AJV.js +0 -9
  293. package/lib/vite/traceViewer/assets/workbench-lypYlf00.js +0 -9
  294. package/lib/vite/traceViewer/embedded.DInvAijy.js +0 -2
  295. package/lib/vite/traceViewer/index.Dha3cgqs.js +0 -2
  296. package/lib/vite/traceViewer/index._Iolt-uE.js +0 -2
  297. package/lib/vite/traceViewer/inspectorTab.DLjBDrQR.css +0 -1
  298. package/lib/vite/traceViewer/recorder.DTSaNaly.js +0 -2
  299. package/lib/vite/traceViewer/uiMode.BM7yhjzl.js +0 -5
  300. package/lib/vite/traceViewer/uiMode.Cr1tvTWS.js +0 -5
  301. package/lib/vite/traceViewer/workbench.DlsCx8k5.css +0 -1
  302. /package/lib/vite/recorder/assets/{codeMirrorModule-ez37Vkbh.css → codeMirrorModule-C3UTv-Ge.css} +0 -0
  303. /package/lib/vite/traceViewer/{codeMirrorModule.ez37Vkbh.css → codeMirrorModule.C3UTv-Ge.css} +0 -0
  304. /package/lib/vite/traceViewer/{embedded.w7WN2u1R.css → embedded.mLhjB5IF.css} +0 -0
  305. /package/lib/vite/traceViewer/{index.CrbWWHbf.css → index.CFOW-Ezb.css} +0 -0
  306. /package/lib/vite/traceViewer/{recorder.B_SY1GJM.css → recorder.tn0RQdqM.css} +0 -0
  307. /package/lib/vite/traceViewer/{xtermModule.DSXBckUd.css → xtermModule.Beg8tuEN.css} +0 -0
package/types/types.d.ts CHANGED
@@ -15,7 +15,6 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import { ChildProcess } from 'child_process';
18
- import { EventEmitter } from 'events';
19
18
  import { Readable } from 'stream';
20
19
  import { ReadStream } from 'fs';
21
20
  import { Protocol } from './protocol';
@@ -2553,19 +2552,24 @@ export interface Page {
2553
2552
  * // → true
2554
2553
  * await page.evaluate(() => matchMedia('(prefers-color-scheme: light)').matches);
2555
2554
  * // → false
2556
- * await page.evaluate(() => matchMedia('(prefers-color-scheme: no-preference)').matches);
2557
- * // → false
2558
2555
  * ```
2559
2556
  *
2560
2557
  * @param options
2561
2558
  */
2562
2559
  emulateMedia(options?: {
2563
2560
  /**
2564
- * Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`.
2565
- * Passing `null` disables color scheme emulation.
2561
+ * Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
2562
+ * media feature, supported values are `'light'` and `'dark'`. Passing `null` disables color scheme emulation.
2563
+ * `'no-preference'` is deprecated.
2566
2564
  */
2567
2565
  colorScheme?: null|"light"|"dark"|"no-preference";
2568
2566
 
2567
+ /**
2568
+ * Emulates `'prefers-contrast'` media feature, supported values are `'no-preference'`, `'more'`. Passing `null`
2569
+ * disables contrast emulation.
2570
+ */
2571
+ contrast?: null|"no-preference"|"more";
2572
+
2569
2573
  /**
2570
2574
  * Emulates `'forced-colors'` media feature, supported values are `'active'` and `'none'`. Passing `null` disables
2571
2575
  * forced colors emulation.
@@ -3610,8 +3614,6 @@ export interface Page {
3610
3614
  /**
3611
3615
  * Returns the PDF buffer.
3612
3616
  *
3613
- * **NOTE** Generating a pdf is currently only supported in Chromium headless.
3614
- *
3615
3617
  * `page.pdf()` generates a pdf of the page with `print` css media. To generate a pdf with `screen` media, call
3616
3618
  * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) before calling
3617
3619
  * `page.pdf()`:
@@ -4297,7 +4299,7 @@ export interface Page {
4297
4299
  * takes priority over
4298
4300
  * [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout).
4299
4301
  *
4300
- * @param timeout Maximum time in milliseconds
4302
+ * @param timeout Maximum time in milliseconds. Pass `0` to disable timeout.
4301
4303
  */
4302
4304
  setDefaultTimeout(timeout: number): void;
4303
4305
 
@@ -8962,9 +8964,13 @@ export interface BrowserContext {
8962
8964
  /**
8963
8965
  * Grants specified permissions to the browser context. Only grants corresponding permissions to the given origin if
8964
8966
  * specified.
8965
- * @param permissions A permission or an array of permissions to grant. Permissions can be one of the following values:
8967
+ * @param permissions A list of permissions to grant.
8968
+ *
8969
+ * **NOTE** Supported permissions differ between browsers, and even between different versions of the same browser.
8970
+ * Any permission may stop working after an update.
8971
+ *
8972
+ * Here are some permissions that may be supported by some browsers:
8966
8973
  * - `'accelerometer'`
8967
- * - `'accessibility-events'`
8968
8974
  * - `'ambient-light-sensor'`
8969
8975
  * - `'background-sync'`
8970
8976
  * - `'camera'`
@@ -9192,7 +9198,7 @@ export interface BrowserContext {
9192
9198
  * take priority over
9193
9199
  * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout).
9194
9200
  *
9195
- * @param timeout Maximum time in milliseconds
9201
+ * @param timeout Maximum time in milliseconds. Pass `0` to disable timeout.
9196
9202
  */
9197
9203
  setDefaultTimeout(timeout: number): void;
9198
9204
 
@@ -9259,10 +9265,21 @@ export interface BrowserContext {
9259
9265
  setOffline(offline: boolean): Promise<void>;
9260
9266
 
9261
9267
  /**
9262
- * Returns storage state for this browser context, contains current cookies and local storage snapshot.
9268
+ * Returns storage state for this browser context, contains current cookies, local storage snapshot and IndexedDB
9269
+ * snapshot.
9263
9270
  * @param options
9264
9271
  */
9265
9272
  storageState(options?: {
9273
+ /**
9274
+ * Set to `true` to include [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API) in the storage
9275
+ * state snapshot. If your application uses IndexedDB to store authentication tokens, like Firebase Authentication,
9276
+ * enable this.
9277
+ *
9278
+ * **NOTE** IndexedDBs with typed arrays are currently not supported.
9279
+ *
9280
+ */
9281
+ indexedDB?: boolean;
9282
+
9266
9283
  /**
9267
9284
  * The file path to save the storage state to. If
9268
9285
  * [`path`](https://playwright.dev/docs/api/class-browsercontext#browser-context-storage-state-option-path) is a
@@ -9588,10 +9605,11 @@ export interface Browser {
9588
9605
  * In case this browser is connected to, clears all created contexts belonging to this browser and disconnects from
9589
9606
  * the browser server.
9590
9607
  *
9591
- * **NOTE** This is similar to force quitting the browser. Therefore, you should call
9608
+ * **NOTE** This is similar to force-quitting the browser. To close pages gracefully and ensure you receive page close
9609
+ * events, call
9592
9610
  * [browserContext.close([options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) on
9593
- * any [BrowserContext](https://playwright.dev/docs/api/class-browsercontext)'s you explicitly created earlier with
9594
- * [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context) **before**
9611
+ * any [BrowserContext](https://playwright.dev/docs/api/class-browsercontext) instances you explicitly created earlier
9612
+ * using [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context) **before**
9595
9613
  * calling [browser.close([options])](https://playwright.dev/docs/api/class-browser#browser-close).
9596
9614
  *
9597
9615
  * The [Browser](https://playwright.dev/docs/api/class-browser) object itself is considered to be disposed and cannot
@@ -9761,12 +9779,20 @@ export interface Browser {
9761
9779
  }>;
9762
9780
 
9763
9781
  /**
9764
- * Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See
9782
+ * Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
9783
+ * media feature, supported values are `'light'` and `'dark'`. See
9765
9784
  * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
9766
9785
  * Passing `null` resets emulation to system defaults. Defaults to `'light'`.
9767
9786
  */
9768
9787
  colorScheme?: null|"light"|"dark"|"no-preference";
9769
9788
 
9789
+ /**
9790
+ * Emulates `'prefers-contrast'` media feature, supported values are `'no-preference'`, `'more'`. See
9791
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
9792
+ * Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`.
9793
+ */
9794
+ contrast?: null|"no-preference"|"more";
9795
+
9770
9796
  /**
9771
9797
  * Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about
9772
9798
  * [emulating devices with device scale factor](https://playwright.dev/docs/emulation#devices).
@@ -10046,12 +10072,12 @@ export interface Browser {
10046
10072
  sameSite: "Strict"|"Lax"|"None";
10047
10073
  }>;
10048
10074
 
10049
- /**
10050
- * localStorage to set for context
10051
- */
10052
10075
  origins: Array<{
10053
10076
  origin: string;
10054
10077
 
10078
+ /**
10079
+ * localStorage to set for context
10080
+ */
10055
10081
  localStorage: Array<{
10056
10082
  name: string;
10057
10083
 
@@ -11624,7 +11650,8 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
11624
11650
  * Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink
11625
11651
  * box `#FF00FF` (customized by
11626
11652
  * [`maskColor`](https://playwright.dev/docs/api/class-elementhandle#element-handle-screenshot-option-mask-color))
11627
- * that completely covers its bounding box.
11653
+ * that completely covers its bounding box. The mask is also applied to invisible elements, see
11654
+ * [Matching only visible elements](https://playwright.dev/docs/locators#matching-only-visible-elements) to disable that.
11628
11655
  */
11629
11656
  mask?: Array<Locator>;
11630
11657
 
@@ -12173,12 +12200,6 @@ export interface Locator {
12173
12200
  * rejects, this method throws.
12174
12201
  *
12175
12202
  * **Usage**
12176
- *
12177
- * ```js
12178
- * const tweets = page.locator('.tweet .retweets');
12179
- * expect(await tweets.evaluate(node => node.innerText)).toBe('10 retweets');
12180
- * ```
12181
- *
12182
12203
  * @param pageFunction Function to be evaluated in the page context.
12183
12204
  * @param arg Optional argument to pass to
12184
12205
  * [`pageFunction`](https://playwright.dev/docs/api/class-locator#locator-evaluate-option-expression).
@@ -12204,12 +12225,6 @@ export interface Locator {
12204
12225
  * rejects, this method throws.
12205
12226
  *
12206
12227
  * **Usage**
12207
- *
12208
- * ```js
12209
- * const tweets = page.locator('.tweet .retweets');
12210
- * expect(await tweets.evaluate(node => node.innerText)).toBe('10 retweets');
12211
- * ```
12212
- *
12213
12228
  * @param pageFunction Function to be evaluated in the page context.
12214
12229
  * @param arg Optional argument to pass to
12215
12230
  * [`pageFunction`](https://playwright.dev/docs/api/class-locator#locator-evaluate-option-expression).
@@ -12424,6 +12439,57 @@ export interface Locator {
12424
12439
  */
12425
12440
  and(locator: Locator): Locator;
12426
12441
 
12442
+ /**
12443
+ * Captures the aria snapshot of the given element. Read more about [aria snapshots](https://playwright.dev/docs/aria-snapshots) and
12444
+ * [expect(locator).toMatchAriaSnapshot(expected[, options])](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-match-aria-snapshot)
12445
+ * for the corresponding assertion.
12446
+ *
12447
+ * **Usage**
12448
+ *
12449
+ * ```js
12450
+ * await page.getByRole('link').ariaSnapshot();
12451
+ * ```
12452
+ *
12453
+ * **Details**
12454
+ *
12455
+ * This method captures the aria snapshot of the given element. The snapshot is a string that represents the state of
12456
+ * the element and its children. The snapshot can be used to assert the state of the element in the test, or to
12457
+ * compare it to state in the future.
12458
+ *
12459
+ * The ARIA snapshot is represented using [YAML](https://yaml.org/spec/1.2.2/) markup language:
12460
+ * - The keys of the objects are the roles and optional accessible names of the elements.
12461
+ * - The values are either text content or an array of child elements.
12462
+ * - Generic static text can be represented with the `text` key.
12463
+ *
12464
+ * Below is the HTML markup and the respective ARIA snapshot:
12465
+ *
12466
+ * ```html
12467
+ * <ul aria-label="Links">
12468
+ * <li><a href="/">Home</a></li>
12469
+ * <li><a href="/about">About</a></li>
12470
+ * <ul>
12471
+ * ```
12472
+ *
12473
+ * ```yml
12474
+ * - list "Links":
12475
+ * - listitem:
12476
+ * - link "Home"
12477
+ * - listitem:
12478
+ * - link "About"
12479
+ * ```
12480
+ *
12481
+ * @param options
12482
+ */
12483
+ ariaSnapshot(options?: {
12484
+ /**
12485
+ * Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
12486
+ * option in the config, or by using the
12487
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
12488
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
12489
+ */
12490
+ timeout?: number;
12491
+ }): Promise<string>;
12492
+
12427
12493
  /**
12428
12494
  * Calls [blur](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/blur) on the element.
12429
12495
  * @param options
@@ -12861,7 +12927,6 @@ export interface Locator {
12861
12927
  * live objects to be passed into the event:
12862
12928
  *
12863
12929
  * ```js
12864
- * // Note you can only create DataTransfer in Chromium and Firefox
12865
12930
  * const dataTransfer = await page.evaluateHandle(() => new DataTransfer());
12866
12931
  * await locator.dispatchEvent('dragstart', { dataTransfer });
12867
12932
  * ```
@@ -13058,6 +13123,11 @@ export interface Locator {
13058
13123
  * `<article><div>Playwright</div></article>`.
13059
13124
  */
13060
13125
  hasText?: string|RegExp;
13126
+
13127
+ /**
13128
+ * Only matches visible or invisible elements.
13129
+ */
13130
+ visible?: boolean;
13061
13131
  }): Locator;
13062
13132
 
13063
13133
  /**
@@ -13625,7 +13695,9 @@ export interface Locator {
13625
13695
  }): Promise<boolean>;
13626
13696
 
13627
13697
  /**
13628
- * Returns whether the element is [editable](https://playwright.dev/docs/actionability#editable).
13698
+ * Returns whether the element is [editable](https://playwright.dev/docs/actionability#editable). If the target element is not an `<input>`,
13699
+ * `<textarea>`, `<select>`, `[contenteditable]` and does not have a role allowing `[aria-readonly]`, this method
13700
+ * throws an error.
13629
13701
  *
13630
13702
  * **NOTE** If you need to assert that an element is editable, prefer
13631
13703
  * [expect(locator).toBeEditable([options])](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-be-editable)
@@ -13797,18 +13869,22 @@ export interface Locator {
13797
13869
  /**
13798
13870
  * Creates a locator matching all elements that match one or both of the two locators.
13799
13871
  *
13800
- * Note that when both locators match something, the resulting locator will have multiple matches and violate
13801
- * [locator strictness](https://playwright.dev/docs/locators#strictness) guidelines.
13872
+ * Note that when both locators match something, the resulting locator will have multiple matches, potentially causing
13873
+ * a [locator strictness](https://playwright.dev/docs/locators#strictness) violation.
13802
13874
  *
13803
13875
  * **Usage**
13804
13876
  *
13805
13877
  * Consider a scenario where you'd like to click on a "New email" button, but sometimes a security settings dialog
13806
13878
  * shows up instead. In this case, you can wait for either a "New email" button, or a dialog and act accordingly.
13807
13879
  *
13880
+ * **NOTE** If both "New email" button and security dialog appear on screen, the "or" locator will match both of them,
13881
+ * possibly throwing the ["strict mode violation" error](https://playwright.dev/docs/locators#strictness). In this case, you can use
13882
+ * [locator.first()](https://playwright.dev/docs/api/class-locator#locator-first) to only match one of them.
13883
+ *
13808
13884
  * ```js
13809
13885
  * const newEmail = page.getByRole('button', { name: 'New' });
13810
13886
  * const dialog = page.getByText('Confirm security settings');
13811
- * await expect(newEmail.or(dialog)).toBeVisible();
13887
+ * await expect(newEmail.or(dialog).first()).toBeVisible();
13812
13888
  * if (await dialog.isVisible())
13813
13889
  * await page.getByRole('button', { name: 'Dismiss' }).click();
13814
13890
  * await newEmail.click();
@@ -14003,9 +14079,9 @@ export interface Locator {
14003
14079
  *
14004
14080
  * ```html
14005
14081
  * <select multiple>
14006
- * <option value="red">Red</div>
14007
- * <option value="green">Green</div>
14008
- * <option value="blue">Blue</div>
14082
+ * <option value="red">Red</option>
14083
+ * <option value="green">Green</option>
14084
+ * <option value="blue">Blue</option>
14009
14085
  * </select>
14010
14086
  * ```
14011
14087
  *
@@ -14254,7 +14330,8 @@ export interface Locator {
14254
14330
  }): Promise<void>;
14255
14331
 
14256
14332
  /**
14257
- * Perform a tap gesture on the element matching the locator.
14333
+ * Perform a tap gesture on the element matching the locator. For examples of emulating other gestures by manually
14334
+ * dispatching touch events, see the [emulating legacy touch events](https://playwright.dev/docs/touch-events) page.
14258
14335
  *
14259
14336
  * **Details**
14260
14337
  *
@@ -14507,6 +14584,11 @@ export interface BrowserType<Unused = {}> {
14507
14584
  *
14508
14585
  * **NOTE** Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers.
14509
14586
  *
14587
+ * **NOTE** This connection is significantly lower fidelity than the Playwright protocol connection via
14588
+ * [browserType.connect(wsEndpoint[, options])](https://playwright.dev/docs/api/class-browsertype#browser-type-connect).
14589
+ * If you are experiencing issues or attempting to use advanced functionality, you probably want to use
14590
+ * [browserType.connect(wsEndpoint[, options])](https://playwright.dev/docs/api/class-browsertype#browser-type-connect).
14591
+ *
14510
14592
  * **Usage**
14511
14593
  *
14512
14594
  * ```js
@@ -14532,6 +14614,11 @@ export interface BrowserType<Unused = {}> {
14532
14614
  *
14533
14615
  * **NOTE** Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers.
14534
14616
  *
14617
+ * **NOTE** This connection is significantly lower fidelity than the Playwright protocol connection via
14618
+ * [browserType.connect(wsEndpoint[, options])](https://playwright.dev/docs/api/class-browsertype#browser-type-connect).
14619
+ * If you are experiencing issues or attempting to use advanced functionality, you probably want to use
14620
+ * [browserType.connect(wsEndpoint[, options])](https://playwright.dev/docs/api/class-browsertype#browser-type-connect).
14621
+ *
14535
14622
  * **Usage**
14536
14623
  *
14537
14624
  * ```js
@@ -14546,10 +14633,12 @@ export interface BrowserType<Unused = {}> {
14546
14633
  */
14547
14634
  connectOverCDP(options: ConnectOverCDPOptions & { wsEndpoint?: string }): Promise<Browser>;
14548
14635
  /**
14549
- * This method attaches Playwright to an existing browser instance. When connecting to another browser launched via
14550
- * `BrowserType.launchServer` in Node.js, the major and minor version needs to match the client version (1.2.3 → is
14551
- * compatible with 1.2.x).
14552
- * @param wsEndpoint A browser websocket endpoint to connect to.
14636
+ * This method attaches Playwright to an existing browser instance created via `BrowserType.launchServer` in Node.js.
14637
+ *
14638
+ * **NOTE** The major and minor version of the Playwright instance that connects needs to match the version of
14639
+ * Playwright that launches the browser (1.2.3 is compatible with 1.2.x).
14640
+ *
14641
+ * @param wsEndpoint A Playwright browser websocket endpoint to connect to. You obtain this endpoint via `BrowserServer.wsEndpoint`.
14553
14642
  * @param options
14554
14643
  */
14555
14644
  connect(wsEndpoint: string, options?: ConnectOptions): Promise<Browser>;
@@ -14560,10 +14649,12 @@ export interface BrowserType<Unused = {}> {
14560
14649
  * @deprecated
14561
14650
  */
14562
14651
  /**
14563
- * This method attaches Playwright to an existing browser instance. When connecting to another browser launched via
14564
- * `BrowserType.launchServer` in Node.js, the major and minor version needs to match the client version (1.2.3 → is
14565
- * compatible with 1.2.x).
14566
- * @param wsEndpoint A browser websocket endpoint to connect to.
14652
+ * This method attaches Playwright to an existing browser instance created via `BrowserType.launchServer` in Node.js.
14653
+ *
14654
+ * **NOTE** The major and minor version of the Playwright instance that connects needs to match the version of
14655
+ * Playwright that launches the browser (1.2.3 is compatible with 1.2.x).
14656
+ *
14657
+ * @param wsEndpoint A Playwright browser websocket endpoint to connect to. You obtain this endpoint via `BrowserServer.wsEndpoint`.
14567
14658
  * @param options
14568
14659
  */
14569
14660
  connect(options: ConnectOptions & { wsEndpoint?: string }): Promise<Browser>;
@@ -14658,9 +14749,12 @@ export interface BrowserType<Unused = {}> {
14658
14749
  bypassCSP?: boolean;
14659
14750
 
14660
14751
  /**
14661
- * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary",
14662
- * "msedge", "msedge-beta", "msedge-dev", "msedge-canary". Read more about using
14663
- * [Google Chrome and Microsoft Edge](https://playwright.dev/docs/browsers#google-chrome--microsoft-edge).
14752
+ * Browser distribution channel.
14753
+ *
14754
+ * Use "chromium" to [opt in to new headless mode](https://playwright.dev/docs/browsers#chromium-new-headless-mode).
14755
+ *
14756
+ * Use "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", or
14757
+ * "msedge-canary" to use branded [Google Chrome and Microsoft Edge](https://playwright.dev/docs/browsers#google-chrome--microsoft-edge).
14664
14758
  */
14665
14759
  channel?: string;
14666
14760
 
@@ -14726,12 +14820,20 @@ export interface BrowserType<Unused = {}> {
14726
14820
  }>;
14727
14821
 
14728
14822
  /**
14729
- * Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See
14823
+ * Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
14824
+ * media feature, supported values are `'light'` and `'dark'`. See
14730
14825
  * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
14731
14826
  * Passing `null` resets emulation to system defaults. Defaults to `'light'`.
14732
14827
  */
14733
14828
  colorScheme?: null|"light"|"dark"|"no-preference";
14734
14829
 
14830
+ /**
14831
+ * Emulates `'prefers-contrast'` media feature, supported values are `'no-preference'`, `'more'`. See
14832
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
14833
+ * Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`.
14834
+ */
14835
+ contrast?: null|"no-preference"|"more";
14836
+
14735
14837
  /**
14736
14838
  * Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about
14737
14839
  * [emulating devices with device scale factor](https://playwright.dev/docs/emulation#devices).
@@ -15153,9 +15255,12 @@ export interface BrowserType<Unused = {}> {
15153
15255
  args?: Array<string>;
15154
15256
 
15155
15257
  /**
15156
- * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary",
15157
- * "msedge", "msedge-beta", "msedge-dev", "msedge-canary". Read more about using
15158
- * [Google Chrome and Microsoft Edge](https://playwright.dev/docs/browsers#google-chrome--microsoft-edge).
15258
+ * Browser distribution channel.
15259
+ *
15260
+ * Use "chromium" to [opt in to new headless mode](https://playwright.dev/docs/browsers#chromium-new-headless-mode).
15261
+ *
15262
+ * Use "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", or
15263
+ * "msedge-canary" to use branded [Google Chrome and Microsoft Edge](https://playwright.dev/docs/browsers#google-chrome--microsoft-edge).
15159
15264
  */
15160
15265
  channel?: string;
15161
15266
 
@@ -16534,16 +16639,19 @@ export interface AndroidDevice {
16534
16639
  bypassCSP?: boolean;
16535
16640
 
16536
16641
  /**
16537
- * Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See
16642
+ * Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
16643
+ * media feature, supported values are `'light'` and `'dark'`. See
16538
16644
  * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
16539
16645
  * Passing `null` resets emulation to system defaults. Defaults to `'light'`.
16540
16646
  */
16541
16647
  colorScheme?: null|"light"|"dark"|"no-preference";
16542
16648
 
16543
16649
  /**
16544
- * Optional package name to launch instead of default Chrome for Android.
16650
+ * Emulates `'prefers-contrast'` media feature, supported values are `'no-preference'`, `'more'`. See
16651
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
16652
+ * Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`.
16545
16653
  */
16546
- command?: string;
16654
+ contrast?: null|"no-preference"|"more";
16547
16655
 
16548
16656
  /**
16549
16657
  * Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about
@@ -16653,6 +16761,11 @@ export interface AndroidDevice {
16653
16761
  */
16654
16762
  permissions?: Array<string>;
16655
16763
 
16764
+ /**
16765
+ * Optional package name to launch instead of default Chrome for Android.
16766
+ */
16767
+ pkg?: string;
16768
+
16656
16769
  /**
16657
16770
  * Network proxy settings.
16658
16771
  */
@@ -17415,6 +17528,12 @@ export interface APIRequest {
17415
17528
  */
17416
17529
  extraHTTPHeaders?: { [key: string]: string; };
17417
17530
 
17531
+ /**
17532
+ * Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
17533
+ * codes.
17534
+ */
17535
+ failOnStatusCode?: boolean;
17536
+
17418
17537
  /**
17419
17538
  * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no
17420
17539
  * origin is specified, the username and password are sent to any servers upon unauthorized responses.
@@ -18284,6 +18403,11 @@ export interface APIRequestContext {
18284
18403
  * @param options
18285
18404
  */
18286
18405
  storageState(options?: {
18406
+ /**
18407
+ * Set to `true` to include IndexedDB in the storage state snapshot.
18408
+ */
18409
+ indexedDB?: boolean;
18410
+
18287
18411
  /**
18288
18412
  * The file path to save the storage state to. If
18289
18413
  * [`path`](https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-storage-state-option-path) is
@@ -18527,6 +18651,19 @@ export interface Clock {
18527
18651
  * await page.clock.pauseAt('2020-02-02');
18528
18652
  * ```
18529
18653
  *
18654
+ * For best results, install the clock before navigating the page and set it to a time slightly before the intended
18655
+ * test time. This ensures that all timers run normally during page loading, preventing the page from getting stuck.
18656
+ * Once the page has fully loaded, you can safely use
18657
+ * [clock.pauseAt(time)](https://playwright.dev/docs/api/class-clock#clock-pause-at) to pause the clock.
18658
+ *
18659
+ * ```js
18660
+ * // Initialize clock with some time before the test time and let the page load
18661
+ * // naturally. `Date.now` will progress as the timers fire.
18662
+ * await page.clock.install({ time: new Date('2024-12-10T08:00:00') });
18663
+ * await page.goto('http://localhost:3333');
18664
+ * await page.clock.pauseAt(new Date('2024-12-10T10:00:00'));
18665
+ * ```
18666
+ *
18530
18667
  * @param time Time to pause at.
18531
18668
  */
18532
18669
  pauseAt(time: number|string|Date): Promise<void>;
@@ -18554,6 +18691,10 @@ export interface Clock {
18554
18691
  /**
18555
18692
  * Makes `Date.now` and `new Date()` return fixed fake time at all times, keeps all the timers running.
18556
18693
  *
18694
+ * Use this method for simple scenarios where you only need to test with a predefined time. For more advanced
18695
+ * scenarios, use [clock.install([options])](https://playwright.dev/docs/api/class-clock#clock-install) instead. Read
18696
+ * docs on [clock emulation](https://playwright.dev/docs/clock) to learn more.
18697
+ *
18557
18698
  * **Usage**
18558
18699
  *
18559
18700
  * ```js
@@ -18567,7 +18708,8 @@ export interface Clock {
18567
18708
  setFixedTime(time: number|string|Date): Promise<void>;
18568
18709
 
18569
18710
  /**
18570
- * Sets current system time but does not trigger any timers.
18711
+ * Sets system time, but does not trigger any timers. Use this to test how the web page reacts to a time shift, for
18712
+ * example switching from summer to winter time, or changing time zones.
18571
18713
  *
18572
18714
  * **Usage**
18573
18715
  *
@@ -19010,7 +19152,8 @@ export interface Electron {
19010
19152
  bypassCSP?: boolean;
19011
19153
 
19012
19154
  /**
19013
- * Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See
19155
+ * Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
19156
+ * media feature, supported values are `'light'` and `'dark'`. See
19014
19157
  * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
19015
19158
  * Passing `null` resets emulation to system defaults. Defaults to `'light'`.
19016
19159
  */
@@ -19760,10 +19903,7 @@ export interface FrameLocator {
19760
19903
  * An example to trigger select-all with the keyboard
19761
19904
  *
19762
19905
  * ```js
19763
- * // on Windows and Linux
19764
- * await page.keyboard.press('Control+A');
19765
- * // on macOS
19766
- * await page.keyboard.press('Meta+A');
19906
+ * await page.keyboard.press('ControlOrMeta+A');
19767
19907
  * ```
19768
19908
  *
19769
19909
  */
@@ -20618,12 +20758,17 @@ export interface Route {
20618
20758
  *
20619
20759
  * **Details**
20620
20760
  *
20621
- * Note that any overrides such as [`url`](https://playwright.dev/docs/api/class-route#route-continue-option-url) or
20622
- * [`headers`](https://playwright.dev/docs/api/class-route#route-continue-option-headers) only apply to the request
20623
- * being routed. If this request results in a redirect, overrides will not be applied to the new redirected request.
20624
- * If you want to propagate a header through redirects, use the combination of
20625
- * [route.fetch([options])](https://playwright.dev/docs/api/class-route#route-fetch) and
20626
- * [route.fulfill([options])](https://playwright.dev/docs/api/class-route#route-fulfill) instead.
20761
+ * The [`headers`](https://playwright.dev/docs/api/class-route#route-continue-option-headers) option applies to both
20762
+ * the routed request and any redirects it initiates. However,
20763
+ * [`url`](https://playwright.dev/docs/api/class-route#route-continue-option-url),
20764
+ * [`method`](https://playwright.dev/docs/api/class-route#route-continue-option-method), and
20765
+ * [`postData`](https://playwright.dev/docs/api/class-route#route-continue-option-post-data) only apply to the
20766
+ * original request and are not carried over to redirected requests.
20767
+ *
20768
+ * [route.continue([options])](https://playwright.dev/docs/api/class-route#route-continue) will immediately send the
20769
+ * request to the network, other matching handlers won't be invoked. Use
20770
+ * [route.fallback([options])](https://playwright.dev/docs/api/class-route#route-fallback) If you want next matching
20771
+ * handler in the chain to be invoked.
20627
20772
  *
20628
20773
  * [route.continue([options])](https://playwright.dev/docs/api/class-route#route-continue) will immediately send the
20629
20774
  * request to the network, other matching handlers won't be invoked. Use
@@ -20966,6 +21111,9 @@ export interface Selectors {
20966
21111
  /**
20967
21112
  * The Touchscreen class operates in main-frame CSS pixels relative to the top-left corner of the viewport. Methods on
20968
21113
  * the touchscreen can only be used in browser contexts that have been initialized with `hasTouch` set to true.
21114
+ *
21115
+ * This class is limited to emulating tap gestures. For examples of other gestures simulated by manually dispatching
21116
+ * touch events, see the [emulating legacy touch events](https://playwright.dev/docs/touch-events) page.
20969
21117
  */
20970
21118
  export interface Touchscreen {
20971
21119
  /**
@@ -20999,6 +21147,45 @@ export interface Touchscreen {
20999
21147
  *
21000
21148
  */
21001
21149
  export interface Tracing {
21150
+ /**
21151
+ * **NOTE** Use `test.step` instead when available.
21152
+ *
21153
+ * Creates a new group within the trace, assigning any subsequent API calls to this group, until
21154
+ * [tracing.groupEnd()](https://playwright.dev/docs/api/class-tracing#tracing-group-end) is called. Groups can be
21155
+ * nested and will be visible in the trace viewer.
21156
+ *
21157
+ * **Usage**
21158
+ *
21159
+ * ```js
21160
+ * // use test.step instead
21161
+ * await test.step('Log in', async () => {
21162
+ * // ...
21163
+ * });
21164
+ * ```
21165
+ *
21166
+ * @param name Group name shown in the trace viewer.
21167
+ * @param options
21168
+ */
21169
+ group(name: string, options?: {
21170
+ /**
21171
+ * Specifies a custom location for the group to be shown in the trace viewer. Defaults to the location of the
21172
+ * [tracing.group(name[, options])](https://playwright.dev/docs/api/class-tracing#tracing-group) call.
21173
+ */
21174
+ location?: {
21175
+ file: string;
21176
+
21177
+ line?: number;
21178
+
21179
+ column?: number;
21180
+ };
21181
+ }): Promise<void>;
21182
+
21183
+ /**
21184
+ * Closes the last group created by
21185
+ * [tracing.group(name[, options])](https://playwright.dev/docs/api/class-tracing#tracing-group).
21186
+ */
21187
+ groupEnd(): Promise<void>;
21188
+
21002
21189
  /**
21003
21190
  * Start tracing.
21004
21191
  *
@@ -21177,8 +21364,11 @@ export interface WebError {
21177
21364
  }
21178
21365
 
21179
21366
  /**
21180
- * The [WebSocket](https://playwright.dev/docs/api/class-websocket) class represents websocket connections in the
21181
- * page.
21367
+ * The [WebSocket](https://playwright.dev/docs/api/class-websocket) class represents WebSocket connections within a
21368
+ * page. It provides the ability to inspect and manipulate the data being transmitted and received.
21369
+ *
21370
+ * If you want to intercept or modify WebSocket frames, consider using
21371
+ * [WebSocketRoute](https://playwright.dev/docs/api/class-websocketroute).
21182
21372
  */
21183
21373
  export interface WebSocket {
21184
21374
  /**
@@ -21445,9 +21635,12 @@ export interface LaunchOptions {
21445
21635
  args?: Array<string>;
21446
21636
 
21447
21637
  /**
21448
- * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary",
21449
- * "msedge", "msedge-beta", "msedge-dev", "msedge-canary". Read more about using
21450
- * [Google Chrome and Microsoft Edge](https://playwright.dev/docs/browsers#google-chrome--microsoft-edge).
21638
+ * Browser distribution channel.
21639
+ *
21640
+ * Use "chromium" to [opt in to new headless mode](https://playwright.dev/docs/browsers#chromium-new-headless-mode).
21641
+ *
21642
+ * Use "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", or
21643
+ * "msedge-canary" to use branded [Google Chrome and Microsoft Edge](https://playwright.dev/docs/browsers#google-chrome--microsoft-edge).
21451
21644
  */
21452
21645
  channel?: string;
21453
21646
 
@@ -21660,7 +21853,8 @@ export interface LocatorScreenshotOptions {
21660
21853
  * Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink
21661
21854
  * box `#FF00FF` (customized by
21662
21855
  * [`maskColor`](https://playwright.dev/docs/api/class-locator#locator-screenshot-option-mask-color)) that completely
21663
- * covers its bounding box.
21856
+ * covers its bounding box. The mask is also applied to invisible elements, see
21857
+ * [Matching only visible elements](https://playwright.dev/docs/locators#matching-only-visible-elements) to disable that.
21664
21858
  */
21665
21859
  mask?: Array<Locator>;
21666
21860
 
@@ -21832,12 +22026,20 @@ export interface BrowserContextOptions {
21832
22026
  }>;
21833
22027
 
21834
22028
  /**
21835
- * Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See
22029
+ * Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
22030
+ * media feature, supported values are `'light'` and `'dark'`. See
21836
22031
  * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
21837
22032
  * Passing `null` resets emulation to system defaults. Defaults to `'light'`.
21838
22033
  */
21839
22034
  colorScheme?: null|"light"|"dark"|"no-preference";
21840
22035
 
22036
+ /**
22037
+ * Emulates `'prefers-contrast'` media feature, supported values are `'no-preference'`, `'more'`. See
22038
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
22039
+ * Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`.
22040
+ */
22041
+ contrast?: null|"no-preference"|"more";
22042
+
21841
22043
  /**
21842
22044
  * Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about
21843
22045
  * [emulating devices with device scale factor](https://playwright.dev/docs/emulation#devices).
@@ -22084,12 +22286,12 @@ export interface BrowserContextOptions {
22084
22286
  sameSite: "Strict"|"Lax"|"None";
22085
22287
  }>;
22086
22288
 
22087
- /**
22088
- * localStorage to set for context
22089
- */
22090
22289
  origins: Array<{
22091
22290
  origin: string;
22092
22291
 
22292
+ /**
22293
+ * localStorage to set for context
22294
+ */
22093
22295
  localStorage: Array<{
22094
22296
  name: string;
22095
22297
 
@@ -22317,7 +22519,8 @@ export interface PageScreenshotOptions {
22317
22519
  * Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink
22318
22520
  * box `#FF00FF` (customized by
22319
22521
  * [`maskColor`](https://playwright.dev/docs/api/class-page#page-screenshot-option-mask-color)) that completely covers
22320
- * its bounding box.
22522
+ * its bounding box. The mask is also applied to invisible elements, see
22523
+ * [Matching only visible elements](https://playwright.dev/docs/locators#matching-only-visible-elements) to disable that.
22321
22524
  */
22322
22525
  mask?: Array<Locator>;
22323
22526