ohos-playwright 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +6 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -61,7 +61,12 @@ if (process.platform === 'openharmony') {
|
|
|
61
61
|
console.error(`[ohos-playwright] UI server bound to ${host}:${port} — open http://<device-ip>:${port} in any browser. Override with OHOS_PW_UI_HOST / OHOS_PW_UI_PORT.`);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
const child = spawn(process.execPath, ['--import', register, playwrightCli, ...argv], { stdio: 'inherit' });
|
|
64
|
+
const child = spawn(process.execPath, ['--import', register, playwrightCli, ...argv], { stdio: ['inherit', 'pipe', 'pipe'] });
|
|
65
|
+
// Playwright prints its own binary name in report hints (e.g. "playwright show-report").
|
|
66
|
+
// Rewrite them so users see the ohos-playwright counterpart.
|
|
67
|
+
const RE_WRITE = /\bplaywright\s+(show-report|test|open)\b/g;
|
|
68
|
+
child.stdout.on('data', (d) => process.stdout.write(d.toString().replace(RE_WRITE, 'ohos-playwright $1')));
|
|
69
|
+
child.stderr.on('data', (d) => process.stderr.write(d.toString().replace(RE_WRITE, 'ohos-playwright $1')));
|
|
65
70
|
child.on('exit', (code, signal) => {
|
|
66
71
|
if (signal)
|
|
67
72
|
process.kill(process.pid, signal);
|