playwright/test/installation-tests/sanity.js
Andrey Lushnikov 65ca87cd9a
fix: fix PLAYWRIGHT_BROWSERS_PATH treatment (#1662)
Drive-by: introduce installation tests that use `npm pack`
to simulate installation from NPM registry.

Fixes #1651
2020-04-03 23:16:14 -07:00

18 lines
473 B
JavaScript

const requireName = process.argv[2];
const browsers = process.argv.slice(3);
const playwright = require(requireName);
(async () => {
for (const browserType of browsers) {
const browser = await playwright[browserType].launch();
const context = await browser.newContext();
const page = await context.newPage();
await page.evaluate(() => navigator.userAgent);
await browser.close();
}
})().catch(err => {
console.error(err);
process.exit(1);
});