Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/playwright-core/src/cli/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export async function runServer(options: RunServerOptions) {
process.on('exit', () => server.close().catch(console.error));
console.log('Listening on ' + wsEndpoint);
process.stdin.on('close', () => gracefullyProcessExitDoNotHang(0));
process.stdin.resume();
}

export async function launchBrowserServer(browserName: string, configFile?: string) {
Expand Down
9 changes: 9 additions & 0 deletions tests/library/browsertype-connect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,15 @@ test('BT-093 should refuse connecting when versions do not match', async ({ conn
expect(error.message).toContain('client version: v' + getPlaywrightVersion(true));
});

test('BT-105 run-server should exit when stdin closes', { annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/44255' } }, async ({ childProcess }) => {
const server = childProcess({
command: ['node', path.join(__dirname, '..', '..', 'packages', 'playwright-core', 'cli.js'), 'run-server', '--port=0'],
});
await server.waitForOutput('Listening on ');
server.process.stdin!.end();
expect(await server.exited).toEqual({ exitCode: 0, signal: null });
});

test('BT-094 should filter local paths from unsafe launch options', async ({ connect, startRemoteServer, server, trace }, testInfo) => {
test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/42394' });
test.skip(trace === 'on', 'the test starts its own tracing');
Expand Down
1 change: 1 addition & 0 deletions tests/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ subsystem, add a row to the Subsystems table. Then update this file:
| `BT-102` | `library/browsertype-launch-selenium.spec.ts` | selenium grid 3.141.59 standalone non-chromium |
| `BT-103` | `library/browsertype-launch-selenium.spec.ts` | selenium grid 3.141.59 standalone chromium through run-driver |
| `BT-104` | `library/browsertype-launch-server.spec.ts` | launch server › should handle timeout |
| `BT-105` | `library/browsertype-connect.spec.ts` | run-server should exit when stdin closes |

### BU — Before unload

Expand Down
Loading