Skip to content
Merged
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
5 changes: 5 additions & 0 deletions web-pages/product-site/assets/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,11 @@ td a {
.evidence-list a {
color: var(--blue-dark);
font-weight: 700;
overflow-wrap: anywhere;
}

.evidence-list li {
min-width: 0;
}

.benchmark-intro > div {
Expand Down
34 changes: 34 additions & 0 deletions web-pages/product-site/tests/browser/product-site.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,40 @@ for (const viewport of [
});
}

for (const viewport of [
{ name: 'mobile', width: 390, height: 844 },
{ name: 'desktop', width: 1440, height: 900 },
]) {
test(`audio.cpp deployment is stable at ${viewport.name}`, async ({ page }, testInfo) => {
await page.setViewportSize(viewport);
await page.goto('/deploy/audio-cpp.html');

await expect(page.locator('h1')).toHaveText('audio.cpp 原生 Fun-ASR-Nano 与 SenseVoice');
await expect(page.getByText('pinned SenseVoice GGUF package', { exact: false })).toBeVisible();
await expect(page.locator('a[href="https://github.com/0xShug0/audio.cpp/pull/219"]')).toBeVisible();

const layout = await page.evaluate(() => ({
overflow: document.documentElement.scrollWidth - document.documentElement.clientWidth,
evidenceWidths: [...document.querySelectorAll<HTMLElement>('.evidence-list li')].map((node) => ({
client: node.clientWidth,
scroll: node.scrollWidth,
})),
commandWidths: [...document.querySelectorAll<HTMLElement>('.command-block')].map((node) => ({
parent: node.parentElement?.getBoundingClientRect().width ?? 0,
width: node.getBoundingClientRect().width,
})),
}));
expect(layout.overflow).toBeLessThanOrEqual(1);
expect(layout.evidenceWidths.every(({ client, scroll }) => scroll <= client + 1)).toBe(true);
expect(layout.commandWidths.every(({ parent, width }) => width <= parent + 1)).toBe(true);

await page.screenshot({
path: testInfo.outputPath(`audio-cpp-${viewport.name}.png`),
fullPage: true,
});
});
}

test('reduced motion disables smooth scrolling', async ({ page }) => {
await page.emulateMedia({ reducedMotion: 'reduce' });
await page.goto('/en/');
Expand Down
Loading