Skip to content

Commit

Permalink
test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Dheeraj committed Jul 5, 2024
1 parent ee48280 commit 2530b19
Showing 1 changed file with 7 additions and 28 deletions.
35 changes: 7 additions & 28 deletions tests/integration.test.js
Original file line number Diff line number Diff line change
@@ -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);
Expand All @@ -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 () => {
Expand All @@ -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();
// });

0 comments on commit 2530b19

Please sign in to comment.