Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
chore: pass color through in web server commands (#24619)
Pavel Feldman414a4c3ef04c
diff --git a/package-lock.json b/package-lock.jsonindex 3b159ec624..4ab4ff905d 100644--- a/package-lock.json+++ b/package-lock.json@@ -6563,7 +6563,8 @@},"packages/playwright-grid": {"name": "@playwright/experimental-grid",- "version": "1.37.0-next",+ "version": "0.0.1",+ "license": "Apache-2.0","dependencies": {"commander": "^11.0.0","debug": "^4.3.2",@@ -6577,6 +6578,9 @@"@types/debug": "^4.1.8","@types/ws": "^8.5.5","playwright-core": "1.37.0-next"+ },+ "engines": {+ "node": ">=16"}},"packages/playwright-grid/node_modules/commander": {diff --git a/packages/playwright-test/src/plugins/webServerPlugin.ts b/packages/playwright-test/src/plugins/webServerPlugin.tsindex 6a518d9f98..cfff7ad441 100644--- a/packages/playwright-test/src/plugins/webServerPlugin.ts+++ b/packages/playwright-test/src/plugins/webServerPlugin.ts@@ -16,7 +16,7 @@import path from 'path';import net from 'net';-import { debug } from 'playwright-core/lib/utilsBundle';+import { colors, debug } from 'playwright-core/lib/utilsBundle';import { raceAgainstDeadline, launchProcess, httpRequest, monotonicTime } from 'playwright-core/lib/utils';import type { FullConfig } from '../../types/testReporter';@@ -40,6 +40,8 @@ export type WebServerPluginOptions = {const DEFAULT_ENVIRONMENT_VARIABLES = {'BROWSER': 'none', // Disable that create-react-app will open the page in the browser+ 'FORCE_COLOR': '1',+ 'DEBUG_COLORS': '1',};const debugWebServer = debug('pw:webserver');@@ -112,11 +114,12 @@ export class WebServerPlugin implements TestRunnerPlugin {launchedProcess.stderr!.on('data', line => {if (debugWebServer.enabled || (this._options.stderr === 'pipe' || !this._options.stderr))- this._reporter!.onStdErr?.('[WebServer] ' + line.toString());+ this._reporter!.onStdErr?.(colors.dim('[WebServer] ') + line.toString());});launchedProcess.stdout!.on('data', line => {+ process.stdout.write(line);if (debugWebServer.enabled || this._options.stdout === 'pipe')- this._reporter!.onStdOut?.('[WebServer] ' + line.toString());+ this._reporter!.onStdOut?.(colors.dim('[WebServer] ') + line.toString());});}