@checkly/playwright-core 1.41.26 → 1.42.12

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 (164) hide show
  1. package/ThirdPartyNotices.txt +3 -3
  2. package/bin/reinstall_chrome_beta_win.ps1 +2 -1
  3. package/bin/reinstall_chrome_stable_win.ps1 +2 -1
  4. package/bin/reinstall_msedge_beta_win.ps1 +2 -1
  5. package/bin/reinstall_msedge_dev_win.ps1 +2 -1
  6. package/bin/reinstall_msedge_stable_win.ps1 +2 -1
  7. package/browsers.json +14 -15
  8. package/cli.js +2 -1
  9. package/lib/checkly/fetch.js +28 -1
  10. package/lib/cli/driver.js +9 -1
  11. package/lib/cli/program.js +12 -4
  12. package/lib/client/browserContext.js +1 -1
  13. package/lib/client/channelOwner.js +1 -1
  14. package/lib/client/clientHelper.js +5 -1
  15. package/lib/client/connection.js +1 -1
  16. package/lib/client/consoleMessage.js +1 -1
  17. package/lib/client/electron.js +3 -0
  18. package/lib/client/events.js +1 -0
  19. package/lib/client/frame.js +2 -1
  20. package/lib/client/harRouter.js +7 -1
  21. package/lib/client/page.js +25 -6
  22. package/lib/common/socksProxy.js +1 -1
  23. package/lib/generated/consoleApiSource.js +1 -1
  24. package/lib/generated/injectedScriptSource.js +1 -1
  25. package/lib/generated/recorderSource.js +1 -1
  26. package/lib/outofprocess.js +1 -1
  27. package/lib/protocol/validator.js +60 -30
  28. package/lib/remote/playwrightConnection.js +1 -1
  29. package/lib/remote/playwrightServer.js +72 -166
  30. package/lib/server/android/android.js +1 -1
  31. package/lib/server/browserType.js +2 -2
  32. package/lib/server/chromium/chromium.js +5 -4
  33. package/lib/server/chromium/crConnection.js +1 -1
  34. package/lib/server/chromium/crNetworkManager.js +1 -3
  35. package/lib/server/chromium/crPage.js +45 -2
  36. package/lib/server/chromium/crPdf.js +8 -2
  37. package/lib/server/console.js +1 -3
  38. package/lib/server/debugController.js +0 -3
  39. package/lib/server/deviceDescriptorsSource.json +50 -50
  40. package/lib/server/dispatchers/browserContextDispatcher.js +3 -2
  41. package/lib/server/dispatchers/dispatcher.js +9 -10
  42. package/lib/server/dispatchers/electronDispatcher.js +13 -0
  43. package/lib/server/dispatchers/frameDispatcher.js +0 -6
  44. package/lib/server/dispatchers/networkDispatchers.js +1 -0
  45. package/lib/server/dispatchers/pageDispatcher.js +14 -10
  46. package/lib/server/dom.js +130 -167
  47. package/lib/server/electron/electron.js +38 -12
  48. package/lib/server/electron/loader.js +4 -2
  49. package/lib/server/fetch.js +1 -0
  50. package/lib/server/firefox/ffAccessibility.js +2 -1
  51. package/lib/server/firefox/ffConnection.js +1 -1
  52. package/lib/server/firefox/ffPage.js +1 -1
  53. package/lib/server/frames.js +39 -20
  54. package/lib/server/helper.js +1 -1
  55. package/lib/server/page.js +49 -5
  56. package/lib/server/pipeTransport.js +1 -1
  57. package/lib/server/playwright.js +1 -1
  58. package/lib/server/progress.js +3 -11
  59. package/lib/server/recorder/csharp.js +1 -1
  60. package/lib/server/recorder/java.js +36 -4
  61. package/lib/server/recorder.js +2 -2
  62. package/lib/server/registry/browserFetcher.js +1 -1
  63. package/lib/server/registry/dependencies.js +5 -4
  64. package/lib/server/registry/index.js +48 -30
  65. package/lib/server/registry/nativeDeps.js +0 -94
  66. package/lib/server/trace/recorder/snapshotter.js +1 -1
  67. package/lib/server/trace/recorder/tracing.js +5 -2
  68. package/lib/server/trace/viewer/traceViewer.js +1 -1
  69. package/lib/server/transport.js +4 -2
  70. package/lib/server/webkit/wkConnection.js +1 -1
  71. package/lib/server/webkit/wkPage.js +2 -2
  72. package/lib/utils/comparators.js +4 -4
  73. package/lib/utils/fileUtils.js +4 -0
  74. package/lib/utils/hostPlatform.js +1 -1
  75. package/lib/utils/index.js +33 -0
  76. package/lib/utils/isomorphic/locatorParser.js +6 -4
  77. package/lib/utils/isomorphic/stringUtils.js +5 -0
  78. package/lib/utils/network.js +32 -0
  79. package/lib/utils/processLauncher.js +7 -0
  80. package/lib/utils/rtti.js +7 -4
  81. package/lib/utils/wsServer.js +5 -3
  82. package/lib/utilsBundleImpl/index.js +4 -4
  83. package/lib/vite/htmlReport/index.html +11 -11
  84. package/lib/vite/traceViewer/assets/{codeMirrorModule-2ImvVqMb.js → codeMirrorModule-BK3t1EEu.js} +1 -1
  85. package/lib/vite/traceViewer/assets/codeMirrorModule-V7N6ppkd.js +15585 -0
  86. package/lib/vite/traceViewer/assets/{codeMirrorModule-y3M3aAqy.js → codeMirrorModule-Vg1kIqMp.js} +1 -1
  87. package/lib/vite/traceViewer/assets/{codeMirrorModule-fqJB1XDu.js → codeMirrorModule-wLpsbIhd.js} +13 -13
  88. package/lib/vite/traceViewer/assets/{wsPort-L8WBvZfK.js → wsPort-964mA9MZ.js} +18 -18
  89. package/lib/vite/traceViewer/assets/wsPort-EUvw-dwH.js +18540 -0
  90. package/lib/vite/traceViewer/assets/{wsPort-uVqol1LI.js → wsPort-RIoVGhlT.js} +18 -18
  91. package/lib/vite/traceViewer/assets/wsPort-f2dAQL4I.js +69 -0
  92. package/lib/vite/traceViewer/assets/xtermModule-_6TC5FYT.js +6529 -0
  93. package/lib/vite/traceViewer/codeMirrorModule.svF_VrcJ.css +344 -0
  94. package/lib/vite/traceViewer/{index.LR1HufLs.js → index.-_8-eHEE.js} +1 -1
  95. package/lib/vite/traceViewer/index.5mge2rY_.css +124 -0
  96. package/lib/vite/traceViewer/index.6KJ-JQ0L.js +180 -0
  97. package/lib/vite/traceViewer/{index.4X7zDysg.js → index.cbtHmFgM.js} +1 -1
  98. package/lib/vite/traceViewer/index.html +3 -3
  99. package/lib/vite/traceViewer/{index.4xhUWj1f.js → index.qOFdH9Ja.js} +1 -1
  100. package/lib/vite/traceViewer/sw.bundle.js +4 -4
  101. package/lib/vite/traceViewer/{uiMode.PlLkrJDI.js → uiMode.9CwNsWc6.js} +1 -1
  102. package/lib/vite/traceViewer/{uiMode.qpn6w4df.js → uiMode.fcU_T5Nf.js} +1 -1
  103. package/lib/vite/traceViewer/uiMode.html +3 -3
  104. package/lib/vite/traceViewer/{uiMode.GTNzARcV.js → uiMode.iNIhieBM.js} +1 -1
  105. package/lib/vite/traceViewer/uiMode.iq7CyYy7.js +1490 -0
  106. package/lib/vite/traceViewer/uiMode.xvJHbkzl.css +1324 -0
  107. package/lib/vite/traceViewer/wsPort.p5jUwABW.css +3450 -0
  108. package/lib/vite/traceViewer/xtermModule.OKEVRlkP.css +209 -0
  109. package/package.json +6 -5
  110. package/types/protocol.d.ts +367 -53
  111. package/types/types.d.ts +220 -50
  112. package/LICENSE +0 -202
  113. package/NOTICE +0 -5
  114. package/lib/cli/cli.js +0 -61
  115. package/lib/common/debugLogger.js +0 -89
  116. package/lib/vite/traceViewer/assets/codeMirrorModule-2mdjgmqe.js +0 -24
  117. package/lib/vite/traceViewer/assets/codeMirrorModule-56536a77.js +0 -24
  118. package/lib/vite/traceViewer/assets/codeMirrorModule-75b0ca4f.js +0 -24
  119. package/lib/vite/traceViewer/assets/codeMirrorModule-A2_PGeGB.js +0 -24
  120. package/lib/vite/traceViewer/assets/codeMirrorModule-GJA8DRmd.js +0 -24
  121. package/lib/vite/traceViewer/assets/codeMirrorModule-GluP1cQ1.js +0 -24
  122. package/lib/vite/traceViewer/assets/codeMirrorModule-aUzO-LID.js +0 -24
  123. package/lib/vite/traceViewer/assets/codeMirrorModule-b361a51f.js +0 -24
  124. package/lib/vite/traceViewer/assets/codeMirrorModule-c1454a2e.js +0 -24
  125. package/lib/vite/traceViewer/assets/codeMirrorModule-f333a775.js +0 -24
  126. package/lib/vite/traceViewer/assets/wsPort-722747dc.js +0 -64
  127. package/lib/vite/traceViewer/assets/wsPort-762c6840.js +0 -64
  128. package/lib/vite/traceViewer/assets/wsPort-93o0i57c.js +0 -69
  129. package/lib/vite/traceViewer/assets/wsPort-98e00a94.js +0 -64
  130. package/lib/vite/traceViewer/assets/wsPort-Rvwd4WC-.js +0 -69
  131. package/lib/vite/traceViewer/assets/wsPort-db501ca9.js +0 -64
  132. package/lib/vite/traceViewer/assets/wsPort-dlD7vDkY.js +0 -69
  133. package/lib/vite/traceViewer/assets/wsPort-ee2830d7.js +0 -64
  134. package/lib/vite/traceViewer/assets/wsPort-qI0zJPR7.js +0 -69
  135. package/lib/vite/traceViewer/assets/wsPort-qOE2NWrO.js +0 -69
  136. package/lib/vite/traceViewer/assets/wsPort-sh0wpjYp.js +0 -69
  137. package/lib/vite/traceViewer/assets/xtermModule-443332e6.js +0 -9
  138. package/lib/vite/traceViewer/codeMirrorModule.5d0f417c.css +0 -1
  139. package/lib/vite/traceViewer/codicon.79f233d0.ttf +0 -0
  140. package/lib/vite/traceViewer/index.0d08c336.js +0 -2
  141. package/lib/vite/traceViewer/index.1a1fe659.css +0 -1
  142. package/lib/vite/traceViewer/index.HkJgzlGy.js +0 -2
  143. package/lib/vite/traceViewer/index.Ox-CymYJ.js +0 -2
  144. package/lib/vite/traceViewer/index.a265fbdb.js +0 -2
  145. package/lib/vite/traceViewer/index.d05939c9.js +0 -2
  146. package/lib/vite/traceViewer/index.decad628.js +0 -2
  147. package/lib/vite/traceViewer/index.ed9a3c58.js +0 -2
  148. package/lib/vite/traceViewer/index.kRjx5sAJ.js +0 -2
  149. package/lib/vite/traceViewer/index.krETyIB_.js +0 -2
  150. package/lib/vite/traceViewer/index.o6j3Cv4u.js +0 -2
  151. package/lib/vite/traceViewer/uiMode.08ab2d90.js +0 -4
  152. package/lib/vite/traceViewer/uiMode.0d0d667b.js +0 -4
  153. package/lib/vite/traceViewer/uiMode.1Wcp_Kto.js +0 -10
  154. package/lib/vite/traceViewer/uiMode.3ff70f7d.js +0 -4
  155. package/lib/vite/traceViewer/uiMode.8b41a49d.css +0 -1
  156. package/lib/vite/traceViewer/uiMode.8e0454c4.js +0 -4
  157. package/lib/vite/traceViewer/uiMode.Rcwfn0db.js +0 -10
  158. package/lib/vite/traceViewer/uiMode.YGPXSUMv.js +0 -10
  159. package/lib/vite/traceViewer/uiMode.YYFJGvtV.js +0 -10
  160. package/lib/vite/traceViewer/uiMode.c1ebfc43.js +0 -4
  161. package/lib/vite/traceViewer/uiMode.zV-7Lf9v.js +0 -10
  162. package/lib/vite/traceViewer/wsPort.9c9a6767.css +0 -1
  163. package/lib/vite/traceViewer/wsPort.kSgQKQ0y.css +0 -1
  164. package/lib/vite/traceViewer/xtermModule.6428296b.css +0 -32
package/types/types.d.ts CHANGED
@@ -901,8 +901,7 @@ export interface Page {
901
901
  on(event: 'close', listener: (page: Page) => void): this;
902
902
 
903
903
  /**
904
- * Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`. Also
905
- * emitted if the page throws an error or a warning.
904
+ * Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`.
906
905
  *
907
906
  * The arguments passed into `console.log` are available on the {@link ConsoleMessage} event handler argument.
908
907
  *
@@ -1197,8 +1196,7 @@ export interface Page {
1197
1196
  addListener(event: 'close', listener: (page: Page) => void): this;
1198
1197
 
1199
1198
  /**
1200
- * Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`. Also
1201
- * emitted if the page throws an error or a warning.
1199
+ * Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`.
1202
1200
  *
1203
1201
  * The arguments passed into `console.log` are available on the {@link ConsoleMessage} event handler argument.
1204
1202
  *
@@ -1588,8 +1586,7 @@ export interface Page {
1588
1586
  prependListener(event: 'close', listener: (page: Page) => void): this;
1589
1587
 
1590
1588
  /**
1591
- * Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`. Also
1592
- * emitted if the page throws an error or a warning.
1589
+ * Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`.
1593
1590
  *
1594
1591
  * The arguments passed into `console.log` are available on the {@link ConsoleMessage} event handler argument.
1595
1592
  *
@@ -1783,6 +1780,89 @@ export interface Page {
1783
1780
  */
1784
1781
  prependListener(event: 'worker', listener: (worker: Worker) => void): this;
1785
1782
 
1783
+ /**
1784
+ * When testing a web page, sometimes unexpected overlays like a coookie consent dialog appear and block actions you
1785
+ * want to automate, e.g. clicking a button. These overlays don't always show up in the same way or at the same time,
1786
+ * making them tricky to handle in automated tests.
1787
+ *
1788
+ * This method lets you set up a special function, called a handler, that activates when it detects that overlay is
1789
+ * visible. The handler's job is to remove the overlay, allowing your test to continue as if the overlay wasn't there.
1790
+ *
1791
+ * Things to keep in mind:
1792
+ * - When an overlay is shown predictably, we recommend explicitly waiting for it in your test and dismissing it as
1793
+ * a part of your normal test flow, instead of using
1794
+ * [page.addLocatorHandler(locator, handler)](https://playwright.dev/docs/api/class-page#page-add-locator-handler).
1795
+ * - Playwright checks for the overlay every time before executing or retrying an action that requires an
1796
+ * [actionability check](https://playwright.dev/docs/actionability), or before performing an auto-waiting assertion check. When overlay
1797
+ * is visible, Playwright calls the handler first, and then proceeds with the action/assertion.
1798
+ * - The execution time of the handler counts towards the timeout of the action/assertion that executed the handler.
1799
+ * If your handler takes too long, it might cause timeouts.
1800
+ * - You can register multiple handlers. However, only a single handler will be running at a time. Make sure the
1801
+ * actions within a handler don't depend on another handler.
1802
+ *
1803
+ * **NOTE** Running the handler will alter your page state mid-test. For example it will change the currently focused
1804
+ * element and move the mouse. Make sure that actions that run after the handler are self-contained and do not rely on
1805
+ * the focus and mouse state being unchanged. <br /> <br /> For example, consider a test that calls
1806
+ * [locator.focus([options])](https://playwright.dev/docs/api/class-locator#locator-focus) followed by
1807
+ * [keyboard.press(key[, options])](https://playwright.dev/docs/api/class-keyboard#keyboard-press). If your handler
1808
+ * clicks a button between these two actions, the focused element most likely will be wrong, and key press will happen
1809
+ * on the unexpected element. Use
1810
+ * [locator.press(key[, options])](https://playwright.dev/docs/api/class-locator#locator-press) instead to avoid this
1811
+ * problem. <br /> <br /> Another example is a series of mouse actions, where
1812
+ * [mouse.move(x, y[, options])](https://playwright.dev/docs/api/class-mouse#mouse-move) is followed by
1813
+ * [mouse.down([options])](https://playwright.dev/docs/api/class-mouse#mouse-down). Again, when the handler runs
1814
+ * between these two actions, the mouse position will be wrong during the mouse down. Prefer self-contained actions
1815
+ * like [locator.click([options])](https://playwright.dev/docs/api/class-locator#locator-click) that do not rely on
1816
+ * the state being unchanged by a handler.
1817
+ *
1818
+ * **Usage**
1819
+ *
1820
+ * An example that closes a cookie consent dialog when it appears:
1821
+ *
1822
+ * ```js
1823
+ * // Setup the handler.
1824
+ * await page.addLocatorHandler(page.getByRole('button', { name: 'Accept all cookies' }), async () => {
1825
+ * await page.getByRole('button', { name: 'Reject all cookies' }).click();
1826
+ * });
1827
+ *
1828
+ * // Write the test as usual.
1829
+ * await page.goto('https://example.com');
1830
+ * await page.getByRole('button', { name: 'Start here' }).click();
1831
+ * ```
1832
+ *
1833
+ * An example that skips the "Confirm your security details" page when it is shown:
1834
+ *
1835
+ * ```js
1836
+ * // Setup the handler.
1837
+ * await page.addLocatorHandler(page.getByText('Confirm your security details'), async () => {
1838
+ * await page.getByRole('button', 'Remind me later').click();
1839
+ * });
1840
+ *
1841
+ * // Write the test as usual.
1842
+ * await page.goto('https://example.com');
1843
+ * await page.getByRole('button', { name: 'Start here' }).click();
1844
+ * ```
1845
+ *
1846
+ * An example with a custom callback on every actionability check. It uses a `<body>` locator that is always visible,
1847
+ * so the handler is called before every actionability check:
1848
+ *
1849
+ * ```js
1850
+ * // Setup the handler.
1851
+ * await page.addLocatorHandler(page.locator('body'), async () => {
1852
+ * await page.evaluate(() => window.removeObstructionsForTestIfNeeded());
1853
+ * });
1854
+ *
1855
+ * // Write the test as usual.
1856
+ * await page.goto('https://example.com');
1857
+ * await page.getByRole('button', { name: 'Start here' }).click();
1858
+ * ```
1859
+ *
1860
+ * @param locator Locator that triggers the handler.
1861
+ * @param handler Function that should be run once `locator` appears. This function should get rid of the element that blocks actions
1862
+ * like click.
1863
+ */
1864
+ addLocatorHandler(locator: Locator, handler: Function): Promise<void>;
1865
+
1786
1866
  /**
1787
1867
  * Adds a `<script>` tag into the page with the desired url or content. Returns the added tag when the script's onload
1788
1868
  * fires or when the script content was injected into frame.
@@ -3415,6 +3495,11 @@ export interface Page {
3415
3495
  left?: string|number;
3416
3496
  };
3417
3497
 
3498
+ /**
3499
+ * Whether or not to embed the document outline into the PDF. Defaults to `false`.
3500
+ */
3501
+ outline?: boolean;
3502
+
3418
3503
  /**
3419
3504
  * Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
3420
3505
  */
@@ -3442,6 +3527,11 @@ export interface Page {
3442
3527
  */
3443
3528
  scale?: number;
3444
3529
 
3530
+ /**
3531
+ * Whether or not to generate tagged (accessible) PDF. Defaults to `false`.
3532
+ */
3533
+ tagged?: boolean;
3534
+
3445
3535
  /**
3446
3536
  * Paper width, accepts values labeled with units.
3447
3537
  */
@@ -3472,8 +3562,8 @@ export interface Page {
3472
3562
  * If `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different respective
3473
3563
  * texts.
3474
3564
  *
3475
- * Shortcuts such as `key: "Control+o"` or `key: "Control+Shift+T"` are supported as well. When specified with the
3476
- * modifier, modifier is pressed and being held while the subsequent key is being pressed.
3565
+ * Shortcuts such as `key: "Control+o"`, `key: "Control++` or `key: "Control+Shift+T"` are supported as well. When
3566
+ * specified with the modifier, modifier is pressed and being held while the subsequent key is being pressed.
3477
3567
  *
3478
3568
  * **Usage**
3479
3569
  *
@@ -3588,11 +3678,11 @@ export interface Page {
3588
3678
  * some post data, and leaving all other requests as is:
3589
3679
  *
3590
3680
  * ```js
3591
- * await page.route('/api/**', route => {
3681
+ * await page.route('/api/**', async route => {
3592
3682
  * if (route.request().postData().includes('my-string'))
3593
- * route.fulfill({ body: 'mocked-data' });
3683
+ * await route.fulfill({ body: 'mocked-data' });
3594
3684
  * else
3595
- * route.continue();
3685
+ * await route.continue();
3596
3686
  * });
3597
3687
  * ```
3598
3688
  *
@@ -4280,8 +4370,7 @@ export interface Page {
4280
4370
  waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;
4281
4371
 
4282
4372
  /**
4283
- * Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`. Also
4284
- * emitted if the page throws an error or a warning.
4373
+ * Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`.
4285
4374
  *
4286
4375
  * The arguments passed into `console.log` are available on the {@link ConsoleMessage} event handler argument.
4287
4376
  *
@@ -6759,8 +6848,8 @@ export interface Frame {
6759
6848
  * If `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different respective
6760
6849
  * texts.
6761
6850
  *
6762
- * Shortcuts such as `key: "Control+o"` or `key: "Control+Shift+T"` are supported as well. When specified with the
6763
- * modifier, modifier is pressed and being held while the subsequent key is being pressed.
6851
+ * Shortcuts such as `key: "Control+o"`, `key: "Control++` or `key: "Control+Shift+T"` are supported as well. When
6852
+ * specified with the modifier, modifier is pressed and being held while the subsequent key is being pressed.
6764
6853
  * @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be
6765
6854
  * used.
6766
6855
  * @param key Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.
@@ -7603,8 +7692,7 @@ export interface BrowserContext {
7603
7692
  on(event: 'close', listener: (browserContext: BrowserContext) => void): this;
7604
7693
 
7605
7694
  /**
7606
- * Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`. Also
7607
- * emitted if the page throws an error or a warning.
7695
+ * Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`.
7608
7696
  *
7609
7697
  * The arguments passed into `console.log` and the page are available on the {@link ConsoleMessage} event handler
7610
7698
  * argument.
@@ -7795,8 +7883,7 @@ export interface BrowserContext {
7795
7883
  addListener(event: 'close', listener: (browserContext: BrowserContext) => void): this;
7796
7884
 
7797
7885
  /**
7798
- * Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`. Also
7799
- * emitted if the page throws an error or a warning.
7886
+ * Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`.
7800
7887
  *
7801
7888
  * The arguments passed into `console.log` and the page are available on the {@link ConsoleMessage} event handler
7802
7889
  * argument.
@@ -8042,8 +8129,7 @@ export interface BrowserContext {
8042
8129
  prependListener(event: 'close', listener: (browserContext: BrowserContext) => void): this;
8043
8130
 
8044
8131
  /**
8045
- * Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`. Also
8046
- * emitted if the page throws an error or a warning.
8132
+ * Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`.
8047
8133
  *
8048
8134
  * The arguments passed into `console.log` and the page are available on the {@link ConsoleMessage} event handler
8049
8135
  * argument.
@@ -8391,11 +8477,11 @@ export interface BrowserContext {
8391
8477
  * some post data, and leaving all other requests as is:
8392
8478
  *
8393
8479
  * ```js
8394
- * await context.route('/api/**', route => {
8480
+ * await context.route('/api/**', async route => {
8395
8481
  * if (route.request().postData().includes('my-string'))
8396
- * route.fulfill({ body: 'mocked-data' });
8482
+ * await route.fulfill({ body: 'mocked-data' });
8397
8483
  * else
8398
- * route.continue();
8484
+ * await route.continue();
8399
8485
  * });
8400
8486
  * ```
8401
8487
  *
@@ -8660,8 +8746,7 @@ export interface BrowserContext {
8660
8746
  waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (browserContext: BrowserContext) => boolean | Promise<boolean>, timeout?: number } | ((browserContext: BrowserContext) => boolean | Promise<boolean>)): Promise<BrowserContext>;
8661
8747
 
8662
8748
  /**
8663
- * Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`. Also
8664
- * emitted if the page throws an error or a warning.
8749
+ * Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`.
8665
8750
  *
8666
8751
  * The arguments passed into `console.log` and the page are available on the {@link ConsoleMessage} event handler
8667
8752
  * argument.
@@ -10039,8 +10124,8 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
10039
10124
  * If `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different respective
10040
10125
  * texts.
10041
10126
  *
10042
- * Shortcuts such as `key: "Control+o"` or `key: "Control+Shift+T"` are supported as well. When specified with the
10043
- * modifier, modifier is pressed and being held while the subsequent key is being pressed.
10127
+ * Shortcuts such as `key: "Control+o"`, `key: "Control++` or `key: "Control+Shift+T"` are supported as well. When
10128
+ * specified with the modifier, modifier is pressed and being held while the subsequent key is being pressed.
10044
10129
  * @param key Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.
10045
10130
  * @param options
10046
10131
  */
@@ -12231,8 +12316,8 @@ export interface Locator {
12231
12316
  * If `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different respective
12232
12317
  * texts.
12233
12318
  *
12234
- * Shortcuts such as `key: "Control+o"` or `key: "Control+Shift+T"` are supported as well. When specified with the
12235
- * modifier, modifier is pressed and being held while the subsequent key is being pressed.
12319
+ * Shortcuts such as `key: "Control+o"`, `key: "Control++` or `key: "Control+Shift+T"` are supported as well. When
12320
+ * specified with the modifier, modifier is pressed and being held while the subsequent key is being pressed.
12236
12321
  * @param key Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.
12237
12322
  * @param options
12238
12323
  */
@@ -13867,10 +13952,31 @@ export interface ElectronApplication {
13867
13952
  */
13868
13953
  evaluateHandle<R>(pageFunction: PageFunctionOn<ElectronType, void, R>, arg?: any): Promise<SmartHandle<R>>;
13869
13954
  /**
13870
- * This event is issued when the application closes.
13955
+ * This event is issued when the application process has been terminated.
13871
13956
  */
13872
13957
  on(event: 'close', listener: () => void): this;
13873
13958
 
13959
+ /**
13960
+ * Emitted when JavaScript within the Electron main process calls one of console API methods, e.g. `console.log` or
13961
+ * `console.dir`.
13962
+ *
13963
+ * The arguments passed into `console.log` are available on the {@link ConsoleMessage} event handler argument.
13964
+ *
13965
+ * **Usage**
13966
+ *
13967
+ * ```js
13968
+ * electronApp.on('console', async msg => {
13969
+ * const values = [];
13970
+ * for (const arg of msg.args())
13971
+ * values.push(await arg.jsonValue());
13972
+ * console.log(...values);
13973
+ * });
13974
+ * await electronApp.evaluate(() => console.log('hello', 5, { foo: 'bar' }));
13975
+ * ```
13976
+ *
13977
+ */
13978
+ on(event: 'console', listener: (consoleMessage: ConsoleMessage) => void): this;
13979
+
13874
13980
  /**
13875
13981
  * This event is issued for every window that is created **and loaded** in Electron. It contains a {@link Page} that
13876
13982
  * can be used for Playwright automation.
@@ -13882,16 +13988,42 @@ export interface ElectronApplication {
13882
13988
  */
13883
13989
  once(event: 'close', listener: () => void): this;
13884
13990
 
13991
+ /**
13992
+ * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event.
13993
+ */
13994
+ once(event: 'console', listener: (consoleMessage: ConsoleMessage) => void): this;
13995
+
13885
13996
  /**
13886
13997
  * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event.
13887
13998
  */
13888
13999
  once(event: 'window', listener: (page: Page) => void): this;
13889
14000
 
13890
14001
  /**
13891
- * This event is issued when the application closes.
14002
+ * This event is issued when the application process has been terminated.
13892
14003
  */
13893
14004
  addListener(event: 'close', listener: () => void): this;
13894
14005
 
14006
+ /**
14007
+ * Emitted when JavaScript within the Electron main process calls one of console API methods, e.g. `console.log` or
14008
+ * `console.dir`.
14009
+ *
14010
+ * The arguments passed into `console.log` are available on the {@link ConsoleMessage} event handler argument.
14011
+ *
14012
+ * **Usage**
14013
+ *
14014
+ * ```js
14015
+ * electronApp.on('console', async msg => {
14016
+ * const values = [];
14017
+ * for (const arg of msg.args())
14018
+ * values.push(await arg.jsonValue());
14019
+ * console.log(...values);
14020
+ * });
14021
+ * await electronApp.evaluate(() => console.log('hello', 5, { foo: 'bar' }));
14022
+ * ```
14023
+ *
14024
+ */
14025
+ addListener(event: 'console', listener: (consoleMessage: ConsoleMessage) => void): this;
14026
+
13895
14027
  /**
13896
14028
  * This event is issued for every window that is created **and loaded** in Electron. It contains a {@link Page} that
13897
14029
  * can be used for Playwright automation.
@@ -13903,6 +14035,11 @@ export interface ElectronApplication {
13903
14035
  */
13904
14036
  removeListener(event: 'close', listener: () => void): this;
13905
14037
 
14038
+ /**
14039
+ * Removes an event listener added by `on` or `addListener`.
14040
+ */
14041
+ removeListener(event: 'console', listener: (consoleMessage: ConsoleMessage) => void): this;
14042
+
13906
14043
  /**
13907
14044
  * Removes an event listener added by `on` or `addListener`.
13908
14045
  */
@@ -13913,16 +14050,42 @@ export interface ElectronApplication {
13913
14050
  */
13914
14051
  off(event: 'close', listener: () => void): this;
13915
14052
 
14053
+ /**
14054
+ * Removes an event listener added by `on` or `addListener`.
14055
+ */
14056
+ off(event: 'console', listener: (consoleMessage: ConsoleMessage) => void): this;
14057
+
13916
14058
  /**
13917
14059
  * Removes an event listener added by `on` or `addListener`.
13918
14060
  */
13919
14061
  off(event: 'window', listener: (page: Page) => void): this;
13920
14062
 
13921
14063
  /**
13922
- * This event is issued when the application closes.
14064
+ * This event is issued when the application process has been terminated.
13923
14065
  */
13924
14066
  prependListener(event: 'close', listener: () => void): this;
13925
14067
 
14068
+ /**
14069
+ * Emitted when JavaScript within the Electron main process calls one of console API methods, e.g. `console.log` or
14070
+ * `console.dir`.
14071
+ *
14072
+ * The arguments passed into `console.log` are available on the {@link ConsoleMessage} event handler argument.
14073
+ *
14074
+ * **Usage**
14075
+ *
14076
+ * ```js
14077
+ * electronApp.on('console', async msg => {
14078
+ * const values = [];
14079
+ * for (const arg of msg.args())
14080
+ * values.push(await arg.jsonValue());
14081
+ * console.log(...values);
14082
+ * });
14083
+ * await electronApp.evaluate(() => console.log('hello', 5, { foo: 'bar' }));
14084
+ * ```
14085
+ *
14086
+ */
14087
+ prependListener(event: 'console', listener: (consoleMessage: ConsoleMessage) => void): this;
14088
+
13926
14089
  /**
13927
14090
  * This event is issued for every window that is created **and loaded** in Electron. It contains a {@link Page} that
13928
14091
  * can be used for Playwright automation.
@@ -13975,10 +14138,31 @@ export interface ElectronApplication {
13975
14138
  process(): ChildProcess;
13976
14139
 
13977
14140
  /**
13978
- * This event is issued when the application closes.
14141
+ * This event is issued when the application process has been terminated.
13979
14142
  */
13980
14143
  waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: () => boolean | Promise<boolean>, timeout?: number } | (() => boolean | Promise<boolean>)): Promise<void>;
13981
14144
 
14145
+ /**
14146
+ * Emitted when JavaScript within the Electron main process calls one of console API methods, e.g. `console.log` or
14147
+ * `console.dir`.
14148
+ *
14149
+ * The arguments passed into `console.log` are available on the {@link ConsoleMessage} event handler argument.
14150
+ *
14151
+ * **Usage**
14152
+ *
14153
+ * ```js
14154
+ * electronApp.on('console', async msg => {
14155
+ * const values = [];
14156
+ * for (const arg of msg.args())
14157
+ * values.push(await arg.jsonValue());
14158
+ * console.log(...values);
14159
+ * });
14160
+ * await electronApp.evaluate(() => console.log('hello', 5, { foo: 'bar' }));
14161
+ * ```
14162
+ *
14163
+ */
14164
+ waitForEvent(event: 'console', optionsOrPredicate?: { predicate?: (consoleMessage: ConsoleMessage) => boolean | Promise<boolean>, timeout?: number } | ((consoleMessage: ConsoleMessage) => boolean | Promise<boolean>)): Promise<ConsoleMessage>;
14165
+
13982
14166
  /**
13983
14167
  * This event is issued for every window that is created **and loaded** in Electron. It contains a {@link Page} that
13984
14168
  * can be used for Playwright automation.
@@ -14165,13 +14349,6 @@ export {};
14165
14349
  * })();
14166
14350
  * ```
14167
14351
  *
14168
- * Note that since you don't need Playwright to install web browsers when testing Android, you can omit browser
14169
- * download via setting the following environment variable when installing Playwright:
14170
- *
14171
- * ```bash
14172
- * PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm i -D playwright
14173
- * ```
14174
- *
14175
14352
  */
14176
14353
  export interface Android {
14177
14354
  /**
@@ -17248,13 +17425,6 @@ export interface Download {
17248
17425
  * })();
17249
17426
  * ```
17250
17427
  *
17251
- * Note that since you don't need Playwright to install web browsers when testing Electron, you can omit browser
17252
- * download via setting the following environment variable when installing Playwright:
17253
- *
17254
- * ```bash
17255
- * PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm i -D playwright
17256
- * ```
17257
- *
17258
17428
  * **Supported Electron versions are:**
17259
17429
  * - v12.2.0+
17260
17430
  * - v13.4.0+
@@ -18070,8 +18240,8 @@ export interface Keyboard {
18070
18240
  * If `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different respective
18071
18241
  * texts.
18072
18242
  *
18073
- * Shortcuts such as `key: "Control+o"` or `key: "Control+Shift+T"` are supported as well. When specified with the
18074
- * modifier, modifier is pressed and being held while the subsequent key is being pressed.
18243
+ * Shortcuts such as `key: "Control+o"`, `key: "Control++` or `key: "Control+Shift+T"` are supported as well. When
18244
+ * specified with the modifier, modifier is pressed and being held while the subsequent key is being pressed.
18075
18245
  *
18076
18246
  * **Usage**
18077
18247
  *
package/LICENSE DELETED
@@ -1,202 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Portions Copyright (c) Microsoft Corporation.
190
- Portions Copyright 2017 Google Inc.
191
-
192
- Licensed under the Apache License, Version 2.0 (the "License");
193
- you may not use this file except in compliance with the License.
194
- You may obtain a copy of the License at
195
-
196
- http://www.apache.org/licenses/LICENSE-2.0
197
-
198
- Unless required by applicable law or agreed to in writing, software
199
- distributed under the License is distributed on an "AS IS" BASIS,
200
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
- See the License for the specific language governing permissions and
202
- limitations under the License.
package/NOTICE DELETED
@@ -1,5 +0,0 @@
1
- Playwright
2
- Copyright (c) Microsoft Corporation
3
-
4
- This software contains code derived from the Puppeteer project (https://github.com/puppeteer/puppeteer),
5
- available under the Apache 2.0 license (https://github.com/puppeteer/puppeteer/blob/master/LICENSE).