Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>()` calls.
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/tests/e2e/dev-browse.spec.ts
Original file line number Diff line number Diff line change
@@ -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) => {
Expand All @@ -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' });
});

Expand Down
3 changes: 2 additions & 1 deletion src/frontend/tests/e2e/dev-grain.spec.ts
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
6 changes: 5 additions & 1 deletion src/frontend/tests/e2e/dev-layout.spec.ts
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
8 changes: 8 additions & 0 deletions src/frontend/tests/e2e/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ export async function resetCookieConsentState(page: Page): Promise<void> {
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<void> {
await page.route(/wcpstatic\.microsoft\.com/, (route) => route.abort());
await page.addInitScript(() => localStorage.setItem('aspireConsentRequired', 'false'));
}

export async function dismissCookieConsentIfVisible(page: Page): Promise<void> {
const siteTourDismissButton = page.locator('[data-tour-action="dismiss"]');
if (await siteTourDismissButton.isVisible().catch(() => false)) {
Expand Down
Loading