update e2e tests after grid update (#1171)

* update default plane size after grid update

* use similar scale

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)

* fix test numbers

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Kurt Hutten
2023-12-05 14:59:50 +11:00
committed by GitHub
parent 77fa9af71e
commit 6deb242eb5
6 changed files with 23 additions and 25 deletions

View File

@ -4,8 +4,6 @@ import { EngineCommand } from '../../src/lang/std/engineConnection'
import { v4 as uuidv4 } from 'uuid' import { v4 as uuidv4 } from 'uuid'
import { getUtils } from './test-utils' import { getUtils } from './test-utils'
import waitOn from 'wait-on' import waitOn from 'wait-on'
import { Models } from '@kittycad/lib'
import fsp from 'fs/promises'
/* /*
debug helper: unfortunately we do rely on exact coord mouse clicks in a few places debug helper: unfortunately we do rely on exact coord mouse clicks in a few places
@ -86,26 +84,26 @@ test('Basic sketch', async ({ page }) => {
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10) await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
const startAt = '[10.97, -14.79]' const startAt = '[18.26, -24.63]'
const tenish = '11.07' const num = '18.43'
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`const part001 = startSketchOn('-XZ') .toHaveText(`const part001 = startSketchOn('-XZ')
|> startProfileAt(${startAt}, %) |> startProfileAt(${startAt}, %)
|> line([${tenish}, 0], %)`) |> line([${num}, 0], %)`)
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20) await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20)
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`const part001 = startSketchOn('-XZ') .toHaveText(`const part001 = startSketchOn('-XZ')
|> startProfileAt(${startAt}, %) |> startProfileAt(${startAt}, %)
|> line([${tenish}, 0], %) |> line([${num}, 0], %)
|> line([0, ${tenish}], %)`) |> line([0, ${num}], %)`)
await page.mouse.click(startXPx, 500 - PUR * 20) await page.mouse.click(startXPx, 500 - PUR * 20)
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`const part001 = startSketchOn('-XZ') .toHaveText(`const part001 = startSketchOn('-XZ')
|> startProfileAt(${startAt}, %) |> startProfileAt(${startAt}, %)
|> line([${tenish}, 0], %) |> line([${num}, 0], %)
|> line([0, ${tenish}], %) |> line([0, ${num}], %)
|> line([-22.04, 0], %)`) |> line([-36.69, 0], %)`)
// deselect line tool // deselect line tool
await u.doAndWaitForCmd( await u.doAndWaitForCmd(
@ -133,8 +131,8 @@ test('Basic sketch', async ({ page }) => {
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`const part001 = startSketchOn('-XZ') .toHaveText(`const part001 = startSketchOn('-XZ')
|> startProfileAt(${startAt}, %) |> startProfileAt(${startAt}, %)
|> line({ to: [${tenish}, 0], tag: 'seg01' }, %) |> line({ to: [${num}, 0], tag: 'seg01' }, %)
|> line([0, ${tenish}], %) |> line([0, ${num}], %)
|> angledLine([180, segLen('seg01', %)], %)`) |> angledLine([180, segLen('seg01', %)], %)`)
}) })
@ -508,27 +506,27 @@ test('Selections work on fresh and edited sketch', async ({ page }) => {
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10) await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
const startAt = '[10.97, -14.79]' const startAt = '[18.26, -24.63]'
const tenish = '11.07' const num = '18.43'
const twentyish = '22.04' const num2 = '36.69'
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`const part001 = startSketchOn('-XZ') .toHaveText(`const part001 = startSketchOn('-XZ')
|> startProfileAt(${startAt}, %) |> startProfileAt(${startAt}, %)
|> line([${tenish}, 0], %)`) |> line([${num}, 0], %)`)
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20) await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20)
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`const part001 = startSketchOn('-XZ') .toHaveText(`const part001 = startSketchOn('-XZ')
|> startProfileAt(${startAt}, %) |> startProfileAt(${startAt}, %)
|> line([${tenish}, 0], %) |> line([${num}, 0], %)
|> line([0, ${tenish}], %)`) |> line([0, ${num}], %)`)
await page.mouse.click(startXPx, 500 - PUR * 20) await page.mouse.click(startXPx, 500 - PUR * 20)
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`const part001 = startSketchOn('-XZ') .toHaveText(`const part001 = startSketchOn('-XZ')
|> startProfileAt(${startAt}, %) |> startProfileAt(${startAt}, %)
|> line([${tenish}, 0], %) |> line([${num}, 0], %)
|> line([0, ${tenish}], %) |> line([0, ${num}], %)
|> line([-${twentyish}, 0], %)`) |> line([-${num2}, 0], %)`)
// deselect line tool // deselect line tool
await u.doAndWaitForCmd( await u.doAndWaitForCmd(
@ -581,7 +579,7 @@ test('Selections work on fresh and edited sketch', async ({ page }) => {
// check the same selection again by putting cursor in code first then selecting axis // check the same selection again by putting cursor in code first then selecting axis
await u.doAndWaitForCmd( await u.doAndWaitForCmd(
() => page.getByText(` |> line([-${twentyish}, 0], %)`).click(), () => page.getByText(` |> line([-${num2}, 0], %)`).click(),
'select_clear', 'select_clear',
false false
) )
@ -596,7 +594,7 @@ test('Selections work on fresh and edited sketch', async ({ page }) => {
// select segment in editor than another segment in scene and check there are two cursors // select segment in editor than another segment in scene and check there are two cursors
await u.doAndWaitForCmd( await u.doAndWaitForCmd(
() => page.getByText(` |> line([-${twentyish}, 0], %)`).click(), () => page.getByText(` |> line([-${num2}, 0], %)`).click(),
'select_clear', 'select_clear',
false false
) )

View File

@ -45,7 +45,7 @@ test('change camera, show planes', async ({ page, context }) => {
type: 'default_camera_look_at', type: 'default_camera_look_at',
center: { x: 0, y: 0, z: 0 }, center: { x: 0, y: 0, z: 0 },
up: { x: 0, y: 0, z: 1 }, up: { x: 0, y: 0, z: 1 },
vantage: { x: 0, y: 50, z: 50 }, vantage: { x: 0, y: 85, z: 85 },
}, },
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View File

@ -1216,7 +1216,7 @@ export class EngineCommandManager {
type: 'modeling_cmd_req', type: 'modeling_cmd_req',
cmd: { cmd: {
type: 'make_plane', type: 'make_plane',
size: 60, size: 100,
origin: { x: 0, y: 0, z: 0 }, origin: { x: 0, y: 0, z: 0 },
x_axis, x_axis,
y_axis, y_axis,