diff --git a/package.json b/package.json index 47db1ce7a..f1f8db5c8 100644 --- a/package.json +++ b/package.json @@ -44,29 +44,29 @@ }, "taiko": { "browser": { - "version": "126.0.6468.0", - "revision": "1298436", + "version": "128.0.6597.0", + "revision": "1327306", "downloads": { "chrome": [ { "platform": "linux64", - "url": "https://storage.googleapis.com/chrome-for-testing-public/126.0.6468.0/linux64/chrome-linux64.zip" + "url": "https://storage.googleapis.com/chrome-for-testing-public/128.0.6597.0/linux64/chrome-linux64.zip" }, { "platform": "mac-arm64", - "url": "https://storage.googleapis.com/chrome-for-testing-public/126.0.6468.0/mac-arm64/chrome-mac-arm64.zip" + "url": "https://storage.googleapis.com/chrome-for-testing-public/128.0.6597.0/mac-arm64/chrome-mac-arm64.zip" }, { "platform": "mac-x64", - "url": "https://storage.googleapis.com/chrome-for-testing-public/126.0.6468.0/mac-x64/chrome-mac-x64.zip" + "url": "https://storage.googleapis.com/chrome-for-testing-public/128.0.6597.0/mac-x64/chrome-mac-x64.zip" }, { "platform": "win32", - "url": "https://storage.googleapis.com/chrome-for-testing-public/126.0.6468.0/win32/chrome-win32.zip" + "url": "https://storage.googleapis.com/chrome-for-testing-public/128.0.6597.0/win32/chrome-win32.zip" }, { "platform": "win64", - "url": "https://storage.googleapis.com/chrome-for-testing-public/126.0.6468.0/win64/chrome-win64.zip" + "url": "https://storage.googleapis.com/chrome-for-testing-public/128.0.6597.0/win64/chrome-win64.zip" } ] } diff --git a/scripts/updateChromium.ts b/scripts/updateChromium.ts index c0b1be617..a72343653 100644 --- a/scripts/updateChromium.ts +++ b/scripts/updateChromium.ts @@ -1,6 +1,6 @@ -import { writeFileSync, readFileSync } from 'fs'; -import { execSync } from 'child_process'; -import path from 'path'; +import { execSync } from 'node:child_process'; +import { readFileSync, writeFileSync } from 'node:fs'; +import path from 'node:path'; const PACKAGE_JSON_PATH = path.join(__dirname, '..', 'package.json'); @@ -20,15 +20,15 @@ interface ChromeReleaseInfo { } class ChromeUpdater { - private static readPackageJSON(): any { + private readPackageJSON() { return JSON.parse(readFileSync(PACKAGE_JSON_PATH, 'utf-8')); } - private static writePackageJSON(content: any): void { + private writePackageJSON(content: ChromeReleaseInfo): void { writeFileSync(PACKAGE_JSON_PATH, `${JSON.stringify(content, null, 2)}\n`); } - public static async updateChromeVersion(): Promise { + public async updateChromeVersion(): Promise { try { const latestVersion = await this.fetchLatestChromeVersion(); const currentVersion = this.getCurrentChromeVersion(); @@ -52,12 +52,12 @@ class ChromeUpdater { } } - private static getCurrentChromeVersion(): ChromeReleaseInfo { + private getCurrentChromeVersion(): ChromeReleaseInfo { const packageJSON = this.readPackageJSON(); return packageJSON.taiko.browser as ChromeReleaseInfo; } - private static updatePackageJSON(releaseInfo: ChromeReleaseInfo): void { + private updatePackageJSON(releaseInfo: ChromeReleaseInfo): void { const packageJSON = this.readPackageJSON(); const filteredReleaseInfo: ChromeReleaseInfo = { version: releaseInfo.version, @@ -68,21 +68,21 @@ class ChromeUpdater { this.writePackageJSON(packageJSON); } - private static async fetchLatestChromeVersion(): Promise { + private async fetchLatestChromeVersion(): Promise { const response = await fetch( 'https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json', ); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } - const data = await response.json(); - const versions = data.versions as ChromeReleaseInfo[]; + const data = (await response.json()) as { versions: ChromeReleaseInfo[] }; + const versions = data.versions; return versions.slice(-1)[0] as ChromeReleaseInfo; } } async function main() { - await ChromeUpdater.updateChromeVersion(); + await new ChromeUpdater().updateChromeVersion(); } main();