diff --git a/.github/workflows/pr-e2e-mvp.yml b/.github/workflows/pr-e2e-mvp.yml index 31f47697..161b525d 100644 --- a/.github/workflows/pr-e2e-mvp.yml +++ b/.github/workflows/pr-e2e-mvp.yml @@ -55,11 +55,6 @@ jobs: npm install npx playwright install --with-deps chromium - - name: Generate fixtures - run: | - node tests/e2e/scripts/generate-fixtures.mjs - python3 tests/e2e/scripts/generate-office-fixtures.py - - name: Start fixture server run: | cd tests/e2e/fixtures diff --git a/tests/e2e/scripts/generate-fixtures.mjs b/tests/e2e/scripts/generate-fixtures.mjs index 6d4efe01..c344afac 100644 --- a/tests/e2e/scripts/generate-fixtures.mjs +++ b/tests/e2e/scripts/generate-fixtures.mjs @@ -24,8 +24,9 @@ if (!fs.existsSync(zipPath)) { fs.writeFileSync(path.join(zipWork, 'inner.txt'), 'kkFileView zip inner file'); try { execFileSync('zip', ['-X', '-q', '-r', zipPath, 'inner.txt'], { cwd: zipWork }); - } catch { - // fallback: keep going if zip is not available locally + } catch (err) { + console.error('Failed to create sample.zip fixture. Ensure "zip" is installed and available in PATH.'); + throw err instanceof Error ? err : new Error(String(err)); } } diff --git a/tests/e2e/specs/preview-smoke.spec.ts b/tests/e2e/specs/preview-smoke.spec.ts index 42a7420a..8f2b36c5 100644 --- a/tests/e2e/specs/preview-smoke.spec.ts +++ b/tests/e2e/specs/preview-smoke.spec.ts @@ -13,12 +13,28 @@ async function openPreview(request: any, fileUrl: string) { test.beforeAll(async () => { const api = await playwrightRequest.newContext(); - const required = ['sample.txt', 'sample.docx', 'sample.xlsx', 'sample.pptx', 'sample.zip']; - for (const name of required) { - const resp = await api.get(`${fixtureBase}/${name}`); - expect(resp.ok(), `fixture missing or unavailable: ${name}`).toBeTruthy(); + const required = [ + 'sample.txt', + 'sample.md', + 'sample.json', + 'sample.xml', + 'sample.csv', + 'sample.html', + 'sample.png', + 'sample.docx', + 'sample.xlsx', + 'sample.pptx', + 'sample.zip', + ]; + + try { + for (const name of required) { + const resp = await api.get(`${fixtureBase}/${name}`); + expect(resp.ok(), `fixture missing or unavailable: ${name}`).toBeTruthy(); + } + } finally { + await api.dispose(); } - await api.dispose(); }); test('01 home/index reachable', async ({ request }) => {