Skip to content

Build your personal knowledge base with Trilium Notes

e2e(server): flaky test in PDF

Elian Doran66659d478673
diff --git a/apps/server-e2e/src/note_types/pdf.spec.ts b/apps/server-e2e/src/note_types/pdf.spec.ts
index 4d5543fda7..65bbeb1fb2 100644
--- a/apps/server-e2e/src/note_types/pdf.spec.ts
+++ b/apps/server-e2e/src/note_types/pdf.spec.ts
@@ -73,13 +73,15 @@ test("Attachments listing works", async ({ page, context }) => {
test("Download original PDF works", async ({ page, context }) => {
const app = new App(page, context);
await app.goto();
- await app.goToNoteInNewTab("Dacia Logan.pdf");
+ await app.goToNoteInNewTab("Layers test.pdf");
const pdfHelper = new PdfHelper(app);
await pdfHelper.toBeInitialized();
+ const downloadButton = app.currentNoteSplit.locator(".icon-action.bx.bx-download");
+ await expect(downloadButton).toBeVisible();
const [ download ] = await Promise.all([
page.waitForEvent("download"),
- app.currentNoteSplit.locator(".icon-action.bx.bx-download").click()
+ downloadButton.click()
]);
expect(download).toBeDefined();
});
@@ -125,5 +127,6 @@ class PdfHelper {
async toBeInitialized() {
await expect(this.contentFrame.locator("#pageNumber")).toBeVisible();
+ await expect(this.contentFrame.locator(".page")).toBeVisible();
}
}