From 5ff8c5f78253f2c9c63f3b6bdabcafdec52bf9f6 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Thu, 23 Mar 2023 15:46:24 -0700 Subject: [PATCH] chore: show global setup errors in ui mode (#21942) Fixes: [21941](https://github.com/microsoft/playwright/issues/21941) --- packages/playwright-test/src/runner/uiMode.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/playwright-test/src/runner/uiMode.ts b/packages/playwright-test/src/runner/uiMode.ts index 819e422c05..aa69930580 100644 --- a/packages/playwright-test/src/runner/uiMode.ts +++ b/packages/playwright-test/src/runner/uiMode.ts @@ -66,7 +66,7 @@ class UIMode { } async runGlobalSetup(): Promise { - const reporter = await createReporter(this._config, 'watch'); + const reporter = await createReporter(this._config, 'run'); const taskRunner = createTaskRunnerForWatchSetup(this._config, reporter); reporter.onConfigure(this._config); const context: TaskRunnerState = { @@ -75,6 +75,7 @@ class UIMode { phases: [], }; const { status, cleanup: globalCleanup } = await taskRunner.runDeferCleanup(context, 0); + await reporter.onExit({ status }); if (status !== 'passed') { await globalCleanup(); return status; @@ -151,7 +152,7 @@ class UIMode { clearCompilationCache(); reporter.onConfigure(this._config); const status = await taskRunner.run(context, 0); - reporter.onExit({ status }); + await reporter.onExit({ status }); const projectDirs = new Set(); for (const p of this._config.projects)