From 2530b19491e6b1990ff9c29aa19149f74bb8bb01 Mon Sep 17 00:00:00 2001 From: Dheeraj Date: Fri, 5 Jul 2024 14:35:32 +0530 Subject: [PATCH] test case --- tests/integration.test.js | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/tests/integration.test.js b/tests/integration.test.js index 4fce3a8de..b6697ad2a 100644 --- a/tests/integration.test.js +++ b/tests/integration.test.js @@ -1,10 +1,15 @@ async function waitForHighlights() { + console.log("Waiting for highlights..."); await page.waitForSelector(".Highlight .Highlight__part", { visible: true, }); + console.log("Highlights are visible."); } async function highlight(start, end) { + console.log( + `Highlighting from ${JSON.stringify(start)} to ${JSON.stringify(end)}` + ); await page.mouse.move(start.x, start.y); await page.mouse.down(); await page.waitFor(50); @@ -13,10 +18,11 @@ async function highlight(start, end) { await page.mouse.up(); } -jest.setTimeout(30000); +jest.setTimeout(60000); // Increased timeout beforeAll(async () => { await page.goto("http://localhost:3000"); + console.log("Page loaded"); }); it("should display highlights", async () => { @@ -33,30 +39,3 @@ it("should display hover tips over highlights", async () => { }); await expect(page).toMatchTextContent("Flow or TypeScript?"); }); - -// it("should highlight text", async () => { -// await page.setViewport({ width: 1397, height: 1329 }); -// await waitForHighlights(); -// await highlight({ x: 400, y: 300 }, { x: 500, y: 300 }); -// await page.waitForSelector(".PdfHighlighter__tip-container", { -// visible: true, -// }); -// }); - -// it("should allow a selection on multiple pages", async () => { -// await page.setViewport({ width: 1397, height: 1329 }); -// await waitForHighlights(); -// await highlight({ x: 30, y: 10 }, { x: 489, y: 3000 }); -// const addHighlightPopup = await page.waitForSelector(".Tip__compact", { -// visible: true, -// }); -// await addHighlightPopup.click(); -// const commentTextArea = await page.waitForSelector( -// "div.PdfHighlighter__tip-container textarea" -// ); -// await commentTextArea.type("test"); -// const saveCommentButton = await page.waitForSelector( -// "div.PdfHighlighter__tip-container input[type=submit]" -// ); -// await saveCommentButton.click(); -// });