Compare commits

...

11 Commits

8 changed files with 41 additions and 37 deletions

View File

@ -104,7 +104,7 @@ test(
}, },
{ timeout: 15_000 } { timeout: 15_000 }
) )
.toBe(477327) .toBe(477481)
// clean up output.gltf // clean up output.gltf
await fsp.rm('output.gltf') await fsp.rm('output.gltf')

View File

@ -173,7 +173,7 @@ test.describe('Can export from electron app', () => {
// gray at this pixel means the stream has loaded in the most // gray at this pixel means the stream has loaded in the most
// user way we can verify it (pixel color) // user way we can verify it (pixel color)
await expect await expect
.poll(() => u.getGreatestPixDiff(pointOnModel, [75, 75, 75]), { .poll(() => u.getGreatestPixDiff(pointOnModel, [85, 85, 85]), {
timeout: 10_000, timeout: 10_000,
}) })
.toBeLessThan(10) .toBeLessThan(10)
@ -207,7 +207,7 @@ test.describe('Can export from electron app', () => {
}, },
{ timeout: 15_000 } { timeout: 15_000 }
) )
.toBe(477327) .toBe(477481)
// clean up output.gltf // clean up output.gltf
await fsp.rm('output.gltf') await fsp.rm('output.gltf')
@ -856,7 +856,7 @@ const extrude001 = extrude(200, sketch001)`)
// gray at this pixel means the stream has loaded in the most // gray at this pixel means the stream has loaded in the most
// user way we can verify it (pixel color) // user way we can verify it (pixel color)
await expect await expect
.poll(() => u.getGreatestPixDiff(pointOnModel, [132, 132, 132]), { .poll(() => u.getGreatestPixDiff(pointOnModel, [143, 143, 143]), {
timeout: 10_000, timeout: 10_000,
}) })
.toBeLessThan(10) .toBeLessThan(10)
@ -867,7 +867,7 @@ const extrude001 = extrude(200, sketch001)`)
await page.mouse.click(pointOnModel.x, pointOnModel.y) await page.mouse.click(pointOnModel.x, pointOnModel.y)
// check user can interact with model by checking it turns yellow // check user can interact with model by checking it turns yellow
await expect await expect
.poll(() => u.getGreatestPixDiff(pointOnModel, [176, 180, 132])) .poll(() => u.getGreatestPixDiff(pointOnModel, [185, 185, 142]))
.toBeLessThan(10) .toBeLessThan(10)
}).toPass({ timeout: 40_000, intervals: [1_000] }) }).toPass({ timeout: 40_000, intervals: [1_000] })
@ -956,7 +956,7 @@ test(
// gray at this pixel means the stream has loaded in the most // gray at this pixel means the stream has loaded in the most
// user way we can verify it (pixel color) // user way we can verify it (pixel color)
await expect await expect
.poll(() => u.getGreatestPixDiff(pointOnModel, [75, 75, 75]), { .poll(() => u.getGreatestPixDiff(pointOnModel, [85, 85, 85]), {
timeout: 10_000, timeout: 10_000,
}) })
.toBeLessThan(10) .toBeLessThan(10)
@ -990,7 +990,7 @@ test(
// gray at this pixel means the stream has loaded in the most // gray at this pixel means the stream has loaded in the most
// user way we can verify it (pixel color) // user way we can verify it (pixel color)
await expect await expect
.poll(() => u.getGreatestPixDiff(pointOnModel, [132, 132, 132]), { .poll(() => u.getGreatestPixDiff(pointOnModel, [143, 143, 143]), {
timeout: 10_000, timeout: 10_000,
}) })
.toBeLessThan(10) .toBeLessThan(10)

View File

@ -358,6 +358,7 @@ const sketch001 = startSketchAt([-0, -0])
await page.addInitScript( await page.addInitScript(
async ({ code }) => { async ({ code }) => {
localStorage.setItem('persistCode', code) localStorage.setItem('persistCode', code)
;(window as any).playwrightSkipFilePicker = true
}, },
{ {
code: bracket, code: bracket,
@ -393,20 +394,22 @@ const sketch001 = startSketchAt([-0, -0])
await test.step('The second export is blocked', async () => { await test.step('The second export is blocked', async () => {
// Find the toast. // Find the toast.
// Look out for the toast message // Look out for the toast message
await expect(exportingToastMessage).toBeVisible() await Promise.all([
await expect(alreadyExportingToastMessage).toBeVisible() expect(exportingToastMessage.first()).toBeVisible(),
expect(alreadyExportingToastMessage).toBeVisible(),
await page.waitForTimeout(1000) ])
}) })
await test.step('The first export still succeeds', async () => { await test.step('The first export still succeeds', async () => {
await expect(exportingToastMessage).not.toBeVisible() await Promise.all([
await expect(errorToastMessage).not.toBeVisible() expect(exportingToastMessage).not.toBeVisible({ timeout: 15_000 }),
await expect(engineErrorToastMessage).not.toBeVisible() expect(errorToastMessage).not.toBeVisible(),
expect(engineErrorToastMessage).not.toBeVisible(),
await expect(successToastMessage).toBeVisible() expect(successToastMessage).toBeVisible({ timeout: 15_000 }),
expect(alreadyExportingToastMessage).not.toBeVisible({
await expect(alreadyExportingToastMessage).not.toBeVisible() timeout: 15_000,
}),
])
}) })
}) })
@ -419,10 +422,12 @@ const sketch001 = startSketchAt([-0, -0])
await expect(exportingToastMessage).toBeVisible() await expect(exportingToastMessage).toBeVisible()
// Expect it to succeed. // Expect it to succeed.
await expect(exportingToastMessage).not.toBeVisible() await Promise.all([
await expect(errorToastMessage).not.toBeVisible() expect(exportingToastMessage).not.toBeVisible(),
await expect(engineErrorToastMessage).not.toBeVisible() expect(errorToastMessage).not.toBeVisible(),
await expect(alreadyExportingToastMessage).not.toBeVisible() expect(engineErrorToastMessage).not.toBeVisible(),
expect(alreadyExportingToastMessage).not.toBeVisible(),
])
await expect(successToastMessage).toBeVisible() await expect(successToastMessage).toBeVisible()
}) })

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -773,9 +773,9 @@ const extrude001 = extrude(50, sketch001)
await page.waitForTimeout(1000) await page.waitForTimeout(1000)
let noHoverColor: [number, number, number] = [82, 82, 82] let noHoverColor: [number, number, number] = [92, 92, 92]
let hoverColor: [number, number, number] = [116, 116, 116] let hoverColor: [number, number, number] = [127, 127, 127]
let selectColor: [number, number, number] = [144, 148, 97] let selectColor: [number, number, number] = [155, 155, 105]
const extrudeWall = { x: 670, y: 275 } const extrudeWall = { x: 670, y: 275 }
const extrudeText = `line([170.36, -121.61], %, $seg01)` const extrudeText = `line([170.36, -121.61], %, $seg01)`
@ -816,9 +816,9 @@ const extrude001 = extrude(50, sketch001)
await expect(page.getByTestId('hover-highlight')).not.toBeVisible() await expect(page.getByTestId('hover-highlight')).not.toBeVisible()
// because of shading, color is not exact everywhere on the face // because of shading, color is not exact everywhere on the face
noHoverColor = [104, 104, 104] noHoverColor = [115, 115, 115]
hoverColor = [134, 134, 134] hoverColor = [145, 145, 145]
selectColor = [158, 162, 110] selectColor = [168, 168, 120]
await expect(await u.getGreatestPixDiff(cap, noHoverColor)).toBeLessThan(6) await expect(await u.getGreatestPixDiff(cap, noHoverColor)).toBeLessThan(6)
await page.mouse.move(cap.x, cap.y) await page.mouse.move(cap.x, cap.y)

View File

@ -66,7 +66,6 @@ import {
hasExtrudableGeometry, hasExtrudableGeometry,
isSingleCursorInPipe, isSingleCursorInPipe,
} from 'lang/queryAst' } from 'lang/queryAst'
import { TEST } from 'env'
import { exportFromEngine } from 'lib/exportFromEngine' import { exportFromEngine } from 'lib/exportFromEngine'
import { Models } from '@kittycad/lib/dist/types/src' import { Models } from '@kittycad/lib/dist/types/src'
import toast from 'react-hot-toast' import toast from 'react-hot-toast'
@ -363,7 +362,7 @@ export const ModelingMachineProvider = ({
return {} return {}
}), }),
Make: async (_, event) => { Make: async (_, event) => {
if (event.type !== 'Make' || TEST) return if (event.type !== 'Make') return
// Check if we already have an export intent. // Check if we already have an export intent.
if (engineCommandManager.exportIntent) { if (engineCommandManager.exportIntent) {
toast.error('Already exporting') toast.error('Already exporting')
@ -407,7 +406,7 @@ export const ModelingMachineProvider = ({
) )
}, },
'Engine export': async (_, event) => { 'Engine export': async (_, event) => {
if (event.type !== 'Export' || TEST) return if (event.type !== 'Export') return
if (engineCommandManager.exportIntent) { if (engineCommandManager.exportIntent) {
toast.error('Already exporting') toast.error('Already exporting')
return return

View File

@ -31,11 +31,11 @@ const bracket = startSketchOn('XY')
|> extrude(width, %) |> extrude(width, %)
|> fillet({ |> fillet({
radius: filletR, radius: filletR,
tags: [getPreviousAdjacentEdge(innerEdge)] tags: [getNextAdjacentEdge(innerEdge)]
}, %) }, %)
|> fillet({ |> fillet({
radius: filletR + thickness, radius: filletR + thickness,
tags: [getPreviousAdjacentEdge(outerEdge)] tags: [getNextAdjacentEdge(outerEdge)]
}, %)` }, %)`
/** /**

View File

@ -55,10 +55,10 @@ const bracketBody = bs
|> fillet({ |> fillet({
radius: radius, radius: radius,
tags: [ tags: [
getNextAdjacentEdge(bs.tags.edge7), getPreviousAdjacentEdge(bs.tags.edge7),
getNextAdjacentEdge(bs.tags.edge2), getPreviousAdjacentEdge(bs.tags.edge2),
getNextAdjacentEdge(bs.tags.edge3), getPreviousAdjacentEdge(bs.tags.edge3),
getNextAdjacentEdge(bs.tags.edge6) getPreviousAdjacentEdge(bs.tags.edge6)
] ]
}, %) }, %)