fix: set revision based on PUPPETEER_PRODUCT (#5643)

This commit is contained in:
Maja Frydrychowicz
2020-04-15 07:30:42 -04:00
committed by GitHub
parent d817ae5a4b
commit 35989a78ba
6 changed files with 72 additions and 26 deletions

View File

@@ -59,14 +59,18 @@ const defaultBrowserOptions = {
dumpio: !!process.env.DUMPIO,
};
(async() => {
if (defaultBrowserOptions.executablePath) {
console.warn(`WARN: running ${product} tests with ${defaultBrowserOptions.executablePath}`);
} else {
if (product === 'firefox')
await puppeteer._launcher._updateRevision();
const executablePath = puppeteer.executablePath();
if (!fs.existsSync(executablePath))
throw new Error(`Browser is not downloaded at ${executablePath}. Run 'npm install' and try to re-run tests`);
}
})();
if (defaultBrowserOptions.executablePath) {
console.warn(`WARN: running ${product} tests with ${defaultBrowserOptions.executablePath}`);
} else {
const executablePath = puppeteer.executablePath();
if (!fs.existsSync(executablePath))
throw new Error(`Browser is not downloaded at ${executablePath}. Run 'npm install' and try to re-run tests`);
}
const setupGoldenAssertions = () => {
const suffix = product.toLowerCase();