mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00

* chore: improve installation tests - all helper scripts and files are moved to `fixture-scripts` subfolder. - `./run_all_tests.sh` now shows a counter to estimate progress - function `copy_test_scripts` is no longer needed; all fixture scripts are automatically copied to test folder Co-authored-by: Max Schmitt <max@schmitt.mx> Co-authored-by: Max Schmitt <max@schmitt.mx>
23 lines
939 B
JavaScript
23 lines
939 B
JavaScript
const playwright = require('playwright-core');
|
|
const { execSync } = require('child_process');
|
|
const path = require('path');
|
|
|
|
(async () => {
|
|
const dir = process.argv[2];
|
|
const chrome = await playwright.chromium.launch({ channel: 'chrome' });
|
|
const version = chrome.version();
|
|
await chrome.close();
|
|
console.log(`Found Chrome version ${version}`);
|
|
|
|
const [major] = version.split('.');
|
|
const driverVersion = execSync(`curl https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${major} --silent`).toString('utf-8');
|
|
console.log(`Found ChromeDriver version ${driverVersion}`);
|
|
|
|
const zip = path.join(dir, 'chromedriver.zip');
|
|
execSync(`curl https://chromedriver.storage.googleapis.com/${driverVersion}/chromedriver_${process.platform === 'darwin' ? 'mac' : 'linux'}64.zip --output ${zip} --silent`);
|
|
console.log(`Downloaded ${zip}`);
|
|
|
|
execSync(`unzip ${zip}`, { cwd: dir });
|
|
console.log(`Unzipped ${zip}`);
|
|
})();
|