get pixel colour util for e2e tests (#2599)

* get pixel colour for e2e tests

* remove cleverness
This commit is contained in:
Kurt Hutten
2024-06-05 10:36:12 +10:00
committed by GitHub
parent 893996430e
commit 978ac42f1c
2 changed files with 31 additions and 2 deletions

View File

@ -134,9 +134,14 @@ test('Basic sketch', async ({ page }) => {
await page.getByRole('button', { name: 'Line' }).click()
await page.waitForTimeout(100)
const line1 = await u.getSegmentBodyCoords(`[data-overlay-index="${0}"]`, 0)
await expect(await u.getGreatestPixDiff(line1, [249, 249, 249])).toBeLessThan(
3
)
// click between first two clicks to get center of the line
await page.mouse.click(startXPx + PUR * 15, 500 - PUR * 10)
await page.waitForTimeout(100)
await expect(await u.getGreatestPixDiff(line1, [0, 0, 255])).toBeLessThan(3)
// hold down shift
await page.keyboard.down('Shift')