Skip to content

Commit 7956637

Browse files
committed
playwright browser server
1 parent 29fe6d1 commit 7956637

20 files changed

+1163
-2
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ jspm_packages/
9999
!.vscode/tasks.json
100100
!.vscode/launch.json
101101
!.vscode/debug-certificate-manager.json
102+
!.vscode/mcp.json
102103

103104
# Rush temporary files
104105
common/deploy/
@@ -128,3 +129,8 @@ dist-storybook/
128129

129130
# VS Code test runner files
130131
.vscode-test/
132+
133+
# Playwright test outputs
134+
playwright-report/
135+
test-results/
136+

.vscode/mcp.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"servers": {
3+
"playwright": {
4+
"type": "stdio",
5+
"command": "node",
6+
"args": [
7+
"${workspaceFolder}/apps/playwright-browser-tunnel/lib/PlaywrightMcpBrowserTunnelClientCommandLine.js"
8+
]
9+
}
10+
},
11+
"inputs": []
12+
}

apps/playwright-browser-tunnel/README.md

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
// The "rig.json" file directs tools to look for their config files in an external package.
3+
// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package
4+
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
5+
6+
"rigPackageName": "local-node-rig"
7+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2+
// See LICENSE in the project root for license information.
3+
4+
const nodeTrustedToolProfile = require('local-node-rig/profiles/default/includes/eslint/flat/profile/node-trusted-tool');
5+
const friendlyLocalsMixin = require('local-node-rig/profiles/default/includes/eslint/flat/mixins/friendly-locals');
6+
7+
module.exports = [
8+
...nodeTrustedToolProfile,
9+
...friendlyLocalsMixin,
10+
{
11+
files: ['**/*.ts', '**/*.tsx'],
12+
languageOptions: {
13+
parserOptions: {
14+
tsconfigRootDir: __dirname
15+
}
16+
},
17+
rules: {
18+
'no-console': 'off'
19+
}
20+
}
21+
];
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "@rushstack/playwright-browser-tunnel",
3+
"version": "0.0.0",
4+
"description": "Run a remote Playwright Browser Tunnel. Useful in remote development environments.",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/microsoft/rushstack.git",
8+
"directory": "apps/playwright-browser-tunnel"
9+
},
10+
"engines": {
11+
"node": ">=20.0.0"
12+
},
13+
"engineStrict": true,
14+
"homepage": "https://rushstack.io",
15+
"scripts": {
16+
"build": "heft build --clean",
17+
"_phase:build": "heft run --only build -- --clean",
18+
"demo": "playwright test --config=playwright.config.ts"
19+
},
20+
"bin": {
21+
"playwright-browser-tunnel": "./bin/playwright-browser-tunnel"
22+
},
23+
"license": "MIT",
24+
"dependencies": {
25+
"@rushstack/node-core-library": "workspace:*",
26+
"@rushstack/terminal": "workspace:*",
27+
"@rushstack/ts-command-line": "workspace:*",
28+
"string-argv": "~0.3.1",
29+
"semver": "~7.5.4",
30+
"ws": "~8.14.1",
31+
"playwright": "1.56.1"
32+
},
33+
"devDependencies": {
34+
"@rushstack/heft": "workspace:*",
35+
"eslint": "~9.37.0",
36+
"local-node-rig": "workspace:*",
37+
"@types/semver": "7.5.0",
38+
"@types/ws": "8.5.5",
39+
"playwright-core": "~1.56.1",
40+
"@playwright/test": "~1.56.1",
41+
"@types/node": "20.17.19"
42+
},
43+
"peerDependencies": {
44+
"playwright-core": "~1.56.1"
45+
}
46+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { defineConfig, devices } from '@playwright/test';
2+
3+
export default defineConfig({
4+
testDir: './tests',
5+
/* Run tests in files in parallel */
6+
fullyParallel: true,
7+
/* Retry on CI only */
8+
retries: 0,
9+
/* Opt out of parallel tests on CI. */
10+
workers: 1,
11+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
12+
reporter: 'html',
13+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
14+
use: {
15+
/* Base URL to use in actions like `await page.goto('/')`. */
16+
// baseURL: 'http://localhost:3000',
17+
18+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
19+
trace: 'on'
20+
},
21+
22+
/* Configure projects for major browsers */
23+
projects: [
24+
{
25+
name: 'chromium',
26+
use: { ...devices['Desktop Chrome'] }
27+
},
28+
{
29+
name: 'firefox',
30+
use: { ...devices['Desktop Firefox'] }
31+
},
32+
{
33+
name: 'webkit',
34+
use: { ...devices['Desktop Safari'] }
35+
},
36+
{
37+
name: 'Google Chrome',
38+
use: { ...devices['Desktop Chrome'], channel: 'chrome' } // or 'chrome-beta'
39+
},
40+
{
41+
name: 'Microsoft Edge',
42+
use: { ...devices['Desktop Edge'], channel: 'msedge' } // or "msedge-beta" or 'msedge-dev'
43+
}
44+
]
45+
});

0 commit comments

Comments
 (0)