From b681de8f8e6ad44b698f65274ec2307564103cb3 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Thu, 12 Sep 2024 12:56:06 +0200 Subject: [PATCH] chore: update Playwright to v1.46 (#281) --- README.md | 2 +- e2e/package-lock.json | 50 +- e2e/package.json | 2 +- frontend/package-lock.json | 418 +- frontend/package.json | 16 +- frontend/src/components/Editor/types.txt | 5234 ++++++++++------- .../src/components/ResponseFile/index.tsx | 3 +- .../src/examples/playwright-test/intro.ts | 17 +- worker-csharp/Dockerfile | 2 +- worker-java/Dockerfile | 2 +- worker-javascript/Dockerfile | 2 +- worker-python/Dockerfile | 2 +- 12 files changed, 3325 insertions(+), 2425 deletions(-) diff --git a/README.md b/README.md index 0ea8892..ba30da4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Try Playwright ![CI](https://github.com/mxschmitt/try-playwright/workflows/CI/badge.svg) -![Playwright version](https://img.shields.io/badge/Playwright-1.45.1-blue.svg) +![Playwright version](https://img.shields.io/badge/Playwright-1.47.0-blue.svg) > Interactive playground for [Playwright](https://github.com/microsoft/playwright) to run examples directly from your browser diff --git a/e2e/package-lock.json b/e2e/package-lock.json index f765c24..65ee2b5 100644 --- a/e2e/package-lock.json +++ b/e2e/package-lock.json @@ -8,16 +8,17 @@ "name": "try-playwright", "version": "1.0.0", "devDependencies": { - "@playwright/test": "^1.45.1" + "@playwright/test": "^1.47.0" } }, "node_modules/@playwright/test": { - "version": "1.45.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.45.1.tgz", - "integrity": "sha512-Wo1bWTzQvGA7LyKGIZc8nFSTFf2TkthGIFBR+QVNilvwouGzFd4PYukZe3rvf5PSqjHi1+1NyKSDZKcQWETzaA==", + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.47.0.tgz", + "integrity": "sha512-SgAdlSwYVpToI4e/IH19IHHWvoijAYH5hu2MWSXptRypLSnzj51PcGD+rsOXFayde4P9ZLi+loXVwArg6IUkCA==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "playwright": "1.45.1" + "playwright": "1.47.0" }, "bin": { "playwright": "cli.js" @@ -32,6 +33,7 @@ "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -41,12 +43,13 @@ } }, "node_modules/playwright": { - "version": "1.45.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.45.1.tgz", - "integrity": "sha512-Hjrgae4kpSQBr98nhCj3IScxVeVUixqj+5oyif8TdIn2opTCPEzqAqNMeK42i3cWDCVu9MI+ZsGWw+gVR4ISBg==", + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.47.0.tgz", + "integrity": "sha512-jOWiRq2pdNAX/mwLiwFYnPHpEZ4rM+fRSQpRHwEwZlP2PUANvL3+aJOF/bvISMhFD30rqMxUB4RJx9aQbfh4Ww==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.45.1" + "playwright-core": "1.47.0" }, "bin": { "playwright": "cli.js" @@ -59,10 +62,11 @@ } }, "node_modules/playwright-core": { - "version": "1.45.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.1.tgz", - "integrity": "sha512-LF4CUUtrUu2TCpDw4mcrAIuYrEjVDfT1cHbJMfwnE2+1b8PZcFzPNgvZCvq2JfQ4aTjRCCHw5EJ2tmr2NSzdPg==", + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.47.0.tgz", + "integrity": "sha512-1DyHT8OqkcfCkYUD9zzUTfg7EfTd+6a8MkD/NWOvjo0u/SCNd5YmY/lJwFvUZOxJbWNds+ei7ic2+R/cRz/PDg==", "dev": true, + "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" }, @@ -73,12 +77,12 @@ }, "dependencies": { "@playwright/test": { - "version": "1.45.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.45.1.tgz", - "integrity": "sha512-Wo1bWTzQvGA7LyKGIZc8nFSTFf2TkthGIFBR+QVNilvwouGzFd4PYukZe3rvf5PSqjHi1+1NyKSDZKcQWETzaA==", + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.47.0.tgz", + "integrity": "sha512-SgAdlSwYVpToI4e/IH19IHHWvoijAYH5hu2MWSXptRypLSnzj51PcGD+rsOXFayde4P9ZLi+loXVwArg6IUkCA==", "dev": true, "requires": { - "playwright": "1.45.1" + "playwright": "1.47.0" } }, "fsevents": { @@ -89,19 +93,19 @@ "optional": true }, "playwright": { - "version": "1.45.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.45.1.tgz", - "integrity": "sha512-Hjrgae4kpSQBr98nhCj3IScxVeVUixqj+5oyif8TdIn2opTCPEzqAqNMeK42i3cWDCVu9MI+ZsGWw+gVR4ISBg==", + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.47.0.tgz", + "integrity": "sha512-jOWiRq2pdNAX/mwLiwFYnPHpEZ4rM+fRSQpRHwEwZlP2PUANvL3+aJOF/bvISMhFD30rqMxUB4RJx9aQbfh4Ww==", "dev": true, "requires": { "fsevents": "2.3.2", - "playwright-core": "1.45.1" + "playwright-core": "1.47.0" } }, "playwright-core": { - "version": "1.45.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.1.tgz", - "integrity": "sha512-LF4CUUtrUu2TCpDw4mcrAIuYrEjVDfT1cHbJMfwnE2+1b8PZcFzPNgvZCvq2JfQ4aTjRCCHw5EJ2tmr2NSzdPg==", + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.47.0.tgz", + "integrity": "sha512-1DyHT8OqkcfCkYUD9zzUTfg7EfTd+6a8MkD/NWOvjo0u/SCNd5YmY/lJwFvUZOxJbWNds+ei7ic2+R/cRz/PDg==", "dev": true } } diff --git a/e2e/package.json b/e2e/package.json index 55acc57..f0e32f8 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -13,7 +13,7 @@ }, "homepage": "https://github.com/mxschmitt/try-playwright#readme", "devDependencies": { - "@playwright/test": "^1.45.1" + "@playwright/test": "^1.47.0" }, "private": true } diff --git a/frontend/package-lock.json b/frontend/package-lock.json index dbd0bea..fa0c738 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -9,20 +9,20 @@ "version": "0.1.0", "dependencies": { "@rsuite/icons": "^1.0.3", - "@sentry/browser": "^8.17.0", - "monaco-editor": "^0.50.0", + "@sentry/browser": "^8.30.0", + "monaco-editor": "^0.51.0", "react": "^18.3.1", "react-dom": "^18.3.1", - "rsuite": "5.66.0" + "rsuite": "5.70.1" }, "devDependencies": { - "@playwright/experimental-ct-react": "^1.45.1", - "@types/node": "^20.14.10", - "@types/react": "^18.3.3", + "@playwright/experimental-ct-react": "^1.47.0", + "@types/node": "^22.5.4", + "@types/react": "^18.3.5", "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^4.3.1", - "typescript": "^5.5.3", - "vite": "^5.3.3" + "typescript": "^5.6.2", + "vite": "^5.4.4" } }, "node_modules/@ampproject/remapping": { @@ -795,16 +795,18 @@ "node_modules/@juggle/resize-observer": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/@juggle/resize-observer/-/resize-observer-3.4.0.tgz", - "integrity": "sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==" + "integrity": "sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==", + "license": "Apache-2.0" }, "node_modules/@playwright/experimental-ct-core": { - "version": "1.45.1", - "resolved": "https://registry.npmjs.org/@playwright/experimental-ct-core/-/experimental-ct-core-1.45.1.tgz", - "integrity": "sha512-/QuzNWJaKTVpa6hkZgjrtNyNawUWXdZ6+iafUEy0hs8Kq9bVEfXlTetIjUHWmF/sCW6MEF+pcTWyHj51rQMatw==", + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/@playwright/experimental-ct-core/-/experimental-ct-core-1.47.0.tgz", + "integrity": "sha512-IgZBGLREGUqTEXwb8Kh0vEG+/CHHf7EtpivAVoaO8cPzEfZU0LMlyjBaQk0ry5LDD65BZ9DwhTfMYMekAqWXMg==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "playwright": "1.45.1", - "playwright-core": "1.45.1", + "playwright": "1.47.0", + "playwright-core": "1.47.0", "vite": "^5.2.8" }, "engines": { @@ -812,12 +814,13 @@ } }, "node_modules/@playwright/experimental-ct-react": { - "version": "1.45.1", - "resolved": "https://registry.npmjs.org/@playwright/experimental-ct-react/-/experimental-ct-react-1.45.1.tgz", - "integrity": "sha512-kf9GcPGQ4cmhFjjx6+WPvuy6lTCpuHXsKGAEOyEo9+oPZkSZ/x7kC+mGURCA0yZoH7tCBWG3SLFNmoe5Q+nA0A==", + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/@playwright/experimental-ct-react/-/experimental-ct-react-1.47.0.tgz", + "integrity": "sha512-GBGfc+NmgdJquyL3XkyhqSROMoyrP4h6Fd77uu/2l/X+xHkb96hmpZ8FyDKEP3Brlm6W0PnTTQUP0FcS5jggAw==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "@playwright/experimental-ct-core": "1.45.1", + "@playwright/experimental-ct-core": "1.47.0", "@vitejs/plugin-react": "^4.2.1" }, "bin": { @@ -828,195 +831,224 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.13.2.tgz", - "integrity": "sha512-3XFIDKWMFZrMnao1mJhnOT1h2g0169Os848NhhmGweEcfJ4rCi+3yMCOLG4zA61rbJdkcrM/DjVZm9Hg5p5w7g==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.3.tgz", + "integrity": "sha512-MmKSfaB9GX+zXl6E8z4koOr/xU63AMVleLEa64v7R0QF/ZloMs5vcD1sHgM64GXXS1csaJutG+ddtzcueI/BLg==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.13.2.tgz", - "integrity": "sha512-GdxxXbAuM7Y/YQM9/TwwP+L0omeE/lJAR1J+olu36c3LqqZEBdsIWeQ91KBe6nxwOnb06Xh7JS2U5ooWU5/LgQ==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.3.tgz", + "integrity": "sha512-zrt8ecH07PE3sB4jPOggweBjJMzI1JG5xI2DIsUbkA+7K+Gkjys6eV7i9pOenNSDJH3eOr/jLb/PzqtmdwDq5g==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.13.2.tgz", - "integrity": "sha512-mCMlpzlBgOTdaFs83I4XRr8wNPveJiJX1RLfv4hggyIVhfB5mJfN4P8Z6yKh+oE4Luz+qq1P3kVdWrCKcMYrrA==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.3.tgz", + "integrity": "sha512-P0UxIOrKNBFTQaXTxOH4RxuEBVCgEA5UTNV6Yz7z9QHnUJ7eLX9reOd/NYMO3+XZO2cco19mXTxDMXxit4R/eQ==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.13.2.tgz", - "integrity": "sha512-yUoEvnH0FBef/NbB1u6d3HNGyruAKnN74LrPAfDQL3O32e3k3OSfLrPgSJmgb3PJrBZWfPyt6m4ZhAFa2nZp2A==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.3.tgz", + "integrity": "sha512-L1M0vKGO5ASKntqtsFEjTq/fD91vAqnzeaF6sfNAy55aD+Hi2pBI5DKwCO+UNDQHWsDViJLqshxOahXyLSh3EA==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.13.2.tgz", - "integrity": "sha512-GYbLs5ErswU/Xs7aGXqzc3RrdEjKdmoCrgzhJWyFL0r5fL3qd1NPcDKDowDnmcoSiGJeU68/Vy+OMUluRxPiLQ==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.3.tgz", + "integrity": "sha512-btVgIsCjuYFKUjopPoWiDqmoUXQDiW2A4C3Mtmp5vACm7/GnyuprqIDPNczeyR5W8rTXEbkmrJux7cJmD99D2g==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.3.tgz", + "integrity": "sha512-zmjbSphplZlau6ZTkxd3+NMtE4UKVy7U4aVFMmHcgO5CUbw17ZP6QCgyxhzGaU/wFFdTfiojjbLG3/0p9HhAqA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.13.2.tgz", - "integrity": "sha512-L1+D8/wqGnKQIlh4Zre9i4R4b4noxzH5DDciyahX4oOz62CphY7WDWqJoQ66zNR4oScLNOqQJfNSIAe/6TPUmQ==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.3.tgz", + "integrity": "sha512-nSZfcZtAnQPRZmUkUQwZq2OjQciR6tEoJaZVFvLHsj0MF6QhNMg0fQ6mUOsiCUpTqxTx0/O6gX0V/nYc7LrgPw==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.13.2.tgz", - "integrity": "sha512-tK5eoKFkXdz6vjfkSTCupUzCo40xueTOiOO6PeEIadlNBkadH1wNOH8ILCPIl8by/Gmb5AGAeQOFeLev7iZDOA==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.3.tgz", + "integrity": "sha512-MnvSPGO8KJXIMGlQDYfvYS3IosFN2rKsvxRpPO2l2cum+Z3exiExLwVU+GExL96pn8IP+GdH8Tz70EpBhO0sIQ==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.13.2.tgz", - "integrity": "sha512-zvXvAUGGEYi6tYhcDmb9wlOckVbuD+7z3mzInCSTACJ4DQrdSLPNUeDIcAQW39M3q6PDquqLWu7pnO39uSMRzQ==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.3.tgz", + "integrity": "sha512-+W+p/9QNDr2vE2AXU0qIy0qQE75E8RTwTwgqS2G5CRQ11vzq0tbnfBd6brWhS9bCRjAjepJe2fvvkvS3dno+iw==", "cpu": [ - "ppc64le" + "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.13.2.tgz", - "integrity": "sha512-C3GSKvMtdudHCN5HdmAMSRYR2kkhgdOfye4w0xzyii7lebVr4riCgmM6lRiSCnJn2w1Xz7ZZzHKuLrjx5620kw==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.3.tgz", + "integrity": "sha512-yXH6K6KfqGXaxHrtr+Uoy+JpNlUlI46BKVyonGiaD74ravdnF9BUNC+vV+SIuB96hUMGShhKV693rF9QDfO6nQ==", "cpu": [ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.13.2.tgz", - "integrity": "sha512-l4U0KDFwzD36j7HdfJ5/TveEQ1fUTjFFQP5qIt9gBqBgu1G8/kCaq5Ok05kd5TG9F8Lltf3MoYsUMw3rNlJ0Yg==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.3.tgz", + "integrity": "sha512-R8cwY9wcnApN/KDYWTH4gV/ypvy9yZUHlbJvfaiXSB48JO3KpwSpjOGqO4jnGkLDSk1hgjYkTbTt6Q7uvPf8eg==", "cpu": [ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.13.2.tgz", - "integrity": "sha512-xXMLUAMzrtsvh3cZ448vbXqlUa7ZL8z0MwHp63K2IIID2+DeP5iWIT6g1SN7hg1VxPzqx0xZdiDM9l4n9LRU1A==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.3.tgz", + "integrity": "sha512-kZPbX/NOPh0vhS5sI+dR8L1bU2cSO9FgxwM8r7wHzGydzfSjLRCFAT87GR5U9scj2rhzN3JPYVC7NoBbl4FZ0g==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.13.2.tgz", - "integrity": "sha512-M/JYAWickafUijWPai4ehrjzVPKRCyDb1SLuO+ZyPfoXgeCEAlgPkNXewFZx0zcnoIe3ay4UjXIMdXQXOZXWqA==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.3.tgz", + "integrity": "sha512-S0Yq+xA1VEH66uiMNhijsWAafffydd2X5b77eLHfRmfLsRSpbiAWiRHV6DEpz6aOToPsgid7TI9rGd6zB1rhbg==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.13.2.tgz", - "integrity": "sha512-2YWwoVg9KRkIKaXSh0mz3NmfurpmYoBBTAXA9qt7VXk0Xy12PoOP40EFuau+ajgALbbhi4uTj3tSG3tVseCjuA==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.3.tgz", + "integrity": "sha512-9isNzeL34yquCPyerog+IMCNxKR8XYmGd0tHSV+OVx0TmE0aJOo9uw4fZfUuk2qxobP5sug6vNdZR6u7Mw7Q+Q==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.13.2.tgz", - "integrity": "sha512-2FSsE9aQ6OWD20E498NYKEQLneShWes0NGMPQwxWOdws35qQXH+FplabOSP5zEe1pVjurSDOGEVCE2agFwSEsw==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.3.tgz", + "integrity": "sha512-nMIdKnfZfzn1Vsk+RuOvl43ONTZXoAPUUxgcU0tXooqg4YrAqzfKzVenqqk2g5efWh46/D28cKFrOzDSW28gTA==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.13.2.tgz", - "integrity": "sha512-7h7J2nokcdPePdKykd8wtc8QqqkqxIrUz7MHj6aNr8waBRU//NLDVnNjQnqQO6fqtjrtCdftpbTuOKAyrAQETQ==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.3.tgz", + "integrity": "sha512-fOvu7PCQjAj4eWDEuD8Xz5gpzFqXzGlxHZozHP4b9Jxv9APtdxL6STqztDzMLuRXEc4UpXGGhx029Xgm91QBeA==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -1044,102 +1076,110 @@ } }, "node_modules/@sentry-internal/browser-utils": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-8.17.0.tgz", - "integrity": "sha512-BEYBIDX1y8paKsDk8PmjYfAYFNS+KSeEhOwJTr/RWjvx/Fyb5ZF2q4u7qMjeNFLcxKnMkQTGYE9CYf/7XWs4bA==", + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-8.30.0.tgz", + "integrity": "sha512-pwX+awNWaxSOAsBLVLqc1+Hw+Fm1Nci9mbKFA6Ed5YzCG049PnBVQwugpmx2dcyyCqJpORhcIqb9jHdCkYmCiA==", + "license": "MIT", "dependencies": { - "@sentry/core": "8.17.0", - "@sentry/types": "8.17.0", - "@sentry/utils": "8.17.0" + "@sentry/core": "8.30.0", + "@sentry/types": "8.30.0", + "@sentry/utils": "8.30.0" }, "engines": { "node": ">=14.18" } }, "node_modules/@sentry-internal/feedback": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-8.17.0.tgz", - "integrity": "sha512-lFypwCqqcwgh++8sPZw9hAEKphXSgPIdSqoXakgwSKxGx2pCIBbzeyOWzUeBpGfBkTw813HiuRwNY+e0dF6b4Q==", + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-8.30.0.tgz", + "integrity": "sha512-ParFRxQY6helxkwUDmro77Wc5uSIC6rZos88jYMrYwFmoTJaNWf4lDzPyECfdSiSYyzSMZk4dorSUN85Ul7DCg==", + "license": "MIT", "dependencies": { - "@sentry/core": "8.17.0", - "@sentry/types": "8.17.0", - "@sentry/utils": "8.17.0" + "@sentry/core": "8.30.0", + "@sentry/types": "8.30.0", + "@sentry/utils": "8.30.0" }, "engines": { "node": ">=14.18" } }, "node_modules/@sentry-internal/replay": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-8.17.0.tgz", - "integrity": "sha512-SBNXBbXEd4WdCIIa/9mkcrwUjxJxSQtYakJ00Xvv/gwqR1rmRFOVqVjLXisryDXCucdD4Rp5MqRT9H+BcSNVtg==", + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-8.30.0.tgz", + "integrity": "sha512-/KFre+BrovPCiovgAu5N1ErJtkDVzkJA5hV3Jw011AlxRWxrmPwu6+9sV9/rn3tqYAGyq6IggYqeIOHhLh1Ihg==", + "license": "MIT", "dependencies": { - "@sentry-internal/browser-utils": "8.17.0", - "@sentry/core": "8.17.0", - "@sentry/types": "8.17.0", - "@sentry/utils": "8.17.0" + "@sentry-internal/browser-utils": "8.30.0", + "@sentry/core": "8.30.0", + "@sentry/types": "8.30.0", + "@sentry/utils": "8.30.0" }, "engines": { "node": ">=14.18" } }, "node_modules/@sentry-internal/replay-canvas": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-8.17.0.tgz", - "integrity": "sha512-2FAbd/65zjPzlUQK/cKBzNPIClBKSPrHzfuB1ZM102JwSpvS5sljzhLvxua17uwU9V1Z9pbOT1pu5KtkUyc7lQ==", + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-8.30.0.tgz", + "integrity": "sha512-y/QqcvchhtMlVA6eOZicIfTxtZarazQZJuFW0018ynPxBTiuuWSxMCLqduulXUYsFejfD8/eKHb3BpCIFdDYjg==", + "license": "MIT", "dependencies": { - "@sentry-internal/replay": "8.17.0", - "@sentry/core": "8.17.0", - "@sentry/types": "8.17.0", - "@sentry/utils": "8.17.0" + "@sentry-internal/replay": "8.30.0", + "@sentry/core": "8.30.0", + "@sentry/types": "8.30.0", + "@sentry/utils": "8.30.0" }, "engines": { "node": ">=14.18" } }, "node_modules/@sentry/browser": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-8.17.0.tgz", - "integrity": "sha512-dPMvxyS+ogu7/3+AI83U2IKaLO7hZUt3J35mtgOQhAETcyNaLZtJP1VNUAcW/VhJa3TMCfmG5A1+dkBp8A6cdA==", + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-8.30.0.tgz", + "integrity": "sha512-M+tKqawH9S3CqlAIcqdZcHbcsNQkEa9MrPqPCYvXco3C4LRpNizJP2XwBiGQY2yK+fOSvbaWpPtlI938/wuRZQ==", + "license": "MIT", "dependencies": { - "@sentry-internal/browser-utils": "8.17.0", - "@sentry-internal/feedback": "8.17.0", - "@sentry-internal/replay": "8.17.0", - "@sentry-internal/replay-canvas": "8.17.0", - "@sentry/core": "8.17.0", - "@sentry/types": "8.17.0", - "@sentry/utils": "8.17.0" + "@sentry-internal/browser-utils": "8.30.0", + "@sentry-internal/feedback": "8.30.0", + "@sentry-internal/replay": "8.30.0", + "@sentry-internal/replay-canvas": "8.30.0", + "@sentry/core": "8.30.0", + "@sentry/types": "8.30.0", + "@sentry/utils": "8.30.0" }, "engines": { "node": ">=14.18" } }, "node_modules/@sentry/core": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.17.0.tgz", - "integrity": "sha512-s62O0Re6WcvaVbH1IEeAWmj/ca8UhaRoFaDnc5TR68reOycBrgnqCNq3qHxBsELOA6NJowoK+T29DDGs9QVXhQ==", + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.30.0.tgz", + "integrity": "sha512-CJ/FuWLw0QEKGKXGL/nm9eaOdajEcmPekLuHAuOCxID7N07R9l9laz3vFbAkUZ97GGDv3sYrJZgywfY3Moropg==", + "license": "MIT", "dependencies": { - "@sentry/types": "8.17.0", - "@sentry/utils": "8.17.0" + "@sentry/types": "8.30.0", + "@sentry/utils": "8.30.0" }, "engines": { "node": ">=14.18" } }, "node_modules/@sentry/types": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.17.0.tgz", - "integrity": "sha512-v0nI0+ajiGTijhF1W/ryn2+zFVFr6VPn6lao3W4qKj9MlltIHa4/uuGzTaiCFwoPw7g5bZ1Q09SStpDXVMkz2A==", + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.30.0.tgz", + "integrity": "sha512-kgWW2BCjBmVlSQRG32GonHEVyeDbys74xf9mLPvynwHTgw3+NUlNAlEdu05xnb2ow4bCTHfbkS5G1zRgyv5k4Q==", + "license": "MIT", "engines": { "node": ">=14.18" } }, "node_modules/@sentry/utils": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-8.17.0.tgz", - "integrity": "sha512-HHtAPLOlvzhwgfYzxtuPnLUoGRMtMrFvopkii74zmx/1ZD4VN4PYPB2E5KFf3c18pTovw+kxF0ux6VrGiyAHsw==", + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-8.30.0.tgz", + "integrity": "sha512-wZxU2HWlzsnu8214Xy7S7cRIuD6h8Z5DnnkojJfX0i0NLooepZQk2824el1Q13AakLb7/S8CHSHXOMnCtoSduw==", + "license": "MIT", "dependencies": { - "@sentry/types": "8.17.0" + "@sentry/types": "8.30.0" }, "engines": { "node": ">=14.18" @@ -1190,7 +1230,8 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/lodash": { "version": "4.17.0", @@ -1198,12 +1239,13 @@ "integrity": "sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA==" }, "node_modules/@types/node": { - "version": "20.14.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz", - "integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==", + "version": "22.5.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.4.tgz", + "integrity": "sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==", "dev": true, + "license": "MIT", "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.19.2" } }, "node_modules/@types/prop-types": { @@ -1212,9 +1254,10 @@ "integrity": "sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==" }, "node_modules/@types/react": { - "version": "18.3.3", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.3.tgz", - "integrity": "sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==", + "version": "18.3.5", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.5.tgz", + "integrity": "sha512-WeqMfGJLGuLCqHGYRGHxnKrXcTitc6L/nBUWfWPcTarG3t9PsquqUMuVeXZeca+mglY4Vo5GZjCi0A3Or2lnxA==", + "license": "MIT", "dependencies": { "@types/prop-types": "*", "csstype": "^3.0.2" @@ -1401,6 +1444,7 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/dom-lib/-/dom-lib-3.3.1.tgz", "integrity": "sha512-N2mpo8qQmB9wIMZJVjER+BSh4GJiZZ7S6EjnMtyETcXo90hpITUDXpUhqOcfXZ2ZefytuYYKTZMp3CGR2X+tDA==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.20.0" } @@ -1473,6 +1517,7 @@ "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -1611,9 +1656,10 @@ "integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==" }, "node_modules/monaco-editor": { - "version": "0.50.0", - "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.50.0.tgz", - "integrity": "sha512-8CclLCmrRRh+sul7C08BmPBP3P8wVWfBHomsTcndxg5NRCEPfu/mc2AGU8k37ajjDVXcXFc12ORAMUkmk+lkFA==" + "version": "0.51.0", + "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.51.0.tgz", + "integrity": "sha512-xaGwVV1fq343cM7aOYB6lVE4Ugf0UyimdD/x5PWcWBMKENwectaEu77FAN7c5sFiyumqeJdX1RPTh1ocioyDjw==", + "license": "MIT" }, "node_modules/ms": { "version": "2.1.2", @@ -1632,6 +1678,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -1649,6 +1696,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1660,12 +1708,13 @@ "dev": true }, "node_modules/playwright": { - "version": "1.45.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.45.1.tgz", - "integrity": "sha512-Hjrgae4kpSQBr98nhCj3IScxVeVUixqj+5oyif8TdIn2opTCPEzqAqNMeK42i3cWDCVu9MI+ZsGWw+gVR4ISBg==", + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.47.0.tgz", + "integrity": "sha512-jOWiRq2pdNAX/mwLiwFYnPHpEZ4rM+fRSQpRHwEwZlP2PUANvL3+aJOF/bvISMhFD30rqMxUB4RJx9aQbfh4Ww==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.45.1" + "playwright-core": "1.47.0" }, "bin": { "playwright": "cli.js" @@ -1678,10 +1727,11 @@ } }, "node_modules/playwright-core": { - "version": "1.45.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.1.tgz", - "integrity": "sha512-LF4CUUtrUu2TCpDw4mcrAIuYrEjVDfT1cHbJMfwnE2+1b8PZcFzPNgvZCvq2JfQ4aTjRCCHw5EJ2tmr2NSzdPg==", + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.47.0.tgz", + "integrity": "sha512-1DyHT8OqkcfCkYUD9zzUTfg7EfTd+6a8MkD/NWOvjo0u/SCNd5YmY/lJwFvUZOxJbWNds+ei7ic2+R/cRz/PDg==", "dev": true, + "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" }, @@ -1690,9 +1740,9 @@ } }, "node_modules/postcss": { - "version": "8.4.39", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.39.tgz", - "integrity": "sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==", + "version": "8.4.45", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.45.tgz", + "integrity": "sha512-7KTLTdzdZZYscUc65XmjFiB73vBhBfbPztCYdUNvlaso9PrzjzcmjqBPR0lNGkcVlcO4BjiO5rK/qNz+XAen1Q==", "dev": true, "funding": [ { @@ -1708,6 +1758,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.0.1", @@ -1721,6 +1772,7 @@ "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "license": "MIT", "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", @@ -1753,7 +1805,8 @@ "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "license": "MIT" }, "node_modules/react-refresh": { "version": "0.14.2", @@ -1794,10 +1847,11 @@ "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" }, "node_modules/rollup": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.13.2.tgz", - "integrity": "sha512-MIlLgsdMprDBXC+4hsPgzWUasLO9CE4zOkj/u6j+Z6j5A4zRY+CtiXAdJyPtgCsc42g658Aeh1DlrdVEJhsL2g==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.3.tgz", + "integrity": "sha512-7sqRtBNnEbcBtMeRVc6VRsJMmpI+JU1z9VTvW8D4gXIYQFz0aLcsE6rRkyghZkLfEgUZgVvOG7A5CVz/VW5GIA==", "dev": true, + "license": "MIT", "dependencies": { "@types/estree": "1.0.5" }, @@ -1809,28 +1863,30 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.13.2", - "@rollup/rollup-android-arm64": "4.13.2", - "@rollup/rollup-darwin-arm64": "4.13.2", - "@rollup/rollup-darwin-x64": "4.13.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.13.2", - "@rollup/rollup-linux-arm64-gnu": "4.13.2", - "@rollup/rollup-linux-arm64-musl": "4.13.2", - "@rollup/rollup-linux-powerpc64le-gnu": "4.13.2", - "@rollup/rollup-linux-riscv64-gnu": "4.13.2", - "@rollup/rollup-linux-s390x-gnu": "4.13.2", - "@rollup/rollup-linux-x64-gnu": "4.13.2", - "@rollup/rollup-linux-x64-musl": "4.13.2", - "@rollup/rollup-win32-arm64-msvc": "4.13.2", - "@rollup/rollup-win32-ia32-msvc": "4.13.2", - "@rollup/rollup-win32-x64-msvc": "4.13.2", + "@rollup/rollup-android-arm-eabi": "4.21.3", + "@rollup/rollup-android-arm64": "4.21.3", + "@rollup/rollup-darwin-arm64": "4.21.3", + "@rollup/rollup-darwin-x64": "4.21.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.21.3", + "@rollup/rollup-linux-arm-musleabihf": "4.21.3", + "@rollup/rollup-linux-arm64-gnu": "4.21.3", + "@rollup/rollup-linux-arm64-musl": "4.21.3", + "@rollup/rollup-linux-powerpc64le-gnu": "4.21.3", + "@rollup/rollup-linux-riscv64-gnu": "4.21.3", + "@rollup/rollup-linux-s390x-gnu": "4.21.3", + "@rollup/rollup-linux-x64-gnu": "4.21.3", + "@rollup/rollup-linux-x64-musl": "4.21.3", + "@rollup/rollup-win32-arm64-msvc": "4.21.3", + "@rollup/rollup-win32-ia32-msvc": "4.21.3", + "@rollup/rollup-win32-x64-msvc": "4.21.3", "fsevents": "~2.3.2" } }, "node_modules/rsuite": { - "version": "5.66.0", - "resolved": "https://registry.npmjs.org/rsuite/-/rsuite-5.66.0.tgz", - "integrity": "sha512-HX1cm3q4Cc/IYXbcdv5//0cG/YAYP+18A4k/HPCrHAT57zbP/oo9Ey7UGnclAGaWMTY3MoRdSueJQYBXF5vSVQ==", + "version": "5.70.1", + "resolved": "https://registry.npmjs.org/rsuite/-/rsuite-5.70.1.tgz", + "integrity": "sha512-a1rpRkkJnZ/eJnQqMoCgWsvTftwABCNYh4Pg+hC+FdwB0D9h4FO+l/f0ZKd7fH9ha5AzZp6QQ5P/sJs2e1wBLQ==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.20.1", "@juggle/resize-observer": "^3.4.0", @@ -1845,7 +1901,7 @@ "prop-types": "^15.8.1", "react-use-set": "^1.0.0", "react-window": "^1.8.8", - "rsuite-table": "^5.18.3", + "rsuite-table": "^5.19.1", "schema-typed": "^2.2.2" }, "peerDependencies": { @@ -1854,15 +1910,16 @@ } }, "node_modules/rsuite-table": { - "version": "5.18.3", - "resolved": "https://registry.npmjs.org/rsuite-table/-/rsuite-table-5.18.3.tgz", - "integrity": "sha512-Rua79XndYY+UdCUpBuH1Ew5qa54y6zLZ0RNRnudKgamksrV1j+rUhcCsA03a5ZY+b8DXTwct4V/Q6K9q/cJT5w==", + "version": "5.19.1", + "resolved": "https://registry.npmjs.org/rsuite-table/-/rsuite-table-5.19.1.tgz", + "integrity": "sha512-PsG+z3GfwywDvPVEjZYVZcel0M6zOBAx2HKTgYLfct/yAzXJWPgW/eVuv9+8KmkcKzAh03UVYQdB88Gp7+RlGg==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.12.5", "@juggle/resize-observer": "^3.3.1", "@rsuite/icons": "^1.0.0", "classnames": "^2.3.1", - "dom-lib": "^3.1.3", + "dom-lib": "^3.3.1", "lodash": "^4.17.21", "react-is": "^17.0.2" }, @@ -1875,7 +1932,8 @@ "node_modules/rsuite-table/node_modules/react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", - "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "license": "MIT" }, "node_modules/scheduler": { "version": "0.23.2", @@ -1921,10 +1979,11 @@ } }, "node_modules/source-map-js": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", - "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -1951,10 +2010,11 @@ } }, "node_modules/typescript": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", - "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", + "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -1964,10 +2024,11 @@ } }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true, + "license": "MIT" }, "node_modules/update-browserslist-db": { "version": "1.0.16", @@ -2000,14 +2061,15 @@ } }, "node_modules/vite": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.3.tgz", - "integrity": "sha512-NPQdeCU0Dv2z5fu+ULotpuq5yfCS1BzKUIPhNbP3YBfAMGJXbt2nS+sbTFu+qchaqWTD+H3JK++nRwr6XIcp6A==", + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.4.tgz", + "integrity": "sha512-RHFCkULitycHVTtelJ6jQLd+KSAAzOgEYorV32R2q++M6COBjKJR6BxqClwp5sf0XaBDjVMuJ9wnNfyAJwjMkA==", "dev": true, + "license": "MIT", "dependencies": { "esbuild": "^0.21.3", - "postcss": "^8.4.39", - "rollup": "^4.13.0" + "postcss": "^8.4.43", + "rollup": "^4.20.0" }, "bin": { "vite": "bin/vite.js" @@ -2026,6 +2088,7 @@ "less": "*", "lightningcss": "^1.21.0", "sass": "*", + "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" @@ -2043,6 +2106,9 @@ "sass": { "optional": true }, + "sass-embedded": { + "optional": true + }, "stylus": { "optional": true }, diff --git a/frontend/package.json b/frontend/package.json index 56b96f1..94203a6 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -9,19 +9,19 @@ }, "dependencies": { "@rsuite/icons": "^1.0.3", - "@sentry/browser": "^8.17.0", - "monaco-editor": "^0.50.0", + "@sentry/browser": "^8.30.0", + "monaco-editor": "^0.51.0", "react": "^18.3.1", "react-dom": "^18.3.1", - "rsuite": "5.66.0" + "rsuite": "5.70.1" }, "devDependencies": { - "@playwright/experimental-ct-react": "^1.45.1", - "@types/node": "^20.14.10", - "@types/react": "^18.3.3", + "@playwright/experimental-ct-react": "^1.47.0", + "@types/node": "^22.5.4", + "@types/react": "^18.3.5", "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^4.3.1", - "typescript": "^5.5.3", - "vite": "^5.3.3" + "typescript": "^5.6.2", + "vite": "^5.4.4" } } diff --git a/frontend/src/components/Editor/types.txt b/frontend/src/components/Editor/types.txt index ca2a22e..c645f3d 100644 --- a/frontend/src/components/Editor/types.txt +++ b/frontend/src/components/Editor/types.txt @@ -6,12 +6,83 @@ type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undi type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response; type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData; type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers; +type _MessageEvent = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").MessageEvent; type _RequestInit = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").RequestInit; type _ResponseInit = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").ResponseInit; // #endregion Fetch and friends +// #region DOMException +type _DOMException = typeof globalThis extends { onmessage: any } ? {} : NodeDOMException; +interface NodeDOMException extends Error { + /** + * @deprecated + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code) + */ + readonly code: number; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */ + readonly message: string; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */ + readonly name: string; + readonly INDEX_SIZE_ERR: 1; + readonly DOMSTRING_SIZE_ERR: 2; + readonly HIERARCHY_REQUEST_ERR: 3; + readonly WRONG_DOCUMENT_ERR: 4; + readonly INVALID_CHARACTER_ERR: 5; + readonly NO_DATA_ALLOWED_ERR: 6; + readonly NO_MODIFICATION_ALLOWED_ERR: 7; + readonly NOT_FOUND_ERR: 8; + readonly NOT_SUPPORTED_ERR: 9; + readonly INUSE_ATTRIBUTE_ERR: 10; + readonly INVALID_STATE_ERR: 11; + readonly SYNTAX_ERR: 12; + readonly INVALID_MODIFICATION_ERR: 13; + readonly NAMESPACE_ERR: 14; + readonly INVALID_ACCESS_ERR: 15; + readonly VALIDATION_ERR: 16; + readonly TYPE_MISMATCH_ERR: 17; + readonly SECURITY_ERR: 18; + readonly NETWORK_ERR: 19; + readonly ABORT_ERR: 20; + readonly URL_MISMATCH_ERR: 21; + readonly QUOTA_EXCEEDED_ERR: 22; + readonly TIMEOUT_ERR: 23; + readonly INVALID_NODE_TYPE_ERR: 24; + readonly DATA_CLONE_ERR: 25; +} +interface NodeDOMExceptionConstructor { + prototype: DOMException; + new(message?: string, nameOrOptions?: string | { name?: string; cause?: unknown }): DOMException; + readonly INDEX_SIZE_ERR: 1; + readonly DOMSTRING_SIZE_ERR: 2; + readonly HIERARCHY_REQUEST_ERR: 3; + readonly WRONG_DOCUMENT_ERR: 4; + readonly INVALID_CHARACTER_ERR: 5; + readonly NO_DATA_ALLOWED_ERR: 6; + readonly NO_MODIFICATION_ALLOWED_ERR: 7; + readonly NOT_FOUND_ERR: 8; + readonly NOT_SUPPORTED_ERR: 9; + readonly INUSE_ATTRIBUTE_ERR: 10; + readonly INVALID_STATE_ERR: 11; + readonly SYNTAX_ERR: 12; + readonly INVALID_MODIFICATION_ERR: 13; + readonly NAMESPACE_ERR: 14; + readonly INVALID_ACCESS_ERR: 15; + readonly VALIDATION_ERR: 16; + readonly TYPE_MISMATCH_ERR: 17; + readonly SECURITY_ERR: 18; + readonly NETWORK_ERR: 19; + readonly ABORT_ERR: 20; + readonly URL_MISMATCH_ERR: 21; + readonly QUOTA_EXCEEDED_ERR: 22; + readonly TIMEOUT_ERR: 23; + readonly INVALID_NODE_TYPE_ERR: 24; + readonly DATA_CLONE_ERR: 25; +} +// #endregion DOMException + declare global { // Declare "static" methods in Error interface ErrorConstructor { @@ -155,6 +226,24 @@ declare global { transfer?: { transfer: ReadonlyArray }, ): T; + // #region DOMException + /** + * @since v17.0.0 + * An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException) + */ + interface DOMException extends _DOMException {} + + /** + * @since v17.0.0 + * + * The WHATWG `DOMException` class. See [DOMException](https://developer.mozilla.org/docs/Web/API/DOMException) for more details. + */ + var DOMException: typeof globalThis extends { onmessage: any; DOMException: infer T } ? T + : NodeDOMExceptionConstructor; + // #endregion DOMException + /*----------------------------------------------* * * * GLOBAL INTERFACES * @@ -374,6 +463,16 @@ declare global { Headers: infer T; } ? T : typeof import("undici-types").Headers; + + interface MessageEvent extends _MessageEvent {} + /** + * @since v15.0.0 + */ + var MessageEvent: typeof globalThis extends { + onmessage: any; + MessageEvent: infer T; + } ? T + : typeof import("undici-types").MessageEvent; } declare module 'playwright-core' { // This is generated from /utils/protocol-types-generator/index.js @@ -490,7 +589,7 @@ export module Protocol { - from 'checked' to 'selected': states which apply to widgets - from 'activedescendant' to 'owns' - relationships between elements other than parent/child/sibling. */ - export type AXPropertyName = "busy"|"disabled"|"editable"|"focusable"|"focused"|"hidden"|"hiddenRoot"|"invalid"|"keyshortcuts"|"settable"|"roledescription"|"live"|"atomic"|"relevant"|"root"|"autocomplete"|"hasPopup"|"level"|"multiselectable"|"orientation"|"multiline"|"readonly"|"required"|"valuemin"|"valuemax"|"valuetext"|"checked"|"expanded"|"modal"|"pressed"|"selected"|"activedescendant"|"controls"|"describedby"|"details"|"errormessage"|"flowto"|"labelledby"|"owns"; + export type AXPropertyName = "busy"|"disabled"|"editable"|"focusable"|"focused"|"hidden"|"hiddenRoot"|"invalid"|"keyshortcuts"|"settable"|"roledescription"|"live"|"atomic"|"relevant"|"root"|"autocomplete"|"hasPopup"|"level"|"multiselectable"|"orientation"|"multiline"|"readonly"|"required"|"valuemin"|"valuemax"|"valuetext"|"checked"|"expanded"|"modal"|"pressed"|"selected"|"activedescendant"|"controls"|"describedby"|"details"|"errormessage"|"flowto"|"labelledby"|"owns"|"url"; /** * A node in the accessibility tree. */ @@ -1253,7 +1352,7 @@ instead of "limited-quirks". sharedDictionaryError: SharedDictionaryError; request: AffectedRequest; } - export type GenericIssueErrorType = "CrossOriginPortalPostMessageError"|"FormLabelForNameError"|"FormDuplicateIdForInputError"|"FormInputWithNoLabelError"|"FormAutocompleteAttributeEmptyError"|"FormEmptyIdAndNameAttributesForInputError"|"FormAriaLabelledByToNonExistingId"|"FormInputAssignedAutocompleteValueToIdOrNameAttributeError"|"FormLabelHasNeitherForNorNestedInput"|"FormLabelForMatchesNonExistingIdError"|"FormInputHasWrongButWellIntendedAutocompleteValueError"|"ResponseWasBlockedByORB"; + export type GenericIssueErrorType = "FormLabelForNameError"|"FormDuplicateIdForInputError"|"FormInputWithNoLabelError"|"FormAutocompleteAttributeEmptyError"|"FormEmptyIdAndNameAttributesForInputError"|"FormAriaLabelledByToNonExistingId"|"FormInputAssignedAutocompleteValueToIdOrNameAttributeError"|"FormLabelHasNeitherForNorNestedInput"|"FormLabelForMatchesNonExistingIdError"|"FormInputHasWrongButWellIntendedAutocompleteValueError"|"ResponseWasBlockedByORB"; /** * Depending on the concrete errorType, different properties are set. */ @@ -1312,7 +1411,7 @@ Should be updated alongside RequestIdTokenStatus in third_party/blink/public/mojom/devtools/inspector_issue.mojom to include all cases except for success. */ - export type FederatedAuthRequestIssueReason = "ShouldEmbargo"|"TooManyRequests"|"WellKnownHttpNotFound"|"WellKnownNoResponse"|"WellKnownInvalidResponse"|"WellKnownListEmpty"|"WellKnownInvalidContentType"|"ConfigNotInWellKnown"|"WellKnownTooBig"|"ConfigHttpNotFound"|"ConfigNoResponse"|"ConfigInvalidResponse"|"ConfigInvalidContentType"|"ClientMetadataHttpNotFound"|"ClientMetadataNoResponse"|"ClientMetadataInvalidResponse"|"ClientMetadataInvalidContentType"|"DisabledInSettings"|"ErrorFetchingSignin"|"InvalidSigninResponse"|"AccountsHttpNotFound"|"AccountsNoResponse"|"AccountsInvalidResponse"|"AccountsListEmpty"|"AccountsInvalidContentType"|"IdTokenHttpNotFound"|"IdTokenNoResponse"|"IdTokenInvalidResponse"|"IdTokenIdpErrorResponse"|"IdTokenCrossSiteIdpErrorResponse"|"IdTokenInvalidRequest"|"IdTokenInvalidContentType"|"ErrorIdToken"|"Canceled"|"RpPageNotVisible"|"SilentMediationFailure"|"ThirdPartyCookiesBlocked"|"NotSignedInWithIdp"|"MissingTransientUserActivation"|"ReplacedByButtonMode"|"RelyingPartyOriginIsOpaque"|"TypeNotMatching"; + export type FederatedAuthRequestIssueReason = "ShouldEmbargo"|"TooManyRequests"|"WellKnownHttpNotFound"|"WellKnownNoResponse"|"WellKnownInvalidResponse"|"WellKnownListEmpty"|"WellKnownInvalidContentType"|"ConfigNotInWellKnown"|"WellKnownTooBig"|"ConfigHttpNotFound"|"ConfigNoResponse"|"ConfigInvalidResponse"|"ConfigInvalidContentType"|"ClientMetadataHttpNotFound"|"ClientMetadataNoResponse"|"ClientMetadataInvalidResponse"|"ClientMetadataInvalidContentType"|"IdpNotPotentiallyTrustworthy"|"DisabledInSettings"|"DisabledInFlags"|"ErrorFetchingSignin"|"InvalidSigninResponse"|"AccountsHttpNotFound"|"AccountsNoResponse"|"AccountsInvalidResponse"|"AccountsListEmpty"|"AccountsInvalidContentType"|"IdTokenHttpNotFound"|"IdTokenNoResponse"|"IdTokenInvalidResponse"|"IdTokenIdpErrorResponse"|"IdTokenCrossSiteIdpErrorResponse"|"IdTokenInvalidRequest"|"IdTokenInvalidContentType"|"ErrorIdToken"|"Canceled"|"RpPageNotVisible"|"SilentMediationFailure"|"ThirdPartyCookiesBlocked"|"NotSignedInWithIdp"|"MissingTransientUserActivation"|"ReplacedByButtonMode"|"InvalidFieldsSpecified"|"RelyingPartyOriginIsOpaque"|"TypeNotMatching"; export interface FederatedAuthUserInfoRequestIssueDetails { federatedAuthUserInfoRequestIssueReason: FederatedAuthUserInfoRequestIssueReason; } @@ -1509,17 +1608,21 @@ using Audits.issueAdded event. } /** - * Defines commands and events for browser extensions. Available if the client -is connected using the --remote-debugging-pipe flag and -the --enable-unsafe-extension-debugging flag is set. + * Defines commands and events for browser extensions. */ export module Extensions { + /** + * Storage areas. + */ + export type StorageArea = "session"|"local"|"sync"|"managed"; /** * Installs an unpacked extension from the filesystem similar to --load-extension CLI flags. Returns extension ID once the extension -has been installed. +has been installed. Available if the client is connected using the +--remote-debugging-pipe flag and the --enable-unsafe-extension-debugging +flag is set. */ export type loadUnpackedParameters = { /** @@ -1533,6 +1636,81 @@ has been installed. */ id: string; } + /** + * Gets data from extension storage in the given `storageArea`. If `keys` is +specified, these are used to filter the result. + */ + export type getStorageItemsParameters = { + /** + * ID of extension. + */ + id: string; + /** + * StorageArea to retrieve data from. + */ + storageArea: StorageArea; + /** + * Keys to retrieve. + */ + keys?: string[]; + } + export type getStorageItemsReturnValue = { + data: { [key: string]: string }; + } + /** + * Removes `keys` from extension storage in the given `storageArea`. + */ + export type removeStorageItemsParameters = { + /** + * ID of extension. + */ + id: string; + /** + * StorageArea to remove data from. + */ + storageArea: StorageArea; + /** + * Keys to remove. + */ + keys: string[]; + } + export type removeStorageItemsReturnValue = { + } + /** + * Clears extension storage in the given `storageArea`. + */ + export type clearStorageItemsParameters = { + /** + * ID of extension. + */ + id: string; + /** + * StorageArea to remove data from. + */ + storageArea: StorageArea; + } + export type clearStorageItemsReturnValue = { + } + /** + * Sets `values` in extension storage in the given `storageArea`. The provided `values` +will be merged with existing values in the storage area. + */ + export type setStorageItemsParameters = { + /** + * ID of extension. + */ + id: string; + /** + * StorageArea to set data in. + */ + storageArea: StorageArea; + /** + * Values to set. + */ + values: { [key: string]: string }; + } + export type setStorageItemsReturnValue = { + } } /** @@ -1858,6 +2036,10 @@ Note that userVisibleOnly = true is the only currently supported type. * For "clipboard" permission, may specify allowWithoutSanitization. */ allowWithoutSanitization?: boolean; + /** + * For "fullscreen" permission, must specify allowWithoutGesture:true. + */ + allowWithoutGesture?: boolean; /** * For "camera" permission, may specify panTiltZoom. */ @@ -2906,16 +3088,6 @@ stylesheet rules) this rule came from. */ style: CSSStyle; } - /** - * CSS position-fallback rule representation. - */ - export interface CSSPositionFallbackRule { - name: Value; - /** - * List of keyframes. - */ - tryRules: CSSTryRule[]; - } /** * CSS @position-try rule representation. */ @@ -2937,6 +3109,7 @@ stylesheet rules) this rule came from. * Associated style declaration. */ style: CSSStyle; + active: boolean; } /** * CSS keyframes rule representation. @@ -3262,13 +3435,14 @@ attributes) for a DOM node identified by `nodeId`. */ cssKeyframesRules?: CSSKeyframesRule[]; /** - * A list of CSS position fallbacks matching this node. + * A list of CSS @position-try rules matching this node, based on the position-try-fallbacks property. */ - cssPositionFallbackRules?: CSSPositionFallbackRule[]; + cssPositionTryRules?: CSSPositionTryRule[]; /** - * A list of CSS @position-try rules matching this node, based on the position-try-options property. + * Index of the active fallback in the applied position-try-fallback property, +will not be set if there is no active position-try fallback. */ - cssPositionTryRules?: CSSPositionTryRule[]; + activePositionFallbackIndex?: number; /** * A list of CSS at-property rules matching this node. */ @@ -3864,7 +4038,7 @@ front-end. /** * Pseudo element type. */ - export type PseudoType = "first-line"|"first-letter"|"before"|"after"|"marker"|"backdrop"|"selection"|"search-text"|"target-text"|"spelling-error"|"grammar-error"|"highlight"|"first-line-inherited"|"scroll-marker"|"scroll-marker-group"|"scrollbar"|"scrollbar-thumb"|"scrollbar-button"|"scrollbar-track"|"scrollbar-track-piece"|"scrollbar-corner"|"resizer"|"input-list-button"|"view-transition"|"view-transition-group"|"view-transition-image-pair"|"view-transition-old"|"view-transition-new"; + export type PseudoType = "first-line"|"first-letter"|"before"|"after"|"marker"|"backdrop"|"selection"|"search-text"|"target-text"|"spelling-error"|"grammar-error"|"highlight"|"first-line-inherited"|"scroll-marker"|"scroll-marker-group"|"scroll-next-button"|"scroll-prev-button"|"scrollbar"|"scrollbar-thumb"|"scrollbar-button"|"scrollbar-track"|"scrollbar-track-piece"|"scrollbar-corner"|"resizer"|"input-list-button"|"view-transition"|"view-transition-group"|"view-transition-image-pair"|"view-transition-old"|"view-transition-new"; /** * Shadow root type. */ @@ -4014,6 +4188,13 @@ The property is always undefined now. compatibilityMode?: CompatibilityMode; assignedSlot?: BackendNode; } + /** + * A structure to hold the top-level node of a detached tree and an array of its retained descendants. + */ + export interface DetachedElementInfo { + treeNode: Node; + retainedNodeIds: NodeId[]; + } /** * A structure holding an RGBA color. */ @@ -5061,6 +5242,17 @@ File wrapper. export type getFileInfoReturnValue = { path: string; } + /** + * Returns list of detached nodes + */ + export type getDetachedDomNodesParameters = { + } + export type getDetachedDomNodesReturnValue = { + /** + * The list of detached nodes + */ + detachedNodes: DetachedElementInfo[]; + } /** * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). @@ -6285,6 +6477,11 @@ See https://w3c.github.io/sensors/#automation for more information. xyz?: SensorReadingXYZ; quaternion?: SensorReadingQuaternion; } + export type PressureSource = "cpu"; + export type PressureState = "nominal"|"fair"|"serious"|"critical"; + export interface PressureMetadata { + available?: boolean; + } /** * Enum of image types that can be disabled. */ @@ -6568,6 +6765,30 @@ by setSensorOverrideEnabled. } export type setSensorOverrideReadingsReturnValue = { } + /** + * Overrides a pressure source of a given type, as used by the Compute +Pressure API, so that updates to PressureObserver.observe() are provided +via setPressureStateOverride instead of being retrieved from +platform-provided telemetry data. + */ + export type setPressureSourceOverrideEnabledParameters = { + enabled: boolean; + source: PressureSource; + metadata?: PressureMetadata; + } + export type setPressureSourceOverrideEnabledReturnValue = { + } + /** + * Provides a given pressure state that will be processed and eventually be +delivered to PressureObserver users. |source| must have been previously +overridden by setPressureSourceOverrideEnabled. + */ + export type setPressureStateOverrideParameters = { + source: PressureSource; + state: PressureState; + } + export type setPressureStateOverrideReturnValue = { + } /** * Overrides the Idle state. */ @@ -6911,6 +7132,54 @@ following the last read). Some types of streams may only support sequential read } } + export module FileSystem { + export interface File { + name: string; + /** + * Timestamp + */ + lastModified: Network.TimeSinceEpoch; + /** + * Size in bytes + */ + size: number; + type: string; + } + export interface Directory { + name: string; + nestedDirectories: string[]; + /** + * Files that are directly nested under this directory. + */ + nestedFiles: File[]; + } + export interface BucketFileSystemLocator { + /** + * Storage key + */ + storageKey: Storage.SerializedStorageKey; + /** + * Bucket name. Not passing a `bucketName` will retrieve the default Bucket. (https://developer.mozilla.org/en-US/docs/Web/API/Storage_API#storage_buckets) + */ + bucketName?: string; + /** + * Path to the directory using each path component as an array item. + */ + pathComponents: string[]; + } + + + export type getDirectoryParameters = { + bucketFileSystemLocator: BucketFileSystemLocator; + } + export type getDirectoryReturnValue = { + /** + * Returns the directory object at the path. + */ + directory: Directory; + } + } + export module IndexedDB { /** * Database with an array of object stores. @@ -9426,7 +9695,7 @@ the same request (but not for redirected requests). initiatorIPAddressSpace: IPAddressSpace; privateNetworkRequestPolicy: PrivateNetworkRequestPolicy; } - export type CrossOriginOpenerPolicyValue = "SameOrigin"|"SameOriginAllowPopups"|"RestrictProperties"|"UnsafeNone"|"SameOriginPlusCoep"|"RestrictPropertiesPlusCoep"; + export type CrossOriginOpenerPolicyValue = "SameOrigin"|"SameOriginAllowPopups"|"RestrictProperties"|"UnsafeNone"|"SameOriginPlusCoep"|"RestrictPropertiesPlusCoep"|"NoopenerAllowPopups"; export interface CrossOriginOpenerPolicyStatus { value: CrossOriginOpenerPolicyValue; reportOnlyValue: CrossOriginOpenerPolicyValue; @@ -10109,6 +10378,10 @@ preemptively (e.g. a cache hit). */ issuedTokenCount?: number; } + /** + * Fired once security policy has been updated. + */ + export type policyUpdatedPayload = void; /** * Fired once when parsing the .wbn file has succeeded. The event contains the information about the web bundle contents. @@ -11656,7 +11929,7 @@ as an ad. * All Permissions Policy features. This enum should match the one defined in third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5. */ - export type PermissionsPolicyFeature = "accelerometer"|"ambient-light-sensor"|"attribution-reporting"|"autoplay"|"bluetooth"|"browsing-topics"|"camera"|"captured-surface-control"|"ch-dpr"|"ch-device-memory"|"ch-downlink"|"ch-ect"|"ch-prefers-color-scheme"|"ch-prefers-reduced-motion"|"ch-prefers-reduced-transparency"|"ch-rtt"|"ch-save-data"|"ch-ua"|"ch-ua-arch"|"ch-ua-bitness"|"ch-ua-platform"|"ch-ua-model"|"ch-ua-mobile"|"ch-ua-form-factors"|"ch-ua-full-version"|"ch-ua-full-version-list"|"ch-ua-platform-version"|"ch-ua-wow64"|"ch-viewport-height"|"ch-viewport-width"|"ch-width"|"clipboard-read"|"clipboard-write"|"compute-pressure"|"cross-origin-isolated"|"deferred-fetch"|"direct-sockets"|"display-capture"|"document-domain"|"encrypted-media"|"execution-while-out-of-viewport"|"execution-while-not-rendered"|"focus-without-user-activation"|"fullscreen"|"frobulate"|"gamepad"|"geolocation"|"gyroscope"|"hid"|"identity-credentials-get"|"idle-detection"|"interest-cohort"|"join-ad-interest-group"|"keyboard-map"|"local-fonts"|"magnetometer"|"microphone"|"midi"|"otp-credentials"|"payment"|"picture-in-picture"|"private-aggregation"|"private-state-token-issuance"|"private-state-token-redemption"|"publickey-credentials-create"|"publickey-credentials-get"|"run-ad-auction"|"screen-wake-lock"|"serial"|"shared-autofill"|"shared-storage"|"shared-storage-select-url"|"smart-card"|"speaker-selection"|"storage-access"|"sub-apps"|"sync-xhr"|"unload"|"usb"|"usb-unrestricted"|"vertical-scroll"|"web-printing"|"web-share"|"window-management"|"xr-spatial-tracking"; + export type PermissionsPolicyFeature = "accelerometer"|"all-screens-capture"|"ambient-light-sensor"|"attribution-reporting"|"autoplay"|"bluetooth"|"browsing-topics"|"camera"|"captured-surface-control"|"ch-dpr"|"ch-device-memory"|"ch-downlink"|"ch-ect"|"ch-prefers-color-scheme"|"ch-prefers-reduced-motion"|"ch-prefers-reduced-transparency"|"ch-rtt"|"ch-save-data"|"ch-ua"|"ch-ua-arch"|"ch-ua-bitness"|"ch-ua-platform"|"ch-ua-model"|"ch-ua-mobile"|"ch-ua-form-factors"|"ch-ua-full-version"|"ch-ua-full-version-list"|"ch-ua-platform-version"|"ch-ua-wow64"|"ch-viewport-height"|"ch-viewport-width"|"ch-width"|"clipboard-read"|"clipboard-write"|"compute-pressure"|"cross-origin-isolated"|"deferred-fetch"|"digital-credentials-get"|"direct-sockets"|"display-capture"|"document-domain"|"encrypted-media"|"execution-while-out-of-viewport"|"execution-while-not-rendered"|"focus-without-user-activation"|"fullscreen"|"frobulate"|"gamepad"|"geolocation"|"gyroscope"|"hid"|"identity-credentials-get"|"idle-detection"|"interest-cohort"|"join-ad-interest-group"|"keyboard-map"|"local-fonts"|"magnetometer"|"media-playback-while-not-visible"|"microphone"|"midi"|"otp-credentials"|"payment"|"picture-in-picture"|"private-aggregation"|"private-state-token-issuance"|"private-state-token-redemption"|"publickey-credentials-create"|"publickey-credentials-get"|"run-ad-auction"|"screen-wake-lock"|"serial"|"shared-autofill"|"shared-storage"|"shared-storage-select-url"|"smart-card"|"speaker-selection"|"storage-access"|"sub-apps"|"sync-xhr"|"unload"|"usb"|"usb-unrestricted"|"vertical-scroll"|"web-printing"|"web-share"|"window-management"|"xr-spatial-tracking"; /** * Reason for a permissions policy feature to be disabled. */ @@ -12071,7 +12344,7 @@ Example URLs: http://www.google.com/file.html -> "google.com" */ fixed?: number; } - export type ClientNavigationReason = "formSubmissionGet"|"formSubmissionPost"|"httpHeaderRefresh"|"scriptInitiated"|"metaTagRefresh"|"pageBlockInterstitial"|"reload"|"anchorClick"; + export type ClientNavigationReason = "anchorClick"|"formSubmissionGet"|"formSubmissionPost"|"httpHeaderRefresh"|"initialFrameNavigation"|"metaTagRefresh"|"other"|"pageBlockInterstitial"|"reload"|"scriptInitiated"; export type ClientNavigationDisposition = "currentTab"|"newTab"|"newWindow"|"download"; export interface InstallabilityErrorArgument { /** @@ -12244,7 +12517,7 @@ https://github.com/WICG/manifest-incubations/blob/gh-pages/scope_extensions-expl /** * List of not restored reasons for back-forward cache. */ - export type BackForwardCacheNotRestoredReason = "NotPrimaryMainFrame"|"BackForwardCacheDisabled"|"RelatedActiveContentsExist"|"HTTPStatusNotOK"|"SchemeNotHTTPOrHTTPS"|"Loading"|"WasGrantedMediaAccess"|"DisableForRenderFrameHostCalled"|"DomainNotAllowed"|"HTTPMethodNotGET"|"SubframeIsNavigating"|"Timeout"|"CacheLimit"|"JavaScriptExecution"|"RendererProcessKilled"|"RendererProcessCrashed"|"SchedulerTrackedFeatureUsed"|"ConflictingBrowsingInstance"|"CacheFlushed"|"ServiceWorkerVersionActivation"|"SessionRestored"|"ServiceWorkerPostMessage"|"EnteredBackForwardCacheBeforeServiceWorkerHostAdded"|"RenderFrameHostReused_SameSite"|"RenderFrameHostReused_CrossSite"|"ServiceWorkerClaim"|"IgnoreEventAndEvict"|"HaveInnerContents"|"TimeoutPuttingInCache"|"BackForwardCacheDisabledByLowMemory"|"BackForwardCacheDisabledByCommandLine"|"NetworkRequestDatapipeDrainedAsBytesConsumer"|"NetworkRequestRedirected"|"NetworkRequestTimeout"|"NetworkExceedsBufferLimit"|"NavigationCancelledWhileRestoring"|"NotMostRecentNavigationEntry"|"BackForwardCacheDisabledForPrerender"|"UserAgentOverrideDiffers"|"ForegroundCacheLimit"|"BrowsingInstanceNotSwapped"|"BackForwardCacheDisabledForDelegate"|"UnloadHandlerExistsInMainFrame"|"UnloadHandlerExistsInSubFrame"|"ServiceWorkerUnregistration"|"CacheControlNoStore"|"CacheControlNoStoreCookieModified"|"CacheControlNoStoreHTTPOnlyCookieModified"|"NoResponseHead"|"Unknown"|"ActivationNavigationsDisallowedForBug1234857"|"ErrorDocument"|"FencedFramesEmbedder"|"CookieDisabled"|"HTTPAuthRequired"|"CookieFlushed"|"BroadcastChannelOnMessage"|"WebViewSettingsChanged"|"WebViewJavaScriptObjectChanged"|"WebViewMessageListenerInjected"|"WebViewSafeBrowsingAllowlistChanged"|"WebViewDocumentStartJavascriptChanged"|"WebSocket"|"WebTransport"|"WebRTC"|"MainResourceHasCacheControlNoStore"|"MainResourceHasCacheControlNoCache"|"SubresourceHasCacheControlNoStore"|"SubresourceHasCacheControlNoCache"|"ContainsPlugins"|"DocumentLoaded"|"OutstandingNetworkRequestOthers"|"RequestedMIDIPermission"|"RequestedAudioCapturePermission"|"RequestedVideoCapturePermission"|"RequestedBackForwardCacheBlockedSensors"|"RequestedBackgroundWorkPermission"|"BroadcastChannel"|"WebXR"|"SharedWorker"|"WebLocks"|"WebHID"|"WebShare"|"RequestedStorageAccessGrant"|"WebNfc"|"OutstandingNetworkRequestFetch"|"OutstandingNetworkRequestXHR"|"AppBanner"|"Printing"|"WebDatabase"|"PictureInPicture"|"Portal"|"SpeechRecognizer"|"IdleManager"|"PaymentManager"|"SpeechSynthesis"|"KeyboardLock"|"WebOTPService"|"OutstandingNetworkRequestDirectSocket"|"InjectedJavascript"|"InjectedStyleSheet"|"KeepaliveRequest"|"IndexedDBEvent"|"Dummy"|"JsNetworkRequestReceivedCacheControlNoStoreResource"|"WebRTCSticky"|"WebTransportSticky"|"WebSocketSticky"|"SmartCard"|"LiveMediaStreamTrack"|"UnloadHandler"|"ParserAborted"|"ContentSecurityHandler"|"ContentWebAuthenticationAPI"|"ContentFileChooser"|"ContentSerial"|"ContentFileSystemAccess"|"ContentMediaDevicesDispatcherHost"|"ContentWebBluetooth"|"ContentWebUSB"|"ContentMediaSessionService"|"ContentScreenReader"|"EmbedderPopupBlockerTabHelper"|"EmbedderSafeBrowsingTriggeredPopupBlocker"|"EmbedderSafeBrowsingThreatDetails"|"EmbedderAppBannerManager"|"EmbedderDomDistillerViewerSource"|"EmbedderDomDistillerSelfDeletingRequestDelegate"|"EmbedderOomInterventionTabHelper"|"EmbedderOfflinePage"|"EmbedderChromePasswordManagerClientBindCredentialManager"|"EmbedderPermissionRequestManager"|"EmbedderModalDialog"|"EmbedderExtensions"|"EmbedderExtensionMessaging"|"EmbedderExtensionMessagingForOpenPort"|"EmbedderExtensionSentMessageToCachedFrame"|"RequestedByWebViewClient"; + export type BackForwardCacheNotRestoredReason = "NotPrimaryMainFrame"|"BackForwardCacheDisabled"|"RelatedActiveContentsExist"|"HTTPStatusNotOK"|"SchemeNotHTTPOrHTTPS"|"Loading"|"WasGrantedMediaAccess"|"DisableForRenderFrameHostCalled"|"DomainNotAllowed"|"HTTPMethodNotGET"|"SubframeIsNavigating"|"Timeout"|"CacheLimit"|"JavaScriptExecution"|"RendererProcessKilled"|"RendererProcessCrashed"|"SchedulerTrackedFeatureUsed"|"ConflictingBrowsingInstance"|"CacheFlushed"|"ServiceWorkerVersionActivation"|"SessionRestored"|"ServiceWorkerPostMessage"|"EnteredBackForwardCacheBeforeServiceWorkerHostAdded"|"RenderFrameHostReused_SameSite"|"RenderFrameHostReused_CrossSite"|"ServiceWorkerClaim"|"IgnoreEventAndEvict"|"HaveInnerContents"|"TimeoutPuttingInCache"|"BackForwardCacheDisabledByLowMemory"|"BackForwardCacheDisabledByCommandLine"|"NetworkRequestDatapipeDrainedAsBytesConsumer"|"NetworkRequestRedirected"|"NetworkRequestTimeout"|"NetworkExceedsBufferLimit"|"NavigationCancelledWhileRestoring"|"NotMostRecentNavigationEntry"|"BackForwardCacheDisabledForPrerender"|"UserAgentOverrideDiffers"|"ForegroundCacheLimit"|"BrowsingInstanceNotSwapped"|"BackForwardCacheDisabledForDelegate"|"UnloadHandlerExistsInMainFrame"|"UnloadHandlerExistsInSubFrame"|"ServiceWorkerUnregistration"|"CacheControlNoStore"|"CacheControlNoStoreCookieModified"|"CacheControlNoStoreHTTPOnlyCookieModified"|"NoResponseHead"|"Unknown"|"ActivationNavigationsDisallowedForBug1234857"|"ErrorDocument"|"FencedFramesEmbedder"|"CookieDisabled"|"HTTPAuthRequired"|"CookieFlushed"|"BroadcastChannelOnMessage"|"WebViewSettingsChanged"|"WebViewJavaScriptObjectChanged"|"WebViewMessageListenerInjected"|"WebViewSafeBrowsingAllowlistChanged"|"WebViewDocumentStartJavascriptChanged"|"WebSocket"|"WebTransport"|"WebRTC"|"MainResourceHasCacheControlNoStore"|"MainResourceHasCacheControlNoCache"|"SubresourceHasCacheControlNoStore"|"SubresourceHasCacheControlNoCache"|"ContainsPlugins"|"DocumentLoaded"|"OutstandingNetworkRequestOthers"|"RequestedMIDIPermission"|"RequestedAudioCapturePermission"|"RequestedVideoCapturePermission"|"RequestedBackForwardCacheBlockedSensors"|"RequestedBackgroundWorkPermission"|"BroadcastChannel"|"WebXR"|"SharedWorker"|"WebLocks"|"WebHID"|"WebShare"|"RequestedStorageAccessGrant"|"WebNfc"|"OutstandingNetworkRequestFetch"|"OutstandingNetworkRequestXHR"|"AppBanner"|"Printing"|"WebDatabase"|"PictureInPicture"|"SpeechRecognizer"|"IdleManager"|"PaymentManager"|"SpeechSynthesis"|"KeyboardLock"|"WebOTPService"|"OutstandingNetworkRequestDirectSocket"|"InjectedJavascript"|"InjectedStyleSheet"|"KeepaliveRequest"|"IndexedDBEvent"|"Dummy"|"JsNetworkRequestReceivedCacheControlNoStoreResource"|"WebRTCSticky"|"WebTransportSticky"|"WebSocketSticky"|"SmartCard"|"LiveMediaStreamTrack"|"UnloadHandler"|"ParserAborted"|"ContentSecurityHandler"|"ContentWebAuthenticationAPI"|"ContentFileChooser"|"ContentSerial"|"ContentFileSystemAccess"|"ContentMediaDevicesDispatcherHost"|"ContentWebBluetooth"|"ContentWebUSB"|"ContentMediaSessionService"|"ContentScreenReader"|"EmbedderPopupBlockerTabHelper"|"EmbedderSafeBrowsingTriggeredPopupBlocker"|"EmbedderSafeBrowsingThreatDetails"|"EmbedderAppBannerManager"|"EmbedderDomDistillerViewerSource"|"EmbedderDomDistillerSelfDeletingRequestDelegate"|"EmbedderOomInterventionTabHelper"|"EmbedderOfflinePage"|"EmbedderChromePasswordManagerClientBindCredentialManager"|"EmbedderPermissionRequestManager"|"EmbedderModalDialog"|"EmbedderExtensions"|"EmbedderExtensionMessaging"|"EmbedderExtensionMessagingForOpenPort"|"EmbedderExtensionSentMessageToCachedFrame"|"RequestedByWebViewClient"; /** * Types of not restored reasons for back-forward cache. */ @@ -12585,6 +12858,10 @@ when bfcache navigation fails. * Frame's new url. */ url: string; + /** + * Navigation type + */ + navigationType: "fragment"|"historyApi"|"other"; } /** * Compressed image data requested by the `startScreencast`. @@ -14431,6 +14708,25 @@ int eventReportWindows: AttributionReportingEventReportWindows; } export type AttributionReportingTriggerDataMatching = "exact"|"modulus"; + export interface AttributionReportingAggregatableDebugReportingData { + keyPiece: UnsignedInt128AsBase16; + /** + * number instead of integer because not all uint32 can be represented by +int + */ + value: number; + types: string[]; + } + export interface AttributionReportingAggregatableDebugReportingConfig { + /** + * number instead of integer because not all uint32 can be represented by +int, only present for source registrations + */ + budget?: number; + keyPiece: UnsignedInt128AsBase16; + debugData: AttributionReportingAggregatableDebugReportingData[]; + aggregationCoordinatorOrigin?: string; + } export interface AttributionReportingSourceRegistration { time: Network.TimeSinceEpoch; /** @@ -14452,8 +14748,10 @@ int aggregationKeys: AttributionReportingAggregationKeysEntry[]; debugKey?: UnsignedInt64AsBase10; triggerDataMatching: AttributionReportingTriggerDataMatching; + destinationLimitPriority: SignedInt64AsBase10; + aggregatableDebugReportingConfig: AttributionReportingAggregatableDebugReportingConfig; } - export type AttributionReportingSourceRegistrationResult = "success"|"internalError"|"insufficientSourceCapacity"|"insufficientUniqueDestinationCapacity"|"excessiveReportingOrigins"|"prohibitedByBrowserPolicy"|"successNoised"|"destinationReportingLimitReached"|"destinationGlobalLimitReached"|"destinationBothLimitsReached"|"reportingOriginsPerSiteLimitReached"|"exceedsMaxChannelCapacity"|"exceedsMaxTriggerStateCardinality"; + export type AttributionReportingSourceRegistrationResult = "success"|"internalError"|"insufficientSourceCapacity"|"insufficientUniqueDestinationCapacity"|"excessiveReportingOrigins"|"prohibitedByBrowserPolicy"|"successNoised"|"destinationReportingLimitReached"|"destinationGlobalLimitReached"|"destinationBothLimitsReached"|"reportingOriginsPerSiteLimitReached"|"exceedsMaxChannelCapacity"|"exceedsMaxTriggerStateCardinality"|"destinationPerDayReportingLimitReached"; export type AttributionReportingSourceRegistrationTimeConfig = "include"|"exclude"; export interface AttributionReportingAggregatableValueDictEntry { key: string; @@ -14462,6 +14760,7 @@ int int */ value: number; + filteringId: UnsignedInt64AsBase10; } export interface AttributionReportingAggregatableValueEntry { values: AttributionReportingAggregatableValueDictEntry[]; @@ -14489,10 +14788,12 @@ int eventTriggerData: AttributionReportingEventTriggerData[]; aggregatableTriggerData: AttributionReportingAggregatableTriggerData[]; aggregatableValues: AttributionReportingAggregatableValueEntry[]; + aggregatableFilteringIdMaxBytes: number; debugReporting: boolean; aggregationCoordinatorOrigin?: string; sourceRegistrationTimeConfig: AttributionReportingSourceRegistrationTimeConfig; triggerContextId?: string; + aggregatableDebugReportingConfig: AttributionReportingAggregatableDebugReportingConfig; } export type AttributionReportingEventLevelResult = "success"|"successDroppedLowerPriority"|"internalError"|"noCapacityForAttributionDestination"|"noMatchingSources"|"deduplicated"|"excessiveAttributions"|"priorityTooLow"|"neverAttributedSource"|"excessiveReportingOrigins"|"noMatchingSourceFilterData"|"prohibitedByBrowserPolicy"|"noMatchingConfigurations"|"excessiveReports"|"falselyAttributedSource"|"reportWindowPassed"|"notRegistered"|"reportWindowNotStarted"|"noMatchingTriggerData"; export type AttributionReportingAggregatableResult = "success"|"internalError"|"noCapacityForAttributionDestination"|"noMatchingSources"|"excessiveAttributions"|"excessiveReportingOrigins"|"noHistograms"|"insufficientBudget"|"noMatchingSourceFilterData"|"notRegistered"|"prohibitedByBrowserPolicy"|"deduplicated"|"reportWindowPassed"|"excessiveReports"; @@ -15358,7 +15659,7 @@ supported. browserContextId?: Browser.BrowserContextID; /** * Provides additional details for specific target types. For example, for -the type of "page", this may be set to "portal" or "prerender". +the type of "page", this may be set to "prerender". */ subtype?: string; } @@ -17185,7 +17486,7 @@ possible for multiple rule sets and links to trigger a single attempt. /** * List of FinalStatus reasons for Prerender2. */ - export type PrerenderFinalStatus = "Activated"|"Destroyed"|"LowEndDevice"|"InvalidSchemeRedirect"|"InvalidSchemeNavigation"|"NavigationRequestBlockedByCsp"|"MainFrameNavigation"|"MojoBinderPolicy"|"RendererProcessCrashed"|"RendererProcessKilled"|"Download"|"TriggerDestroyed"|"NavigationNotCommitted"|"NavigationBadHttpStatus"|"ClientCertRequested"|"NavigationRequestNetworkError"|"CancelAllHostsForTesting"|"DidFailLoad"|"Stop"|"SslCertificateError"|"LoginAuthRequested"|"UaChangeRequiresReload"|"BlockedByClient"|"AudioOutputDeviceRequested"|"MixedContent"|"TriggerBackgrounded"|"MemoryLimitExceeded"|"DataSaverEnabled"|"TriggerUrlHasEffectiveUrl"|"ActivatedBeforeStarted"|"InactivePageRestriction"|"StartFailed"|"TimeoutBackgrounded"|"CrossSiteRedirectInInitialNavigation"|"CrossSiteNavigationInInitialNavigation"|"SameSiteCrossOriginRedirectNotOptInInInitialNavigation"|"SameSiteCrossOriginNavigationNotOptInInInitialNavigation"|"ActivationNavigationParameterMismatch"|"ActivatedInBackground"|"EmbedderHostDisallowed"|"ActivationNavigationDestroyedBeforeSuccess"|"TabClosedByUserGesture"|"TabClosedWithoutUserGesture"|"PrimaryMainFrameRendererProcessCrashed"|"PrimaryMainFrameRendererProcessKilled"|"ActivationFramePolicyNotCompatible"|"PreloadingDisabled"|"BatterySaverEnabled"|"ActivatedDuringMainFrameNavigation"|"PreloadingUnsupportedByWebContents"|"CrossSiteRedirectInMainFrameNavigation"|"CrossSiteNavigationInMainFrameNavigation"|"SameSiteCrossOriginRedirectNotOptInInMainFrameNavigation"|"SameSiteCrossOriginNavigationNotOptInInMainFrameNavigation"|"MemoryPressureOnTrigger"|"MemoryPressureAfterTriggered"|"PrerenderingDisabledByDevTools"|"SpeculationRuleRemoved"|"ActivatedWithAuxiliaryBrowsingContexts"|"MaxNumOfRunningEagerPrerendersExceeded"|"MaxNumOfRunningNonEagerPrerendersExceeded"|"MaxNumOfRunningEmbedderPrerendersExceeded"|"PrerenderingUrlHasEffectiveUrl"|"RedirectedPrerenderingUrlHasEffectiveUrl"|"ActivationUrlHasEffectiveUrl"|"JavaScriptInterfaceAdded"|"JavaScriptInterfaceRemoved"|"AllPrerenderingCanceled"; + export type PrerenderFinalStatus = "Activated"|"Destroyed"|"LowEndDevice"|"InvalidSchemeRedirect"|"InvalidSchemeNavigation"|"NavigationRequestBlockedByCsp"|"MainFrameNavigation"|"MojoBinderPolicy"|"RendererProcessCrashed"|"RendererProcessKilled"|"Download"|"TriggerDestroyed"|"NavigationNotCommitted"|"NavigationBadHttpStatus"|"ClientCertRequested"|"NavigationRequestNetworkError"|"CancelAllHostsForTesting"|"DidFailLoad"|"Stop"|"SslCertificateError"|"LoginAuthRequested"|"UaChangeRequiresReload"|"BlockedByClient"|"AudioOutputDeviceRequested"|"MixedContent"|"TriggerBackgrounded"|"MemoryLimitExceeded"|"DataSaverEnabled"|"TriggerUrlHasEffectiveUrl"|"ActivatedBeforeStarted"|"InactivePageRestriction"|"StartFailed"|"TimeoutBackgrounded"|"CrossSiteRedirectInInitialNavigation"|"CrossSiteNavigationInInitialNavigation"|"SameSiteCrossOriginRedirectNotOptInInInitialNavigation"|"SameSiteCrossOriginNavigationNotOptInInInitialNavigation"|"ActivationNavigationParameterMismatch"|"ActivatedInBackground"|"EmbedderHostDisallowed"|"ActivationNavigationDestroyedBeforeSuccess"|"TabClosedByUserGesture"|"TabClosedWithoutUserGesture"|"PrimaryMainFrameRendererProcessCrashed"|"PrimaryMainFrameRendererProcessKilled"|"ActivationFramePolicyNotCompatible"|"PreloadingDisabled"|"BatterySaverEnabled"|"ActivatedDuringMainFrameNavigation"|"PreloadingUnsupportedByWebContents"|"CrossSiteRedirectInMainFrameNavigation"|"CrossSiteNavigationInMainFrameNavigation"|"SameSiteCrossOriginRedirectNotOptInInMainFrameNavigation"|"SameSiteCrossOriginNavigationNotOptInInMainFrameNavigation"|"MemoryPressureOnTrigger"|"MemoryPressureAfterTriggered"|"PrerenderingDisabledByDevTools"|"SpeculationRuleRemoved"|"ActivatedWithAuxiliaryBrowsingContexts"|"MaxNumOfRunningEagerPrerendersExceeded"|"MaxNumOfRunningNonEagerPrerendersExceeded"|"MaxNumOfRunningEmbedderPrerendersExceeded"|"PrerenderingUrlHasEffectiveUrl"|"RedirectedPrerenderingUrlHasEffectiveUrl"|"ActivationUrlHasEffectiveUrl"|"JavaScriptInterfaceAdded"|"JavaScriptInterfaceRemoved"|"AllPrerenderingCanceled"|"WindowClosed"|"SlowNetwork"|"OtherPrerenderedPageActivated"; /** * Preloading status values, see also PreloadingTriggeringOutcome. This status is shared by prefetchStatusUpdated and prerenderStatusUpdated. @@ -17399,6 +17700,10 @@ https://www.iana.org/assignments/media-types/media-types.xhtml accepts: FileHandlerAccept[]; displayName: string; } + /** + * If user prefers opening the app in browser or an app window. + */ + export type DisplayMode = "standalone"|"browser"; /** @@ -17439,7 +17744,7 @@ manifestId. export type installReturnValue = { } /** - * Uninstals the given manifest_id and closes any opened app windows. + * Uninstalls the given manifest_id and closes any opened app windows. */ export type uninstallParameters = { manifestId: string; @@ -17468,7 +17773,7 @@ the files. The API returns one or more page Target.TargetIDs which can be used to attach to via Target.attachToTarget or similar APIs. If some files in the parameters cannot be handled by the web app, they will be ignored. If none of the files can be handled, this API returns an error. -If no files provided as the parameter, this API also returns an error. +If no files are provided as the parameter, this API also returns an error. According to the definition of the file handlers in the manifest file, one Target.TargetID may represent a page handling one or more files. The order @@ -17489,13 +17794,139 @@ TODO(crbug.com/339454034): Check the existences of the input files. /** * Opens the current page in its web app identified by the manifest id, needs to be called on a page target. This function returns immediately without -waiting for the app finishing loading. +waiting for the app to finish loading. */ export type openCurrentPageInAppParameters = { manifestId: string; } export type openCurrentPageInAppReturnValue = { } + /** + * Changes user settings of the web app identified by its manifestId. If the +app was not installed, this command returns an error. Unset parameters will +be ignored; unrecognized values will cause an error. + +Unlike the ones defined in the manifest files of the web apps, these +settings are provided by the browser and controlled by the users, they +impact the way the browser handling the web apps. + +See the comment of each parameter. + */ + export type changeAppUserSettingsParameters = { + manifestId: string; + /** + * If user allows the links clicked on by the user in the app's scope, or +extended scope if the manifest has scope extensions and the flags +`DesktopPWAsLinkCapturingWithScopeExtensions` and +`WebAppEnableScopeExtensions` are enabled. + +Note, the API does not support resetting the linkCapturing to the +initial value, uninstalling and installing the web app again will reset +it. + +TODO(crbug.com/339453269): Setting this value on ChromeOS is not +supported yet. + */ + linkCapturing?: boolean; + displayMode?: DisplayMode; + } + export type changeAppUserSettingsReturnValue = { + } + } + + /** + * This domain allows configuring virtual Bluetooth devices to test +the web-bluetooth API. + */ + export module BluetoothEmulation { + /** + * Indicates the various states of Central. + */ + export type CentralState = "absent"|"powered-off"|"powered-on"; + /** + * Stores the manufacturer data + */ + export interface ManufacturerData { + /** + * Company identifier +https://bitbucket.org/bluetooth-SIG/public/src/main/assigned_numbers/company_identifiers/company_identifiers.yaml +https://usb.org/developers + */ + key: number; + /** + * Manufacturer-specific data + */ + data: binary; + } + /** + * Stores the byte data of the advertisement packet sent by a Bluetooth device. + */ + export interface ScanRecord { + name?: string; + uuids?: string[]; + /** + * Stores the external appearance description of the device. + */ + appearance?: number; + /** + * Stores the transmission power of a broadcasting device. + */ + txPower?: number; + /** + * Key is the company identifier and the value is an array of bytes of +manufacturer specific data. + */ + manufacturerData?: ManufacturerData[]; + } + /** + * Stores the advertisement packet information that is sent by a Bluetooth device. + */ + export interface ScanEntry { + deviceAddress: string; + rssi: number; + scanRecord: ScanRecord; + } + + + /** + * Enable the BluetoothEmulation domain. + */ + export type enableParameters = { + /** + * State of the simulated central. + */ + state: CentralState; + } + export type enableReturnValue = { + } + /** + * Disable the BluetoothEmulation domain. + */ + export type disableParameters = { + } + export type disableReturnValue = { + } + /** + * Simulates a peripheral with |address|, |name| and |knownServiceUuids| +that has already been connected to the system. + */ + export type simulatePreconnectedPeripheralParameters = { + address: string; + name: string; + manufacturerData: ManufacturerData[]; + knownServiceUuids: string[]; + } + export type simulatePreconnectedPeripheralReturnValue = { + } + /** + * Simulates an advertisement packet described in |entry| being received by +the central. + */ + export type simulateAdvertisementParameters = { + entry: ScanEntry; + } + export type simulateAdvertisementReturnValue = { + } } /** @@ -20202,6 +20633,7 @@ Error was thrown. "Network.responseReceivedExtraInfo": Network.responseReceivedExtraInfoPayload; "Network.responseReceivedEarlyHints": Network.responseReceivedEarlyHintsPayload; "Network.trustTokenOperationDone": Network.trustTokenOperationDonePayload; + "Network.policyUpdated": Network.policyUpdatedPayload; "Network.subresourceWebBundleMetadataReceived": Network.subresourceWebBundleMetadataReceivedPayload; "Network.subresourceWebBundleMetadataError": Network.subresourceWebBundleMetadataErrorPayload; "Network.subresourceWebBundleInnerResponseParsed": Network.subresourceWebBundleInnerResponseParsedPayload; @@ -20349,6 +20781,10 @@ Error was thrown. "Audits.checkContrast": Audits.checkContrastParameters; "Audits.checkFormsIssues": Audits.checkFormsIssuesParameters; "Extensions.loadUnpacked": Extensions.loadUnpackedParameters; + "Extensions.getStorageItems": Extensions.getStorageItemsParameters; + "Extensions.removeStorageItems": Extensions.removeStorageItemsParameters; + "Extensions.clearStorageItems": Extensions.clearStorageItemsParameters; + "Extensions.setStorageItems": Extensions.setStorageItemsParameters; "Autofill.trigger": Autofill.triggerParameters; "Autofill.setAddresses": Autofill.setAddressesParameters; "Autofill.disable": Autofill.disableParameters; @@ -20459,6 +20895,7 @@ Error was thrown. "DOM.setNodeStackTracesEnabled": DOM.setNodeStackTracesEnabledParameters; "DOM.getNodeStackTraces": DOM.getNodeStackTracesParameters; "DOM.getFileInfo": DOM.getFileInfoParameters; + "DOM.getDetachedDomNodes": DOM.getDetachedDomNodesParameters; "DOM.setInspectedNode": DOM.setInspectedNodeParameters; "DOM.setNodeName": DOM.setNodeNameParameters; "DOM.setNodeValue": DOM.setNodeValueParameters; @@ -20517,6 +20954,8 @@ Error was thrown. "Emulation.getOverriddenSensorInformation": Emulation.getOverriddenSensorInformationParameters; "Emulation.setSensorOverrideEnabled": Emulation.setSensorOverrideEnabledParameters; "Emulation.setSensorOverrideReadings": Emulation.setSensorOverrideReadingsParameters; + "Emulation.setPressureSourceOverrideEnabled": Emulation.setPressureSourceOverrideEnabledParameters; + "Emulation.setPressureStateOverride": Emulation.setPressureStateOverrideParameters; "Emulation.setIdleOverride": Emulation.setIdleOverrideParameters; "Emulation.clearIdleOverride": Emulation.clearIdleOverrideParameters; "Emulation.setNavigatorOverrides": Emulation.setNavigatorOverridesParameters; @@ -20537,6 +20976,7 @@ Error was thrown. "IO.close": IO.closeParameters; "IO.read": IO.readParameters; "IO.resolveBlob": IO.resolveBlobParameters; + "FileSystem.getDirectory": FileSystem.getDirectoryParameters; "IndexedDB.clearObjectStore": IndexedDB.clearObjectStoreParameters; "IndexedDB.deleteDatabase": IndexedDB.deleteDatabaseParameters; "IndexedDB.deleteObjectStoreEntries": IndexedDB.deleteObjectStoreEntriesParameters; @@ -20839,6 +21279,11 @@ Error was thrown. "PWA.launch": PWA.launchParameters; "PWA.launchFilesInApp": PWA.launchFilesInAppParameters; "PWA.openCurrentPageInApp": PWA.openCurrentPageInAppParameters; + "PWA.changeAppUserSettings": PWA.changeAppUserSettingsParameters; + "BluetoothEmulation.enable": BluetoothEmulation.enableParameters; + "BluetoothEmulation.disable": BluetoothEmulation.disableParameters; + "BluetoothEmulation.simulatePreconnectedPeripheral": BluetoothEmulation.simulatePreconnectedPeripheralParameters; + "BluetoothEmulation.simulateAdvertisement": BluetoothEmulation.simulateAdvertisementParameters; "Console.clearMessages": Console.clearMessagesParameters; "Console.disable": Console.disableParameters; "Console.enable": Console.enableParameters; @@ -20945,6 +21390,10 @@ Error was thrown. "Audits.checkContrast": Audits.checkContrastReturnValue; "Audits.checkFormsIssues": Audits.checkFormsIssuesReturnValue; "Extensions.loadUnpacked": Extensions.loadUnpackedReturnValue; + "Extensions.getStorageItems": Extensions.getStorageItemsReturnValue; + "Extensions.removeStorageItems": Extensions.removeStorageItemsReturnValue; + "Extensions.clearStorageItems": Extensions.clearStorageItemsReturnValue; + "Extensions.setStorageItems": Extensions.setStorageItemsReturnValue; "Autofill.trigger": Autofill.triggerReturnValue; "Autofill.setAddresses": Autofill.setAddressesReturnValue; "Autofill.disable": Autofill.disableReturnValue; @@ -21055,6 +21504,7 @@ Error was thrown. "DOM.setNodeStackTracesEnabled": DOM.setNodeStackTracesEnabledReturnValue; "DOM.getNodeStackTraces": DOM.getNodeStackTracesReturnValue; "DOM.getFileInfo": DOM.getFileInfoReturnValue; + "DOM.getDetachedDomNodes": DOM.getDetachedDomNodesReturnValue; "DOM.setInspectedNode": DOM.setInspectedNodeReturnValue; "DOM.setNodeName": DOM.setNodeNameReturnValue; "DOM.setNodeValue": DOM.setNodeValueReturnValue; @@ -21113,6 +21563,8 @@ Error was thrown. "Emulation.getOverriddenSensorInformation": Emulation.getOverriddenSensorInformationReturnValue; "Emulation.setSensorOverrideEnabled": Emulation.setSensorOverrideEnabledReturnValue; "Emulation.setSensorOverrideReadings": Emulation.setSensorOverrideReadingsReturnValue; + "Emulation.setPressureSourceOverrideEnabled": Emulation.setPressureSourceOverrideEnabledReturnValue; + "Emulation.setPressureStateOverride": Emulation.setPressureStateOverrideReturnValue; "Emulation.setIdleOverride": Emulation.setIdleOverrideReturnValue; "Emulation.clearIdleOverride": Emulation.clearIdleOverrideReturnValue; "Emulation.setNavigatorOverrides": Emulation.setNavigatorOverridesReturnValue; @@ -21133,6 +21585,7 @@ Error was thrown. "IO.close": IO.closeReturnValue; "IO.read": IO.readReturnValue; "IO.resolveBlob": IO.resolveBlobReturnValue; + "FileSystem.getDirectory": FileSystem.getDirectoryReturnValue; "IndexedDB.clearObjectStore": IndexedDB.clearObjectStoreReturnValue; "IndexedDB.deleteDatabase": IndexedDB.deleteDatabaseReturnValue; "IndexedDB.deleteObjectStoreEntries": IndexedDB.deleteObjectStoreEntriesReturnValue; @@ -21435,6 +21888,11 @@ Error was thrown. "PWA.launch": PWA.launchReturnValue; "PWA.launchFilesInApp": PWA.launchFilesInAppReturnValue; "PWA.openCurrentPageInApp": PWA.openCurrentPageInAppReturnValue; + "PWA.changeAppUserSettings": PWA.changeAppUserSettingsReturnValue; + "BluetoothEmulation.enable": BluetoothEmulation.enableReturnValue; + "BluetoothEmulation.disable": BluetoothEmulation.disableReturnValue; + "BluetoothEmulation.simulatePreconnectedPeripheral": BluetoothEmulation.simulatePreconnectedPeripheralReturnValue; + "BluetoothEmulation.simulateAdvertisement": BluetoothEmulation.simulateAdvertisementReturnValue; "Console.clearMessages": Console.clearMessagesReturnValue; "Console.disable": Console.disableReturnValue; "Console.enable": Console.enableReturnValue; @@ -21551,8 +22009,6 @@ type ElementHandleWaitForSelectorOptionsNotHidden = ElementHandleWaitForSelector }; /** - * - extends: [EventEmitter] - * * Page provides methods to interact with a single tab in a {@link Browser}, or an * [extension background page](https://developer.chrome.com/extensions/background_pages) in Chromium. One {@link * Browser} instance might have multiple {@link Page} instances. @@ -22387,6 +22843,57 @@ export interface Page { * @param options */ exposeBinding(name: string, playwrightBinding: (source: BindingSource, ...args: any[]) => any, options?: { handle?: boolean }): Promise; + + /** + * Removes all the listeners of the given type (or all registered listeners if no type given). Allows to wait for + * async listeners to complete or to ignore subsequent errors from these listeners. + * + * **Usage** + * + * ```js + * page.on('request', async request => { + * const response = await request.response(); + * const body = await response.body(); + * console.log(body.byteLength); + * }); + * await page.goto('https://playwright.dev', { waitUntil: 'domcontentloaded' }); + * // Waits for all the reported 'request' events to resolve. + * await page.removeAllListeners('request', { behavior: 'wait' }); + * ``` + * + * @param type + * @param options + */ + removeAllListeners(type?: string): this; + /** + * Removes all the listeners of the given type (or all registered listeners if no type given). Allows to wait for + * async listeners to complete or to ignore subsequent errors from these listeners. + * + * **Usage** + * + * ```js + * page.on('request', async request => { + * const response = await request.response(); + * const body = await response.body(); + * console.log(body.byteLength); + * }); + * await page.goto('https://playwright.dev', { waitUntil: 'domcontentloaded' }); + * // Waits for all the reported 'request' events to resolve. + * await page.removeAllListeners('request', { behavior: 'wait' }); + * ``` + * + * @param type + * @param options + */ + removeAllListeners(type: string | undefined, options: { + /** + * Specifies whether to wait for already running listeners and what to do if they throw errors: + * - `'default'` - do not wait for current listener calls (if any) to finish, if the listener throws, it may result in unhandled error + * - `'wait'` - wait for current listener calls (if any) to finish + * - `'ignoreErrors'` - do not wait for current listener calls (if any) to finish, all errors thrown by the listeners after removal are silently caught + */ + behavior?: 'wait'|'ignoreErrors'|'default' + }): Promise; /** * Emitted when the page closes. */ @@ -23409,7 +23916,7 @@ export interface Page { path?: string; /** - * Script type. Use 'module' in order to load a Javascript ES6 module. See + * Script type. Use 'module' in order to load a JavaScript ES6 module. See * [script](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) for more details. */ type?: string; @@ -23461,7 +23968,6 @@ export interface Page { * 1. Scroll the element into view if needed. * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the * element. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. * 1. Ensure that the element is now checked. If not, this method throws. * * When all steps combined have not finished during the specified `timeout`, this method throws a {@link @@ -23477,9 +23983,8 @@ export interface Page { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -23565,6 +24070,7 @@ export interface Page { * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as * navigating to inaccessible pages. Defaults to `false`. + * @deprecated This option will default to `true` in the future. */ noWaitAfter?: boolean; @@ -23643,8 +24149,6 @@ export interface Page { * 1. Scroll the element into view if needed. * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to double click in the center of the * element, or the specified `position`. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if - * the first click of the `dblclick()` triggers a navigation event, this method will throw. * * When all steps combined have not finished during the specified `timeout`, this method throws a {@link * TimeoutError}. Passing zero timeout disables this. @@ -23678,9 +24182,8 @@ export interface Page { modifiers?: Array<"Alt"|"Control"|"ControlOrMeta"|"Meta"|"Shift">; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -23803,9 +24306,8 @@ export interface Page { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -23986,9 +24488,8 @@ export interface Page { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -24424,7 +24925,7 @@ export interface Page { /** * Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of - * the last redirect. If can not go back, returns `null`. + * the last redirect. If cannot go back, returns `null`. * * Navigate to the previous page in history. * @param options @@ -24454,7 +24955,7 @@ export interface Page { /** * Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of - * the last redirect. If can not go forward, returns `null`. + * the last redirect. If cannot go forward, returns `null`. * * Navigate to the next page in history. * @param options @@ -24547,7 +25048,6 @@ export interface Page { * 1. Scroll the element into view if needed. * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to hover over the center of the * element, or the specified `position`. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. * * When all steps combined have not finished during the specified `timeout`, this method throws a {@link * TimeoutError}. Passing zero timeout disables this. @@ -24569,9 +25069,8 @@ export interface Page { modifiers?: Array<"Alt"|"Control"|"ControlOrMeta"|"Meta"|"Shift">; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -25126,6 +25625,7 @@ export interface Page { * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as * navigating to inaccessible pages. Defaults to `false`. + * @deprecated This option will default to `true` in the future. */ noWaitAfter?: boolean; @@ -25289,7 +25789,8 @@ export interface Page { /** * When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, - * cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`. + * cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to + * `minimal`. */ updateMode?: "full"|"minimal"; @@ -25381,9 +25882,8 @@ export interface Page { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -25416,7 +25916,6 @@ export interface Page { * 1. Scroll the element into view if needed. * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the * element. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. * 1. Ensure that the element is now checked or unchecked. If not, this method throws. * * When all steps combined have not finished during the specified `timeout`, this method throws a {@link @@ -25433,9 +25932,8 @@ export interface Page { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -25591,9 +26089,8 @@ export interface Page { buffer: Buffer; }>, options?: { /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -25661,7 +26158,6 @@ export interface Page { * 1. Scroll the element into view if needed. * 1. Use [page.touchscreen](https://playwright.dev/docs/api/class-page#page-touchscreen) to tap the center of the * element, or the specified `position`. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. * * When all steps combined have not finished during the specified `timeout`, this method throws a {@link * TimeoutError}. Passing zero timeout disables this. @@ -25686,9 +26182,8 @@ export interface Page { modifiers?: Array<"Alt"|"Control"|"ControlOrMeta"|"Meta"|"Shift">; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -25779,9 +26274,8 @@ export interface Page { delay?: number; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -25813,7 +26307,6 @@ export interface Page { * 1. Scroll the element into view if needed. * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the * element. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. * 1. Ensure that the element is now unchecked. If not, this method throws. * * When all steps combined have not finished during the specified `timeout`, this method throws a {@link @@ -25829,9 +26322,8 @@ export interface Page { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -27117,7 +27609,7 @@ export interface Frame { path?: string; /** - * Script type. Use 'module' in order to load a Javascript ES6 module. See + * Script type. Use 'module' in order to load a JavaScript ES6 module. See * [script](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) for more details. */ type?: string; @@ -27166,7 +27658,6 @@ export interface Frame { * 1. Scroll the element into view if needed. * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the * element. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. * 1. Ensure that the element is now checked. If not, this method throws. * * When all steps combined have not finished during the specified `timeout`, this method throws a {@link @@ -27182,9 +27673,8 @@ export interface Frame { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -27272,6 +27762,7 @@ export interface Frame { * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as * navigating to inaccessible pages. Defaults to `false`. + * @deprecated This option will default to `true` in the future. */ noWaitAfter?: boolean; @@ -27321,9 +27812,8 @@ export interface Frame { * the element is detached during the checks, the whole action is retried. * 1. Scroll the element into view if needed. * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to double click in the center of the - * element, or the specified `position`. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if - * the first click of the `dblclick()` triggers a navigation event, this method will throw. + * element, or the specified `position`. if the first click of the `dblclick()` triggers a navigation event, + * this method will throw. * * When all steps combined have not finished during the specified `timeout`, this method throws a {@link * TimeoutError}. Passing zero timeout disables this. @@ -27357,9 +27847,8 @@ export interface Frame { modifiers?: Array<"Alt"|"Control"|"ControlOrMeta"|"Meta"|"Shift">; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -27468,9 +27957,8 @@ export interface Frame { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -27542,9 +28030,8 @@ export interface Frame { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -28029,7 +28516,6 @@ export interface Frame { * 1. Scroll the element into view if needed. * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to hover over the center of the * element, or the specified `position`. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. * * When all steps combined have not finished during the specified `timeout`, this method throws a {@link * TimeoutError}. Passing zero timeout disables this. @@ -28051,9 +28537,8 @@ export interface Frame { modifiers?: Array<"Alt"|"Control"|"ControlOrMeta"|"Meta"|"Shift">; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -28429,6 +28914,7 @@ export interface Frame { * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as * navigating to inaccessible pages. Defaults to `false`. + * @deprecated This option will default to `true` in the future. */ noWaitAfter?: boolean; @@ -28520,9 +29006,8 @@ export interface Frame { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -28555,7 +29040,6 @@ export interface Frame { * 1. Scroll the element into view if needed. * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the * element. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. * 1. Ensure that the element is now checked or unchecked. If not, this method throws. * * When all steps combined have not finished during the specified `timeout`, this method throws a {@link @@ -28572,9 +29056,8 @@ export interface Frame { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -28687,9 +29170,8 @@ export interface Frame { buffer: Buffer; }>, options?: { /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -28719,7 +29201,6 @@ export interface Frame { * 1. Scroll the element into view if needed. * 1. Use [page.touchscreen](https://playwright.dev/docs/api/class-page#page-touchscreen) to tap the center of the * element, or the specified `position`. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. * * When all steps combined have not finished during the specified `timeout`, this method throws a {@link * TimeoutError}. Passing zero timeout disables this. @@ -28743,9 +29224,8 @@ export interface Frame { modifiers?: Array<"Alt"|"Control"|"ControlOrMeta"|"Meta"|"Shift">; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -28836,9 +29316,8 @@ export interface Frame { delay?: number; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -28870,7 +29349,6 @@ export interface Frame { * 1. Scroll the element into view if needed. * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the * element. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. * 1. Ensure that the element is now unchecked. If not, this method throws. * * When all steps combined have not finished during the specified `timeout`, this method throws a {@link @@ -28886,9 +29364,8 @@ export interface Frame { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -29070,16 +29547,14 @@ export interface Frame { } /** - * - extends: [EventEmitter] - * * BrowserContexts provide a way to operate multiple independent browser sessions. * * If a page opens another page, e.g. with a `window.open` call, the popup will belong to the parent page's browser * context. * - * Playwright allows creating "incognito" browser contexts with + * Playwright allows creating isolated non-persistent browser contexts with * [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context) method. - * "Incognito" browser contexts don't write any browsing data to disk. + * Non-persistent browser contexts don't write any browsing data to disk. * * ```js * // Create a new incognito browser context @@ -29209,202 +29684,29 @@ export interface BrowserContext { * @param arg Optional argument to pass to `script` (only supported when passing a function). */ addInitScript(script: PageFunction | { path?: string, content?: string }, arg?: Arg): Promise; - /** - * **NOTE** Only works with Chromium browser's persistent context. - * - * Emitted when new background page is created in the context. - * - * ```js - * const backgroundPage = await context.waitForEvent('backgroundpage'); - * ``` - * - */ - on(event: 'backgroundpage', listener: (page: Page) => any): this; - - /** - * Emitted when Browser context gets closed. This might happen because of one of the following: - * - Browser context is closed. - * - Browser application is closed or crashed. - * - The [browser.close([options])](https://playwright.dev/docs/api/class-browser#browser-close) method was called. - */ - on(event: 'close', listener: (browserContext: BrowserContext) => any): this; - - /** - * Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`. - * - * The arguments passed into `console.log` and the page are available on the {@link ConsoleMessage} event handler - * argument. - * - * **Usage** - * - * ```js - * context.on('console', async msg => { - * const values = []; - * for (const arg of msg.args()) - * values.push(await arg.jsonValue()); - * console.log(...values); - * }); - * await page.evaluate(() => console.log('hello', 5, { foo: 'bar' })); - * ``` - * - */ - on(event: 'console', listener: (consoleMessage: ConsoleMessage) => any): this; - - /** - * Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Listener **must** - * either [dialog.accept([promptText])](https://playwright.dev/docs/api/class-dialog#dialog-accept) or - * [dialog.dismiss()](https://playwright.dev/docs/api/class-dialog#dialog-dismiss) the dialog - otherwise the page - * will [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the - * dialog, and actions like click will never finish. - * - * **Usage** - * - * ```js - * context.on('dialog', dialog => { - * dialog.accept(); - * }); - * ``` - * - * **NOTE** When no [page.on('dialog')](https://playwright.dev/docs/api/class-page#page-event-dialog) or - * [browserContext.on('dialog')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-dialog) - * listeners are present, all dialogs are automatically dismissed. - */ - on(event: 'dialog', listener: (dialog: Dialog) => any): this; - - /** - * The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event - * will also fire for popup pages. See also - * [page.on('popup')](https://playwright.dev/docs/api/class-page#page-event-popup) to receive events about popups - * relevant to a specific page. - * - * The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a - * popup with `window.open('http://example.com')`, this event will fire when the network request to - * "http://example.com" is done and its response has started loading in the popup. If you would like to route/listen - * to this network request, use - * [browserContext.route(url, handler[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-route) - * and - * [browserContext.on('request')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-request) - * respectively instead of similar methods on the {@link Page}. - * - * ```js - * const newPagePromise = context.waitForEvent('page'); - * await page.getByText('open new page').click(); - * const newPage = await newPagePromise; - * console.log(await newPage.evaluate('location.href')); - * ``` - * - * **NOTE** Use - * [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to - * wait until the page gets to a particular state (you should not need it in most cases). - */ - on(event: 'page', listener: (page: Page) => any): this; - - /** - * Emitted when a request is issued from any pages created through this context. The [request] object is read-only. To - * only listen for requests from a particular page, use - * [page.on('request')](https://playwright.dev/docs/api/class-page#page-event-request). - * - * In order to intercept and mutate requests, see - * [browserContext.route(url, handler[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-route) - * or [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route). - */ - on(event: 'request', listener: (request: Request) => any): this; - - /** - * Emitted when a request fails, for example by timing out. To only listen for failed requests from a particular page, - * use [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed). - * - * **NOTE** HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request - * will complete with - * [browserContext.on('requestfinished')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-request-finished) - * event and not with - * [browserContext.on('requestfailed')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-request-failed). - */ - on(event: 'requestfailed', listener: (request: Request) => any): this; - - /** - * Emitted when a request finishes successfully after downloading the response body. For a successful response, the - * sequence of events is `request`, `response` and `requestfinished`. To listen for successful requests from a - * particular page, use - * [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished). - */ - on(event: 'requestfinished', listener: (request: Request) => any): this; - - /** - * Emitted when [response] status and headers are received for a request. For a successful response, the sequence of - * events is `request`, `response` and `requestfinished`. To listen for response events from a particular page, use - * [page.on('response')](https://playwright.dev/docs/api/class-page#page-event-response). - */ - on(event: 'response', listener: (response: Response) => any): this; - - /** - * **NOTE** Service workers are only supported on Chromium-based browsers. - * - * Emitted when new service worker is created in the context. - */ - on(event: 'serviceworker', listener: (worker: Worker) => any): this; - - /** - * Emitted when exception is unhandled in any of the pages in this context. To listen for errors from a particular - * page, use [page.on('pageerror')](https://playwright.dev/docs/api/class-page#page-event-page-error) instead. - */ - on(event: 'weberror', listener: (webError: WebError) => any): this; /** - * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. - */ - once(event: 'backgroundpage', listener: (page: Page) => any): this; - - /** - * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. - */ - once(event: 'close', listener: (browserContext: BrowserContext) => any): this; - - /** - * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. - */ - once(event: 'console', listener: (consoleMessage: ConsoleMessage) => any): this; - - /** - * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. - */ - once(event: 'dialog', listener: (dialog: Dialog) => any): this; - - /** - * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. - */ - once(event: 'page', listener: (page: Page) => any): this; - - /** - * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. - */ - once(event: 'request', listener: (request: Request) => any): this; - - /** - * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. - */ - once(event: 'requestfailed', listener: (request: Request) => any): this; - - /** - * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. - */ - once(event: 'requestfinished', listener: (request: Request) => any): this; - - /** - * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. - */ - once(event: 'response', listener: (response: Response) => any): this; - - /** - * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. + * Removes all the listeners of the given type (or all registered listeners if no type given). Allows to wait for + * async listeners to complete or to ignore subsequent errors from these listeners. + * @param type + * @param options */ - once(event: 'serviceworker', listener: (worker: Worker) => any): this; - + removeAllListeners(type?: string): this; /** - * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. + * Removes all the listeners of the given type (or all registered listeners if no type given). Allows to wait for + * async listeners to complete or to ignore subsequent errors from these listeners. + * @param type + * @param options */ - once(event: 'weberror', listener: (webError: WebError) => any): this; - + removeAllListeners(type: string | undefined, options: { + /** + * Specifies whether to wait for already running listeners and what to do if they throw errors: + * - `'default'` - do not wait for current listener calls (if any) to finish, if the listener throws, it may result in unhandled error + * - `'wait'` - wait for current listener calls (if any) to finish + * - `'ignoreErrors'` - do not wait for current listener calls (if any) to finish, all errors thrown by the listeners after removal are silently caught + */ + behavior?: 'wait'|'ignoreErrors'|'default' + }): Promise; /** * **NOTE** Only works with Chromium browser's persistent context. * @@ -29415,7 +29717,7 @@ export interface BrowserContext { * ``` * */ - addListener(event: 'backgroundpage', listener: (page: Page) => any): this; + on(event: 'backgroundpage', listener: (page: Page) => any): this; /** * Emitted when Browser context gets closed. This might happen because of one of the following: @@ -29423,7 +29725,7 @@ export interface BrowserContext { * - Browser application is closed or crashed. * - The [browser.close([options])](https://playwright.dev/docs/api/class-browser#browser-close) method was called. */ - addListener(event: 'close', listener: (browserContext: BrowserContext) => any): this; + on(event: 'close', listener: (browserContext: BrowserContext) => any): this; /** * Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`. @@ -29444,7 +29746,7 @@ export interface BrowserContext { * ``` * */ - addListener(event: 'console', listener: (consoleMessage: ConsoleMessage) => any): this; + on(event: 'console', listener: (consoleMessage: ConsoleMessage) => any): this; /** * Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Listener **must** @@ -29465,7 +29767,203 @@ export interface BrowserContext { * [browserContext.on('dialog')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-dialog) * listeners are present, all dialogs are automatically dismissed. */ - addListener(event: 'dialog', listener: (dialog: Dialog) => any): this; + on(event: 'dialog', listener: (dialog: Dialog) => any): this; + + /** + * The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event + * will also fire for popup pages. See also + * [page.on('popup')](https://playwright.dev/docs/api/class-page#page-event-popup) to receive events about popups + * relevant to a specific page. + * + * The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a + * popup with `window.open('http://example.com')`, this event will fire when the network request to + * "http://example.com" is done and its response has started loading in the popup. If you would like to route/listen + * to this network request, use + * [browserContext.route(url, handler[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-route) + * and + * [browserContext.on('request')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-request) + * respectively instead of similar methods on the {@link Page}. + * + * ```js + * const newPagePromise = context.waitForEvent('page'); + * await page.getByText('open new page').click(); + * const newPage = await newPagePromise; + * console.log(await newPage.evaluate('location.href')); + * ``` + * + * **NOTE** Use + * [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to + * wait until the page gets to a particular state (you should not need it in most cases). + */ + on(event: 'page', listener: (page: Page) => any): this; + + /** + * Emitted when a request is issued from any pages created through this context. The [request] object is read-only. To + * only listen for requests from a particular page, use + * [page.on('request')](https://playwright.dev/docs/api/class-page#page-event-request). + * + * In order to intercept and mutate requests, see + * [browserContext.route(url, handler[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-route) + * or [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route). + */ + on(event: 'request', listener: (request: Request) => any): this; + + /** + * Emitted when a request fails, for example by timing out. To only listen for failed requests from a particular page, + * use [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed). + * + * **NOTE** HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request + * will complete with + * [browserContext.on('requestfinished')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-request-finished) + * event and not with + * [browserContext.on('requestfailed')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-request-failed). + */ + on(event: 'requestfailed', listener: (request: Request) => any): this; + + /** + * Emitted when a request finishes successfully after downloading the response body. For a successful response, the + * sequence of events is `request`, `response` and `requestfinished`. To listen for successful requests from a + * particular page, use + * [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished). + */ + on(event: 'requestfinished', listener: (request: Request) => any): this; + + /** + * Emitted when [response] status and headers are received for a request. For a successful response, the sequence of + * events is `request`, `response` and `requestfinished`. To listen for response events from a particular page, use + * [page.on('response')](https://playwright.dev/docs/api/class-page#page-event-response). + */ + on(event: 'response', listener: (response: Response) => any): this; + + /** + * **NOTE** Service workers are only supported on Chromium-based browsers. + * + * Emitted when new service worker is created in the context. + */ + on(event: 'serviceworker', listener: (worker: Worker) => any): this; + + /** + * Emitted when exception is unhandled in any of the pages in this context. To listen for errors from a particular + * page, use [page.on('pageerror')](https://playwright.dev/docs/api/class-page#page-event-page-error) instead. + */ + on(event: 'weberror', listener: (webError: WebError) => any): this; + + /** + * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. + */ + once(event: 'backgroundpage', listener: (page: Page) => any): this; + + /** + * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. + */ + once(event: 'close', listener: (browserContext: BrowserContext) => any): this; + + /** + * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. + */ + once(event: 'console', listener: (consoleMessage: ConsoleMessage) => any): this; + + /** + * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. + */ + once(event: 'dialog', listener: (dialog: Dialog) => any): this; + + /** + * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. + */ + once(event: 'page', listener: (page: Page) => any): this; + + /** + * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. + */ + once(event: 'request', listener: (request: Request) => any): this; + + /** + * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. + */ + once(event: 'requestfailed', listener: (request: Request) => any): this; + + /** + * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. + */ + once(event: 'requestfinished', listener: (request: Request) => any): this; + + /** + * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. + */ + once(event: 'response', listener: (response: Response) => any): this; + + /** + * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. + */ + once(event: 'serviceworker', listener: (worker: Worker) => any): this; + + /** + * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. + */ + once(event: 'weberror', listener: (webError: WebError) => any): this; + + /** + * **NOTE** Only works with Chromium browser's persistent context. + * + * Emitted when new background page is created in the context. + * + * ```js + * const backgroundPage = await context.waitForEvent('backgroundpage'); + * ``` + * + */ + addListener(event: 'backgroundpage', listener: (page: Page) => any): this; + + /** + * Emitted when Browser context gets closed. This might happen because of one of the following: + * - Browser context is closed. + * - Browser application is closed or crashed. + * - The [browser.close([options])](https://playwright.dev/docs/api/class-browser#browser-close) method was called. + */ + addListener(event: 'close', listener: (browserContext: BrowserContext) => any): this; + + /** + * Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`. + * + * The arguments passed into `console.log` and the page are available on the {@link ConsoleMessage} event handler + * argument. + * + * **Usage** + * + * ```js + * context.on('console', async msg => { + * const values = []; + * for (const arg of msg.args()) + * values.push(await arg.jsonValue()); + * console.log(...values); + * }); + * await page.evaluate(() => console.log('hello', 5, { foo: 'bar' })); + * ``` + * + */ + addListener(event: 'console', listener: (consoleMessage: ConsoleMessage) => any): this; + + /** + * Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Listener **must** + * either [dialog.accept([promptText])](https://playwright.dev/docs/api/class-dialog#dialog-accept) or + * [dialog.dismiss()](https://playwright.dev/docs/api/class-dialog#dialog-dismiss) the dialog - otherwise the page + * will [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the + * dialog, and actions like click will never finish. + * + * **Usage** + * + * ```js + * context.on('dialog', dialog => { + * dialog.accept(); + * }); + * ``` + * + * **NOTE** When no [page.on('dialog')](https://playwright.dev/docs/api/class-page#page-event-dialog) or + * [browserContext.on('dialog')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-dialog) + * listeners are present, all dialogs are automatically dismissed. + */ + addListener(event: 'dialog', listener: (dialog: Dialog) => any): this; /** * The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event @@ -29808,9 +30306,7 @@ export interface BrowserContext { * await browserContext.addCookies([cookieObject1, cookieObject2]); * ``` * - * @param cookies Adds cookies to the browser context. - * - * For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com". + * @param cookies */ addCookies(cookies: ReadonlyArray<{ name: string; @@ -29818,17 +30314,18 @@ export interface BrowserContext { value: string; /** - * either url or domain / path are required. Optional. + * Either url or domain / path are required. Optional. */ url?: string; /** - * either url or domain / path are required Optional. + * For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com". Either url + * or domain / path are required. Optional. */ domain?: string; /** - * either url or domain / path are required Optional. + * Either url or domain / path are required Optional. */ path?: string; @@ -30465,283 +30962,961 @@ export interface BrowserContext { } /** - * The Worker class represents a [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API). - * `worker` event is emitted on the page object to signal a worker creation. `close` event is emitted on the worker - * object when the worker is gone. + * A Browser is created via + * [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch). An example + * of using a {@link Browser} to create a {@link Page}: * * ```js - * page.on('worker', worker => { - * console.log('Worker created: ' + worker.url()); - * worker.on('close', worker => console.log('Worker destroyed: ' + worker.url())); - * }); + * const { firefox } = require('playwright'); // Or 'chromium' or 'webkit'. * - * console.log('Current workers:'); - * for (const worker of page.workers()) - * console.log(' ' + worker.url()); + * (async () => { + * const browser = await firefox.launch(); + * const page = await browser.newPage(); + * await page.goto('https://example.com'); + * await browser.close(); + * })(); * ``` * */ -export interface Worker { - /** - * Returns the return value of `pageFunction`. - * - * If the function passed to the - * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) returns a - * [Promise], then - * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) would wait for - * the promise to resolve and return its value. - * - * If the function passed to the - * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) returns a - * non-[Serializable] value, then - * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) returns - * `undefined`. Playwright also supports transferring some additional values that are not serializable by `JSON`: - * `-0`, `NaN`, `Infinity`, `-Infinity`. - * @param pageFunction Function to be evaluated in the worker context. - * @param arg Optional argument to pass to `pageFunction`. - */ - evaluate(pageFunction: PageFunction, arg: Arg): Promise; - /** - * Returns the return value of `pageFunction`. - * - * If the function passed to the - * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) returns a - * [Promise], then - * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) would wait for - * the promise to resolve and return its value. - * - * If the function passed to the - * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) returns a - * non-[Serializable] value, then - * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) returns - * `undefined`. Playwright also supports transferring some additional values that are not serializable by `JSON`: - * `-0`, `NaN`, `Infinity`, `-Infinity`. - * @param pageFunction Function to be evaluated in the worker context. - * @param arg Optional argument to pass to `pageFunction`. - */ - evaluate(pageFunction: PageFunction, arg?: any): Promise; - +export interface Browser { /** - * Returns the return value of `pageFunction` as a {@link JSHandle}. - * - * The only difference between - * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) and - * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle) - * is that - * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle) - * returns {@link JSHandle}. - * - * If the function passed to the - * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle) - * returns a [Promise], then - * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle) - * would wait for the promise to resolve and return its value. - * @param pageFunction Function to be evaluated in the worker context. - * @param arg Optional argument to pass to `pageFunction`. + * Removes all the listeners of the given type (or all registered listeners if no type given). Allows to wait for + * async listeners to complete or to ignore subsequent errors from these listeners. + * @param type + * @param options */ - evaluateHandle(pageFunction: PageFunction, arg: Arg): Promise>; + removeAllListeners(type?: string): this; /** - * Returns the return value of `pageFunction` as a {@link JSHandle}. - * - * The only difference between - * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) and - * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle) - * is that - * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle) - * returns {@link JSHandle}. - * - * If the function passed to the - * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle) - * returns a [Promise], then - * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle) - * would wait for the promise to resolve and return its value. - * @param pageFunction Function to be evaluated in the worker context. - * @param arg Optional argument to pass to `pageFunction`. + * Removes all the listeners of the given type (or all registered listeners if no type given). Allows to wait for + * async listeners to complete or to ignore subsequent errors from these listeners. + * @param type + * @param options */ - evaluateHandle(pageFunction: PageFunction, arg?: any): Promise>; + removeAllListeners(type: string | undefined, options: { + /** + * Specifies whether to wait for already running listeners and what to do if they throw errors: + * - `'default'` - do not wait for current listener calls (if any) to finish, if the listener throws, it may result in unhandled error + * - `'wait'` - wait for current listener calls (if any) to finish + * - `'ignoreErrors'` - do not wait for current listener calls (if any) to finish, all errors thrown by the listeners after removal are silently caught + */ + behavior?: 'wait'|'ignoreErrors'|'default' + }): Promise; /** - * Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is - * terminated. + * Emitted when Browser gets disconnected from the browser application. This might happen because of one of the + * following: + * - Browser application is closed or crashed. + * - The [browser.close([options])](https://playwright.dev/docs/api/class-browser#browser-close) method was called. */ - on(event: 'close', listener: (worker: Worker) => any): this; + on(event: 'disconnected', listener: (browser: Browser) => any): this; /** * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. */ - once(event: 'close', listener: (worker: Worker) => any): this; + once(event: 'disconnected', listener: (browser: Browser) => any): this; /** - * Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is - * terminated. + * Emitted when Browser gets disconnected from the browser application. This might happen because of one of the + * following: + * - Browser application is closed or crashed. + * - The [browser.close([options])](https://playwright.dev/docs/api/class-browser#browser-close) method was called. */ - addListener(event: 'close', listener: (worker: Worker) => any): this; + addListener(event: 'disconnected', listener: (browser: Browser) => any): this; /** * Removes an event listener added by `on` or `addListener`. */ - removeListener(event: 'close', listener: (worker: Worker) => any): this; + removeListener(event: 'disconnected', listener: (browser: Browser) => any): this; /** * Removes an event listener added by `on` or `addListener`. */ - off(event: 'close', listener: (worker: Worker) => any): this; + off(event: 'disconnected', listener: (browser: Browser) => any): this; /** - * Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is - * terminated. + * Emitted when Browser gets disconnected from the browser application. This might happen because of one of the + * following: + * - Browser application is closed or crashed. + * - The [browser.close([options])](https://playwright.dev/docs/api/class-browser#browser-close) method was called. */ - prependListener(event: 'close', listener: (worker: Worker) => any): this; + prependListener(event: 'disconnected', listener: (browser: Browser) => any): this; - url(): string; -} + /** + * Get the browser type (chromium, firefox or webkit) that the browser belongs to. + */ + browserType(): BrowserType; -/** - * JSHandle represents an in-page JavaScript object. JSHandles can be created with the - * [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) method. - * - * ```js - * const windowHandle = await page.evaluateHandle(() => window); - * // ... - * ``` - * - * JSHandle prevents the referenced JavaScript object being garbage collected unless the handle is exposed with - * [jsHandle.dispose()](https://playwright.dev/docs/api/class-jshandle#js-handle-dispose). JSHandles are auto-disposed - * when their origin frame gets navigated or the parent context gets destroyed. - * - * JSHandle instances can be used as an argument in - * [page.$eval(selector, pageFunction[, arg, options])](https://playwright.dev/docs/api/class-page#page-eval-on-selector), - * [page.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate) and - * [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) - * methods. - */ -export interface JSHandle { /** - * Returns the return value of `pageFunction`. - * - * This method passes this handle as the first argument to `pageFunction`. - * - * If `pageFunction` returns a [Promise], then `handle.evaluate` would wait for the promise to resolve and return its - * value. + * In case this browser is obtained using + * [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch), closes the + * browser and all of its pages (if any were opened). * - * **Usage** + * In case this browser is connected to, clears all created contexts belonging to this browser and disconnects from + * the browser server. * - * ```js - * const tweetHandle = await page.$('.tweet .retweets'); - * expect(await tweetHandle.evaluate(node => node.innerText)).toBe('10 retweets'); - * ``` + * **NOTE** This is similar to force quitting the browser. Therefore, you should call + * [browserContext.close([options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) on + * any {@link BrowserContext}'s you explicitly created earlier with + * [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context) **before** + * calling [browser.close([options])](https://playwright.dev/docs/api/class-browser#browser-close). * - * @param pageFunction Function to be evaluated in the page context. - * @param arg Optional argument to pass to `pageFunction`. + * The {@link Browser} object itself is considered to be disposed and cannot be used anymore. + * @param options */ - evaluate(pageFunction: PageFunctionOn, arg: Arg): Promise; + close(options?: { + /** + * The reason to be reported to the operations interrupted by the browser closure. + */ + reason?: string; + }): Promise; + /** - * Returns the return value of `pageFunction`. - * - * This method passes this handle as the first argument to `pageFunction`. - * - * If `pageFunction` returns a [Promise], then `handle.evaluate` would wait for the promise to resolve and return its - * value. + * Returns an array of all open browser contexts. In a newly created browser, this will return zero browser contexts. * * **Usage** * * ```js - * const tweetHandle = await page.$('.tweet .retweets'); - * expect(await tweetHandle.evaluate(node => node.innerText)).toBe('10 retweets'); + * const browser = await pw.webkit.launch(); + * console.log(browser.contexts().length); // prints `0` + * + * const context = await browser.newContext(); + * console.log(browser.contexts().length); // prints `1` * ``` * - * @param pageFunction Function to be evaluated in the page context. - * @param arg Optional argument to pass to `pageFunction`. */ - evaluate(pageFunction: PageFunctionOn, arg?: any): Promise; + contexts(): Array; /** - * Returns the return value of `pageFunction` as a {@link JSHandle}. - * - * This method passes this handle as the first argument to `pageFunction`. - * - * The only difference between `jsHandle.evaluate` and `jsHandle.evaluateHandle` is that `jsHandle.evaluateHandle` - * returns {@link JSHandle}. - * - * If the function passed to the `jsHandle.evaluateHandle` returns a [Promise], then `jsHandle.evaluateHandle` would - * wait for the promise to resolve and return its value. - * - * See [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) for - * more details. - * @param pageFunction Function to be evaluated in the page context. - * @param arg Optional argument to pass to `pageFunction`. - */ - evaluateHandle(pageFunction: PageFunctionOn, arg: Arg): Promise>; - /** - * Returns the return value of `pageFunction` as a {@link JSHandle}. - * - * This method passes this handle as the first argument to `pageFunction`. - * - * The only difference between `jsHandle.evaluate` and `jsHandle.evaluateHandle` is that `jsHandle.evaluateHandle` - * returns {@link JSHandle}. - * - * If the function passed to the `jsHandle.evaluateHandle` returns a [Promise], then `jsHandle.evaluateHandle` would - * wait for the promise to resolve and return its value. - * - * See [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) for - * more details. - * @param pageFunction Function to be evaluated in the page context. - * @param arg Optional argument to pass to `pageFunction`. + * Indicates that the browser is connected. */ - evaluateHandle(pageFunction: PageFunctionOn, arg?: any): Promise>; + isConnected(): boolean; /** - * Returns a JSON representation of the object. If the object has a `toJSON` function, it **will not be called**. + * **NOTE** CDP Sessions are only supported on Chromium-based browsers. * - * **NOTE** The method will return an empty JSON object if the referenced object is not stringifiable. It will throw - * an error if the object has circular references. - */ - jsonValue(): Promise; - /** - * Returns either `null` or the object handle itself, if the object handle is an instance of {@link ElementHandle}. - */ - asElement(): T extends Node ? ElementHandle : null; - /** - * The `jsHandle.dispose` method stops referencing the element handle. + * Returns the newly created browser session. */ - dispose(): Promise; + newBrowserCDPSession(): Promise; /** - * The method returns a map with **own property names** as keys and JSHandle instances for the property values. + * Creates a new browser context. It won't share cookies/cache with other browser contexts. + * + * **NOTE** If directly using this method to create {@link BrowserContext}s, it is best practice to explicitly close + * the returned context via + * [browserContext.close([options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) when + * your code is done with the {@link BrowserContext}, and before calling + * [browser.close([options])](https://playwright.dev/docs/api/class-browser#browser-close). This will ensure the + * `context` is closed gracefully and any artifacts—like HARs and videos—are fully flushed and saved. * * **Usage** * * ```js - * const handle = await page.evaluateHandle(() => ({ window, document })); - * const properties = await handle.getProperties(); - * const windowHandle = properties.get('window'); - * const documentHandle = properties.get('document'); - * await handle.dispose(); + * (async () => { + * const browser = await playwright.firefox.launch(); // Or 'chromium' or 'webkit'. + * // Create a new incognito browser context. + * const context = await browser.newContext(); + * // Create a new page in a pristine context. + * const page = await context.newPage(); + * await page.goto('https://example.com'); + * + * // Gracefully close up everything + * await context.close(); + * await browser.close(); + * })(); * ``` * + * @param options */ - getProperties(): Promise>; + newContext(options?: BrowserContextOptions): Promise; /** - * Fetches a single property from the referenced object. - * @param propertyName property to get + * Creates a new page in a new browser context. Closing this page will close the context as well. + * + * This is a convenience API that should only be used for the single-page scenarios and short snippets. Production + * code and testing frameworks should explicitly create + * [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context) followed by the + * [browserContext.newPage()](https://playwright.dev/docs/api/class-browsercontext#browser-context-new-page) to + * control their exact life times. + * @param options */ - getProperty(propertyName: string): Promise; - - [Symbol.asyncDispose](): Promise; -} + newPage(options?: { + /** + * Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted. + */ + acceptDownloads?: boolean; -/** - * - extends: {@link JSHandle} - * - * ElementHandle represents an in-page DOM element. ElementHandles can be created with the - * [page.$(selector[, options])](https://playwright.dev/docs/api/class-page#page-query-selector) method. - * - * **NOTE** The use of ElementHandle is discouraged, use {@link Locator} objects and web-first assertions instead. - * - * ```js - * const hrefElement = await page.$('a'); - * await hrefElement.click(); - * ``` + /** + * When using [page.goto(url[, options])](https://playwright.dev/docs/api/class-page#page-goto), + * [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route), + * [page.waitForURL(url[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-url), + * [page.waitForRequest(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-request), + * or + * [page.waitForResponse(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-response) + * it takes the base URL in consideration by using the + * [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. + * Unset by default. Examples: + * - baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html` + * - baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in + * `http://localhost:3000/foo/bar.html` + * - baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in + * `http://localhost:3000/bar.html` + */ + baseURL?: string; + + /** + * Toggles bypassing page's Content-Security-Policy. Defaults to `false`. + */ + bypassCSP?: boolean; + + /** + * TLS Client Authentication allows the server to request a client certificate and verify it. + * + * **Details** + * + * An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, + * a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, + * `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided + * with an exact match to the request origin that the certificate is valid for. + * + * **NOTE** Using Client Certificates in combination with Proxy Servers is not supported. + * + * **NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it + * work by replacing `localhost` with `local.playwright`. + */ + clientCertificates?: Array<{ + /** + * Exact origin that the certificate is valid for. Origin includes `https` protocol, a hostname and optionally a port. + */ + origin: string; + + /** + * Path to the file with the certificate in PEM format. + */ + certPath?: string; + + /** + * Direct value of the certificate in PEM format. + */ + cert?: Buffer; + + /** + * Path to the file with the private key in PEM format. + */ + keyPath?: string; + + /** + * Direct value of the private key in PEM format. + */ + key?: Buffer; + + /** + * Path to the PFX or PKCS12 encoded private key and certificate chain. + */ + pfxPath?: string; + + /** + * Direct value of the PFX or PKCS12 encoded private key and certificate chain. + */ + pfx?: Buffer; + + /** + * Passphrase for the private key (PEM or PFX). + */ + passphrase?: string; + }>; + + /** + * Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See + * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. + * Passing `null` resets emulation to system defaults. Defaults to `'light'`. + */ + colorScheme?: null|"light"|"dark"|"no-preference"; + + /** + * Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about + * [emulating devices with device scale factor](https://playwright.dev/docs/emulation#devices). + */ + deviceScaleFactor?: number; + + /** + * An object containing additional HTTP headers to be sent with every request. Defaults to none. + */ + extraHTTPHeaders?: { [key: string]: string; }; + + /** + * Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See + * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. + * Passing `null` resets emulation to system defaults. Defaults to `'none'`. + */ + forcedColors?: null|"active"|"none"; + + geolocation?: { + /** + * Latitude between -90 and 90. + */ + latitude: number; + + /** + * Longitude between -180 and 180. + */ + longitude: number; + + /** + * Non-negative accuracy value. Defaults to `0`. + */ + accuracy?: number; + }; + + /** + * Specifies if viewport supports touch events. Defaults to false. Learn more about + * [mobile emulation](https://playwright.dev/docs/emulation#devices). + */ + hasTouch?: boolean; + + /** + * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no + * origin is specified, the username and password are sent to any servers upon unauthorized responses. + */ + httpCredentials?: { + username: string; + + password: string; + + /** + * Restrain sending http credentials on specific origin (scheme://host:port). + */ + origin?: string; + + /** + * This option only applies to the requests sent from corresponding {@link APIRequestContext} and does not affect + * requests sent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be + * sent with the each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response + * with `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. + */ + send?: "unauthorized"|"always"; + }; + + /** + * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`. + */ + ignoreHTTPSErrors?: boolean; + + /** + * Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device, + * so you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more + * about [mobile emulation](https://playwright.dev/docs/emulation#ismobile). + */ + isMobile?: boolean; + + /** + * Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about + * [disabling JavaScript](https://playwright.dev/docs/emulation#javascript-enabled). + */ + javaScriptEnabled?: boolean; + + /** + * Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, + * `Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default + * locale. Learn more about emulation in our [emulation guide](https://playwright.dev/docs/emulation#locale--timezone). + */ + locale?: string; + + /** + * Logger sink for Playwright logging. + */ + logger?: Logger; + + /** + * Whether to emulate network being offline. Defaults to `false`. Learn more about + * [network emulation](https://playwright.dev/docs/emulation#offline). + */ + offline?: boolean; + + /** + * A list of permissions to grant to all pages in this context. See + * [browserContext.grantPermissions(permissions[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-grant-permissions) + * for more details. Defaults to none. + */ + permissions?: Array; + + /** + * Network proxy settings to use with this context. Defaults to none. + */ + proxy?: { + /** + * Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or + * `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy. + */ + server: string; + + /** + * Optional comma-separated domains to bypass proxy, for example `".com, chromium.org, .domain.com"`. + */ + bypass?: string; + + /** + * Optional username to use if HTTP proxy requires authentication. + */ + username?: string; + + /** + * Optional password to use if HTTP proxy requires authentication. + */ + password?: string; + }; + + /** + * Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. + * If not specified, the HAR is not recorded. Make sure to await + * [browserContext.close([options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for + * the HAR to be saved. + */ + recordHar?: { + /** + * Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use + * `content` policy instead. + */ + omitContent?: boolean; + + /** + * Optional setting to control resource content management. If `omit` is specified, content is not persisted. If + * `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is + * specified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output + * files and to `embed` for all other file extensions. + */ + content?: "omit"|"embed"|"attach"; + + /** + * Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by + * default. + */ + path: string; + + /** + * When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, + * cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`. + */ + mode?: "full"|"minimal"; + + /** + * A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was + * provided and the passed URL is a path, it gets merged via the + * [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none. + */ + urlFilter?: string|RegExp; + }; + + /** + * Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. + * Make sure to await + * [browserContext.close([options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for + * videos to be saved. + */ + recordVideo?: { + /** + * Path to the directory to put videos into. + */ + dir: string; + + /** + * Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to + * fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of + * each page will be scaled down if necessary to fit the specified size. + */ + size?: { + /** + * Video frame width. + */ + width: number; + + /** + * Video frame height. + */ + height: number; + }; + }; + + /** + * Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See + * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. + * Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`. + */ + reducedMotion?: null|"reduce"|"no-preference"; + + /** + * Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the + * `viewport` is set. + */ + screen?: { + /** + * page width in pixels. + */ + width: number; + + /** + * page height in pixels. + */ + height: number; + }; + + /** + * Whether to allow sites to register Service workers. Defaults to `'allow'`. + * - `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be + * registered. + * - `'block'`: Playwright will block all registration of Service Workers. + */ + serviceWorkers?: "allow"|"block"; + + /** + * Learn more about [storage state and auth](https://playwright.dev/docs/auth). + * + * Populates context with given storage state. This option can be used to initialize context with logged-in + * information obtained via + * [browserContext.storageState([options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-storage-state). + */ + storageState?: string|{ + /** + * Cookies to set for context + */ + cookies: Array<{ + name: string; + + value: string; + + /** + * Domain and path are required. For the cookie to apply to all subdomains as well, prefix domain with a dot, like + * this: ".example.com" + */ + domain: string; + + /** + * Domain and path are required + */ + path: string; + + /** + * Unix time in seconds. + */ + expires: number; + + httpOnly: boolean; + + secure: boolean; + + /** + * sameSite flag + */ + sameSite: "Strict"|"Lax"|"None"; + }>; + + /** + * localStorage to set for context + */ + origins: Array<{ + origin: string; + + localStorage: Array<{ + name: string; + + value: string; + }>; + }>; + }; + + /** + * If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on + * selectors that imply single target DOM element will throw when more than one element matches the selector. This + * option does not affect any Locator APIs (Locators are always strict). Defaults to `false`. See {@link Locator} to + * learn more about the strict mode. + */ + strictSelectors?: boolean; + + /** + * Changes the timezone of the context. See + * [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1) + * for a list of supported timezone IDs. Defaults to the system timezone. + */ + timezoneId?: string; + + /** + * Specific user agent to use in this context. + */ + userAgent?: string; + + /** + * @deprecated Use `recordVideo` instead. + */ + videoSize?: { + /** + * Video frame width. + */ + width: number; + + /** + * Video frame height. + */ + height: number; + }; + + /** + * @deprecated Use `recordVideo` instead. + */ + videosPath?: string; + + /** + * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `null` to disable the consistent + * viewport emulation. Learn more about [viewport emulation](https://playwright.dev/docs/emulation#viewport). + * + * **NOTE** The `null` value opts out from the default presets, makes viewport depend on the host window size defined + * by the operating system. It makes the execution of the tests non-deterministic. + */ + viewport?: null|{ + /** + * page width in pixels. + */ + width: number; + + /** + * page height in pixels. + */ + height: number; + }; + }): Promise; + + /** + * **NOTE** This API controls + * [Chromium Tracing](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) which is a low-level + * chromium-specific debugging tool. API to control [Playwright Tracing](https://playwright.dev/docs/trace-viewer) could be found + * [here](https://playwright.dev/docs/api/class-tracing). + * + * You can use + * [browser.startTracing([page, options])](https://playwright.dev/docs/api/class-browser#browser-start-tracing) and + * [browser.stopTracing()](https://playwright.dev/docs/api/class-browser#browser-stop-tracing) to create a trace file + * that can be opened in Chrome DevTools performance panel. + * + * **Usage** + * + * ```js + * await browser.startTracing(page, { path: 'trace.json' }); + * await page.goto('https://www.google.com'); + * await browser.stopTracing(); + * ``` + * + * @param page Optional, if specified, tracing includes screenshots of the given page. + * @param options + */ + startTracing(page?: Page, options?: { + /** + * specify custom categories to use instead of default. + */ + categories?: Array; + + /** + * A path to write the trace file to. + */ + path?: string; + + /** + * captures screenshots in the trace. + */ + screenshots?: boolean; + }): Promise; + + /** + * **NOTE** This API controls + * [Chromium Tracing](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) which is a low-level + * chromium-specific debugging tool. API to control [Playwright Tracing](https://playwright.dev/docs/trace-viewer) could be found + * [here](https://playwright.dev/docs/api/class-tracing). + * + * Returns the buffer with trace data. + */ + stopTracing(): Promise; + + /** + * Returns the browser version. + */ + version(): string; + + [Symbol.asyncDispose](): Promise; +} + +/** + * The Worker class represents a [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API). + * `worker` event is emitted on the page object to signal a worker creation. `close` event is emitted on the worker + * object when the worker is gone. + * + * ```js + * page.on('worker', worker => { + * console.log('Worker created: ' + worker.url()); + * worker.on('close', worker => console.log('Worker destroyed: ' + worker.url())); + * }); + * + * console.log('Current workers:'); + * for (const worker of page.workers()) + * console.log(' ' + worker.url()); + * ``` + * + */ +export interface Worker { + /** + * Returns the return value of `pageFunction`. + * + * If the function passed to the + * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) returns a + * [Promise], then + * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) would wait for + * the promise to resolve and return its value. + * + * If the function passed to the + * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) returns a + * non-[Serializable] value, then + * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) returns + * `undefined`. Playwright also supports transferring some additional values that are not serializable by `JSON`: + * `-0`, `NaN`, `Infinity`, `-Infinity`. + * @param pageFunction Function to be evaluated in the worker context. + * @param arg Optional argument to pass to `pageFunction`. + */ + evaluate(pageFunction: PageFunction, arg: Arg): Promise; + /** + * Returns the return value of `pageFunction`. + * + * If the function passed to the + * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) returns a + * [Promise], then + * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) would wait for + * the promise to resolve and return its value. + * + * If the function passed to the + * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) returns a + * non-[Serializable] value, then + * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) returns + * `undefined`. Playwright also supports transferring some additional values that are not serializable by `JSON`: + * `-0`, `NaN`, `Infinity`, `-Infinity`. + * @param pageFunction Function to be evaluated in the worker context. + * @param arg Optional argument to pass to `pageFunction`. + */ + evaluate(pageFunction: PageFunction, arg?: any): Promise; + + /** + * Returns the return value of `pageFunction` as a {@link JSHandle}. + * + * The only difference between + * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) and + * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle) + * is that + * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle) + * returns {@link JSHandle}. + * + * If the function passed to the + * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle) + * returns a [Promise], then + * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle) + * would wait for the promise to resolve and return its value. + * @param pageFunction Function to be evaluated in the worker context. + * @param arg Optional argument to pass to `pageFunction`. + */ + evaluateHandle(pageFunction: PageFunction, arg: Arg): Promise>; + /** + * Returns the return value of `pageFunction` as a {@link JSHandle}. + * + * The only difference between + * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) and + * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle) + * is that + * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle) + * returns {@link JSHandle}. + * + * If the function passed to the + * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle) + * returns a [Promise], then + * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle) + * would wait for the promise to resolve and return its value. + * @param pageFunction Function to be evaluated in the worker context. + * @param arg Optional argument to pass to `pageFunction`. + */ + evaluateHandle(pageFunction: PageFunction, arg?: any): Promise>; + /** + * Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is + * terminated. + */ + on(event: 'close', listener: (worker: Worker) => any): this; + + /** + * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. + */ + once(event: 'close', listener: (worker: Worker) => any): this; + + /** + * Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is + * terminated. + */ + addListener(event: 'close', listener: (worker: Worker) => any): this; + + /** + * Removes an event listener added by `on` or `addListener`. + */ + removeListener(event: 'close', listener: (worker: Worker) => any): this; + + /** + * Removes an event listener added by `on` or `addListener`. + */ + off(event: 'close', listener: (worker: Worker) => any): this; + + /** + * Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is + * terminated. + */ + prependListener(event: 'close', listener: (worker: Worker) => any): this; + + url(): string; +} + +/** + * JSHandle represents an in-page JavaScript object. JSHandles can be created with the + * [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) method. + * + * ```js + * const windowHandle = await page.evaluateHandle(() => window); + * // ... + * ``` + * + * JSHandle prevents the referenced JavaScript object being garbage collected unless the handle is exposed with + * [jsHandle.dispose()](https://playwright.dev/docs/api/class-jshandle#js-handle-dispose). JSHandles are auto-disposed + * when their origin frame gets navigated or the parent context gets destroyed. + * + * JSHandle instances can be used as an argument in + * [page.$eval(selector, pageFunction[, arg, options])](https://playwright.dev/docs/api/class-page#page-eval-on-selector), + * [page.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate) and + * [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) + * methods. + */ +export interface JSHandle { + /** + * Returns the return value of `pageFunction`. + * + * This method passes this handle as the first argument to `pageFunction`. + * + * If `pageFunction` returns a [Promise], then `handle.evaluate` would wait for the promise to resolve and return its + * value. + * + * **Usage** + * + * ```js + * const tweetHandle = await page.$('.tweet .retweets'); + * expect(await tweetHandle.evaluate(node => node.innerText)).toBe('10 retweets'); + * ``` + * + * @param pageFunction Function to be evaluated in the page context. + * @param arg Optional argument to pass to `pageFunction`. + */ + evaluate(pageFunction: PageFunctionOn, arg: Arg): Promise; + /** + * Returns the return value of `pageFunction`. + * + * This method passes this handle as the first argument to `pageFunction`. + * + * If `pageFunction` returns a [Promise], then `handle.evaluate` would wait for the promise to resolve and return its + * value. + * + * **Usage** + * + * ```js + * const tweetHandle = await page.$('.tweet .retweets'); + * expect(await tweetHandle.evaluate(node => node.innerText)).toBe('10 retweets'); + * ``` + * + * @param pageFunction Function to be evaluated in the page context. + * @param arg Optional argument to pass to `pageFunction`. + */ + evaluate(pageFunction: PageFunctionOn, arg?: any): Promise; + + /** + * Returns the return value of `pageFunction` as a {@link JSHandle}. + * + * This method passes this handle as the first argument to `pageFunction`. + * + * The only difference between `jsHandle.evaluate` and `jsHandle.evaluateHandle` is that `jsHandle.evaluateHandle` + * returns {@link JSHandle}. + * + * If the function passed to the `jsHandle.evaluateHandle` returns a [Promise], then `jsHandle.evaluateHandle` would + * wait for the promise to resolve and return its value. + * + * See [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) for + * more details. + * @param pageFunction Function to be evaluated in the page context. + * @param arg Optional argument to pass to `pageFunction`. + */ + evaluateHandle(pageFunction: PageFunctionOn, arg: Arg): Promise>; + /** + * Returns the return value of `pageFunction` as a {@link JSHandle}. + * + * This method passes this handle as the first argument to `pageFunction`. + * + * The only difference between `jsHandle.evaluate` and `jsHandle.evaluateHandle` is that `jsHandle.evaluateHandle` + * returns {@link JSHandle}. + * + * If the function passed to the `jsHandle.evaluateHandle` returns a [Promise], then `jsHandle.evaluateHandle` would + * wait for the promise to resolve and return its value. + * + * See [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) for + * more details. + * @param pageFunction Function to be evaluated in the page context. + * @param arg Optional argument to pass to `pageFunction`. + */ + evaluateHandle(pageFunction: PageFunctionOn, arg?: any): Promise>; + + /** + * Returns a JSON representation of the object. If the object has a `toJSON` function, it **will not be called**. + * + * **NOTE** The method will return an empty JSON object if the referenced object is not stringifiable. It will throw + * an error if the object has circular references. + */ + jsonValue(): Promise; + /** + * Returns either `null` or the object handle itself, if the object handle is an instance of {@link ElementHandle}. + */ + asElement(): T extends Node ? ElementHandle : null; + /** + * The `jsHandle.dispose` method stops referencing the element handle. + */ + dispose(): Promise; + + /** + * The method returns a map with **own property names** as keys and JSHandle instances for the property values. + * + * **Usage** + * + * ```js + * const handle = await page.evaluateHandle(() => ({ window, document })); + * const properties = await handle.getProperties(); + * const windowHandle = properties.get('window'); + * const documentHandle = properties.get('document'); + * await handle.dispose(); + * ``` + * + */ + getProperties(): Promise>; + + /** + * Fetches a single property from the referenced object. + * @param propertyName property to get + */ + getProperty(propertyName: string): Promise; + + [Symbol.asyncDispose](): Promise; +} + +/** + * - extends: {@link JSHandle} + * + * ElementHandle represents an in-page DOM element. ElementHandles can be created with the + * [page.$(selector[, options])](https://playwright.dev/docs/api/class-page#page-query-selector) method. + * + * **NOTE** The use of ElementHandle is discouraged, use {@link Locator} objects and web-first assertions instead. + * + * ```js + * const hrefElement = await page.$('a'); + * await hrefElement.click(); + * ``` * * ElementHandle prevents DOM element from garbage collection unless the handle is disposed with * [jsHandle.dispose()](https://playwright.dev/docs/api/class-jshandle#js-handle-dispose). ElementHandles are @@ -31236,7 +32411,6 @@ export interface ElementHandle extends JSHandle { * 1. Scroll the element into view if needed. * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the * element. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. * 1. Ensure that the element is now checked. If not, this method throws. * * If the element is detached from the DOM at any moment during the action, this method throws. @@ -31252,9 +32426,8 @@ export interface ElementHandle extends JSHandle { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -31332,6 +32505,7 @@ export interface ElementHandle extends JSHandle { * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as * navigating to inaccessible pages. Defaults to `false`. + * @deprecated This option will default to `true` in the future. */ noWaitAfter?: boolean; @@ -31374,8 +32548,6 @@ export interface ElementHandle extends JSHandle { * 1. Scroll the element into view if needed. * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to double click in the center of the * element, or the specified `position`. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if - * the first click of the `dblclick()` triggers a navigation event, this method will throw. * * If the element is detached from the DOM at any moment during the action, this method throws. * @@ -31409,9 +32581,8 @@ export interface ElementHandle extends JSHandle { modifiers?: Array<"Alt"|"Control"|"ControlOrMeta"|"Meta"|"Shift">; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -31507,9 +32678,8 @@ export interface ElementHandle extends JSHandle { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -31549,7 +32719,6 @@ export interface ElementHandle extends JSHandle { * 1. Scroll the element into view if needed. * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to hover over the center of the * element, or the specified `position`. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. * * If the element is detached from the DOM at any moment during the action, this method throws. * @@ -31571,9 +32740,8 @@ export interface ElementHandle extends JSHandle { modifiers?: Array<"Alt"|"Control"|"ControlOrMeta"|"Meta"|"Shift">; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -31735,6 +32903,7 @@ export interface ElementHandle extends JSHandle { * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as * navigating to inaccessible pages. Defaults to `false`. + * @deprecated This option will default to `true` in the future. */ noWaitAfter?: boolean; @@ -31935,9 +33104,8 @@ export interface ElementHandle extends JSHandle { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -31991,7 +33159,6 @@ export interface ElementHandle extends JSHandle { * 1. Scroll the element into view if needed. * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the * element. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. * 1. Ensure that the element is now checked or unchecked. If not, this method throws. * * When all steps combined have not finished during the specified `timeout`, this method throws a {@link @@ -32006,9 +33173,8 @@ export interface ElementHandle extends JSHandle { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -32085,9 +33251,8 @@ export interface ElementHandle extends JSHandle { buffer: Buffer; }>, options?: { /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -32109,7 +33274,6 @@ export interface ElementHandle extends JSHandle { * 1. Scroll the element into view if needed. * 1. Use [page.touchscreen](https://playwright.dev/docs/api/class-page#page-touchscreen) to tap the center of the * element, or the specified `position`. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. * * If the element is detached from the DOM at any moment during the action, this method throws. * @@ -32133,9 +33297,8 @@ export interface ElementHandle extends JSHandle { modifiers?: Array<"Alt"|"Control"|"ControlOrMeta"|"Meta"|"Shift">; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -32195,9 +33358,8 @@ export interface ElementHandle extends JSHandle { delay?: number; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -32221,7 +33383,6 @@ export interface ElementHandle extends JSHandle { * 1. Scroll the element into view if needed. * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the * element. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. * 1. Ensure that the element is now unchecked. If not, this method throws. * * If the element is detached from the DOM at any moment during the action, this method throws. @@ -32237,9 +33398,8 @@ export interface ElementHandle extends JSHandle { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -32619,7 +33779,6 @@ export interface Locator { * 1. Scroll the element into view if needed. * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the * element. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. * 1. Ensure that the element is now checked. If not, this method throws. * * If the element is detached from the DOM at any moment during the action, this method throws. @@ -32642,9 +33801,8 @@ export interface Locator { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -32701,9 +33859,8 @@ export interface Locator { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -32785,6 +33942,7 @@ export interface Locator { * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as * navigating to inaccessible pages. Defaults to `false`. + * @deprecated This option will default to `true` in the future. */ noWaitAfter?: boolean; @@ -32860,8 +34018,6 @@ export interface Locator { * 1. Scroll the element into view if needed. * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to double click in the center of the * element, or the specified `position`. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if - * the first click of the `dblclick()` triggers a navigation event, this method will throw. * * If the element is detached from the DOM at any moment during the action, this method throws. * @@ -32895,9 +34051,8 @@ export interface Locator { modifiers?: Array<"Alt"|"Control"|"ControlOrMeta"|"Meta"|"Shift">; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -33010,9 +34165,8 @@ export interface Locator { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -33090,9 +34244,8 @@ export interface Locator { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -33547,7 +34700,6 @@ export interface Locator { * 1. Scroll the element into view if needed. * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to hover over the center of the * element, or the specified `position`. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. * * If the element is detached from the DOM at any moment during the action, this method throws. * @@ -33569,9 +34721,8 @@ export interface Locator { modifiers?: Array<"Alt"|"Control"|"ControlOrMeta"|"Meta"|"Shift">; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -33956,6 +35107,7 @@ export interface Locator { * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as * navigating to inaccessible pages. Defaults to `false`. + * @deprecated This option will default to `true` in the future. */ noWaitAfter?: boolean; @@ -34004,9 +35156,8 @@ export interface Locator { delay?: number; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -34146,9 +35297,8 @@ export interface Locator { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -34204,7 +35354,6 @@ export interface Locator { * 1. Scroll the element into view if needed. * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the * element. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. * 1. Ensure that the element is now checked or unchecked. If not, this method throws. * * When all steps combined have not finished during the specified `timeout`, this method throws a {@link @@ -34219,9 +35368,8 @@ export interface Locator { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -34324,9 +35472,8 @@ export interface Locator { buffer: Buffer; }>, options?: { /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -34349,7 +35496,6 @@ export interface Locator { * 1. Scroll the element into view if needed. * 1. Use [page.touchscreen](https://playwright.dev/docs/api/class-page#page-touchscreen) to tap the center of the * element, or the specified `position`. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. * * If the element is detached from the DOM at any moment during the action, this method throws. * @@ -34373,9 +35519,8 @@ export interface Locator { modifiers?: Array<"Alt"|"Control"|"ControlOrMeta"|"Meta"|"Shift">; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -34444,9 +35589,8 @@ export interface Locator { delay?: number; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -34477,7 +35621,6 @@ export interface Locator { * 1. Scroll the element into view if needed. * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the * element. - * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. * 1. Ensure that the element is now unchecked. If not, this method throws. * * If the element is detached from the DOM at any moment during the action, this method throws. @@ -34493,9 +35636,8 @@ export interface Locator { force?: boolean; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -34744,6 +35886,63 @@ export interface BrowserType { */ chromiumSandbox?: boolean; + /** + * TLS Client Authentication allows the server to request a client certificate and verify it. + * + * **Details** + * + * An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, + * a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, + * `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided + * with an exact match to the request origin that the certificate is valid for. + * + * **NOTE** Using Client Certificates in combination with Proxy Servers is not supported. + * + * **NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it + * work by replacing `localhost` with `local.playwright`. + */ + clientCertificates?: Array<{ + /** + * Exact origin that the certificate is valid for. Origin includes `https` protocol, a hostname and optionally a port. + */ + origin: string; + + /** + * Path to the file with the certificate in PEM format. + */ + certPath?: string; + + /** + * Direct value of the certificate in PEM format. + */ + cert?: Buffer; + + /** + * Path to the file with the private key in PEM format. + */ + keyPath?: string; + + /** + * Direct value of the private key in PEM format. + */ + key?: Buffer; + + /** + * Path to the PFX or PKCS12 encoded private key and certificate chain. + */ + pfxPath?: string; + + /** + * Direct value of the PFX or PKCS12 encoded private key and certificate chain. + */ + pfx?: Buffer; + + /** + * Passphrase for the private key (PEM or PFX). + */ + passphrase?: string; + }>; + /** * Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. @@ -35301,8 +36500,6 @@ export interface BrowserType { } /** - * - extends: [EventEmitter] - * * The `CDPSession` instances are used to talk raw Chrome Devtools Protocol: * - protocol methods can be called with `session.send` method. * - protocol events can be subscribed to with `session.on` method. @@ -35875,6 +37072,7 @@ export type AndroidKey = 'Star' | 'Pound' | '*' | '#' | 'DialUp' | 'DialDown' | 'DialLeft' | 'DialRight' | 'DialCenter' | 'VolumeUp' | 'VolumeDown' | + 'ChannelUp' | 'ChannelDown' | 'Power' | 'Camera' | 'Clear' | @@ -35917,6 +37115,7 @@ export type AndroidKey = export const _electron: Electron; export const _android: Android; +export const _experimentalBidi: BrowserType; // This is required to not export everything by default. See https://github.com/Microsoft/TypeScript/issues/19545#issuecomment-340490459 export {}; @@ -37112,6 +38311,63 @@ export interface APIRequest { */ baseURL?: string; + /** + * TLS Client Authentication allows the server to request a client certificate and verify it. + * + * **Details** + * + * An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, + * a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, + * `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided + * with an exact match to the request origin that the certificate is valid for. + * + * **NOTE** Using Client Certificates in combination with Proxy Servers is not supported. + * + * **NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it + * work by replacing `localhost` with `local.playwright`. + */ + clientCertificates?: Array<{ + /** + * Exact origin that the certificate is valid for. Origin includes `https` protocol, a hostname and optionally a port. + */ + origin: string; + + /** + * Path to the file with the certificate in PEM format. + */ + certPath?: string; + + /** + * Direct value of the certificate in PEM format. + */ + cert?: Buffer; + + /** + * Path to the file with the private key in PEM format. + */ + keyPath?: string; + + /** + * Direct value of the private key in PEM format. + */ + key?: Buffer; + + /** + * Path to the PFX or PKCS12 encoded private key and certificate chain. + */ + pfxPath?: string; + + /** + * Direct value of the PFX or PKCS12 encoded private key and certificate chain. + */ + pfx?: Buffer; + + /** + * Passphrase for the private key (PEM or PFX). + */ + passphrase?: string; + }>; + /** * An object containing additional HTTP headers to be sent with every request. Defaults to none. */ @@ -37301,6 +38557,12 @@ export interface APIRequestContext { */ maxRedirects?: number; + /** + * Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not + * retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries. + */ + maxRetries?: number; + /** * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this * request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless @@ -37328,7 +38590,7 @@ export interface APIRequestContext { /** * Query parameters to be sent with the URL. */ - params?: { [key: string]: string|number|boolean; }; + params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. @@ -37425,6 +38687,12 @@ export interface APIRequestContext { */ maxRedirects?: number; + /** + * Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not + * retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries. + */ + maxRetries?: number; + /** * If set changes the fetch method (e.g. [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) or * [POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST)). If not specified, GET method is used. @@ -37458,7 +38726,7 @@ export interface APIRequestContext { /** * Query parameters to be sent with the URL. */ - params?: { [key: string]: string|number|boolean; }; + params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. @@ -37476,12 +38744,24 @@ export interface APIRequestContext { * Request parameters can be configured with `params` option, they will be serialized into the URL search parameters: * * ```js + * // Passing params as object * await request.get('https://example.com/api/getText', { * params: { * 'isbn': '1234', * 'page': 23, * } * }); + * + * // Passing params as URLSearchParams + * const searchParams = new URLSearchParams(); + * searchParams.set('isbn', '1234'); + * searchParams.append('page', 23); + * searchParams.append('page', 24); + * await request.get('https://example.com/api/getText', { params: searchParams }); + * + * // Passing params as string + * const queryString = 'isbn=1234&page=23&page=24'; + * await request.get('https://example.com/api/getText', { params: queryString }); * ``` * * @param url Target URL. @@ -37525,6 +38805,12 @@ export interface APIRequestContext { */ maxRedirects?: number; + /** + * Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not + * retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries. + */ + maxRetries?: number; + /** * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this * request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless @@ -37552,7 +38838,7 @@ export interface APIRequestContext { /** * Query parameters to be sent with the URL. */ - params?: { [key: string]: string|number|boolean; }; + params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. @@ -37605,6 +38891,12 @@ export interface APIRequestContext { */ maxRedirects?: number; + /** + * Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not + * retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries. + */ + maxRetries?: number; + /** * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this * request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless @@ -37632,7 +38924,7 @@ export interface APIRequestContext { /** * Query parameters to be sent with the URL. */ - params?: { [key: string]: string|number|boolean; }; + params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. @@ -37685,6 +38977,12 @@ export interface APIRequestContext { */ maxRedirects?: number; + /** + * Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not + * retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries. + */ + maxRetries?: number; + /** * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this * request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless @@ -37712,7 +39010,7 @@ export interface APIRequestContext { /** * Query parameters to be sent with the URL. */ - params?: { [key: string]: string|number|boolean; }; + params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. @@ -37757,891 +39055,298 @@ export interface APIRequestContext { * ```js * const form = new FormData(); * form.set('name', 'John'); - * form.append('name', 'Doe'); - * // Send two file fields with the same name. - * form.append('file', new File(['console.log(2024);'], 'f1.js', { type: 'text/javascript' })); - * form.append('file', new File(['hello'], 'f2.txt', { type: 'text/plain' })); - * await request.post('https://example.com/api/uploadForm', { - * multipart: form - * }); - * ``` - * - * @param url Target URL. - * @param options - */ - post(url: string, options?: { - /** - * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string - * and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` - * header will be set to `application/octet-stream` if not explicitly set. - */ - data?: string|Buffer|Serializable; - - /** - * Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status - * codes. - */ - failOnStatusCode?: boolean; - - /** - * Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent - * as this request body. If this parameter is specified `content-type` header will be set to - * `application/x-www-form-urlencoded` unless explicitly provided. - */ - form?: { [key: string]: string|number|boolean; }; - - /** - * Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by - * it. - */ - headers?: { [key: string]: string; }; - - /** - * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`. - */ - ignoreHTTPSErrors?: boolean; - - /** - * Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is - * exceeded. Defaults to `20`. Pass `0` to not follow redirects. - */ - maxRedirects?: number; - - /** - * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this - * request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless - * explicitly provided. File values can be passed either as - * [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file - * name, mime-type and its content. - */ - multipart?: FormData|{ [key: string]: string|number|boolean|ReadStream|{ - /** - * File name - */ - name: string; - - /** - * File type - */ - mimeType: string; - - /** - * File content - */ - buffer: Buffer; - }; }; - - /** - * Query parameters to be sent with the URL. - */ - params?: { [key: string]: string|number|boolean; }; - - /** - * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. - */ - timeout?: number; - }): Promise; - - /** - * Sends HTTP(S) [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) request and returns its - * response. The method will populate request cookies from the context and update context cookies from the response. - * The method will automatically follow redirects. - * @param url Target URL. - * @param options - */ - put(url: string, options?: { - /** - * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string - * and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` - * header will be set to `application/octet-stream` if not explicitly set. - */ - data?: string|Buffer|Serializable; - - /** - * Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status - * codes. - */ - failOnStatusCode?: boolean; - - /** - * Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent - * as this request body. If this parameter is specified `content-type` header will be set to - * `application/x-www-form-urlencoded` unless explicitly provided. - */ - form?: { [key: string]: string|number|boolean; }; - - /** - * Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by - * it. - */ - headers?: { [key: string]: string; }; - - /** - * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`. - */ - ignoreHTTPSErrors?: boolean; - - /** - * Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is - * exceeded. Defaults to `20`. Pass `0` to not follow redirects. - */ - maxRedirects?: number; - - /** - * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this - * request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless - * explicitly provided. File values can be passed either as - * [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file - * name, mime-type and its content. - */ - multipart?: FormData|{ [key: string]: string|number|boolean|ReadStream|{ - /** - * File name - */ - name: string; - - /** - * File type - */ - mimeType: string; - - /** - * File content - */ - buffer: Buffer; - }; }; - - /** - * Query parameters to be sent with the URL. - */ - params?: { [key: string]: string|number|boolean; }; - - /** - * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. - */ - timeout?: number; - }): Promise; - - /** - * Returns storage state for this request context, contains current cookies and local storage snapshot if it was - * passed to the constructor. - * @param options - */ - storageState(options?: { - /** - * The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to current - * working directory. If no path is provided, storage state is still returned, but won't be saved to the disk. - */ - path?: string; - }): Promise<{ - cookies: Array<{ - name: string; - - value: string; - - domain: string; - - path: string; - - /** - * Unix time in seconds. - */ - expires: number; - - httpOnly: boolean; - - secure: boolean; - - sameSite: "Strict"|"Lax"|"None"; - }>; - - origins: Array<{ - origin: string; - - localStorage: Array<{ - name: string; - - value: string; - }>; - }>; - }>; - - [Symbol.asyncDispose](): Promise; -} - -/** - * {@link APIResponse} class represents responses returned by - * [apiRequestContext.get(url[, options])](https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-get) - * and similar methods. - */ -export interface APIResponse { - /** - * Returns the buffer with response body. - */ - body(): Promise; - - /** - * Disposes the body of this response. If not called then the body will stay in memory until the context closes. - */ - dispose(): Promise; - - /** - * An object with all the response HTTP headers associated with this response. - */ - headers(): { [key: string]: string; }; - - /** - * An array with all the request HTTP headers associated with this response. Header names are not lower-cased. Headers - * with multiple entries, such as `Set-Cookie`, appear in the array multiple times. - */ - headersArray(): Array<{ - /** - * Name of the header. - */ - name: string; - - /** - * Value of the header. - */ - value: string; - }>; - - /** - * Returns the JSON representation of response body. - * - * This method will throw if the response body is not parsable via `JSON.parse`. - */ - json(): Promise; - - /** - * Contains a boolean stating whether the response was successful (status in the range 200-299) or not. - */ - ok(): boolean; - - /** - * Contains the status code of the response (e.g., 200 for a success). - */ - status(): number; - - /** - * Contains the status text of the response (e.g. usually an "OK" for a success). - */ - statusText(): string; - - /** - * Returns the text representation of response body. - */ - text(): Promise; - - /** - * Contains the URL of the response. - */ - url(): string; - - [Symbol.asyncDispose](): Promise; -} - -/** - * - extends: [EventEmitter] - * - * A Browser is created via - * [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch). An example - * of using a {@link Browser} to create a {@link Page}: - * - * ```js - * const { firefox } = require('playwright'); // Or 'chromium' or 'webkit'. - * - * (async () => { - * const browser = await firefox.launch(); - * const page = await browser.newPage(); - * await page.goto('https://example.com'); - * await browser.close(); - * })(); - * ``` - * - */ -export interface Browser extends EventEmitter { - /** - * Emitted when Browser gets disconnected from the browser application. This might happen because of one of the - * following: - * - Browser application is closed or crashed. - * - The [browser.close([options])](https://playwright.dev/docs/api/class-browser#browser-close) method was called. - */ - on(event: 'disconnected', listener: (browser: Browser) => any): this; - - /** - * Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event. - */ - once(event: 'disconnected', listener: (browser: Browser) => any): this; - - /** - * Emitted when Browser gets disconnected from the browser application. This might happen because of one of the - * following: - * - Browser application is closed or crashed. - * - The [browser.close([options])](https://playwright.dev/docs/api/class-browser#browser-close) method was called. - */ - addListener(event: 'disconnected', listener: (browser: Browser) => any): this; - - /** - * Removes an event listener added by `on` or `addListener`. - */ - removeListener(event: 'disconnected', listener: (browser: Browser) => any): this; - - /** - * Removes an event listener added by `on` or `addListener`. - */ - off(event: 'disconnected', listener: (browser: Browser) => any): this; - - /** - * Emitted when Browser gets disconnected from the browser application. This might happen because of one of the - * following: - * - Browser application is closed or crashed. - * - The [browser.close([options])](https://playwright.dev/docs/api/class-browser#browser-close) method was called. - */ - prependListener(event: 'disconnected', listener: (browser: Browser) => any): this; - - /** - * Get the browser type (chromium, firefox or webkit) that the browser belongs to. - */ - browserType(): BrowserType; - - /** - * In case this browser is obtained using - * [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch), closes the - * browser and all of its pages (if any were opened). - * - * In case this browser is connected to, clears all created contexts belonging to this browser and disconnects from - * the browser server. - * - * **NOTE** This is similar to force quitting the browser. Therefore, you should call - * [browserContext.close([options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) on - * any {@link BrowserContext}'s you explicitly created earlier with - * [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context) **before** - * calling [browser.close([options])](https://playwright.dev/docs/api/class-browser#browser-close). - * - * The {@link Browser} object itself is considered to be disposed and cannot be used anymore. - * @param options - */ - close(options?: { - /** - * The reason to be reported to the operations interrupted by the browser closure. - */ - reason?: string; - }): Promise; - - /** - * Returns an array of all open browser contexts. In a newly created browser, this will return zero browser contexts. - * - * **Usage** - * - * ```js - * const browser = await pw.webkit.launch(); - * console.log(browser.contexts().length); // prints `0` - * - * const context = await browser.newContext(); - * console.log(browser.contexts().length); // prints `1` - * ``` - * - */ - contexts(): Array; - - /** - * Indicates that the browser is connected. - */ - isConnected(): boolean; - - /** - * **NOTE** CDP Sessions are only supported on Chromium-based browsers. - * - * Returns the newly created browser session. - */ - newBrowserCDPSession(): Promise; - - /** - * Creates a new browser context. It won't share cookies/cache with other browser contexts. - * - * **NOTE** If directly using this method to create {@link BrowserContext}s, it is best practice to explicitly close - * the returned context via - * [browserContext.close([options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) when - * your code is done with the {@link BrowserContext}, and before calling - * [browser.close([options])](https://playwright.dev/docs/api/class-browser#browser-close). This will ensure the - * `context` is closed gracefully and any artifacts—like HARs and videos—are fully flushed and saved. - * - * **Usage** - * - * ```js - * (async () => { - * const browser = await playwright.firefox.launch(); // Or 'chromium' or 'webkit'. - * // Create a new incognito browser context. - * const context = await browser.newContext(); - * // Create a new page in a pristine context. - * const page = await context.newPage(); - * await page.goto('https://example.com'); - * - * // Gracefully close up everything - * await context.close(); - * await browser.close(); - * })(); + * form.append('name', 'Doe'); + * // Send two file fields with the same name. + * form.append('file', new File(['console.log(2024);'], 'f1.js', { type: 'text/javascript' })); + * form.append('file', new File(['hello'], 'f2.txt', { type: 'text/plain' })); + * await request.post('https://example.com/api/uploadForm', { + * multipart: form + * }); * ``` * + * @param url Target URL. * @param options */ - newContext(options?: BrowserContextOptions): Promise; - - /** - * Creates a new page in a new browser context. Closing this page will close the context as well. - * - * This is a convenience API that should only be used for the single-page scenarios and short snippets. Production - * code and testing frameworks should explicitly create - * [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context) followed by the - * [browserContext.newPage()](https://playwright.dev/docs/api/class-browsercontext#browser-context-new-page) to - * control their exact life times. - * @param options - */ - newPage(options?: { + post(url: string, options?: { /** - * Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted. + * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string + * and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` + * header will be set to `application/octet-stream` if not explicitly set. */ - acceptDownloads?: boolean; + data?: string|Buffer|Serializable; /** - * When using [page.goto(url[, options])](https://playwright.dev/docs/api/class-page#page-goto), - * [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route), - * [page.waitForURL(url[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-url), - * [page.waitForRequest(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-request), - * or - * [page.waitForResponse(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-response) - * it takes the base URL in consideration by using the - * [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. - * Unset by default. Examples: - * - baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html` - * - baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in - * `http://localhost:3000/foo/bar.html` - * - baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in - * `http://localhost:3000/bar.html` + * Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status + * codes. */ - baseURL?: string; + failOnStatusCode?: boolean; /** - * Toggles bypassing page's Content-Security-Policy. Defaults to `false`. + * Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent + * as this request body. If this parameter is specified `content-type` header will be set to + * `application/x-www-form-urlencoded` unless explicitly provided. */ - bypassCSP?: boolean; + form?: { [key: string]: string|number|boolean; }; /** - * Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See - * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. - * Passing `null` resets emulation to system defaults. Defaults to `'light'`. + * Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by + * it. */ - colorScheme?: null|"light"|"dark"|"no-preference"; + headers?: { [key: string]: string; }; /** - * Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about - * [emulating devices with device scale factor](https://playwright.dev/docs/emulation#devices). + * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`. */ - deviceScaleFactor?: number; + ignoreHTTPSErrors?: boolean; /** - * An object containing additional HTTP headers to be sent with every request. Defaults to none. + * Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is + * exceeded. Defaults to `20`. Pass `0` to not follow redirects. */ - extraHTTPHeaders?: { [key: string]: string; }; + maxRedirects?: number; /** - * Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See - * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. - * Passing `null` resets emulation to system defaults. Defaults to `'none'`. + * Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not + * retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries. */ - forcedColors?: null|"active"|"none"; + maxRetries?: number; - geolocation?: { + /** + * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this + * request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless + * explicitly provided. File values can be passed either as + * [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file + * name, mime-type and its content. + */ + multipart?: FormData|{ [key: string]: string|number|boolean|ReadStream|{ /** - * Latitude between -90 and 90. + * File name */ - latitude: number; + name: string; /** - * Longitude between -180 and 180. + * File type */ - longitude: number; + mimeType: string; /** - * Non-negative accuracy value. Defaults to `0`. + * File content */ - accuracy?: number; - }; + buffer: Buffer; + }; }; /** - * Specifies if viewport supports touch events. Defaults to false. Learn more about - * [mobile emulation](https://playwright.dev/docs/emulation#devices). + * Query parameters to be sent with the URL. */ - hasTouch?: boolean; + params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; /** - * Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no - * origin is specified, the username and password are sent to any servers upon unauthorized responses. + * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. */ - httpCredentials?: { - username: string; - - password: string; - - /** - * Restrain sending http credentials on specific origin (scheme://host:port). - */ - origin?: string; - - /** - * This option only applies to the requests sent from corresponding {@link APIRequestContext} and does not affect - * requests sent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be - * sent with the each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response - * with `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. - */ - send?: "unauthorized"|"always"; - }; + timeout?: number; + }): Promise; + /** + * Sends HTTP(S) [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) request and returns its + * response. The method will populate request cookies from the context and update context cookies from the response. + * The method will automatically follow redirects. + * @param url Target URL. + * @param options + */ + put(url: string, options?: { /** - * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`. + * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string + * and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` + * header will be set to `application/octet-stream` if not explicitly set. */ - ignoreHTTPSErrors?: boolean; + data?: string|Buffer|Serializable; /** - * Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device, - * so you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more - * about [mobile emulation](https://playwright.dev/docs/emulation#ismobile). + * Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status + * codes. */ - isMobile?: boolean; + failOnStatusCode?: boolean; /** - * Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about - * [disabling JavaScript](https://playwright.dev/docs/emulation#javascript-enabled). + * Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent + * as this request body. If this parameter is specified `content-type` header will be set to + * `application/x-www-form-urlencoded` unless explicitly provided. */ - javaScriptEnabled?: boolean; + form?: { [key: string]: string|number|boolean; }; /** - * Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, - * `Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default - * locale. Learn more about emulation in our [emulation guide](https://playwright.dev/docs/emulation#locale--timezone). + * Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by + * it. */ - locale?: string; + headers?: { [key: string]: string; }; /** - * Logger sink for Playwright logging. + * Whether to ignore HTTPS errors when sending network requests. Defaults to `false`. */ - logger?: Logger; + ignoreHTTPSErrors?: boolean; /** - * Whether to emulate network being offline. Defaults to `false`. Learn more about - * [network emulation](https://playwright.dev/docs/emulation#offline). + * Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is + * exceeded. Defaults to `20`. Pass `0` to not follow redirects. */ - offline?: boolean; + maxRedirects?: number; /** - * A list of permissions to grant to all pages in this context. See - * [browserContext.grantPermissions(permissions[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-grant-permissions) - * for more details. Defaults to none. + * Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not + * retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries. */ - permissions?: Array; + maxRetries?: number; /** - * Network proxy settings to use with this context. Defaults to none. - * - * **NOTE** For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If - * all contexts override the proxy, global proxy will be never used and can be any string, for example `launch({ - * proxy: { server: 'http://per-context' } })`. + * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this + * request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless + * explicitly provided. File values can be passed either as + * [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file + * name, mime-type and its content. */ - proxy?: { - /** - * Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or - * `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy. - */ - server: string; - + multipart?: FormData|{ [key: string]: string|number|boolean|ReadStream|{ /** - * Optional comma-separated domains to bypass proxy, for example `".com, chromium.org, .domain.com"`. + * File name */ - bypass?: string; + name: string; /** - * Optional username to use if HTTP proxy requires authentication. + * File type */ - username?: string; + mimeType: string; /** - * Optional password to use if HTTP proxy requires authentication. + * File content */ - password?: string; - }; + buffer: Buffer; + }; }; /** - * Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. - * If not specified, the HAR is not recorded. Make sure to await - * [browserContext.close([options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for - * the HAR to be saved. + * Query parameters to be sent with the URL. */ - recordHar?: { - /** - * Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use - * `content` policy instead. - */ - omitContent?: boolean; - - /** - * Optional setting to control resource content management. If `omit` is specified, content is not persisted. If - * `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is - * specified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output - * files and to `embed` for all other file extensions. - */ - content?: "omit"|"embed"|"attach"; - - /** - * Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by - * default. - */ - path: string; - - /** - * When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, - * cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`. - */ - mode?: "full"|"minimal"; - - /** - * A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was - * provided and the passed URL is a path, it gets merged via the - * [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none. - */ - urlFilter?: string|RegExp; - }; + params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; /** - * Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. - * Make sure to await - * [browserContext.close([options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for - * videos to be saved. + * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. */ - recordVideo?: { - /** - * Path to the directory to put videos into. - */ - dir: string; - - /** - * Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to - * fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of - * each page will be scaled down if necessary to fit the specified size. - */ - size?: { - /** - * Video frame width. - */ - width: number; - - /** - * Video frame height. - */ - height: number; - }; - }; + timeout?: number; + }): Promise; + /** + * Returns storage state for this request context, contains current cookies and local storage snapshot if it was + * passed to the constructor. + * @param options + */ + storageState(options?: { /** - * Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See - * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. - * Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`. + * The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to current + * working directory. If no path is provided, storage state is still returned, but won't be saved to the disk. */ - reducedMotion?: null|"reduce"|"no-preference"; + path?: string; + }): Promise<{ + cookies: Array<{ + name: string; - /** - * Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the - * `viewport` is set. - */ - screen?: { - /** - * page width in pixels. - */ - width: number; + value: string; - /** - * page height in pixels. - */ - height: number; - }; + domain: string; - /** - * Whether to allow sites to register Service workers. Defaults to `'allow'`. - * - `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be - * registered. - * - `'block'`: Playwright will block all registration of Service Workers. - */ - serviceWorkers?: "allow"|"block"; + path: string; - /** - * Learn more about [storage state and auth](https://playwright.dev/docs/auth). - * - * Populates context with given storage state. This option can be used to initialize context with logged-in - * information obtained via - * [browserContext.storageState([options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-storage-state). - */ - storageState?: string|{ /** - * Cookies to set for context + * Unix time in seconds. */ - cookies: Array<{ - name: string; - - value: string; - - /** - * Domain and path are required. For the cookie to apply to all subdomains as well, prefix domain with a dot, like - * this: ".example.com" - */ - domain: string; - - /** - * Domain and path are required - */ - path: string; - - /** - * Unix time in seconds. - */ - expires: number; + expires: number; - httpOnly: boolean; + httpOnly: boolean; - secure: boolean; + secure: boolean; - /** - * sameSite flag - */ - sameSite: "Strict"|"Lax"|"None"; - }>; + sameSite: "Strict"|"Lax"|"None"; + }>; - /** - * localStorage to set for context - */ - origins: Array<{ - origin: string; + origins: Array<{ + origin: string; - localStorage: Array<{ - name: string; + localStorage: Array<{ + name: string; - value: string; - }>; + value: string; }>; - }; - - /** - * If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on - * selectors that imply single target DOM element will throw when more than one element matches the selector. This - * option does not affect any Locator APIs (Locators are always strict). Defaults to `false`. See {@link Locator} to - * learn more about the strict mode. - */ - strictSelectors?: boolean; + }>; + }>; - /** - * Changes the timezone of the context. See - * [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1) - * for a list of supported timezone IDs. Defaults to the system timezone. - */ - timezoneId?: string; + [Symbol.asyncDispose](): Promise; +} - /** - * Specific user agent to use in this context. - */ - userAgent?: string; +/** + * {@link APIResponse} class represents responses returned by + * [apiRequestContext.get(url[, options])](https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-get) + * and similar methods. + */ +export interface APIResponse { + /** + * Returns the buffer with response body. + */ + body(): Promise; - /** - * @deprecated Use `recordVideo` instead. - */ - videoSize?: { - /** - * Video frame width. - */ - width: number; + /** + * Disposes the body of this response. If not called then the body will stay in memory until the context closes. + */ + dispose(): Promise; - /** - * Video frame height. - */ - height: number; - }; + /** + * An object with all the response HTTP headers associated with this response. + */ + headers(): { [key: string]: string; }; + /** + * An array with all the response HTTP headers associated with this response. Header names are not lower-cased. + * Headers with multiple entries, such as `Set-Cookie`, appear in the array multiple times. + */ + headersArray(): Array<{ /** - * @deprecated Use `recordVideo` instead. + * Name of the header. */ - videosPath?: string; + name: string; /** - * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `null` to disable the consistent - * viewport emulation. Learn more about [viewport emulation](https://playwright.dev/docs/emulation#viewport). - * - * **NOTE** The `null` value opts out from the default presets, makes viewport depend on the host window size defined - * by the operating system. It makes the execution of the tests non-deterministic. + * Value of the header. */ - viewport?: null|{ - /** - * page width in pixels. - */ - width: number; - - /** - * page height in pixels. - */ - height: number; - }; - }): Promise; + value: string; + }>; /** - * **NOTE** This API controls - * [Chromium Tracing](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) which is a low-level - * chromium-specific debugging tool. API to control [Playwright Tracing](https://playwright.dev/docs/trace-viewer) could be found - * [here](https://playwright.dev/docs/api/class-tracing). - * - * You can use - * [browser.startTracing([page, options])](https://playwright.dev/docs/api/class-browser#browser-start-tracing) and - * [browser.stopTracing()](https://playwright.dev/docs/api/class-browser#browser-stop-tracing) to create a trace file - * that can be opened in Chrome DevTools performance panel. - * - * **Usage** - * - * ```js - * await browser.startTracing(page, { path: 'trace.json' }); - * await page.goto('https://www.google.com'); - * await browser.stopTracing(); - * ``` + * Returns the JSON representation of response body. * - * @param page Optional, if specified, tracing includes screenshots of the given page. - * @param options + * This method will throw if the response body is not parsable via `JSON.parse`. */ - startTracing(page?: Page, options?: { - /** - * specify custom categories to use instead of default. - */ - categories?: Array; + json(): Promise; - /** - * A path to write the trace file to. - */ - path?: string; + /** + * Contains a boolean stating whether the response was successful (status in the range 200-299) or not. + */ + ok(): boolean; - /** - * captures screenshots in the trace. - */ - screenshots?: boolean; - }): Promise; + /** + * Contains the status code of the response (e.g., 200 for a success). + */ + status(): number; /** - * **NOTE** This API controls - * [Chromium Tracing](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) which is a low-level - * chromium-specific debugging tool. API to control [Playwright Tracing](https://playwright.dev/docs/trace-viewer) could be found - * [here](https://playwright.dev/docs/api/class-tracing). - * - * Returns the buffer with trace data. + * Contains the status text of the response (e.g. usually an "OK" for a success). */ - stopTracing(): Promise; + statusText(): string; /** - * Returns the browser version. + * Returns the text representation of response body. */ - version(): string; + text(): Promise; + + /** + * Contains the URL of the response. + */ + url(): string; [Symbol.asyncDispose](): Promise; } @@ -38774,7 +39479,7 @@ export interface Clock { * await page.clock.pauseAt('2020-02-02'); * ``` * - * @param time + * @param time Time to pause at. */ pauseAt(time: number|string|Date): Promise; @@ -38809,7 +39514,7 @@ export interface Clock { * await page.clock.setFixedTime('2020-02-02'); * ``` * - * @param time Time to be set. + * @param time Time to be set in milliseconds. */ setFixedTime(time: number|string|Date): Promise; @@ -38824,7 +39529,7 @@ export interface Clock { * await page.clock.setSystemTime('2020-02-02'); * ``` * - * @param time + * @param time Time to be set in milliseconds. */ setSystemTime(time: number|string|Date): Promise; } @@ -39494,9 +40199,8 @@ export interface FileChooser { buffer: Buffer; }>, options?: { /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You - * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as - * navigating to inaccessible pages. Defaults to `false`. + * This option has no effect. + * @deprecated This option has no effect. */ noWaitAfter?: boolean; @@ -40194,8 +40898,8 @@ export interface Mouse { * Shortcut for [mouse.move(x, y[, options])](https://playwright.dev/docs/api/class-mouse#mouse-move), * [mouse.down([options])](https://playwright.dev/docs/api/class-mouse#mouse-down), * [mouse.up([options])](https://playwright.dev/docs/api/class-mouse#mouse-up). - * @param x - * @param y + * @param x X coordinate relative to the main frame's viewport in CSS pixels. + * @param y Y coordinate relative to the main frame's viewport in CSS pixels. * @param options */ click(x: number, y: number, options?: { @@ -40221,8 +40925,8 @@ export interface Mouse { * [mouse.up([options])](https://playwright.dev/docs/api/class-mouse#mouse-up), * [mouse.down([options])](https://playwright.dev/docs/api/class-mouse#mouse-down) and * [mouse.up([options])](https://playwright.dev/docs/api/class-mouse#mouse-up). - * @param x - * @param y + * @param x X coordinate relative to the main frame's viewport in CSS pixels. + * @param y Y coordinate relative to the main frame's viewport in CSS pixels. * @param options */ dblclick(x: number, y: number, options?: { @@ -40255,8 +40959,8 @@ export interface Mouse { /** * Dispatches a `mousemove` event. - * @param x - * @param y + * @param x X coordinate relative to the main frame's viewport in CSS pixels. + * @param y Y coordinate relative to the main frame's viewport in CSS pixels. * @param options */ move(x: number, y: number, options?: { @@ -40424,7 +41128,7 @@ export interface Request { }>>; /** - * Returns the value of the header matching the name. The name is case insensitive. + * Returns the value of the header matching the name. The name is case-insensitive. * @param name Name of the header. */ headerValue(name: string): Promise; @@ -40685,7 +41389,7 @@ export interface Response { }>>; /** - * Returns the value of the header matching the name. The name is case insensitive. If multiple headers have the same + * Returns the value of the header matching the name. The name is case-insensitive. If multiple headers have the same * name (except `set-cookie`), they are returned as a list separated by `, `. For `set-cookie`, the `\n` separator is * used. If no headers are found, `null` is returned. * @param name Name of the header. @@ -40693,7 +41397,7 @@ export interface Response { headerValue(name: string): Promise; /** - * Returns all values of the headers matching the name, for example `set-cookie`. The name is case insensitive. + * Returns all values of the headers matching the name, for example `set-cookie`. The name is case-insensitive. * @param name Name of the header. */ headerValues(name: string): Promise>; @@ -40812,7 +41516,7 @@ export interface Route { abort(errorCode?: string): Promise; /** - * Continues route's request with optional overrides. + * Sends route's request to the network with optional overrides. * * **Usage** * @@ -40835,6 +41539,11 @@ export interface Route { * through redirects, use the combination of * [route.fetch([options])](https://playwright.dev/docs/api/class-route#route-fetch) and * [route.fulfill([options])](https://playwright.dev/docs/api/class-route#route-fulfill) instead. + * + * [route.continue([options])](https://playwright.dev/docs/api/class-route#route-continue) will immediately send the + * request to the network, other matching handlers won't be invoked. Use + * [route.fallback([options])](https://playwright.dev/docs/api/class-route#route-fallback) If you want next matching + * handler in the chain to be invoked. * @param options */ continue(options?: { @@ -40860,13 +41569,17 @@ export interface Route { }): Promise; /** + * Continues route's request with optional overrides. The method is similar to + * [route.continue([options])](https://playwright.dev/docs/api/class-route#route-continue) with the difference that + * other matching handlers will be invoked before sending the request. + * + * **Usage** + * * When several routes match the given pattern, they run in the order opposite to their registration. That way the * last registered route can always override all the previous ones. In the example below, request will be handled by * the bottom-most handler first, then it'll fall back to the previous one and in the end will be aborted by the first * registered route. * - * **Usage** - * * ```js * await page.route('**\/*', async route => { * // Runs last. @@ -40922,6 +41635,8 @@ export interface Route { * }); * ``` * + * Use [route.continue([options])](https://playwright.dev/docs/api/class-route#route-continue) to immediately send the + * request to the network, other matching handlers won't be invoked in that case. * @param options */ fallback(options?: { @@ -40981,6 +41696,12 @@ export interface Route { */ maxRedirects?: number; + /** + * Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not + * retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries. + */ + maxRetries?: number; + /** * If set changes the request method (e.g. GET or POST). */ @@ -41165,8 +41886,8 @@ export interface Touchscreen { * * **NOTE** [page.tap(selector[, options])](https://playwright.dev/docs/api/class-page#page-tap) the method will throw * if `hasTouch` option of the browser context is false. - * @param x - * @param y + * @param x X coordinate relative to the main frame's viewport in CSS pixels. + * @param y Y coordinate relative to the main frame's viewport in CSS pixels. */ tap(x: number, y: number): Promise; } @@ -41441,170 +42162,486 @@ export interface WebSocket { }) => any): this; /** - * Fired when the websocket sends a frame. + * Fired when the websocket sends a frame. + */ + addListener(event: 'framesent', listener: (data: { + /** + * frame payload + */ + payload: string|Buffer; + }) => any): this; + + /** + * Fired when the websocket has an error. + */ + addListener(event: 'socketerror', listener: (string: string) => any): this; + + /** + * Removes an event listener added by `on` or `addListener`. + */ + removeListener(event: 'close', listener: (webSocket: WebSocket) => any): this; + + /** + * Removes an event listener added by `on` or `addListener`. + */ + removeListener(event: 'framereceived', listener: (data: { + /** + * frame payload + */ + payload: string|Buffer; + }) => any): this; + + /** + * Removes an event listener added by `on` or `addListener`. + */ + removeListener(event: 'framesent', listener: (data: { + /** + * frame payload + */ + payload: string|Buffer; + }) => any): this; + + /** + * Removes an event listener added by `on` or `addListener`. + */ + removeListener(event: 'socketerror', listener: (string: string) => any): this; + + /** + * Removes an event listener added by `on` or `addListener`. + */ + off(event: 'close', listener: (webSocket: WebSocket) => any): this; + + /** + * Removes an event listener added by `on` or `addListener`. + */ + off(event: 'framereceived', listener: (data: { + /** + * frame payload + */ + payload: string|Buffer; + }) => any): this; + + /** + * Removes an event listener added by `on` or `addListener`. + */ + off(event: 'framesent', listener: (data: { + /** + * frame payload + */ + payload: string|Buffer; + }) => any): this; + + /** + * Removes an event listener added by `on` or `addListener`. + */ + off(event: 'socketerror', listener: (string: string) => any): this; + + /** + * Fired when the websocket closes. + */ + prependListener(event: 'close', listener: (webSocket: WebSocket) => any): this; + + /** + * Fired when the websocket receives a frame. + */ + prependListener(event: 'framereceived', listener: (data: { + /** + * frame payload + */ + payload: string|Buffer; + }) => any): this; + + /** + * Fired when the websocket sends a frame. + */ + prependListener(event: 'framesent', listener: (data: { + /** + * frame payload + */ + payload: string|Buffer; + }) => any): this; + + /** + * Fired when the websocket has an error. + */ + prependListener(event: 'socketerror', listener: (string: string) => any): this; + + /** + * Indicates that the web socket has been closed. + */ + isClosed(): boolean; + + /** + * Contains the URL of the WebSocket. + */ + url(): string; + + /** + * Fired when the websocket closes. + */ + waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (webSocket: WebSocket) => boolean | Promise, timeout?: number } | ((webSocket: WebSocket) => boolean | Promise)): Promise; + + /** + * Fired when the websocket receives a frame. + */ + waitForEvent(event: 'framereceived', optionsOrPredicate?: { predicate?: (data: { + /** + * frame payload + */ + payload: string|Buffer; + }) => boolean | Promise, timeout?: number } | ((data: { + /** + * frame payload + */ + payload: string|Buffer; + }) => boolean | Promise)): Promise<{ + /** + * frame payload + */ + payload: string|Buffer; + }>; + + /** + * Fired when the websocket sends a frame. + */ + waitForEvent(event: 'framesent', optionsOrPredicate?: { predicate?: (data: { + /** + * frame payload + */ + payload: string|Buffer; + }) => boolean | Promise, timeout?: number } | ((data: { + /** + * frame payload + */ + payload: string|Buffer; + }) => boolean | Promise)): Promise<{ + /** + * frame payload + */ + payload: string|Buffer; + }>; + + /** + * Fired when the websocket has an error. + */ + waitForEvent(event: 'socketerror', optionsOrPredicate?: { predicate?: (string: string) => boolean | Promise, timeout?: number } | ((string: string) => boolean | Promise)): Promise; + +} + +interface AccessibilitySnapshotOptions { + /** + * Prune uninteresting nodes from the tree. Defaults to `true`. + */ + interestingOnly?: boolean; + + /** + * The root DOM element for the snapshot. Defaults to the whole page. + */ + root?: ElementHandle; +} + +export interface LaunchOptions { + /** + * **NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality. + * + * Additional arguments to pass to the browser instance. The list of Chromium flags can be found + * [here](https://peter.sh/experiments/chromium-command-line-switches/). + */ + args?: Array; + + /** + * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", + * "msedge", "msedge-beta", "msedge-dev", "msedge-canary". Read more about using + * [Google Chrome and Microsoft Edge](https://playwright.dev/docs/browsers#google-chrome--microsoft-edge). + */ + channel?: string; + + /** + * Enable Chromium sandboxing. Defaults to `false`. + */ + chromiumSandbox?: boolean; + + /** + * **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the + * `headless` option will be set `false`. + * @deprecated Use [debugging tools](https://playwright.dev/docs/debug) instead. + */ + devtools?: boolean; + + /** + * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and + * is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were + * created in is closed. + */ + downloadsPath?: string; + + /** + * Specify environment variables that will be visible to the browser. Defaults to `process.env`. + */ + env?: { [key: string]: string|number|boolean; }; + + /** + * Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is + * resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, + * Firefox or WebKit, use at your own risk. + */ + executablePath?: string; + + /** + * Firefox user preferences. Learn more about the Firefox user preferences at + * [`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox). + */ + firefoxUserPrefs?: { [key: string]: string|number|boolean; }; + + /** + * Close the browser process on SIGHUP. Defaults to `true`. + */ + handleSIGHUP?: boolean; + + /** + * Close the browser process on Ctrl-C. Defaults to `true`. + */ + handleSIGINT?: boolean; + + /** + * Close the browser process on SIGTERM. Defaults to `true`. + */ + handleSIGTERM?: boolean; + + /** + * Whether to run browser in headless mode. More details for + * [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and + * [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the + * `devtools` option is `true`. + */ + headless?: boolean; + + /** + * If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. If an array is + * given, then filters out the given default arguments. Dangerous option; use with care. Defaults to `false`. + */ + ignoreDefaultArgs?: boolean|Array; + + /** + * Logger sink for Playwright logging. + */ + logger?: Logger; + + /** + * Network proxy settings. + */ + proxy?: { + /** + * Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or + * `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy. + */ + server: string; + + /** + * Optional comma-separated domains to bypass proxy, for example `".com, chromium.org, .domain.com"`. + */ + bypass?: string; + + /** + * Optional username to use if HTTP proxy requires authentication. + */ + username?: string; + + /** + * Optional password to use if HTTP proxy requires authentication. + */ + password?: string; + }; + + /** + * Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going + * on. + */ + slowMo?: number; + + /** + * Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` + * to disable timeout. + */ + timeout?: number; + + /** + * If specified, traces are saved into this directory. + */ + tracesDir?: string; +} + +export interface ConnectOverCDPOptions { + /** + * Deprecated, use the first argument instead. Optional. + */ + endpointURL?: string; + + /** + * Additional HTTP headers to be sent with connect request. Optional. + */ + headers?: { [key: string]: string; }; + + /** + * Logger sink for Playwright logging. Optional. + */ + logger?: Logger; + + /** + * Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going + * on. Defaults to 0. */ - addListener(event: 'framesent', listener: (data: { - /** - * frame payload - */ - payload: string|Buffer; - }) => any): this; + slowMo?: number; /** - * Fired when the websocket has an error. + * Maximum time in milliseconds to wait for the connection to be established. Defaults to `30000` (30 seconds). Pass + * `0` to disable timeout. */ - addListener(event: 'socketerror', listener: (string: string) => any): this; + timeout?: number; +} +export interface ConnectOptions { /** - * Removes an event listener added by `on` or `addListener`. + * This option exposes network available on the connecting client to the browser being connected to. Consists of a + * list of rules separated by comma. + * + * Available rules: + * 1. Hostname pattern, for example: `example.com`, `*.org:99`, `x.*.y.com`, `*foo.org`. + * 1. IP literal, for example: `127.0.0.1`, `0.0.0.0:99`, `[::1]`, `[0:0::1]:99`. + * 1. `` that matches local loopback interfaces: `localhost`, `*.localhost`, `127.0.0.1`, `[::1]`. + * + * Some common examples: + * 1. `"*"` to expose all network. + * 1. `""` to expose localhost network. + * 1. `"*.test.internal-domain,*.staging.internal-domain,"` to expose test/staging deployments and + * localhost. */ - removeListener(event: 'close', listener: (webSocket: WebSocket) => any): this; + exposeNetwork?: string; /** - * Removes an event listener added by `on` or `addListener`. + * Additional HTTP headers to be sent with web socket connect request. Optional. */ - removeListener(event: 'framereceived', listener: (data: { - /** - * frame payload - */ - payload: string|Buffer; - }) => any): this; + headers?: { [key: string]: string; }; /** - * Removes an event listener added by `on` or `addListener`. + * Logger sink for Playwright logging. Optional. */ - removeListener(event: 'framesent', listener: (data: { - /** - * frame payload - */ - payload: string|Buffer; - }) => any): this; + logger?: Logger; /** - * Removes an event listener added by `on` or `addListener`. + * Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going + * on. Defaults to 0. */ - removeListener(event: 'socketerror', listener: (string: string) => any): this; + slowMo?: number; /** - * Removes an event listener added by `on` or `addListener`. + * Maximum time in milliseconds to wait for the connection to be established. Defaults to `0` (no timeout). */ - off(event: 'close', listener: (webSocket: WebSocket) => any): this; + timeout?: number; +} +export interface LocatorScreenshotOptions { /** - * Removes an event listener added by `on` or `addListener`. + * When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations. Animations get different + * treatment depending on their duration: + * - finite animations are fast-forwarded to completion, so they'll fire `transitionend` event. + * - infinite animations are canceled to initial state, and then played over after the screenshot. + * + * Defaults to `"allow"` that leaves animations untouched. */ - off(event: 'framereceived', listener: (data: { - /** - * frame payload - */ - payload: string|Buffer; - }) => any): this; + animations?: "disabled"|"allow"; /** - * Removes an event listener added by `on` or `addListener`. + * When set to `"hide"`, screenshot will hide text caret. When set to `"initial"`, text caret behavior will not be + * changed. Defaults to `"hide"`. */ - off(event: 'framesent', listener: (data: { - /** - * frame payload - */ - payload: string|Buffer; - }) => any): this; + caret?: "hide"|"initial"; /** - * Removes an event listener added by `on` or `addListener`. + * Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink + * box `#FF00FF` (customized by `maskColor`) that completely covers its bounding box. */ - off(event: 'socketerror', listener: (string: string) => any): this; + mask?: Array; /** - * Fired when the websocket closes. + * Specify the color of the overlay box for masked elements, in + * [CSS color format](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Default color is pink `#FF00FF`. */ - prependListener(event: 'close', listener: (webSocket: WebSocket) => any): this; + maskColor?: string; /** - * Fired when the websocket receives a frame. + * Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images. + * Defaults to `false`. */ - prependListener(event: 'framereceived', listener: (data: { - /** - * frame payload - */ - payload: string|Buffer; - }) => any): this; + omitBackground?: boolean; /** - * Fired when the websocket sends a frame. + * The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a + * relative path, then it is resolved relative to the current working directory. If no path is provided, the image + * won't be saved to the disk. */ - prependListener(event: 'framesent', listener: (data: { - /** - * frame payload - */ - payload: string|Buffer; - }) => any): this; + path?: string; /** - * Fired when the websocket has an error. + * The quality of the image, between 0-100. Not applicable to `png` images. */ - prependListener(event: 'socketerror', listener: (string: string) => any): this; + quality?: number; /** - * Indicates that the web socket has been closed. + * When set to `"css"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this + * will keep screenshots small. Using `"device"` option will produce a single pixel per each device pixel, so + * screenshots of high-dpi devices will be twice as large or even larger. + * + * Defaults to `"device"`. */ - isClosed(): boolean; + scale?: "css"|"device"; /** - * Contains the URL of the WebSocket. + * Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make + * elements invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces + * the Shadow DOM and applies to the inner frames. */ - url(): string; + style?: string; /** - * Fired when the websocket closes. + * Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` + * option in the config, or by using the + * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) + * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods. */ - waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (webSocket: WebSocket) => boolean | Promise, timeout?: number } | ((webSocket: WebSocket) => boolean | Promise)): Promise; + timeout?: number; /** - * Fired when the websocket receives a frame. + * Specify screenshot type, defaults to `png`. */ - waitForEvent(event: 'framereceived', optionsOrPredicate?: { predicate?: (data: { - /** - * frame payload - */ - payload: string|Buffer; - }) => boolean | Promise, timeout?: number } | ((data: { - /** - * frame payload - */ - payload: string|Buffer; - }) => boolean | Promise)): Promise<{ - /** - * frame payload - */ - payload: string|Buffer; - }>; + type?: "png"|"jpeg"; +} +interface ElementHandleWaitForSelectorOptions { /** - * Fired when the websocket sends a frame. + * Defaults to `'visible'`. Can be either: + * - `'attached'` - wait for element to be present in DOM. + * - `'detached'` - wait for element to not be present in DOM. + * - `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element + * without any content or with `display:none` has an empty bounding box and is not considered visible. + * - `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or + * `visibility:hidden`. This is opposite to the `'visible'` option. */ - waitForEvent(event: 'framesent', optionsOrPredicate?: { predicate?: (data: { - /** - * frame payload - */ - payload: string|Buffer; - }) => boolean | Promise, timeout?: number } | ((data: { - /** - * frame payload - */ - payload: string|Buffer; - }) => boolean | Promise)): Promise<{ - /** - * frame payload - */ - payload: string|Buffer; - }>; + state?: "attached"|"detached"|"visible"|"hidden"; /** - * Fired when the websocket has an error. + * When true, the call requires selector to resolve to a single element. If given selector resolves to more than one + * element, the call throws an exception. */ - waitForEvent(event: 'socketerror', optionsOrPredicate?: { predicate?: (string: string) => boolean | Promise, timeout?: number } | ((string: string) => boolean | Promise)): Promise; + strict?: boolean; + /** + * Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` + * option in the config, or by using the + * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) + * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods. + */ + timeout?: number; } export interface BrowserContextOptions { @@ -41636,6 +42673,63 @@ export interface BrowserContextOptions { */ bypassCSP?: boolean; + /** + * TLS Client Authentication allows the server to request a client certificate and verify it. + * + * **Details** + * + * An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, + * a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, + * `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided + * with an exact match to the request origin that the certificate is valid for. + * + * **NOTE** Using Client Certificates in combination with Proxy Servers is not supported. + * + * **NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it + * work by replacing `localhost` with `local.playwright`. + */ + clientCertificates?: Array<{ + /** + * Exact origin that the certificate is valid for. Origin includes `https` protocol, a hostname and optionally a port. + */ + origin: string; + + /** + * Path to the file with the certificate in PEM format. + */ + certPath?: string; + + /** + * Direct value of the certificate in PEM format. + */ + cert?: Buffer; + + /** + * Path to the file with the private key in PEM format. + */ + keyPath?: string; + + /** + * Direct value of the private key in PEM format. + */ + key?: Buffer; + + /** + * Path to the PFX or PKCS12 encoded private key and certificate chain. + */ + pfxPath?: string; + + /** + * Direct value of the PFX or PKCS12 encoded private key and certificate chain. + */ + pfx?: Buffer; + + /** + * Passphrase for the private key (PEM or PFX). + */ + passphrase?: string; + }>; + /** * Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. @@ -41720,10 +42814,6 @@ export interface BrowserContextOptions { /** * Network proxy settings to use with this context. Defaults to none. - * - * **NOTE** For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If - * all contexts override the proxy, global proxy will be never used and can be any string, for example `launch({ - * proxy: { server: 'http://per-context' } })`. */ proxy?: { /** @@ -41820,504 +42910,188 @@ export interface BrowserContextOptions { }; /** - * Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See - * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. - * Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`. - */ - reducedMotion?: null|"reduce"|"no-preference"; - - /** - * Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the - * `viewport` is set. - */ - screen?: { - /** - * page width in pixels. - */ - width: number; - - /** - * page height in pixels. - */ - height: number; - }; - - /** - * Whether to allow sites to register Service workers. Defaults to `'allow'`. - * - `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be - * registered. - * - `'block'`: Playwright will block all registration of Service Workers. - */ - serviceWorkers?: "allow"|"block"; - - /** - * Learn more about [storage state and auth](https://playwright.dev/docs/auth). - * - * Populates context with given storage state. This option can be used to initialize context with logged-in - * information obtained via - * [browserContext.storageState([options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-storage-state). - */ - storageState?: string|{ - /** - * Cookies to set for context - */ - cookies: Array<{ - name: string; - - value: string; - - /** - * Domain and path are required. For the cookie to apply to all subdomains as well, prefix domain with a dot, like - * this: ".example.com" - */ - domain: string; - - /** - * Domain and path are required - */ - path: string; - - /** - * Unix time in seconds. - */ - expires: number; - - httpOnly: boolean; - - secure: boolean; - - /** - * sameSite flag - */ - sameSite: "Strict"|"Lax"|"None"; - }>; - - /** - * localStorage to set for context - */ - origins: Array<{ - origin: string; - - localStorage: Array<{ - name: string; - - value: string; - }>; - }>; - }; - - /** - * If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on - * selectors that imply single target DOM element will throw when more than one element matches the selector. This - * option does not affect any Locator APIs (Locators are always strict). Defaults to `false`. See {@link Locator} to - * learn more about the strict mode. - */ - strictSelectors?: boolean; - - /** - * Changes the timezone of the context. See - * [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1) - * for a list of supported timezone IDs. Defaults to the system timezone. - */ - timezoneId?: string; - - /** - * Specific user agent to use in this context. - */ - userAgent?: string; - - /** - * @deprecated Use `recordVideo` instead. - */ - videoSize?: { - /** - * Video frame width. - */ - width: number; - - /** - * Video frame height. - */ - height: number; - }; - - /** - * @deprecated Use `recordVideo` instead. - */ - videosPath?: string; - - /** - * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `null` to disable the consistent - * viewport emulation. Learn more about [viewport emulation](https://playwright.dev/docs/emulation#viewport). - * - * **NOTE** The `null` value opts out from the default presets, makes viewport depend on the host window size defined - * by the operating system. It makes the execution of the tests non-deterministic. - */ - viewport?: null|ViewportSize; -} - -export interface ViewportSize { - /** - * page width in pixels. - */ - width: number; - - /** - * page height in pixels. - */ - height: number; -} - -export interface HTTPCredentials { - username: string; - - password: string; - - /** - * Restrain sending http credentials on specific origin (scheme://host:port). - */ - origin?: string; - - /** - * This option only applies to the requests sent from corresponding {@link APIRequestContext} and does not affect - * requests sent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be - * sent with the each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response - * with `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. - */ - send?: "unauthorized"|"always"; -} - -export interface Geolocation { - /** - * Latitude between -90 and 90. - */ - latitude: number; - - /** - * Longitude between -180 and 180. - */ - longitude: number; - - /** - * Non-negative accuracy value. Defaults to `0`. - */ - accuracy?: number; -} - -interface AccessibilitySnapshotOptions { - /** - * Prune uninteresting nodes from the tree. Defaults to `true`. - */ - interestingOnly?: boolean; - - /** - * The root DOM element for the snapshot. Defaults to the whole page. - */ - root?: ElementHandle; -} - -export interface LaunchOptions { - /** - * **NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality. - * - * Additional arguments to pass to the browser instance. The list of Chromium flags can be found - * [here](https://peter.sh/experiments/chromium-command-line-switches/). - */ - args?: Array; - - /** - * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", - * "msedge", "msedge-beta", "msedge-dev", "msedge-canary". Read more about using - * [Google Chrome and Microsoft Edge](https://playwright.dev/docs/browsers#google-chrome--microsoft-edge). - */ - channel?: string; - - /** - * Enable Chromium sandboxing. Defaults to `false`. - */ - chromiumSandbox?: boolean; - - /** - * **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the - * `headless` option will be set `false`. - * @deprecated Use [debugging tools](https://playwright.dev/docs/debug) instead. - */ - devtools?: boolean; - - /** - * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and - * is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were - * created in is closed. - */ - downloadsPath?: string; - - /** - * Specify environment variables that will be visible to the browser. Defaults to `process.env`. - */ - env?: { [key: string]: string|number|boolean; }; - - /** - * Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is - * resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, - * Firefox or WebKit, use at your own risk. - */ - executablePath?: string; - - /** - * Firefox user preferences. Learn more about the Firefox user preferences at - * [`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox). - */ - firefoxUserPrefs?: { [key: string]: string|number|boolean; }; - - /** - * Close the browser process on SIGHUP. Defaults to `true`. - */ - handleSIGHUP?: boolean; - - /** - * Close the browser process on Ctrl-C. Defaults to `true`. - */ - handleSIGINT?: boolean; - - /** - * Close the browser process on SIGTERM. Defaults to `true`. - */ - handleSIGTERM?: boolean; - - /** - * Whether to run browser in headless mode. More details for - * [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and - * [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the - * `devtools` option is `true`. - */ - headless?: boolean; - - /** - * If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. If an array is - * given, then filters out the given default arguments. Dangerous option; use with care. Defaults to `false`. - */ - ignoreDefaultArgs?: boolean|Array; - - /** - * Logger sink for Playwright logging. + * Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See + * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. + * Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`. */ - logger?: Logger; + reducedMotion?: null|"reduce"|"no-preference"; /** - * Network proxy settings. + * Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the + * `viewport` is set. */ - proxy?: { - /** - * Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or - * `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy. - */ - server: string; - - /** - * Optional comma-separated domains to bypass proxy, for example `".com, chromium.org, .domain.com"`. - */ - bypass?: string; - + screen?: { /** - * Optional username to use if HTTP proxy requires authentication. + * page width in pixels. */ - username?: string; + width: number; /** - * Optional password to use if HTTP proxy requires authentication. + * page height in pixels. */ - password?: string; + height: number; }; /** - * Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going - * on. + * Whether to allow sites to register Service workers. Defaults to `'allow'`. + * - `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be + * registered. + * - `'block'`: Playwright will block all registration of Service Workers. */ - slowMo?: number; + serviceWorkers?: "allow"|"block"; /** - * Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` - * to disable timeout. + * Learn more about [storage state and auth](https://playwright.dev/docs/auth). + * + * Populates context with given storage state. This option can be used to initialize context with logged-in + * information obtained via + * [browserContext.storageState([options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-storage-state). */ - timeout?: number; + storageState?: string|{ + /** + * Cookies to set for context + */ + cookies: Array<{ + name: string; - /** - * If specified, traces are saved into this directory. - */ - tracesDir?: string; -} + value: string; -export interface ConnectOverCDPOptions { - /** - * Deprecated, use the first argument instead. Optional. - */ - endpointURL?: string; + /** + * Domain and path are required. For the cookie to apply to all subdomains as well, prefix domain with a dot, like + * this: ".example.com" + */ + domain: string; - /** - * Additional HTTP headers to be sent with connect request. Optional. - */ - headers?: { [key: string]: string; }; + /** + * Domain and path are required + */ + path: string; - /** - * Logger sink for Playwright logging. Optional. - */ - logger?: Logger; + /** + * Unix time in seconds. + */ + expires: number; - /** - * Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going - * on. Defaults to 0. - */ - slowMo?: number; + httpOnly: boolean; - /** - * Maximum time in milliseconds to wait for the connection to be established. Defaults to `30000` (30 seconds). Pass - * `0` to disable timeout. - */ - timeout?: number; -} + secure: boolean; -export interface ConnectOptions { - /** - * This option exposes network available on the connecting client to the browser being connected to. Consists of a - * list of rules separated by comma. - * - * Available rules: - * 1. Hostname pattern, for example: `example.com`, `*.org:99`, `x.*.y.com`, `*foo.org`. - * 1. IP literal, for example: `127.0.0.1`, `0.0.0.0:99`, `[::1]`, `[0:0::1]:99`. - * 1. `` that matches local loopback interfaces: `localhost`, `*.localhost`, `127.0.0.1`, `[::1]`. - * - * Some common examples: - * 1. `"*"` to expose all network. - * 1. `""` to expose localhost network. - * 1. `"*.test.internal-domain,*.staging.internal-domain,"` to expose test/staging deployments and - * localhost. - */ - exposeNetwork?: string; + /** + * sameSite flag + */ + sameSite: "Strict"|"Lax"|"None"; + }>; - /** - * Additional HTTP headers to be sent with web socket connect request. Optional. - */ - headers?: { [key: string]: string; }; + /** + * localStorage to set for context + */ + origins: Array<{ + origin: string; - /** - * Logger sink for Playwright logging. Optional. - */ - logger?: Logger; + localStorage: Array<{ + name: string; - /** - * Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going - * on. Defaults to 0. - */ - slowMo?: number; + value: string; + }>; + }>; + }; /** - * Maximum time in milliseconds to wait for the connection to be established. Defaults to `0` (no timeout). + * If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on + * selectors that imply single target DOM element will throw when more than one element matches the selector. This + * option does not affect any Locator APIs (Locators are always strict). Defaults to `false`. See {@link Locator} to + * learn more about the strict mode. */ - timeout?: number; -} + strictSelectors?: boolean; -export interface LocatorScreenshotOptions { /** - * When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations. Animations get different - * treatment depending on their duration: - * - finite animations are fast-forwarded to completion, so they'll fire `transitionend` event. - * - infinite animations are canceled to initial state, and then played over after the screenshot. - * - * Defaults to `"allow"` that leaves animations untouched. + * Changes the timezone of the context. See + * [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1) + * for a list of supported timezone IDs. Defaults to the system timezone. */ - animations?: "disabled"|"allow"; + timezoneId?: string; /** - * When set to `"hide"`, screenshot will hide text caret. When set to `"initial"`, text caret behavior will not be - * changed. Defaults to `"hide"`. + * Specific user agent to use in this context. */ - caret?: "hide"|"initial"; + userAgent?: string; /** - * Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink - * box `#FF00FF` (customized by `maskColor`) that completely covers its bounding box. + * @deprecated Use `recordVideo` instead. */ - mask?: Array; + videoSize?: { + /** + * Video frame width. + */ + width: number; - /** - * Specify the color of the overlay box for masked elements, in - * [CSS color format](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Default color is pink `#FF00FF`. - */ - maskColor?: string; + /** + * Video frame height. + */ + height: number; + }; /** - * Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images. - * Defaults to `false`. + * @deprecated Use `recordVideo` instead. */ - omitBackground?: boolean; + videosPath?: string; /** - * The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a - * relative path, then it is resolved relative to the current working directory. If no path is provided, the image - * won't be saved to the disk. + * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `null` to disable the consistent + * viewport emulation. Learn more about [viewport emulation](https://playwright.dev/docs/emulation#viewport). + * + * **NOTE** The `null` value opts out from the default presets, makes viewport depend on the host window size defined + * by the operating system. It makes the execution of the tests non-deterministic. */ - path?: string; + viewport?: null|ViewportSize; +} +export interface ViewportSize { /** - * The quality of the image, between 0-100. Not applicable to `png` images. + * page width in pixels. */ - quality?: number; + width: number; /** - * When set to `"css"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this - * will keep screenshots small. Using `"device"` option will produce a single pixel per each device pixel, so - * screenshots of high-dpi devices will be twice as large or even larger. - * - * Defaults to `"device"`. + * page height in pixels. */ - scale?: "css"|"device"; + height: number; +} - /** - * Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make - * elements invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces - * the Shadow DOM and applies to the inner frames. - */ - style?: string; +export interface HTTPCredentials { + username: string; + + password: string; /** - * Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` - * option in the config, or by using the - * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) - * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods. + * Restrain sending http credentials on specific origin (scheme://host:port). */ - timeout?: number; + origin?: string; /** - * Specify screenshot type, defaults to `png`. + * This option only applies to the requests sent from corresponding {@link APIRequestContext} and does not affect + * requests sent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be + * sent with the each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response + * with `WWW-Authenticate` header is received. Defaults to `'unauthorized'`. */ - type?: "png"|"jpeg"; + send?: "unauthorized"|"always"; } -interface ElementHandleWaitForSelectorOptions { +export interface Geolocation { /** - * Defaults to `'visible'`. Can be either: - * - `'attached'` - wait for element to be present in DOM. - * - `'detached'` - wait for element to not be present in DOM. - * - `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element - * without any content or with `display:none` has an empty bounding box and is not considered visible. - * - `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or - * `visibility:hidden`. This is opposite to the `'visible'` option. + * Latitude between -90 and 90. */ - state?: "attached"|"detached"|"visible"|"hidden"; + latitude: number; /** - * When true, the call requires selector to resolve to a single element. If given selector resolves to more than one - * element, the call throws an exception. + * Longitude between -180 and 180. */ - strict?: boolean; + longitude: number; /** - * Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` - * option in the config, or by using the - * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) - * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods. + * Non-negative accuracy value. Defaults to `0`. */ - timeout?: number; + accuracy?: number; } export interface Cookie { @@ -42570,6 +43344,14 @@ type Devices = { "iPhone 14 Pro landscape": DeviceDescriptor; "iPhone 14 Pro Max": DeviceDescriptor; "iPhone 14 Pro Max landscape": DeviceDescriptor; + "iPhone 15": DeviceDescriptor; + "iPhone 15 landscape": DeviceDescriptor; + "iPhone 15 Plus": DeviceDescriptor; + "iPhone 15 Plus landscape": DeviceDescriptor; + "iPhone 15 Pro": DeviceDescriptor; + "iPhone 15 Pro landscape": DeviceDescriptor; + "iPhone 15 Pro Max": DeviceDescriptor; + "iPhone 15 Pro Max landscape": DeviceDescriptor; "Kindle Fire HDX": DeviceDescriptor; "Kindle Fire HDX landscape": DeviceDescriptor; "LG Optimus L70": DeviceDescriptor; @@ -43001,7 +43783,7 @@ interface TestProject { /** * Whether to skip entries from `.gitignore` when searching for test files. By default, if neither * [testConfig.testDir](https://playwright.dev/docs/api/class-testconfig#test-config-test-dir) nor - * [testProject.testDir](https://playwright.dev/docs/api/class-testproject#test-project-test-dir) are explicitely + * [testProject.testDir](https://playwright.dev/docs/api/class-testproject#test-project-test-dir) are explicitly * specified, Playwright will ignore any test files matching `.gitignore` entries. This option allows to override that * behavior. */ @@ -47445,18 +48227,19 @@ export type WorkerFixture = (args: Args, use: (r: R) = type TestFixtureValue = Exclude | TestFixture; type WorkerFixtureValue = Exclude | WorkerFixture; export type Fixtures = { - [K in keyof PW]?: WorkerFixtureValue | [WorkerFixtureValue, { scope: 'worker', timeout?: number | undefined }]; + [K in keyof PW]?: WorkerFixtureValue | [WorkerFixtureValue, { scope: 'worker', timeout?: number | undefined, title?: string, box?: boolean }]; } & { - [K in keyof PT]?: TestFixtureValue | [TestFixtureValue, { scope: 'test', timeout?: number | undefined }]; + [K in keyof PT]?: TestFixtureValue | [TestFixtureValue, { scope: 'test', timeout?: number | undefined, title?: string, box?: boolean }]; } & { - [K in keyof W]?: [WorkerFixtureValue, { scope: 'worker', auto?: boolean, option?: boolean, timeout?: number | undefined }]; + [K in keyof W]?: [WorkerFixtureValue, { scope: 'worker', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean }]; } & { - [K in keyof T]?: TestFixtureValue | [TestFixtureValue, { scope?: 'test', auto?: boolean, option?: boolean, timeout?: number | undefined }]; + [K in keyof T]?: TestFixtureValue | [TestFixtureValue, { scope?: 'test', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean }]; }; type BrowserName = 'chromium' | 'firefox' | 'webkit'; type BrowserChannel = Exclude; type ColorScheme = Exclude; +type ClientCertificate = Exclude[0]; type ExtraHTTPHeaders = Exclude; type Proxy = Exclude; type StorageState = Exclude; @@ -47531,164 +48314,255 @@ type ConnectOptions = { * ``` * */ -export interface PlaywrightWorkerOptions { - /** - * Name of the browser that runs tests. Defaults to `'chromium'`. Most of the time you should set `browserName` in - * your {@link TestConfig}: - * - * **Usage** - * - * ```js - * // playwright.config.ts - * import { defineConfig, devices } from '@playwright/test'; - * - * export default defineConfig({ - * use: { - * browserName: 'firefox', - * }, - * }); - * ``` - * - */ - browserName: BrowserName; - defaultBrowserType: BrowserName; - /** - * Whether to run browser in headless mode. More details for - * [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and - * [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the - * `devtools` option is `true`. - * - * **Usage** - * - * ```js - * // playwright.config.ts - * import { defineConfig } from '@playwright/test'; - * - * export default defineConfig({ - * use: { - * headless: false - * }, - * }); - * ``` - * - */ - headless: boolean; - /** - * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", - * "msedge", "msedge-beta", "msedge-dev", "msedge-canary". Read more about using - * [Google Chrome and Microsoft Edge](https://playwright.dev/docs/browsers#google-chrome--microsoft-edge). - * - * **Usage** - * - * ```js - * // playwright.config.ts - * import { defineConfig } from '@playwright/test'; - * - * export default defineConfig({ - * projects: [ - * { - * name: 'Microsoft Edge', - * use: { - * ...devices['Desktop Edge'], - * channel: 'msedge' - * }, - * }, - * ] - * }); - * ``` - * - */ - channel: BrowserChannel | undefined; - /** - * Options used to launch the browser, as passed to - * [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch). Specific - * options [testOptions.headless](https://playwright.dev/docs/api/class-testoptions#test-options-headless) and - * [testOptions.channel](https://playwright.dev/docs/api/class-testoptions#test-options-channel) take priority over - * this. - * - * **NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality. - * - * **Usage** - * - * ```js - * // playwright.config.ts - * import { defineConfig } from '@playwright/test'; - * - * export default defineConfig({ - * projects: [ - * { - * name: 'chromium', - * use: { - * ...devices['Desktop Chrome'], - * launchOptions: { - * args: ['--start-maximized'] - * } - * } - * } - * ] - * }); - * ``` - * - */ - launchOptions: Omit; - /** - * **Usage** - * - * ```js - * // playwright.config.ts - * import { defineConfig } from '@playwright/test'; - * - * export default defineConfig({ - * use: { - * connectOptions: { - * wsEndpoint: 'ws://localhost:5678', - * }, - * }, - * }); - * ``` - * - * When connect options are specified, default - * [fixtures.browser](https://playwright.dev/docs/api/class-fixtures#fixtures-browser), - * [fixtures.context](https://playwright.dev/docs/api/class-fixtures#fixtures-context) and - * [fixtures.page](https://playwright.dev/docs/api/class-fixtures#fixtures-page) use the remote browser instead of - * launching a browser locally, and any launch options like - * [testOptions.headless](https://playwright.dev/docs/api/class-testoptions#test-options-headless) or - * [testOptions.channel](https://playwright.dev/docs/api/class-testoptions#test-options-channel) are ignored. - */ - connectOptions: ConnectOptions | undefined; - /** - * Whether to automatically capture a screenshot after each test. Defaults to `'off'`. - * - `'off'`: Do not capture screenshots. - * - `'on'`: Capture screenshot after each test. - * - `'only-on-failure'`: Capture screenshot after each test failure. - * - * **Usage** - * - * ```js - * // playwright.config.ts - * import { defineConfig } from '@playwright/test'; - * - * export default defineConfig({ - * use: { - * screenshot: 'only-on-failure', - * }, - * }); - * ``` - * - * Learn more about [automatic screenshots](https://playwright.dev/docs/test-use-options#recording-options). - */ - screenshot: ScreenshotMode | { mode: ScreenshotMode } & Pick; +export interface PlaywrightWorkerOptions { + /** + * Name of the browser that runs tests. Defaults to `'chromium'`. Most of the time you should set `browserName` in + * your {@link TestConfig}: + * + * **Usage** + * + * ```js + * // playwright.config.ts + * import { defineConfig, devices } from '@playwright/test'; + * + * export default defineConfig({ + * use: { + * browserName: 'firefox', + * }, + * }); + * ``` + * + */ + browserName: BrowserName; + defaultBrowserType: BrowserName; + /** + * Whether to run browser in headless mode. More details for + * [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and + * [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the + * `devtools` option is `true`. + * + * **Usage** + * + * ```js + * // playwright.config.ts + * import { defineConfig } from '@playwright/test'; + * + * export default defineConfig({ + * use: { + * headless: false + * }, + * }); + * ``` + * + */ + headless: boolean; + /** + * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", + * "msedge", "msedge-beta", "msedge-dev", "msedge-canary". Read more about using + * [Google Chrome and Microsoft Edge](https://playwright.dev/docs/browsers#google-chrome--microsoft-edge). + * + * **Usage** + * + * ```js + * // playwright.config.ts + * import { defineConfig } from '@playwright/test'; + * + * export default defineConfig({ + * projects: [ + * { + * name: 'Microsoft Edge', + * use: { + * ...devices['Desktop Edge'], + * channel: 'msedge' + * }, + * }, + * ] + * }); + * ``` + * + */ + channel: BrowserChannel | undefined; + /** + * Options used to launch the browser, as passed to + * [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch). Specific + * options [testOptions.headless](https://playwright.dev/docs/api/class-testoptions#test-options-headless) and + * [testOptions.channel](https://playwright.dev/docs/api/class-testoptions#test-options-channel) take priority over + * this. + * + * **NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality. + * + * **Usage** + * + * ```js + * // playwright.config.ts + * import { defineConfig } from '@playwright/test'; + * + * export default defineConfig({ + * projects: [ + * { + * name: 'chromium', + * use: { + * ...devices['Desktop Chrome'], + * launchOptions: { + * args: ['--start-maximized'] + * } + * } + * } + * ] + * }); + * ``` + * + */ + launchOptions: Omit; + /** + * **Usage** + * + * ```js + * // playwright.config.ts + * import { defineConfig } from '@playwright/test'; + * + * export default defineConfig({ + * use: { + * connectOptions: { + * wsEndpoint: 'ws://localhost:5678', + * }, + * }, + * }); + * ``` + * + * When connect options are specified, default + * [fixtures.browser](https://playwright.dev/docs/api/class-fixtures#fixtures-browser), + * [fixtures.context](https://playwright.dev/docs/api/class-fixtures#fixtures-context) and + * [fixtures.page](https://playwright.dev/docs/api/class-fixtures#fixtures-page) use the remote browser instead of + * launching a browser locally, and any launch options like + * [testOptions.headless](https://playwright.dev/docs/api/class-testoptions#test-options-headless) or + * [testOptions.channel](https://playwright.dev/docs/api/class-testoptions#test-options-channel) are ignored. + */ + connectOptions: ConnectOptions | undefined; + /** + * Whether to automatically capture a screenshot after each test. Defaults to `'off'`. + * - `'off'`: Do not capture screenshots. + * - `'on'`: Capture screenshot after each test. + * - `'only-on-failure'`: Capture screenshot after each test failure. + * + * **Usage** + * + * ```js + * // playwright.config.ts + * import { defineConfig } from '@playwright/test'; + * + * export default defineConfig({ + * use: { + * screenshot: 'only-on-failure', + * }, + * }); + * ``` + * + * Learn more about [automatic screenshots](https://playwright.dev/docs/test-use-options#recording-options). + */ + screenshot: ScreenshotMode | { mode: ScreenshotMode } & Pick; + /** + * Whether to record trace for each test. Defaults to `'off'`. + * - `'off'`: Do not record trace. + * - `'on'`: Record trace for each test. + * - `'on-first-retry'`: Record trace only when retrying a test for the first time. + * - `'on-all-retries'`: Record trace only when retrying a test. + * - `'retain-on-failure'`: Record trace for each test. When test run passes, remove the recorded trace. + * - `'retain-on-first-failure'`: Record trace for the first run of each test, but not for retries. When test run + * passes, remove the recorded trace. + * + * For more control, pass an object that specifies `mode` and trace features to enable. + * + * **Usage** + * + * ```js + * // playwright.config.ts + * import { defineConfig } from '@playwright/test'; + * + * export default defineConfig({ + * use: { + * trace: 'on-first-retry' + * }, + * }); + * ``` + * + * Learn more about [recording trace](https://playwright.dev/docs/test-use-options#recording-options). + */ + trace: TraceMode | /** deprecated */ 'retry-with-trace' | { mode: TraceMode, snapshots?: boolean, screenshots?: boolean, sources?: boolean, attachments?: boolean }; + /** + * Whether to record video for each test. Defaults to `'off'`. + * - `'off'`: Do not record video. + * - `'on'`: Record video for each test. + * - `'retain-on-failure'`: Record video for each test, but remove all videos from successful test runs. + * - `'on-first-retry'`: Record video only when retrying a test for the first time. + * + * To control video size, pass an object with `mode` and `size` properties. If video size is not specified, it will be + * equal to [testOptions.viewport](https://playwright.dev/docs/api/class-testoptions#test-options-viewport) scaled + * down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual + * picture of each page will be scaled down if necessary to fit the specified size. + * + * **Usage** + * + * ```js + * // playwright.config.ts + * import { defineConfig } from '@playwright/test'; + * + * export default defineConfig({ + * use: { + * video: 'on-first-retry', + * }, + * }); + * ``` + * + * Learn more about [recording video](https://playwright.dev/docs/test-use-options#recording-options). + */ + video: VideoMode | /** deprecated */ 'retry-with-video' | { mode: VideoMode, size?: ViewportSize }; +} + +export type ScreenshotMode = 'off' | 'on' | 'only-on-failure'; +export type TraceMode = 'off' | 'on' | 'retain-on-failure' | 'on-first-retry' | 'on-all-retries' | 'retain-on-first-failure'; +export type VideoMode = 'off' | 'on' | 'retain-on-failure' | 'on-first-retry'; + +/** + * Playwright Test provides many options to configure test environment, {@link Browser}, {@link BrowserContext} and + * more. + * + * These options are usually provided in the [configuration file](https://playwright.dev/docs/test-configuration) through + * [testConfig.use](https://playwright.dev/docs/api/class-testconfig#test-config-use) and + * [testProject.use](https://playwright.dev/docs/api/class-testproject#test-project-use). + * + * ```js + * // playwright.config.ts + * import { defineConfig } from '@playwright/test'; + * export default defineConfig({ + * use: { + * headless: false, + * viewport: { width: 1280, height: 720 }, + * ignoreHTTPSErrors: true, + * video: 'on-first-retry', + * }, + * }); + * ``` + * + * Alternatively, with [test.use(options)](https://playwright.dev/docs/api/class-test#test-use) you can override some + * options for a file. + * + * ```js + * // example.spec.ts + * import { test, expect } from '@playwright/test'; + * + * // Run tests in this file with portrait-like viewport. + * test.use({ viewport: { width: 600, height: 900 } }); + * + * test('my portrait test', async ({ page }) => { + * // ... + * }); + * ``` + * + */ +export interface PlaywrightTestOptions { /** - * Whether to record trace for each test. Defaults to `'off'`. - * - `'off'`: Do not record trace. - * - `'on'`: Record trace for each test. - * - `'on-first-retry'`: Record trace only when retrying a test for the first time. - * - `'on-all-retries'`: Record trace only when retrying a test. - * - `'retain-on-failure'`: Record trace for each test. When test run passes, remove the recorded trace. - * - `'retain-on-first-failure'`: Record trace for the first run of each test, but not for retries. When test run - * passes, remove the recorded trace. - * - * For more control, pass an object that specifies `mode` and trace features to enable. + * Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted. * * **Usage** * @@ -47698,25 +48572,15 @@ export interface PlaywrightWorkerOptions { * * export default defineConfig({ * use: { - * trace: 'on-first-retry' + * acceptDownloads: false, * }, * }); * ``` * - * Learn more about [recording trace](https://playwright.dev/docs/test-use-options#recording-options). */ - trace: TraceMode | /** deprecated */ 'retry-with-trace' | { mode: TraceMode, snapshots?: boolean, screenshots?: boolean, sources?: boolean, attachments?: boolean }; + acceptDownloads: boolean; /** - * Whether to record video for each test. Defaults to `'off'`. - * - `'off'`: Do not record video. - * - `'on'`: Record video for each test. - * - `'retain-on-failure'`: Record video for each test, but remove all videos from successful test runs. - * - `'on-first-retry'`: Record video only when retrying a test for the first time. - * - * To control video size, pass an object with `mode` and `size` properties. If video size is not specified, it will be - * equal to [testOptions.viewport](https://playwright.dev/docs/api/class-testoptions#test-options-viewport) scaled - * down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual - * picture of each page will be scaled down if necessary to fit the specified size. + * Toggles bypassing page's Content-Security-Policy. Defaults to `false`. * * **Usage** * @@ -47726,60 +48590,17 @@ export interface PlaywrightWorkerOptions { * * export default defineConfig({ * use: { - * video: 'on-first-retry', - * }, + * bypassCSP: true, + * } * }); * ``` * - * Learn more about [recording video](https://playwright.dev/docs/test-use-options#recording-options). */ - video: VideoMode | /** deprecated */ 'retry-with-video' | { mode: VideoMode, size?: ViewportSize }; -} - -export type ScreenshotMode = 'off' | 'on' | 'only-on-failure'; -export type TraceMode = 'off' | 'on' | 'retain-on-failure' | 'on-first-retry' | 'on-all-retries' | 'retain-on-first-failure'; -export type VideoMode = 'off' | 'on' | 'retain-on-failure' | 'on-first-retry'; - -/** - * Playwright Test provides many options to configure test environment, {@link Browser}, {@link BrowserContext} and - * more. - * - * These options are usually provided in the [configuration file](https://playwright.dev/docs/test-configuration) through - * [testConfig.use](https://playwright.dev/docs/api/class-testconfig#test-config-use) and - * [testProject.use](https://playwright.dev/docs/api/class-testproject#test-project-use). - * - * ```js - * // playwright.config.ts - * import { defineConfig } from '@playwright/test'; - * export default defineConfig({ - * use: { - * headless: false, - * viewport: { width: 1280, height: 720 }, - * ignoreHTTPSErrors: true, - * video: 'on-first-retry', - * }, - * }); - * ``` - * - * Alternatively, with [test.use(options)](https://playwright.dev/docs/api/class-test#test-use) you can override some - * options for a file. - * - * ```js - * // example.spec.ts - * import { test, expect } from '@playwright/test'; - * - * // Run tests in this file with portrait-like viewport. - * test.use({ viewport: { width: 600, height: 900 } }); - * - * test('my portrait test', async ({ page }) => { - * // ... - * }); - * ``` - * - */ -export interface PlaywrightTestOptions { + bypassCSP: boolean; /** - * Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted. + * Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See + * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. + * Passing `null` resets emulation to system defaults. Defaults to `'light'`. * * **Usage** * @@ -47789,35 +48610,27 @@ export interface PlaywrightTestOptions { * * export default defineConfig({ * use: { - * acceptDownloads: false, + * colorScheme: 'dark', * }, * }); * ``` * */ - acceptDownloads: boolean; + colorScheme: ColorScheme; /** - * Toggles bypassing page's Content-Security-Policy. Defaults to `false`. + * TLS Client Authentication allows the server to request a client certificate and verify it. * - * **Usage** + * **Details** * - * ```js - * // playwright.config.ts - * import { defineConfig } from '@playwright/test'; + * An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, + * a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, + * `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided + * with an exact match to the request origin that the certificate is valid for. * - * export default defineConfig({ - * use: { - * bypassCSP: true, - * } - * }); - * ``` + * **NOTE** Using Client Certificates in combination with Proxy Servers is not supported. * - */ - bypassCSP: boolean; - /** - * Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See - * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. - * Passing `null` resets emulation to system defaults. Defaults to `'light'`. + * **NOTE** When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it + * work by replacing `localhost` with `local.playwright`. * * **Usage** * @@ -47827,13 +48640,18 @@ export interface PlaywrightTestOptions { * * export default defineConfig({ * use: { - * colorScheme: 'dark', + * clientCertificates: [{ + * origin: 'https://example.com', + * certPath: './cert.pem', + * keyPath: './key.pem', + * passphrase: 'mysecretpassword', + * }], * }, * }); * ``` * */ - colorScheme: ColorScheme; + clientCertificates: ClientCertificate[] | undefined; /** * Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about * [emulating devices with device scale factor](https://playwright.dev/docs/emulation#devices). @@ -49163,15 +49981,17 @@ type MakeMatchers = { rejects: MakeMatchers, any, ExtendedMatchers>; } & IfAny, SpecificMatchers & ToUserMatcherObject>; +type PollMatchers = { + /** + * If you know how to test something, `.not` lets you test its opposite. + */ + not: PollMatchers; +} & BaseMatchers & ToUserMatcherObject; + export type Expect = { (actual: T, messageOrOptions?: string | { message?: string }): MakeMatchers; soft: (actual: T, messageOrOptions?: string | { message?: string }) => MakeMatchers; - poll: (actual: () => T | Promise, messageOrOptions?: string | { message?: string, timeout?: number, intervals?: number[] }) => BaseMatchers, T> & { - /** - * If you know how to test something, `.not` lets you test its opposite. - */ - not: BaseMatchers, T>; - }; + poll: (actual: () => T | Promise, messageOrOptions?: string | { message?: string, timeout?: number, intervals?: number[] }) => PollMatchers, T, ExtendedMatchers>; extend MatcherReturnType | Promise>>(matchers: MoreMatchers): Expect; configure: (configuration: { message?: string, diff --git a/frontend/src/components/ResponseFile/index.tsx b/frontend/src/components/ResponseFile/index.tsx index b9bbd05..a1a5b64 100644 --- a/frontend/src/components/ResponseFile/index.tsx +++ b/frontend/src/components/ResponseFile/index.tsx @@ -37,9 +37,8 @@ const ResponseFile: React.FunctionComponent = ({ file }) => { } const ResponseFileWrapper: React.FunctionComponent = ({ file }) => { - const { publicURL, fileName, extension } = file return

- {fileName} + {file.fileName}

} diff --git a/frontend/src/examples/playwright-test/intro.ts b/frontend/src/examples/playwright-test/intro.ts index 75a1093..87cce5d 100644 --- a/frontend/src/examples/playwright-test/intro.ts +++ b/frontend/src/examples/playwright-test/intro.ts @@ -1,7 +1,18 @@ import { test, expect } from '@playwright/test'; -test('basic test', async ({ page }) => { +test('has title', async ({ page }) => { await page.goto('https://playwright.dev/'); - const title = page.locator('.navbar__inner .navbar__title'); - await expect(title).toHaveText('Playwright'); + + // Expect a title "to contain" a substring. + await expect(page).toHaveTitle(/Playwright/); +}); + +test('get started link', async ({ page }) => { + await page.goto('https://playwright.dev/'); + + // Click the get started link. + await page.getByRole('link', { name: 'Get started' }).click(); + + // Expects page to have a heading with the name of Installation. + await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible(); }); \ No newline at end of file diff --git a/worker-csharp/Dockerfile b/worker-csharp/Dockerfile index a1c5ec5..65d074c 100644 --- a/worker-csharp/Dockerfile +++ b/worker-csharp/Dockerfile @@ -1,4 +1,4 @@ -ARG PLAYWRIGHT_VERSION=1.45.0 +ARG PLAYWRIGHT_VERSION=1.46.0 FROM golang:1.20-buster as builder WORKDIR /root COPY go.mod /root/ diff --git a/worker-java/Dockerfile b/worker-java/Dockerfile index 5136111..be47f83 100644 --- a/worker-java/Dockerfile +++ b/worker-java/Dockerfile @@ -1,4 +1,4 @@ -ARG PLAYWRIGHT_VERSION=1.45.0 +ARG PLAYWRIGHT_VERSION=1.46.0 FROM golang:1.20-buster as builder WORKDIR /root COPY go.mod /root/ diff --git a/worker-javascript/Dockerfile b/worker-javascript/Dockerfile index fa76937..c2d6e8d 100644 --- a/worker-javascript/Dockerfile +++ b/worker-javascript/Dockerfile @@ -1,4 +1,4 @@ -ARG PLAYWRIGHT_VERSION=1.45.1 +ARG PLAYWRIGHT_VERSION=1.47.0 FROM golang:1.20-buster as builder WORKDIR /root COPY go.mod /root/ diff --git a/worker-python/Dockerfile b/worker-python/Dockerfile index 5807bdf..e1ff2a6 100644 --- a/worker-python/Dockerfile +++ b/worker-python/Dockerfile @@ -1,4 +1,4 @@ -ARG PLAYWRIGHT_VERSION=1.45.0 +ARG PLAYWRIGHT_VERSION=1.46.0 FROM golang:1.20-buster as builder WORKDIR /root COPY go.mod /root/