diff --git a/apps/website/e2e/vfx-nav-attribution.spec.ts b/apps/website/e2e/vfx-nav-attribution.spec.ts
new file mode 100644
index 00000000000..d53953a85be
--- /dev/null
+++ b/apps/website/e2e/vfx-nav-attribution.spec.ts
@@ -0,0 +1,98 @@
+import assert from 'node:assert/strict'
+import { expect } from '@playwright/test'
+import { test } from './fixtures/blockExternalMedia'
+import { expectIslandHydrated } from './fixtures/islands'
+
+const TRACKED =
+ 'https://cloud.comfy.org/?utm_source=comfy_org&utm_medium=website&utm_campaign=free_tier&utm_content=nav_try_cloud'
+for (const { path, label, expected } of [
+ {
+ path: '/solutions/vfx/v3/',
+ label: 'TRY CLOUD FOR FREE',
+ expected: 'https://cloud.comfy.org/'
+ },
+ {
+ path: '/zh-CN/solutions/vfx/v3/',
+ label: '免费试用云端',
+ expected: 'https://cloud.comfy.org/'
+ },
+ { path: '/solutions/vfx/', label: 'TRY CLOUD FOR FREE', expected: TRACKED },
+ { path: '/zh-CN/solutions/vfx/', label: '免费试用云端', expected: TRACKED },
+ { path: '/', label: 'TRY CLOUD FOR FREE', expected: TRACKED }
+]) {
+ test(`${path} scopes cloud nav attribution in SSR and after hydration`, async ({
+ page
+ }) => {
+ const response = await page.goto(
+ `${path}?utm_source=linkedin&utm_medium=paid_social&utm_campaign=vfx`
+ )
+ assert(response)
+ const html = await response.text()
+ const serverHref = await page.evaluate(
+ ({ html, label }) => {
+ const document = new DOMParser().parseFromString(html, 'text/html')
+ return Array.from(
+ document.querySelectorAll('[data-testid="desktop-nav-cta"] a')
+ )
+ .find((node) => node.getAttribute('aria-label') === label)
+ ?.getAttribute('href')
+ },
+ { html, label }
+ )
+ expect(serverHref).toBe(expected)
+ const nav = page
+ .getByTestId('desktop-nav-cta')
+ .getByRole('link', { name: label, exact: true })
+ await expectIslandHydrated(page, page.getByTestId('desktop-nav-cta'))
+ await expect(nav).toHaveAttribute('href', expected)
+ await page.evaluate(() =>
+ document.dispatchEvent(new Event('astro:page-load'))
+ )
+ await expect(nav).toHaveAttribute('href', expected)
+ })
+}
+for (const path of ['/solutions/vfx/v3/', '/zh-CN/solutions/vfx/v3/']) {
+ test(`${path} preserves attribution on contact, workflow and Studio signup links`, async ({
+ page
+ }) => {
+ await page.goto(`${path}?utm_source=linkedin&utm_campaign=vfx`)
+ await expect(
+ page.locator('[data-vfx-v3] a[href*="/contact/"]').first()
+ ).toHaveAttribute(
+ 'href',
+ /interest=vfx&landing_version=v3&utm_source=linkedin&utm_campaign=vfx/
+ )
+ await expect(
+ page.locator('[data-vfx-demo="swap"] [data-try-workflow]')
+ ).toHaveAttribute(
+ 'href',
+ 'https://cloud.comfy.org/?share=28fa6219c110&utm_source=linkedin&utm_campaign=vfx'
+ )
+ await expect(
+ page.locator('[data-vfx-studio] a[href*="/cloud/signup"]').first()
+ ).toHaveAttribute(
+ 'href',
+ 'https://cloud.comfy.org/cloud/signup?utm_source=linkedin&utm_campaign=vfx'
+ )
+ })
+}
+test('restores the normal nav URL when navigating away from V3', async ({
+ page
+}) => {
+ await page.goto('/solutions/vfx/?utm_source=linkedin')
+ const nav = page
+ .getByTestId('desktop-nav-cta')
+ .getByRole('link', { name: 'TRY CLOUD FOR FREE', exact: true })
+ await expectIslandHydrated(page, page.getByTestId('desktop-nav-cta'))
+ await expect(nav).toHaveAttribute('href', TRACKED)
+ await page.evaluate(() => {
+ history.pushState(null, '', '/solutions/vfx/v3/?utm_source=linkedin')
+ document.dispatchEvent(new Event('astro:page-load'))
+ })
+ await expect(nav).toHaveAttribute('href', 'https://cloud.comfy.org/')
+ await page.evaluate(() => {
+ history.pushState(null, '', '/pricing/')
+ document.dispatchEvent(new Event('astro:page-load'))
+ })
+ await expect(nav).toHaveAttribute('href', TRACKED)
+})
diff --git a/apps/website/e2e/vfx-studio-signup.spec.ts b/apps/website/e2e/vfx-studio-signup.spec.ts
new file mode 100644
index 00000000000..22c867e1c06
--- /dev/null
+++ b/apps/website/e2e/vfx-studio-signup.spec.ts
@@ -0,0 +1,131 @@
+import { join } from 'node:path'
+import { expect } from '@playwright/test'
+import type { Locator, Page } from '@playwright/test'
+import { websiteRoot } from '@website/paths'
+import { test } from './fixtures/blockExternalMedia'
+import { expectIslandHydrated } from './fixtures/islands'
+import { vfxMediaRoot } from '@/data/vfxMedia'
+
+const SIGNUP = 'https://cloud.comfy.org/cloud/signup'
+const QUERY =
+ 'utm_source=linkedin&utm_medium=paid_social&utm_campaign=vfx&utm_content=v3'
+const DESTINATION = `${SIGNUP}?${QUERY}`
+
+async function clickSignup(_page: Page, studio: Locator, label: string) {
+ await studio.getByRole('link', { name: label }).click()
+}
+async function keyboardSignup(page: Page, studio: Locator, label: string) {
+ await studio.getByRole('link', { name: label }).focus()
+ await page.keyboard.press('Enter')
+}
+async function dropFootage(page: Page, studio: Locator) {
+ await studio.getByRole('tab', { name: 'SETTINGS' }).click()
+ const transfer = await page.evaluateHandle(() => {
+ const data = new DataTransfer()
+ data.items.add(
+ new File(['private-footage-bytes'], 'private-footage.mov', {
+ type: 'video/quicktime'
+ })
+ )
+ return data
+ })
+ await studio
+ .getByRole('textbox', { name: 'Describe the shot' })
+ .dispatchEvent('dragover', { dataTransfer: transfer })
+ await studio
+ .getByRole('textbox', { name: 'Describe the shot' })
+ .dispatchEvent('drop', { dataTransfer: transfer })
+}
+
+for (const { name, path, open, label, activate } of [
+ {
+ name: 'pointer',
+ path: '/solutions/vfx/v3/',
+ open: 'OPEN STUDIO',
+ label: 'SIGN UP TO TRY FREE',
+ activate: clickSignup
+ },
+ {
+ name: 'keyboard',
+ path: '/solutions/vfx/v3/',
+ open: 'OPEN STUDIO',
+ label: 'SIGN UP TO TRY FREE',
+ activate: keyboardSignup
+ },
+ {
+ name: 'file drop',
+ path: '/solutions/vfx/v3/',
+ open: 'OPEN STUDIO',
+ label: 'SIGN UP TO TRY FREE',
+ activate: dropFootage
+ },
+ {
+ name: 'Chinese pointer',
+ path: '/zh-CN/solutions/vfx/v3/',
+ open: '打开工作室',
+ label: '注册免费试用',
+ activate: clickSignup
+ }
+]) {
+ test(`${name} footage intent enters signup without a picker or file transfer`, async ({
+ page,
+ context
+ }) => {
+ await context.route(`${vfxMediaRoot}/*.mp4`, (route) =>
+ route.fulfill({
+ path: join(websiteRoot, 'e2e/assets/vfx-playback.mp4'),
+ contentType: 'video/mp4'
+ })
+ )
+ await context.route(`${SIGNUP}**`, (route) =>
+ route.fulfill({
+ contentType: 'text/html',
+ body: '
Existing signup destination
'
+ })
+ )
+ await page.goto(
+ `${path}?${QUERY}&filename=page-query.mov&email=private@example.com`
+ )
+ const section = page.locator('[data-vfx-demo="relight"]')
+ await section
+ .locator('.vfx-canvas-window')
+ .evaluate((node) =>
+ node.scrollIntoView({ block: 'start', behavior: 'instant' })
+ )
+ await expect(section).toHaveAttribute('data-canvas-ready', '', {
+ timeout: 12000
+ })
+ await section.getByRole('button', { name: open, exact: true }).click()
+ const studio = section.locator('[data-vfx-studio]')
+ await expectIslandHydrated(
+ page,
+ page.getByRole('link', { name: label, exact: true })
+ )
+ const link = studio.getByRole('link', { name: label })
+ await expect(link).toHaveAttribute('href', DESTINATION)
+ await expect(studio.locator('input[type=file]')).toHaveCount(0)
+ let pickerOpened = false
+ page.on('filechooser', () => {
+ pickerOpened = true
+ })
+ const sent: string[] = []
+ page.on('request', (request) =>
+ sent.push(
+ JSON.stringify({
+ url: request.url(),
+ method: request.method(),
+ body: request.postData()
+ })
+ )
+ )
+ await activate(page, studio, label)
+ await expect(page).toHaveURL(DESTINATION)
+ expect(pickerOpened).toBe(false)
+ expect(sent.join('\n')).not.toContain('private-footage')
+ expect(sent.join('\n')).not.toContain('page-query.mov')
+ expect(sent.join('\n')).not.toContain('private@example.com')
+ await expect(
+ page.getByRole('heading', { name: 'Existing signup destination' })
+ ).toBeVisible()
+ })
+}
diff --git a/apps/website/e2e/vfx-v3.spec.ts b/apps/website/e2e/vfx-v3.spec.ts
index 625dc37c02e..8c0b240bcf5 100644
--- a/apps/website/e2e/vfx-v3.spec.ts
+++ b/apps/website/e2e/vfx-v3.spec.ts
@@ -9,9 +9,17 @@ import type { Locator, Page } from '@playwright/test'
import { test } from './fixtures/blockExternalMedia'
import { expectIslandHydrated } from './fixtures/islands'
-import { vfxMediaRoot } from '@/data/vfxMedia'
+import { vfxWorkflows } from '@/data/vfxWorkflows'
+import { DEFAULT_OG_IMAGE } from '@/utils/jsonLd'
+import { vfxRedSkyMedia, vfxMediaRoot } from '@/data/vfxMedia'
test.beforeEach(async ({ context }) => {
+ await context.route(vfxRedSkyMedia.video, (route) =>
+ route.fulfill({
+ path: join(websiteRoot, 'e2e/assets/vfx-playback.mp4'),
+ headers: { 'Accept-Ranges': 'bytes', 'Content-Type': 'video/mp4' }
+ })
+ )
await context.route(`${vfxMediaRoot}/*.mp4`, (route) =>
route.fulfill({
path: join(websiteRoot, 'e2e/assets/vfx-playback.mp4'),
@@ -37,24 +45,36 @@ async function waitForShowcase(section: Locator) {
})
}
-for (const { path, heading, sales, contact, rain, taxi, vertical } of [
+for (const {
+ path,
+ heading,
+ sales,
+ contact,
+ rain,
+ taxi,
+ vertical,
+ shareAlt
+} of [
{
path: '/solutions/vfx/v3/',
heading: 'One shot. More possibilities.',
- sales: 'TALK TO SALES',
+ sales: 'TALK TO COMFY TEAM',
contact: '/contact/',
rain: 'Rain',
taxi: 'London taxi',
- vertical: 'Vertical'
+ vertical: 'Vertical',
+ shareAlt:
+ 'A classic car outside the Starlite Diner beneath a red sky with meteors.'
},
{
path: '/zh-CN/solutions/vfx/v3/',
heading: '一个镜头,更多可能。',
- sales: '联系销售',
+ sales: '联系 COMFY 团队',
contact: '/zh-CN/contact/',
rain: '雨天',
taxi: '伦敦出租车',
- vertical: '竖屏'
+ vertical: '竖屏',
+ shareAlt: '流星划过红色天空,经典汽车停在星光餐厅外。'
}
]) {
test(`${path} preserves sales attribution`, async ({ page }) => {
@@ -65,6 +85,32 @@ for (const { path, heading, sales, contact, rain, taxi, vertical } of [
`https://comfy.org${path}`
)
await expect(page.locator('meta[name="robots"]')).toHaveCount(0)
+ expect(
+ await page
+ .locator('meta[property^="og:image"]')
+ .evaluateAll((nodes) =>
+ nodes.map((node) => [
+ node.getAttribute('property'),
+ node.getAttribute('content')
+ ])
+ )
+ ).toEqual([
+ ['og:image', vfxRedSkyMedia.share],
+ ['og:image:type', 'image/gif'],
+ ['og:image:width', '1200'],
+ ['og:image:height', '630'],
+ ['og:image:alt', shareAlt],
+ ['og:image', vfxRedSkyMedia.poster],
+ ['og:image:type', 'image/jpeg'],
+ ['og:image:width', '1200'],
+ ['og:image:height', '630'],
+ ['og:image:alt', shareAlt]
+ ])
+ await expect(page.locator('meta[name="twitter:image"]')).toHaveAttribute(
+ 'content',
+ vfxRedSkyMedia.share
+ )
+
await expect(
page.getByRole('link', { name: sales, exact: true }).first()
).toHaveAttribute(
@@ -569,7 +615,12 @@ for (const {
await expect(
studio.getByRole('button', { name: option, exact: true })
).toHaveAttribute('aria-pressed', 'true')
- await expect(studio.locator('button[disabled]')).toHaveCount(3)
+ await expect(
+ studio.getByRole('button', { name: /^(ADJUST KEY FRAME|调整关键帧)$/ })
+ ).toBeDisabled()
+ await expect(
+ studio.getByRole('button', { name: /^(RUN WORKFLOW|运行工作流)$/ })
+ ).toBeDisabled()
await returnButton.click()
await expect(trigger).toBeFocused()
await expect(trigger).toHaveAttribute('aria-expanded', 'false')
@@ -593,7 +644,7 @@ for (const {
})
}
-test('verified workflow links stay external and unresolved workflows cannot navigate', async ({
+test('verified workflow links stay external and use the supplied destinations', async ({
page
}) => {
await page.goto('/solutions/vfx/v3/')
@@ -608,10 +659,10 @@ test('verified workflow links stay external and unresolved workflows cannot navi
await expect(relight).toHaveAttribute('target', '_blank')
await expect(
page.locator('[data-vfx-demo="swap"] [data-try-workflow]')
- ).toBeDisabled()
+ ).toHaveAttribute('href', 'https://cloud.comfy.org/?share=28fa6219c110')
await expect(
page.locator('[data-vfx-demo="reframe"] [data-try-workflow]')
- ).toBeDisabled()
+ ).toHaveAttribute('href', 'https://cloud.comfy.org/?share=ccfd0e7d75c3')
})
for (const { demo, width, axis, leading, trailing } of [
@@ -902,7 +953,9 @@ for (const {
await expect(
studio.getByRole('button', { name: /ADJUST KEY FRAME|调整关键帧/ })
).toHaveCount(0)
- await expect(studio.locator('button[disabled]')).toHaveCount(2)
+ await expect(
+ studio.getByRole('button', { name: /^(RUN WORKFLOW|运行工作流)$/ })
+ ).toBeDisabled()
await studio.getByRole('button', { name: orbit, exact: true }).click()
await expect(studio.locator('video')).toHaveAttribute(
'src',
@@ -984,8 +1037,11 @@ async function startHeroPlayback(
play: string,
reducedMotion: 'reduce' | 'no-preference'
) {
- if (reducedMotion === 'reduce')
- await hero.getByRole('button', { name: play, exact: true }).click()
+ if (reducedMotion === 'reduce') {
+ const control = hero.getByRole('button', { name: play, exact: true })
+ await control.focus()
+ await control.press('Space')
+ }
await comparison.scrollIntoViewIfNeeded()
}
@@ -1037,7 +1093,8 @@ for (const { path, pause, play, sample, reducedMotion, mobile } of [
)
)
.toBe(true)
- await control.click()
+ await control.focus()
+ await control.press('Space')
await hero.getByRole('button', { name: sample, exact: true }).click()
await comparison.scrollIntoViewIfNeeded()
await expect
@@ -1057,7 +1114,9 @@ for (const { path, pause, play, sample, reducedMotion, mobile } of [
'aria-valuenow',
'50'
)
- await hero.getByRole('button', { name: play, exact: true }).click()
+ const resume = hero.getByRole('button', { name: play, exact: true })
+ await resume.focus()
+ await resume.press('Space')
await comparison.scrollIntoViewIfNeeded()
await expect
.poll(() =>
@@ -1149,3 +1208,182 @@ for (const { demo, sample } of [
).toBeVisible()
})
}
+
+test('VFX hero follows fine-pointer hover without a press and preserves keyboard and page scrolling', async ({
+ page
+}) => {
+ await page.goto('/solutions/vfx/v3/')
+ const hero = page.locator('[data-vfx-demo="hero"]')
+ await expectIslandHydrated(page, hero)
+ const comparison = hero.getByTestId('video-compare-surface')
+ await comparison.scrollIntoViewIfNeeded()
+ const bounds = await comparison.boundingBox()
+ assert(bounds)
+ const slider = hero.getByRole('slider')
+ await page.mouse.move(
+ bounds.x + bounds.width * 0.25,
+ bounds.y + bounds.height / 2
+ )
+ await expect(slider).toHaveAttribute('aria-valuenow', '25')
+ await slider.focus()
+ await slider.press('ArrowRight')
+ await expect(slider).toHaveAttribute('aria-valuenow', '27')
+ await page.mouse.move(
+ bounds.x + bounds.width * 0.75,
+ bounds.y + bounds.height / 2
+ )
+ await expect(slider).toHaveAttribute('aria-valuenow', '75')
+ const beforeScroll = await page.evaluate(() => window.scrollY)
+ await page.mouse.wheel(0, 200)
+ await expect
+ .poll(() => page.evaluate(() => window.scrollY))
+ .toBeGreaterThan(beforeScroll)
+})
+
+for (const { path, image, dimensions } of [
+ { path: '/', image: DEFAULT_OG_IMAGE, dimensions: 1 },
+ {
+ path: '/solutions/vfx/',
+ image: vfxWorkflows[5].template.thumbnails[0],
+ dimensions: 0
+ }
+]) {
+ test(`${path} keeps its existing share image when V3 uses animated metadata`, async ({
+ page
+ }) => {
+ await page.goto(path)
+ await expect(page.locator('meta[property="og:image"]')).toHaveCount(1)
+ await expect(page.locator('meta[property="og:image"]')).toHaveAttribute(
+ 'content',
+ image
+ )
+ await expect(page.locator('meta[name="twitter:image"]')).toHaveAttribute(
+ 'content',
+ image
+ )
+ await expect(page.locator('meta[property="og:image:type"]')).toHaveCount(0)
+ await expect(page.locator('meta[property="og:image:width"]')).toHaveCount(
+ dimensions
+ )
+ })
+}
+
+for (const { path, redSky, daylight, openStudio } of [
+ {
+ path: '/solutions/vfx/v3/',
+ redSky: 'Red sky',
+ daylight: 'Daylight',
+ openStudio: 'OPEN STUDIO'
+ },
+ {
+ path: '/zh-CN/solutions/vfx/v3/',
+ redSky: '红色天空',
+ daylight: '白天',
+ openStudio: '打开工作室'
+ }
+]) {
+ test(`${path} replaces only Blue hour across hero, canvas and Studio`, async ({
+ page
+ }) => {
+ await page.goto(path)
+ const hero = page.locator('[data-vfx-demo="hero"]')
+ await hero.getByRole('button', { name: redSky, exact: true }).click()
+ const after = hero.getByTestId('video-compare-after')
+ await expect(after).toHaveAttribute('src', vfxRedSkyMedia.video)
+ await expect(after).toHaveAttribute('poster', vfxRedSkyMedia.poster)
+ await expect(hero.getByTestId('video-compare-before')).toHaveAttribute(
+ 'src',
+ `${vfxMediaRoot}/diner.mp4`
+ )
+ await hero.getByRole('button', { name: daylight, exact: true }).click()
+ await expect(after).toHaveAttribute(
+ 'src',
+ `${vfxMediaRoot}/relight_day.mp4`
+ )
+ const section = page.locator('[data-vfx-demo="relight"]')
+ await waitForShowcase(section)
+ const choice = section.getByRole('button', { name: redSky, exact: true })
+ await expect(choice.locator('img')).toHaveAttribute(
+ 'src',
+ vfxRedSkyMedia.poster
+ )
+ await choice.click()
+ const output = section.locator('.vfx-main-node video')
+ await expect(output).toHaveAttribute('src', vfxRedSkyMedia.video)
+ await expect(output).toHaveAttribute('poster', vfxRedSkyMedia.poster)
+ await expect(section.locator('.vfx-keyframe-node img')).toHaveAttribute(
+ 'src',
+ vfxRedSkyMedia.poster
+ )
+ await section.getByRole('button', { name: openStudio, exact: true }).click()
+ const studio = section.locator('.vfx-studio-view')
+ await expect(studio.getByTestId('video-compare-after')).toHaveAttribute(
+ 'src',
+ vfxRedSkyMedia.video
+ )
+ await expect(studio.getByTestId('video-compare-before')).toHaveAttribute(
+ 'src',
+ `${vfxMediaRoot}/diner.mp4`
+ )
+ await studio.getByRole('button', { name: daylight, exact: true }).click()
+ await expect(studio.getByTestId('video-compare-after')).toHaveAttribute(
+ 'src',
+ `${vfxMediaRoot}/relight_day.mp4`
+ )
+ })
+}
+
+for (const { path, demo, share, open, workflow, expose } of [
+ {
+ path: '/solutions/vfx/v3/',
+ demo: 'swap',
+ share: '28fa6219c110',
+ open: 'OPEN STUDIO',
+ workflow: 'WORKFLOW',
+ expose: 'EXPOSE WORKFLOW ↗'
+ },
+ {
+ path: '/solutions/vfx/v3/',
+ demo: 'reframe',
+ share: 'ccfd0e7d75c3',
+ open: 'OPEN STUDIO',
+ workflow: 'WORKFLOW',
+ expose: 'EXPOSE WORKFLOW ↗'
+ },
+ {
+ path: '/zh-CN/solutions/vfx/v3/',
+ demo: 'swap',
+ share: '28fa6219c110',
+ open: '打开工作室',
+ workflow: '工作流',
+ expose: '查看工作流 ↗'
+ },
+ {
+ path: '/zh-CN/solutions/vfx/v3/',
+ demo: 'reframe',
+ share: 'ccfd0e7d75c3',
+ open: '打开工作室',
+ workflow: '工作流',
+ expose: '查看工作流 ↗'
+ }
+]) {
+ test(`${path} ${demo} uses its supplied workflow in the page and Studio`, async ({
+ page
+ }) => {
+ await page.goto(
+ `${path}?utm_source=linkedin&utm_campaign=vfx&utm_content=v3`
+ )
+ const section = page.locator(`[data-vfx-demo="${demo}"]`)
+ const expected = `https://cloud.comfy.org/?share=${share}&utm_source=linkedin&utm_campaign=vfx&utm_content=v3`
+ const cta = section.locator('[data-try-workflow]')
+ await expect(cta).toHaveAttribute('href', expected)
+ await expect(cta).toHaveAttribute('target', '_blank')
+ await waitForShowcase(section)
+ await section.getByRole('button', { name: open, exact: true }).click()
+ const studio = section.locator('[data-vfx-studio]')
+ await studio.getByRole('tab', { name: workflow, exact: true }).click()
+ await expect(
+ studio.getByRole('link', { name: expose, exact: true })
+ ).toHaveAttribute('href', expected)
+ })
+}
diff --git a/apps/website/e2e/vfx.spec.ts b/apps/website/e2e/vfx.spec.ts
index 203821932e3..7042ec52101 100644
--- a/apps/website/e2e/vfx.spec.ts
+++ b/apps/website/e2e/vfx.spec.ts
@@ -64,7 +64,7 @@ for (const {
path: '/solutions/vfx/',
heading: 'VFX workflows. Built for your pipeline.',
contact: '/contact/',
- cta: 'TALK TO COMFY',
+ cta: 'TALK TO COMFY TEAM',
cleanplate: 'OBJECT REMOVAL',
upscale: 'SHOT UPSCALING',
play: 'Play',
@@ -75,7 +75,7 @@ for (const {
path: '/zh-CN/solutions/vfx/',
heading: '为制作流程而构建的 视觉特效工作流。',
contact: '/zh-CN/contact/',
- cta: '联系 COMFY',
+ cta: '联系 COMFY 团队',
cleanplate: '物体移除',
upscale: '镜头超分辨率',
play: '播放',
diff --git a/apps/website/src/components/campaign/VfxHeroPrototype.test.ts b/apps/website/src/components/campaign/VfxHeroPrototype.test.ts
index f68cdf05a2f..6797006b095 100644
--- a/apps/website/src/components/campaign/VfxHeroPrototype.test.ts
+++ b/apps/website/src/components/campaign/VfxHeroPrototype.test.ts
@@ -81,7 +81,8 @@ it('keeps both hero clips paused after selecting another sample', async () => {
const user = userEvent.setup()
const { beforeVideo, afterVideo } = await renderReadyHero()
await waitFor(() => expect(beforeVideo.paused).toBe(false))
- await user.click(screen.getByRole('button', { name: /^Pause$/ }))
+ screen.getByRole('button', { name: /^Pause$/ }).focus()
+ await user.keyboard(' ')
await waitFor(() => {
expect(beforeVideo.paused).toBe(true)
expect(afterVideo.paused).toBe(true)
@@ -96,7 +97,10 @@ it('keeps both hero clips paused after selecting another sample', async () => {
expect(beforeVideo.paused).toBe(true)
expect(selectedVideo.paused).toBe(true)
- expect(screen.getByRole('button', { name: /^Play$/ })).toBeVisible()
+ expect(screen.getByRole('button', { name: /^Play$/ })).toHaveAttribute(
+ 'aria-pressed',
+ 'true'
+ )
})
it('lets reduced-motion visitors play both clips and keeps that choice after selection', async () => {
@@ -104,7 +108,8 @@ it('lets reduced-motion visitors play both clips and keeps that choice after sel
motion.reduced = true
const { beforeVideo, afterVideo } = await renderReadyHero('zh-CN')
expect(beforeVideo.paused).toBe(true)
- await user.click(screen.getByRole('button', { name: /^播放$/ }))
+ screen.getByRole('button', { name: /^播放$/ }).focus()
+ await user.keyboard(' ')
await waitFor(() => {
expect(beforeVideo.paused).toBe(false)
expect(afterVideo.paused).toBe(false)
@@ -120,7 +125,10 @@ it('lets reduced-motion visitors play both clips and keeps that choice after sel
expect(beforeVideo.paused).toBe(false)
expect(selectedVideo.paused).toBe(false)
})
- expect(screen.getByRole('button', { name: /^暂停$/ })).toBeVisible()
+ expect(screen.getByRole('button', { name: /^暂停$/ })).toHaveAttribute(
+ 'aria-pressed',
+ 'false'
+ )
})
it('resumes a new hero sample after a media failure when the visitor has not paused', async () => {
@@ -146,7 +154,8 @@ it('does not move the comparison divider when playback is toggled', async () =>
const user = userEvent.setup()
await renderReadyHero()
- await user.click(screen.getByRole('button', { name: /^Pause$/ }))
+ screen.getByRole('button', { name: /^Pause$/ }).focus()
+ await user.keyboard(' ')
expect(screen.getByRole('slider')).toHaveAttribute('aria-valuenow', '50')
})
diff --git a/apps/website/src/components/campaign/VfxHeroPrototype.vue b/apps/website/src/components/campaign/VfxHeroPrototype.vue
index 2a674de5100..a9e49d004ce 100644
--- a/apps/website/src/components/campaign/VfxHeroPrototype.vue
+++ b/apps/website/src/components/campaign/VfxHeroPrototype.vue
@@ -2,7 +2,6 @@
import { onMounted, onUnmounted, ref, useTemplateRef, watch } from 'vue'
import { useIntersectionObserver } from '@vueuse/core'
import { prefersReducedMotion } from '@/composables/useReducedMotion'
-import BrandButton from '@/components/common/BrandButton.vue'
import ProductHeroBadge from '@/components/common/ProductHeroBadge.vue'
import HeroSplit01 from '@/components/blocks/HeroSplit01.vue'
import VfxSampleScene from '@/components/campaign/VfxSampleScene.vue'
@@ -59,7 +58,11 @@ onUnmounted(() => clearTimeout(assemblyTimer))
-
+
clearTimeout(assemblyTimer))
:slider-label="t('modelLaunch.beforeAfter.sliderLabel')"
:choices-label="t('modelLaunch.beforeAfter.tabsLabel')"
/>
-
- {{ paused ? t('player.play') : t('player.pause') }}
-
+
diff --git a/apps/website/src/components/campaign/VfxSampleScene.vue b/apps/website/src/components/campaign/VfxSampleScene.vue
index c39294d144d..638a69f9d2a 100644
--- a/apps/website/src/components/campaign/VfxSampleScene.vue
+++ b/apps/website/src/components/campaign/VfxSampleScene.vue
@@ -1,5 +1,5 @@