test(e2e): stabilize direct upload selector

This commit is contained in:
Xiaoxia AI
2026-06-23 16:29:17 +08:00
parent 6e42f944c0
commit 64b29791a2
+3 -4
View File
@@ -73,14 +73,13 @@ test.describe('Core media upload flow', () => {
await page.goto(`/projects/${projectData.id}/assets`);
const uploadButton = page.getByRole('button', { name: /点击或拖拽文件到这里批量上传素材/ });
await expect(uploadButton).toBeEnabled({ timeout: 20_000 });
const fileInput = page.locator('.ant-upload input[type="file"]:not([disabled])').first();
await expect(fileInput).toBeAttached({ timeout: 20_000 });
const completeResponsePromise = page.waitForResponse(
(response) => response.url().includes('/api/v1/upload/direct/complete') && response.request().method() === 'POST',
{ timeout: 60_000 }
);
const fileChooserPromise = page.waitForEvent('filechooser');
await uploadButton.click();
const fileChooser = await fileChooserPromise;
await fileChooser.setFiles({
await fileInput.setInputFiles({
name: 'e2e-sample.MOV',
mimeType: 'video/quicktime',
buffer: Buffer.from('playwright mov upload smoke'),