Skip to content

Commit a186ab1

Browse files
committed
Add todos and update version
1 parent 92fd7dc commit a186ab1

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

apps/playwright-browser-tunnel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rushstack/playwright-browser-tunnel",
3-
"version": "0.0.0",
3+
"version": "0.0.1",
44
"description": "Run a remote Playwright Browser Tunnel. Useful in remote development environments.",
55
"repository": {
66
"type": "git",

apps/playwright-browser-tunnel/src/PlaywrightBrowserTunnel.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ export class PlaywrightTunnel {
156156
}
157157
}
158158

159+
// TODO: This is not used but we should use this in a vscode command to perform cleanup.
159160
public async uninstallPlaywrightBrowsersAsync(): Promise<void> {
160161
try {
161162
const playwrightVersion: semver.SemVer | null = semver.coerce('latest');
@@ -208,6 +209,8 @@ export class PlaywrightTunnel {
208209
await Executable.waitForExitAsync(cp);
209210
}
210211

212+
// TODO: Add a installation cache to avoid reinstalling same version multiple times
213+
// Map which stores the state of installed playwright-core versions
211214
private async _installPlaywrightCoreAsync({
212215
playwrightVersion
213216
}: Pick<IHandshake, 'playwrightVersion'>): Promise<void> {
@@ -248,6 +251,8 @@ export class PlaywrightTunnel {
248251
});
249252
}
250253

254+
// TODO: Only supporting one test at a time.
255+
// Need to support multiple simultaneous connections for parallel tests.
251256
private async _pollConnectionAsync(): Promise<WebSocket> {
252257
this._terminal.writeLine(`Waiting for WebSocket connection`);
253258
return new Promise((resolve, reject) => {
@@ -367,6 +372,7 @@ export class PlaywrightTunnel {
367372
};
368373
}
369374

375+
// ws1 is the tunnel websocket, ws2 is the browser server websocket
370376
private async _setupForwardingAsync(ws1: WebSocket, ws2: WebSocket): Promise<void> {
371377
console.log('Setting up message forwarding between ws1 and ws2');
372378
ws1.on('message', (data) => {

apps/playwright-browser-tunnel/src/tunneledBrowserConnection.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class HttpServer {
4242
return new Promise((resolve) => {
4343
this._server.listen(0, '127.0.0.1', () => {
4444
this._listeningPort = (this._server.address() as AddressInfo).port;
45+
// This MUST be printed to terminal so VS Code can auto-port forward
4546
console.log(`Local proxy HttpServer listening at ws://127.0.0.1:${this._listeningPort}`);
4647
resolve();
4748
});

0 commit comments

Comments
 (0)