fix(ArrowAnnotate): Allow free-form text for arrow annotations (#5259)

This commit is contained in:
Joe Boccanfuso authored and GitHub committed 2025-07-24 12:58:45 -04:00
1 parent 4e6530d1d8
commit 3c8446a5e5
17 files changed
+156 -11

No files matched your search

+2
View File
@@ -3,6 +3,7 @@ import { checkForScreenshot } from './checkForScreenshot';
import { screenShotPaths } from './screenShotPaths';
import {
simulateClicksOnElement,
simulateDoubleClickOnElement,
simulateNormalizedClickOnElement,
simulateNormalizedClicksOnElement,
} from './simulateClicksOnElement';
@@ -20,6 +21,7 @@ export {
checkForScreenshot,
screenShotPaths,
simulateClicksOnElement,
simulateDoubleClickOnElement,
simulateNormalizedClickOnElement,
simulateNormalizedClicksOnElement,
reduce3DViewportSize,
+5
View File
@@ -2,6 +2,11 @@
* Paths to the screenshots of the tests.
*/
const screenShotPaths = {
arrowAnnotate: {
arrowAnnotateDisplayedCorrectly0: 'arrowAnnotateDisplayedCorrectly0.png',
arrowAnnotateDisplayedCorrectly1: 'arrowAnnotateDisplayedCorrectly1.png',
arrowAnnotateDisplayedCorrectly2: 'arrowAnnotateDisplayedCorrectly2.png',
},
angle: {
angleDisplayedCorrectly: 'angleDisplayedCorrectly.png',
},
+14 -1
View File
@@ -9,15 +9,28 @@ import { Locator } from 'playwright';
export async function simulateClicksOnElement({
locator,
points,
button = 'left',
}: {
locator: Locator;
points: { x: number; y: number }[];
button?: 'left' | 'right' | 'middle';
}) {
for (const { x, y } of points) {
await locator.click({ delay: 100, position: { x, y } });
await locator.click({ delay: 100, position: { x, y }, button });
}
}
export async function simulateDoubleClickOnElement({
locator,
point,
}: {
locator: Locator;
point: { x: number; y: number };
}) {
const { x, y } = point;
await locator.dblclick({ delay: 100, position: { x, y } });
}
/**
* Simulates clicks on an element at a normalized point.
*