parent
81cf42df47
commit
edc2cd1968
@ -1785,6 +1785,10 @@ describe("Highlight Editor", () => {
|
|||||||
await page.keyboard.press("Escape");
|
await page.keyboard.press("Escape");
|
||||||
await page.waitForSelector(`${editorSelector}:not(.selectedEditor)`);
|
await page.waitForSelector(`${editorSelector}:not(.selectedEditor)`);
|
||||||
|
|
||||||
|
const clickHandle = await waitForPointerUp(page);
|
||||||
|
y = rect.y - rect.height;
|
||||||
|
await page.mouse.move(x, y);
|
||||||
|
|
||||||
const counterHandle = await page.evaluateHandle(sel => {
|
const counterHandle = await page.evaluateHandle(sel => {
|
||||||
const el = document.querySelector(sel);
|
const el = document.querySelector(sel);
|
||||||
const counter = { count: 0 };
|
const counter = { count: 0 };
|
||||||
@ -1798,19 +1802,22 @@ describe("Highlight Editor", () => {
|
|||||||
return counter;
|
return counter;
|
||||||
}, editorSelector);
|
}, editorSelector);
|
||||||
|
|
||||||
const clickHandle = await waitForPointerUp(page);
|
|
||||||
y = rect.y - rect.height;
|
|
||||||
await page.mouse.move(x, y);
|
|
||||||
await page.mouse.down();
|
await page.mouse.down();
|
||||||
|
await page.waitForSelector(
|
||||||
|
`.page[data-page-number = "1"] .annotationEditorLayer.drawing`
|
||||||
|
);
|
||||||
for (
|
for (
|
||||||
const endY = rect.y + 2 * rect.height;
|
const endY = rect.y + 2 * rect.height;
|
||||||
y <= endY;
|
y <= endY;
|
||||||
y += rect.height / 10
|
y += rect.height / 10
|
||||||
) {
|
) {
|
||||||
await page.mouse.move(x, y);
|
await page.mouse.move(x, Math.round(y));
|
||||||
}
|
}
|
||||||
await page.mouse.up();
|
await page.mouse.up();
|
||||||
await awaitPromise(clickHandle);
|
await awaitPromise(clickHandle);
|
||||||
|
await page.waitForSelector(
|
||||||
|
`.page[data-page-number = "1"] .annotationEditorLayer:not(.drawing)`
|
||||||
|
);
|
||||||
|
|
||||||
const { count } = await counterHandle.jsonValue();
|
const { count } = await counterHandle.jsonValue();
|
||||||
expect(count).withContext(`In ${browserName}`).toEqual(0);
|
expect(count).withContext(`In ${browserName}`).toEqual(0);
|
||||||
@ -1841,14 +1848,18 @@ describe("Highlight Editor", () => {
|
|||||||
"ternative compilation technique for dynamically-typed languages"
|
"ternative compilation technique for dynamically-typed languages"
|
||||||
);
|
);
|
||||||
const editorSelector = getEditorSelector(0);
|
const editorSelector = getEditorSelector(0);
|
||||||
const x = rect.x + rect.width / 2;
|
const x = Math.round(rect.x + rect.width / 2);
|
||||||
let y = rect.y + rect.height / 2;
|
let y = Math.round(rect.y + rect.height / 2);
|
||||||
await page.mouse.click(x, y, { count: 3, delay: 100 });
|
await page.mouse.click(x, y, { count: 3, delay: 100 });
|
||||||
await page.waitForSelector(editorSelector);
|
await page.waitForSelector(editorSelector);
|
||||||
await waitForSerialized(page, 1);
|
await waitForSerialized(page, 1);
|
||||||
await page.keyboard.press("Escape");
|
await page.keyboard.press("Escape");
|
||||||
await page.waitForSelector(`${editorSelector}:not(.selectedEditor)`);
|
await page.waitForSelector(`${editorSelector}:not(.selectedEditor)`);
|
||||||
|
|
||||||
|
const clickHandle = await waitForPointerUp(page);
|
||||||
|
y = rect.y - 3 * rect.height;
|
||||||
|
await page.mouse.move(x, y);
|
||||||
|
|
||||||
const counterHandle = await page.evaluateHandle(sel => {
|
const counterHandle = await page.evaluateHandle(sel => {
|
||||||
const el = document.querySelector(sel);
|
const el = document.querySelector(sel);
|
||||||
const counter = { count: 0 };
|
const counter = { count: 0 };
|
||||||
@ -1862,19 +1873,22 @@ describe("Highlight Editor", () => {
|
|||||||
return counter;
|
return counter;
|
||||||
}, editorSelector);
|
}, editorSelector);
|
||||||
|
|
||||||
const clickHandle = await waitForPointerUp(page);
|
|
||||||
y = rect.y - 3 * rect.height;
|
|
||||||
await page.mouse.move(x, y);
|
|
||||||
await page.mouse.down();
|
await page.mouse.down();
|
||||||
|
await page.waitForSelector(
|
||||||
|
`.page[data-page-number = "1"] .textLayer.selecting`
|
||||||
|
);
|
||||||
for (
|
for (
|
||||||
const endY = rect.y + 3 * rect.height;
|
const endY = rect.y + 3 * rect.height;
|
||||||
y <= endY;
|
y <= endY;
|
||||||
y += rect.height / 10
|
y += rect.height / 10
|
||||||
) {
|
) {
|
||||||
await page.mouse.move(x, y);
|
await page.mouse.move(x, Math.round(y));
|
||||||
}
|
}
|
||||||
await page.mouse.up();
|
await page.mouse.up();
|
||||||
await awaitPromise(clickHandle);
|
await awaitPromise(clickHandle);
|
||||||
|
await page.waitForSelector(
|
||||||
|
`.page[data-page-number = "1"] .textLayer:not(.selecting)`
|
||||||
|
);
|
||||||
|
|
||||||
const { count } = await counterHandle.jsonValue();
|
const { count } = await counterHandle.jsonValue();
|
||||||
expect(count).withContext(`In ${browserName}`).toEqual(0);
|
expect(count).withContext(`In ${browserName}`).toEqual(0);
|
||||||
|
|||||||
@ -43,11 +43,14 @@ describe("Text layer", () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function middleLeftPosition(rect) {
|
function middleLeftPosition(rect) {
|
||||||
return { x: rect.x + 1, y: rect.y + rect.height / 2 };
|
return { x: rect.x + 1, y: rect.y + Math.floor(rect.height / 2) };
|
||||||
}
|
}
|
||||||
|
|
||||||
function belowEndPosition(rect) {
|
function belowEndPosition(rect) {
|
||||||
return { x: rect.x + rect.width, y: rect.y + rect.height * 1.5 };
|
return {
|
||||||
|
x: rect.x + rect.width,
|
||||||
|
y: rect.y + Math.floor(rect.height * 1.5),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user