From e7fa9432fbfef0a6f2b8d4ee9efe029ec162ac4b Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Tue, 23 Aug 2022 09:22:54 -0700 Subject: [PATCH] fix: ensure browser versions in browsers.json (#16760) Fixes #15702 --- utils/doclint/cli.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/utils/doclint/cli.js b/utils/doclint/cli.js index fc5e977953..816d2ff1eb 100755 --- a/utils/doclint/cli.js +++ b/utils/doclint/cli.js @@ -74,6 +74,19 @@ async function run() { if (playwrightVersion.endsWith('-next')) playwrightVersion = playwrightVersion.substring(0, playwrightVersion.indexOf('-next')); + // Ensure browser versions in browsers.json. This is most important for WebKit + // since its version is hardcoded in Playwright library rather then in browser builds. + // @see https://github.com/microsoft/playwright/issues/15702 + { + const browsersJSONPath = path.join(__dirname, '..', '..', 'packages/playwright-core/browsers.json'); + const browsersJSON = JSON.parse(await fs.promises.readFile(browsersJSONPath, 'utf8')); + for (const browser of browsersJSON.browsers) { + if (versions[browser.name]) + browser.browserVersion = versions[browser.name]; + } + writeAssumeNoop(browsersJSONPath, JSON.stringify(browsersJSON, null, 2) + '\n', dirtyFiles); + } + // Patch docker version in docs { const regex = new RegExp("(mcr.microsoft.com/playwright[^: ]*):?([^ ]*)");