webui: Streamline playwright reporter config
diff --git a/webui/playwright-ct.config.ts b/webui/playwright-ct.config.ts
index 0acbc5e..8f75fcd 100644
--- a/webui/playwright-ct.config.ts
+++ b/webui/playwright-ct.config.ts
@@ -1,4 +1,8 @@
-import { defineConfig, devices } from "@sand4rt/experimental-ct-web";
+import {
+ defineConfig,
+ devices,
+ PlaywrightTestConfig,
+} from "@sand4rt/experimental-ct-web";
/**
* See https://playwright.dev/docs/test-configuration.
@@ -18,7 +22,7 @@
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
- reporter: [["html", { open: process.env.CI ? "never" : "on-failure" }]],
+ reporter: getReporterConfig(),
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
@@ -44,3 +48,11 @@
// },
],
});
+
+function getReporterConfig(): PlaywrightTestConfig["reporter"] {
+ if (process.env.SKETCH) {
+ return [["junit"]];
+ }
+
+ return [["html", { open: "never" }]];
+}