feat: make media inspection progressive
This commit is contained in:
@@ -4,6 +4,7 @@ import { join } from 'node:path';
|
||||
import { expect, test, type Page } from '@playwright/test';
|
||||
import {
|
||||
GENERATED_FIXTURES,
|
||||
inspectMediaDetails,
|
||||
observeRuntime,
|
||||
PRIMARY_FIXTURE,
|
||||
type RuntimeObservation,
|
||||
@@ -51,8 +52,9 @@ test.describe
|
||||
await mediaInput(page).setInputFiles(
|
||||
join(GENERATED_FIXTURES, 'attached-cover.mp3')
|
||||
);
|
||||
await inspectMediaDetails(page, 'attached-cover.mp3');
|
||||
await expect(page.locator('.source-summary .phase--ready')).toHaveText(
|
||||
'Ready',
|
||||
'Details ready',
|
||||
{ timeout: 60_000 }
|
||||
);
|
||||
await expect(page.locator('.source-summary')).toContainText(
|
||||
@@ -108,13 +110,23 @@ test.describe
|
||||
await mediaInput(page).setInputFiles(
|
||||
join(GENERATED_FIXTURES, 'truncated.mp4')
|
||||
);
|
||||
await page
|
||||
.getByRole('button', {
|
||||
name: 'Inspect details for truncated.mp4',
|
||||
})
|
||||
.click();
|
||||
const malformedCard = page
|
||||
.locator('.media-card')
|
||||
.filter({ hasText: 'truncated.mp4' });
|
||||
await expect(malformedCard.locator('.phase--error')).toContainText(
|
||||
'ffprobe did not find any media streams.',
|
||||
'File ready · Details unavailable',
|
||||
{ timeout: 30_000 }
|
||||
);
|
||||
await expect(
|
||||
page.getByRole('button', {
|
||||
name: 'Retry detailed inspection for truncated.mp4',
|
||||
})
|
||||
).toHaveAttribute('title', 'ffprobe did not find any media streams.');
|
||||
expect(Date.now() - probeStartedAt).toBeLessThan(30_000);
|
||||
await expect(
|
||||
page
|
||||
@@ -123,6 +135,7 @@ test.describe
|
||||
).toBeVisible();
|
||||
|
||||
await mediaInput(page).setInputFiles(PRIMARY_FIXTURE);
|
||||
await inspectMediaDetails(page, 'pattern-av.mp4');
|
||||
const validCard = page
|
||||
.locator('.media-card')
|
||||
.filter({ hasText: 'pattern-av.mp4' });
|
||||
|
||||
Reference in New Issue
Block a user