Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix: ensure browser versions in browsers.json (#16760)

Andrey Lushnikove7fa9432fbfe
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[^: ]*):?([^ ]*)");