Issue 1:
Context:

Playwright Version: 1.22.2

Operating System: Windows 10 21H2 & macOS Monterey

Node.js version: v16.14.0

Browser: Chromium

Extra: [any specific details about your environment]

Windows 10 System:

OS: Windows 10 10.0.19044

Memory: 10.86 GB / 31.71 GB

Windows 10 Binaries:

Node: 16.15.0 - C:\Program Files\nodejs\node.EXE

npm: 8.5.5 - C:\Program Files\nodejs\npm.CMD

macOS 12.3.1 System:

OS: macOS 12.3.1

Memory: 89.27 MB / 64.00 GB

macOS 12.3.1 Binaries:

Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node

Yarn: 1.22.17 - /opt/homebrew/bin/yarn

npm: 8.3.1 - ~/.nvm/versions/node/v16.14.0/bin/npm

macOS 12.3.1 Languages:

Bash: 3.2.57 - /bin/bash

##Code Snippet

As per @mxschmitt they wanted a minimal reproducible attached in the form of a GitHub repository took some time to strip most of the data that is relevant to my work project and still be able to repro. I think it's related to data-driven test cases coming from my caseData.json file, when I remove it the Buffer() issues go away, but I need data-driven test cases.

Minimum Reproducible Github Repository:

qa-automation-playwright

(node:355124) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use 'node --trace-deprecation ... ' to show where the warning was created)

Using node --trace-deprecation ....

Error: Cannot find module 'C:\Source\Repos\qa-automation\tests\...'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []

Checking for playwright duplicates

npm list

qa-automation-playwright@0.0.1 C:\Source\Repos\qa-automation-playwright
├── @playwright/test@1.23.0-alpha-jun-7-2022
├── prettier@2.6.2
└── testcafe-react-selectors@5.0.1

From the project locally I'm seeing 1.23.0-alpha-jun-7-2022 and when I attempt npm list -g I only see grunt installed.

When I run npx playwright -V see:

PS C:\Source\Repos\qa-automation-playwright> npx playwright -V
Version 1.23.0-alpha-jun-7-2022

##Test Script Output:

[TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[Chromium] › e2e\e2e-registration.spec.ts:22:9 › Registration › Registration on Product
[Chromium] › e2e\e2e-registration.spec.ts:22:9 › Registration › Registration on Product
(node:328216) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
[TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
(node:341020) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
[Chromium] › e2e\e2e-registration.spec.ts:22:9 › Registration › Registration on Product
(node:355124) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
[TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[Chromium] › e2e\e2e-registration.spec.ts:22:9 › Registration › Registration on Product
(node:358552) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

Windows 10 Stack Trace

$Env:NODE_OPTIONS="--trace-deprecation"
npx playwright test --config=playwright.config.ts --project=Chromium

PS C:\Source\Repos\qa-automation-playwright\tests> $Env:NODE_OPTIONS="--trace-deprecation"
PS C:\Source\Repos\qa-automation-playwright\tests> npx playwright test --config=playwright.config.ts --project=Chromium
[TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Running 7 tests using 6 workers

(node:474972) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
at showFlaggedDeprecation (node:buffer:187:11)
at new Buffer (node:buffer:271:3)
at Array.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644)
at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666
at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782)
at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427)
at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10
at Array.map (<anonymous>)
at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810)
at maybeOverridePrepareStackTrace (node:internal/errors:142:29)
at prepareStackTrace (node:internal/errors:116:5)
at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15)
at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14
at Object.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17)
[TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration
[TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration
(node:484728) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
at showFlaggedDeprecation (node:buffer:187:11)
at new Buffer (node:buffer:271:3)
at Array.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644)
at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666
at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782)
at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427)
at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10
at Array.map (<anonymous>)
at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810)
at maybeOverridePrepareStackTrace (node:internal/errors:142:29)
at prepareStackTrace (node:internal/errors:116:5)
at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15)
at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14
at Object.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17)
(node:470588) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
at showFlaggedDeprecation (node:buffer:187:11)
at new Buffer (node:buffer:271:3)
at Array.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644)
at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666
at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782)
at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427)
at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10
at Array.map (<anonymous>)
at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810)
at maybeOverridePrepareStackTrace (node:internal/errors:142:29)
at prepareStackTrace (node:internal/errors:116:5)
at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15)
at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14
at Object.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17)
[TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration
[Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration
(node:493340) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
at showFlaggedDeprecation (node:buffer:187:11)
at new Buffer (node:buffer:271:3)
at Array.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644)
at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666
at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782)
at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427)
at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10
at Array.map (<anonymous>)
at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810)
at maybeOverridePrepareStackTrace (node:internal/errors:142:29)
at prepareStackTrace (node:internal/errors:116:5)
at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15)
at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14
at Object.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17)
(node:449628) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
at showFlaggedDeprecation (node:buffer:187:11)
at new Buffer (node:buffer:271:3)
at Array.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644)
at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666
at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782)
at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427)
at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10
at Array.map (<anonymous>)
at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810)
at maybeOverridePrepareStackTrace (node:internal/errors:142:29)
at prepareStackTrace (node:internal/errors:116:5)
at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15)
at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14
at Object.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17)
[TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[TestData] Json TestCaseData: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration
[Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration
(node:488108) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
at showFlaggedDeprecation (node:buffer:187:11)
at new Buffer (node:buffer:271:3)
at Array.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644)
at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666
at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782)
at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427)
at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10
at Array.map (<anonymous>)
at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810)
at maybeOverridePrepareStackTrace (node:internal/errors:142:29)
at prepareStackTrace (node:internal/errors:116:5)
at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15)
at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14
at Object.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17)
(node:476512) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
at showFlaggedDeprecation (node:buffer:187:11)
at new Buffer (node:buffer:271:3)
at Array.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28644)
at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:27666
at oe (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:28782)
at Er (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30427)
at C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:17:10
at Array.map (<anonymous>)
at Function.pt [as prepareStackTrace] (C:\Source\Repos\qa-automation-playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:30810)
at maybeOverridePrepareStackTrace (node:internal/errors:142:29)
at prepareStackTrace (node:internal/errors:116:5)
at extendedTrace (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:68:15)
at C:\Source\Repos\qa-automation-playwright\node_modules\@babel\template\lib\builder.js:25:14
at Object.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\for-await.js:10:42)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
✓ [Chromium] › e2e\e2e-registration.spec.ts:22:9 › Onboarding | Registration › Registration (16s)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Source\Repos\qa-automation-playwright\node_modules\@babel\plugin-proposal-async-generator-functions\lib\index.js:16:17)

Describe the bug

*During npx playwright test --config=playwright.config.ts --project=Chromium this error occurs even after attempting to upgrade to latest alpha build with Merge PR 14638 fix: hide DeprecationWarning of fd-slicer

Buffer() keeps being thrown, I have zeroed down on data-driven JSON file causing the issue, why, I don't know. If I remove the JSON file the errors go away. I do not have dupe playwright or playwright/test versions installed.

It's not a super major issue, but it is spamming my test output

Minimum Reproducible Github Repository:

qa-automation-playwright

See Bug: DeprecationWarning: Buffer() is deprecated due to security and usability issues

Issue 2:
It would be helpful include the SHA256 sum of the browsers that are downloaded. That would allow the checking to ensure that the proper binary was downloaded as expected.

Additionally, this would aid in integration with other tools that may have download caches to prevent duplicated downloads.