mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-12 08:50:17 +00:00
*PR Created by the Glary-Bot Agent* --- ## Summary Replaces `right1.webp` with `right1.webm` in the VFX panel of `UseCaseSection`. `BlobMedia` already auto-detects `.webm` URLs and mounts a `<video>` element (with the `.webp` as poster), so this single URL swap is the only change required — matching the pattern used by the other 4 use-case panels. ## Files changed - `apps/website/src/components/home/UseCaseSection.vue` — swap `right1.webp` → `right1.webm`. ## Verification - `pnpm exec nx run website:typecheck` — clean - `pnpm exec eslint` on changed file — clean - `pnpm exec oxfmt --check` — clean - pre-commit lint-staged hooks — passed ## Reviewer note (Oracle finding) VFX is the default active panel, so the homepage's initial right-rail asset moves from ~131 KB `.webp` to ~4.1 MB `.webm`. Behaviorally consistent with the other 4 panels (which already use `.webm`), but worth confirming whether `right1.webm` should be re-encoded smaller on the CDN before promoting this PR out of draft. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-12040-fix-use-webm-video-for-VFX-use-case-right-asset-3596d73d365081829976f37b733840f1) by [Unito](https://www.unito.io) --------- Co-authored-by: Glary-Bot <glary-bot@users.noreply.github.com> Co-authored-by: Amp <amp@ampcode.com>
147 lines
4.5 KiB
TypeScript
147 lines
4.5 KiB
TypeScript
import type { Page } from '@playwright/test'
|
|
|
|
import { expect } from '@playwright/test'
|
|
|
|
import { test } from './fixtures/blockExternalMedia'
|
|
import { VIEWPORTS } from './viewports'
|
|
|
|
test.describe.configure({ timeout: 60_000 })
|
|
|
|
const SMALL_VIEWPORTS = VIEWPORTS.filter(
|
|
(v) => v.name === '1-sm' || v.name === '2-md'
|
|
)
|
|
|
|
async function assertNoOverflow(page: Page) {
|
|
await expect
|
|
.poll(
|
|
() =>
|
|
page.evaluate(
|
|
() =>
|
|
document.documentElement.scrollWidth >
|
|
document.documentElement.clientWidth
|
|
),
|
|
{ message: 'page has horizontal overflow', timeout: 5_000 }
|
|
)
|
|
.toBe(false)
|
|
}
|
|
|
|
async function navigateAndSettle(page: Page, url: string) {
|
|
await page.goto(url, { waitUntil: 'domcontentloaded' })
|
|
await page.waitForLoadState('load')
|
|
}
|
|
|
|
test.describe('Home', { tag: '@visual' }, () => {
|
|
for (const vp of VIEWPORTS) {
|
|
test.describe(vp.name, () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await page.setViewportSize({ width: vp.width, height: vp.height })
|
|
await navigateAndSettle(page, '/')
|
|
})
|
|
|
|
test('product-cards screenshot', async ({ page }) => {
|
|
const section = page.locator('section', {
|
|
has: page.getByRole('heading', { name: /The AI creation/i })
|
|
})
|
|
await expect(section).toBeVisible()
|
|
await section.scrollIntoViewIfNeeded()
|
|
await expect(page).toHaveScreenshot(`home-product-cards-${vp.name}.png`)
|
|
})
|
|
|
|
test('get-started screenshot', async ({ page }) => {
|
|
const section = page.locator('section', {
|
|
has: page.getByRole('heading', { name: /Get started/i })
|
|
})
|
|
await expect(section).toBeVisible()
|
|
await section.scrollIntoViewIfNeeded()
|
|
await expect(page).toHaveScreenshot(`home-get-started-${vp.name}.png`)
|
|
})
|
|
})
|
|
}
|
|
})
|
|
|
|
test.describe('Pricing', { tag: '@visual' }, () => {
|
|
for (const vp of VIEWPORTS) {
|
|
test(`pricing-tiers-${vp.name}`, async ({ page }) => {
|
|
await page.setViewportSize({ width: vp.width, height: vp.height })
|
|
await navigateAndSettle(page, '/cloud/pricing')
|
|
await assertNoOverflow(page)
|
|
|
|
const section = page.locator('section', {
|
|
has: page.getByRole('heading', { name: /Pricing/i })
|
|
})
|
|
await expect(section).toBeVisible()
|
|
await section.scrollIntoViewIfNeeded()
|
|
await expect(page).toHaveScreenshot(`pricing-tiers-${vp.name}.png`)
|
|
})
|
|
}
|
|
})
|
|
|
|
test.describe('Contact', { tag: '@visual' }, () => {
|
|
for (const vp of SMALL_VIEWPORTS) {
|
|
test(`form-${vp.name}`, async ({ page }) => {
|
|
await page.setViewportSize({ width: vp.width, height: vp.height })
|
|
await navigateAndSettle(page, '/contact')
|
|
|
|
const section = page.locator('section', {
|
|
has: page.getByRole('heading', { name: /Create powerful workflows/i })
|
|
})
|
|
await expect(section).toBeVisible()
|
|
await section.scrollIntoViewIfNeeded()
|
|
await expect(page).toHaveScreenshot(`contact-form-${vp.name}.png`)
|
|
})
|
|
}
|
|
})
|
|
|
|
test.describe('Gallery', { tag: '@visual' }, () => {
|
|
for (const vp of SMALL_VIEWPORTS) {
|
|
test(`gallery-grid-${vp.name}`, async ({ page }) => {
|
|
await page.setViewportSize({ width: vp.width, height: vp.height })
|
|
await navigateAndSettle(page, '/gallery')
|
|
|
|
const section = page.getByTestId('gallery-grid')
|
|
await expect(section).toBeVisible()
|
|
await section.scrollIntoViewIfNeeded()
|
|
await expect(page).toHaveScreenshot(`gallery-grid-${vp.name}.png`)
|
|
})
|
|
}
|
|
})
|
|
|
|
test.describe('About', { tag: '@visual' }, () => {
|
|
for (const vp of SMALL_VIEWPORTS) {
|
|
test(`hero-${vp.name}`, async ({ page }) => {
|
|
await page.setViewportSize({ width: vp.width, height: vp.height })
|
|
await navigateAndSettle(page, '/about')
|
|
|
|
const hero = page.locator('section', {
|
|
has: page.getByRole('heading', { name: /Build the tools/i })
|
|
})
|
|
await expect(hero).toBeVisible()
|
|
await hero.scrollIntoViewIfNeeded()
|
|
await expect(page).toHaveScreenshot(`about-hero-${vp.name}.png`)
|
|
})
|
|
}
|
|
})
|
|
|
|
test.describe('Overflow guards', { tag: '@visual' }, () => {
|
|
const pages = [
|
|
'/',
|
|
'/cloud',
|
|
'/cloud/enterprise',
|
|
'/cloud/pricing',
|
|
'/contact',
|
|
'/download',
|
|
'/gallery',
|
|
'/about',
|
|
'/careers'
|
|
]
|
|
for (const url of pages) {
|
|
for (const vp of VIEWPORTS) {
|
|
test(`${url} ${vp.name} no overflow`, async ({ page }) => {
|
|
await page.setViewportSize({ width: vp.width, height: vp.height })
|
|
await page.goto(url)
|
|
await assertNoOverflow(page)
|
|
})
|
|
}
|
|
}
|
|
})
|