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

Fixes #15702
This commit is contained in:
Andrey Lushnikov 2022-08-23 09:22:54 -07:00 committed by GitHub
parent d99b93c38a
commit e7fa9432fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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