playwright/test/fixtures/dumpio.js
Dmitry Gozman b388722777
chore: update top-level api (#479)
```
require('playwright').chromium.launch(...)
window.playwrightweb.chromium.connect(...)
```
2020-01-13 17:36:46 -08:00

25 lines
770 B
JavaScript

(async() => {
process.on('unhandledRejection', error => {
// Catch various errors as we launch non-browser binary.
console.log('unhandledRejection', error.message);
});
const [, , playwrightRoot, product, usePipe] = process.argv;
const options = {
pipe: usePipe === 'use-pipe',
ignoreDefaultArgs: true,
dumpio: true,
timeout: 1,
executablePath: 'node',
args: ['-e', 'console.error("message from dumpio")', '--']
}
console.error('using pipe: ' + options.pipe);
if (product.toLowerCase() === 'firefox')
options.args.push('-juggler', '-profile');
try {
await require(playwrightRoot)[product.toLowerCase()].launchServer(options);
console.error('Browser launch unexpectedly succeeded.');
} catch (e) {
}
})();