splitting tests
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
import { createPdf, dropFiles, expectPdfDownload, pdfDropzone, trackPageErrors } from './helpers';
|
||||
|
||||
test('merge accepts dropped PDFs and downloads a merged PDF', async ({ page }) => {
|
||||
const pageErrors = trackPageErrors(page);
|
||||
await page.goto('/tools/merge');
|
||||
await dropFiles(page, pdfDropzone(page), [
|
||||
{ name: 'eins.pdf', mimeType: 'application/pdf', buffer: await createPdf(1, 'Eins') },
|
||||
{ name: 'zwei.pdf', mimeType: 'application/pdf', buffer: await createPdf(2, 'Zwei') }
|
||||
]);
|
||||
|
||||
await expect(page.getByText('2 Dateien ausgewählt')).toBeVisible();
|
||||
const downloadPromise = page.waitForEvent('download');
|
||||
await page.getByRole('button', { name: 'PDFs zusammenfügen' }).click();
|
||||
await expectPdfDownload(await downloadPromise, /^zusammengefuegt\.pdf$/);
|
||||
expect(pageErrors).toEqual([]);
|
||||
});
|
||||
Reference in New Issue
Block a user