diff --git a/tests/specs/generate-pdf.spec.js b/tests/specs/generate-pdf.spec.js index 4c57a2b..ff927f7 100644 --- a/tests/specs/generate-pdf.spec.js +++ b/tests/specs/generate-pdf.spec.js @@ -24,7 +24,7 @@ test.beforeEach(async ({page, testPdf}) => { await expect(page.locator("#generate")).toBeEnabled(); }); -test("Simple PDF generation", async ({page, testPdf}) => { +test("Simple PDF generation", async ({page, testPdf}, testInfo) => { // generate PDF await page.locator("#generate").click(); @@ -42,15 +42,18 @@ test("Simple PDF generation", async ({page, testPdf}) => { expect(download.url()).toContain("blob:"); expect(download.suggestedFilename()).toMatch(/.pdf$/i); - let result; - try { - result = await pdfCompare(await download.path(), testPdf.outputPath); - } catch (error) { - result = error; + if (testInfo.project === "chromium") { + // compare PDFs, but only in Chrome for now due to different rendering in Firefox + let result; + try { + result = await pdfCompare(await download.path(), testPdf.outputPath); + } catch (error) { + result = error; + } + console.log("Result:", result); + expect(result.message).toBeUndefined(); + expect(result.status).toBe("passed") } - console.log("Result:", result); - expect(result.message).toBeUndefined(); - expect(result.status).toBe("passed") // cleanup await download.delete();