diff --git a/src/frontend/src/content/docs/reference/cli/commands/aspire-init.mdx b/src/frontend/src/content/docs/reference/cli/commands/aspire-init.mdx index 29f7ac64be..ac396ea4fa 100644 --- a/src/frontend/src/content/docs/reference/cli/commands/aspire-init.mdx +++ b/src/frontend/src/content/docs/reference/cli/commands/aspire-init.mdx @@ -36,7 +36,7 @@ The command adapts to the repo it finds: - **C# file-based AppHost** (when selected interactively) — creates `apphost.cs` with `#:sdk` and `#:package` directives for a lightweight single-file orchestrator. - **TypeScript AppHost** (when selected interactively) — creates `apphost.mts` with the generated `.aspire/modules/` folder. If the repo already has a root `package.json`, the AppHost is created as a nested `aspire-apphost/` package and the root `aspire.config.json` points to `aspire-apphost/apphost.mts`. -- **Go AppHost** (when selected interactively): creates `apphost.go`, a `go.mod` that points at the generated SDK, and the generated `.aspire/modules/` folder. +- **Go AppHost** (when selected interactively) — creates `apphost.go`, a `go.mod` that points at the generated SDK, and the generated `.aspire/modules/` folder. If the repo already has a root `go.mod`, the existing module, `go.work`, and source files are left unchanged. The AppHost is created as a separate `aspire-apphost/` module with its own `go.work`, so that an ancestor workspace that doesn't list it doesn't interfere. The root `aspire.config.json` points to `aspire-apphost/apphost.go`. An explicit `GOWORK` environment variable override is respected. :::note When a `.sln` or `.slnx` is present, the C# option creates a **project-based AppHost** instead — an `AppHost.csproj` added to the solution with `ProjectReference` items and strongly-typed `AddProject()` calls. diff --git a/src/frontend/tests/e2e/dev-browse.spec.ts b/src/frontend/tests/e2e/dev-browse.spec.ts index fceaa98814..b480231945 100644 --- a/src/frontend/tests/e2e/dev-browse.spec.ts +++ b/src/frontend/tests/e2e/dev-browse.spec.ts @@ -1,7 +1,7 @@ import { expect, test } from '@playwright/test'; import AxeBuilder from '@axe-core/playwright'; import blogPosts from '../../src/data/aspire-blog-posts.json' with { type: 'json' }; -import { getSiteNavigationLink } from './helpers'; +import { getSiteNavigationLink, emulateConsentNotRequiredRegion } from './helpers'; const results = (page: import('@playwright/test').Page) => page.locator('.browse-result:not([hidden])'); const openFacet = async (page: import('@playwright/test').Page, name: string) => { @@ -13,6 +13,7 @@ const openFacet = async (page: import('@playwright/test').Page, name: string) => }; test.beforeEach(async ({ page }) => { + await emulateConsentNotRequiredRegion(page); await page.emulateMedia({ reducedMotion: 'reduce' }); }); diff --git a/src/frontend/tests/e2e/dev-grain.spec.ts b/src/frontend/tests/e2e/dev-grain.spec.ts index c0e982131f..c18b5b95d1 100644 --- a/src/frontend/tests/e2e/dev-grain.spec.ts +++ b/src/frontend/tests/e2e/dev-grain.spec.ts @@ -1,9 +1,10 @@ import { expect, test } from '@playwright/test'; import sharp from 'sharp'; +import { emulateConsentNotRequiredRegion } from './helpers'; for (const route of ['/hub/browse/', '/hub/glossary/']) { test(`${route} controls container reuses passive static Hub grain`, async ({ page }) => { - await page.addInitScript(() => localStorage.setItem('aspireConsentRequired', 'false')); + await emulateConsentNotRequiredRegion(page); await page.goto(`${route}?q=zzzz-no-match&topic=foundations`); const empty = page.locator('.search-empty:visible'); const controls = page.locator('.browse-controls, .glossary-filter-panel'); diff --git a/src/frontend/tests/e2e/dev-layout.spec.ts b/src/frontend/tests/e2e/dev-layout.spec.ts index 90b99e8018..5bf3e2737f 100644 --- a/src/frontend/tests/e2e/dev-layout.spec.ts +++ b/src/frontend/tests/e2e/dev-layout.spec.ts @@ -1,6 +1,10 @@ import { expect, test } from '@playwright/test'; import AxeBuilder from '@axe-core/playwright'; -import { getSiteNavigationLink } from './helpers'; +import { getSiteNavigationLink, emulateConsentNotRequiredRegion } from './helpers'; + +test.beforeEach(async ({ page }) => { + await emulateConsentNotRequiredRegion(page); +}); test('production Dev Hub scripts, styles, and Pagefind load from static assets', async ({ page, request }) => { const pagefind = await request.get('/pagefind/pagefind.js'); diff --git a/src/frontend/tests/e2e/helpers.ts b/src/frontend/tests/e2e/helpers.ts index 4065e11511..6a59154443 100644 --- a/src/frontend/tests/e2e/helpers.ts +++ b/src/frontend/tests/e2e/helpers.ts @@ -16,6 +16,14 @@ export async function resetCookieConsentState(page: Page): Promise { await page.context().clearCookies(); } +// WCP decides per runner region whether to show its banner. When shown, the banner +// pushes `.page` down and reveals the cookie button, so layout assertions need the +// no-consent state. A cached `false` alone does not stop live WCP showing the banner. +export async function emulateConsentNotRequiredRegion(page: Page): Promise { + await page.route(/wcpstatic\.microsoft\.com/, (route) => route.abort()); + await page.addInitScript(() => localStorage.setItem('aspireConsentRequired', 'false')); +} + export async function dismissCookieConsentIfVisible(page: Page): Promise { const siteTourDismissButton = page.locator('[data-tour-action="dismiss"]'); if (await siteTourDismissButton.isVisible().catch(() => false)) {