diff --git a/apps/workplace/playwright.config.ts b/apps/workplace/playwright.config.ts index 7f99ddf9f2d..f97121c7804 100644 --- a/apps/workplace/playwright.config.ts +++ b/apps/workplace/playwright.config.ts @@ -115,8 +115,9 @@ export default defineConfig({ // No HMR: every compiled component otherwise imports // /@ng/component?c=…&t=… at load (96 of the 159 asset requests on each // browser-only meeting page), which those specs proxy through route.fetch, and - // the app never receives HMR updates here anyway. - command: `bunx nx serve workplace --port=${PORT} --hmr=false`, + // the app never receives HMR updates here anyway. The `e2e` + // configuration turns Sentry off (settings.e2e.ts). + command: `bunx nx serve workplace --configuration=e2e --port=${PORT} --hmr=false`, url: APP_URL, reuseExistingServer: !CI, cwd: workspaceRoot, diff --git a/apps/workplace/project.json b/apps/workplace/project.json index 63f4c50e8ef..824017cbae1 100644 --- a/apps/workplace/project.json +++ b/apps/workplace/project.json @@ -53,6 +53,14 @@ "browser": "apps/workplace/src/main.ts" }, "configurations": { + "e2e": { + "fileReplacements": [ + { + "replace": "libs/common/src/lib/settings.ts", + "with": "apps/workplace/src/environments/settings.e2e.ts" + } + ] + }, "staging": { "optimization": true, "fileReplacements": [ @@ -157,6 +165,9 @@ "buildTarget": "workplace:build" }, "configurations": { + "e2e": { + "buildTarget": "workplace:build:e2e" + }, "production": { "buildTarget": "workplace:build:production" } diff --git a/apps/workplace/src/environments/settings.e2e.ts b/apps/workplace/src/environments/settings.e2e.ts new file mode 100644 index 00000000000..0c95586b567 --- /dev/null +++ b/apps/workplace/src/environments/settings.e2e.ts @@ -0,0 +1,10 @@ +import { DEFAULT_SETTINGS as WORKPLACE_SETTINGS } from './settings'; + +/** + * Workplace build-time settings for the `e2e` build configuration, which + * Playwright serves. Sentry is off, so the app sends nothing to Sentry. + */ +export const DEFAULT_SETTINGS: any = { + ...WORKPLACE_SETTINGS, + app: { ...WORKPLACE_SETTINGS.app, sentry_dsn: '' }, +}; diff --git a/e2e/README.md b/e2e/README.md index 116bee894fc..fb26df72548 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -37,8 +37,10 @@ bunx playwright test --config apps/workplace/playwright.config.ts --ui `local` and `settings` depend on `preflight`, which checks the stack is up. Add `--no-deps` to skip it. -Playwright starts the Angular dev server itself (`nx serve workplace --port=4214`) -and points its API proxy at the stack. Nothing reaches the network. +Playwright starts the Angular dev server itself +(`nx serve workplace --configuration=e2e --port=4214`) and points its API proxy +at the stack. The `e2e` configuration turns Sentry off, so nothing reaches the +network. If a run dies with "Executable doesn't exist", the workspace's pinned Playwright needs its browser: `bunx playwright install chromium`.