-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: stackSegmentation (CircularEraser, RectangleScissor and PaintFi…
…ll screenshots) (#1385) * test: stackSegmentation (CircularEraser, RectangleScissor and PaintFill) * test: stackSegmentation (CircularEraser, RectangleScissor and PaintFill screenshots)
- Loading branch information
Showing
10 changed files
with
214 additions
and
28 deletions.
There are no files selected for viewing
Binary file added
BIN
+68.4 KB
.../screenshots/chromium/stackSegmentation.spec.ts/circularEraserSegmentation1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+70.7 KB
.../screenshots/chromium/stackSegmentation.spec.ts/circularEraserSegmentation2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+67.7 KB
tests/screenshots/chromium/stackSegmentation.spec.ts/paintFillSeg1OuterCircle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+62.8 KB
tests/screenshots/chromium/stackSegmentation.spec.ts/paintFillSegmentation2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+69.2 KB
...creenshots/chromium/stackSegmentation.spec.ts/rectangleScissorSegmentation1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export default async function locatorToPageCoord( | ||
page, | ||
locator, | ||
point: number[] | ||
) { | ||
const bbox = await locator.boundingBox(); | ||
|
||
return [bbox.x + point[0], bbox.y + point[1]]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function pause(ms: number) { | ||
return new Promise((resolve) => setTimeout(resolve, ms)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import locatorToPageCoord from './locatorToPageCoord'; | ||
import pause from './pause'; | ||
|
||
export default async function simulateDrawRect( | ||
page, | ||
locator, | ||
rectTopLeft, | ||
rectBottomRight | ||
) { | ||
const pageTopLeftPoint = await locatorToPageCoord(page, locator, rectTopLeft); | ||
const pageBottomRightPoint = await locatorToPageCoord( | ||
page, | ||
locator, | ||
rectBottomRight | ||
); | ||
|
||
await page.mouse.move(pageTopLeftPoint[0], pageTopLeftPoint[1]); | ||
await page.mouse.down(); | ||
await pause(500); | ||
await page.mouse.move(pageBottomRightPoint[0], pageBottomRightPoint[1]); | ||
await pause(500); | ||
await page.mouse.up(); | ||
} |