Start fixing playwright tests
This commit is contained in:
committed by
Nick Cameron
parent
ee6014d0cf
commit
ce8aeab508
@ -20,11 +20,11 @@ test.describe('Code pane and errors', () => {
|
||||
`// Extruded Triangle
|
||||
sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([10, 0], %)
|
||||
|> line([-5, 10], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [10, 0])
|
||||
|> line(end = [-5, 10])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
extrude001 = extrude(5, sketch001)`
|
||||
extrude001 = extrude(sketch001, length = 5)`
|
||||
)
|
||||
})
|
||||
|
||||
|
@ -14,8 +14,8 @@ test.describe('Command bar tests', () => {
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> xLine(-20, %)
|
||||
|> close(%)
|
||||
`
|
||||
@ -42,7 +42,47 @@ test.describe('Command bar tests', () => {
|
||||
await page.keyboard.press('Enter')
|
||||
await page.waitForTimeout(200)
|
||||
await expect(page.locator('.cm-activeLine')).toHaveText(
|
||||
`extrude001 = extrude(${KCL_DEFAULT_LENGTH}, sketch001)`
|
||||
`extrude001 = extrude(sketch001, length = ${KCL_DEFAULT_LENGTH})`
|
||||
)
|
||||
})
|
||||
|
||||
// TODO: fix this test after the electron migration
|
||||
test.fixme('Fillet from command bar', async ({ page, homePage }) => {
|
||||
await page.addInitScript(async () => {
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XY')
|
||||
|> startProfileAt([-5, -5], %)
|
||||
|> line(end = [0, 10])
|
||||
|> line(end = [10, 0])
|
||||
|> line(end = [0, -10])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
extrude001 = extrude(sketch001, length = -10)`
|
||||
)
|
||||
})
|
||||
|
||||
const u = await getUtils(page)
|
||||
await page.setBodyDimensions({ width: 1000, height: 500 })
|
||||
await homePage.goToModelingScene()
|
||||
await u.openDebugPanel()
|
||||
await u.expectCmdLog('[data-message-type="execution-done"]')
|
||||
await u.closeDebugPanel()
|
||||
|
||||
const selectSegment = () => page.getByText(`line([0, -10], %)`).click()
|
||||
|
||||
await selectSegment()
|
||||
await page.waitForTimeout(100)
|
||||
await page.getByRole('button', { name: 'Fillet' }).click()
|
||||
await page.waitForTimeout(100)
|
||||
await page.keyboard.press('Enter') // skip selection
|
||||
await page.waitForTimeout(100)
|
||||
await page.keyboard.press('Enter') // accept default radius
|
||||
await page.waitForTimeout(100)
|
||||
await page.keyboard.press('Enter') // submit
|
||||
await page.waitForTimeout(100)
|
||||
await expect(page.locator('.cm-activeLine')).toContainText(
|
||||
`fillet({ radius = ${KCL_DEFAULT_LENGTH}, tags = [seg01] }, %)`
|
||||
)
|
||||
})
|
||||
|
||||
@ -183,9 +223,9 @@ test.describe('Command bar tests', () => {
|
||||
`distance = sqrt(20)
|
||||
sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([-6.95, 10.98], %)
|
||||
|> line([25.1, 0.41], %)
|
||||
|> line([0.73, -20.93], %)
|
||||
|> line([-23.44, 0.52], %)
|
||||
|> line(end = [25.1, 0.41])
|
||||
|> line(end = [0.73, -20.93])
|
||||
|> line(end = [-23.44, 0.52])
|
||||
|> close(%)
|
||||
`
|
||||
)
|
||||
@ -251,7 +291,7 @@ test.describe('Command bar tests', () => {
|
||||
await u.waitForCmdReceive('extrude')
|
||||
|
||||
await expect(page.locator('.cm-content')).toContainText(
|
||||
'extrude001 = extrude(distance001, sketch001)'
|
||||
'extrude001 = extrude(sketch001, length = distance001)'
|
||||
)
|
||||
})
|
||||
|
||||
|
@ -20,7 +20,7 @@ test.describe('Copilot ghost text', () => {
|
||||
await page.keyboard.press('Enter')
|
||||
await expect(page.locator('.cm-ghostText').first()).toBeVisible()
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)`
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)`
|
||||
)
|
||||
await expect(page.locator('.cm-ghostText').first()).toHaveText(
|
||||
`fn cube = (pos, scale) => {`
|
||||
@ -29,7 +29,7 @@ test.describe('Copilot ghost text', () => {
|
||||
// We should be able to hit Tab to accept the completion.
|
||||
await page.keyboard.press('Tab')
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)`
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)`
|
||||
)
|
||||
|
||||
// Hit enter a few times.
|
||||
@ -37,7 +37,7 @@ test.describe('Copilot ghost text', () => {
|
||||
await page.keyboard.press('Enter')
|
||||
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %) `
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20) `
|
||||
)
|
||||
|
||||
await expect(page.locator('.cm-ghostText')).not.toBeVisible()
|
||||
@ -80,7 +80,7 @@ test.describe('Copilot ghost text', () => {
|
||||
await page.keyboard.press('Enter')
|
||||
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)`
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)`
|
||||
)
|
||||
await expect(page.locator('.cm-ghostText').first()).toHaveText(
|
||||
`fn cube = (pos, scale) => {`
|
||||
@ -89,7 +89,7 @@ test.describe('Copilot ghost text', () => {
|
||||
// We should be able to hit Tab to accept the completion.
|
||||
await page.keyboard.press('Tab')
|
||||
await expect(page.locator('.cm-content')).toContainText(
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)`
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)`
|
||||
)
|
||||
})
|
||||
|
||||
@ -156,7 +156,7 @@ test.describe('Copilot ghost text', () => {
|
||||
await page.keyboard.press('Enter')
|
||||
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)`
|
||||
`sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)`
|
||||
)
|
||||
await expect(page.locator('.cm-ghostText').first()).toHaveText(
|
||||
`fn cube = (pos, scale) => {`
|
||||
@ -165,7 +165,7 @@ test.describe('Copilot ghost text', () => {
|
||||
// We should be able to hit Tab to accept the completion.
|
||||
await page.keyboard.press('Tab')
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)`
|
||||
`sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)`
|
||||
)
|
||||
|
||||
// Hit enter a few times.
|
||||
@ -173,7 +173,7 @@ test.describe('Copilot ghost text', () => {
|
||||
await page.keyboard.press('Enter')
|
||||
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %) `
|
||||
`sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20) `
|
||||
)
|
||||
|
||||
await expect(page.locator('.cm-ghostText')).not.toBeVisible()
|
||||
@ -194,7 +194,7 @@ test.describe('Copilot ghost text', () => {
|
||||
await page.keyboard.press('Enter')
|
||||
await expect(page.locator('.cm-ghostText').first()).toBeVisible()
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)`
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)`
|
||||
)
|
||||
await expect(page.locator('.cm-ghostText').first()).toHaveText(
|
||||
`fn cube = (pos, scale) => {`
|
||||
@ -225,7 +225,7 @@ test.describe('Copilot ghost text', () => {
|
||||
await page.keyboard.press('Enter')
|
||||
await expect(page.locator('.cm-ghostText').first()).toBeVisible()
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)`
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)`
|
||||
)
|
||||
await expect(page.locator('.cm-ghostText').first()).toHaveText(
|
||||
`fn cube = (pos, scale) => {`
|
||||
@ -256,7 +256,7 @@ test.describe('Copilot ghost text', () => {
|
||||
await page.keyboard.press('Enter')
|
||||
await expect(page.locator('.cm-ghostText').first()).toBeVisible()
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)`
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)`
|
||||
)
|
||||
await expect(page.locator('.cm-ghostText').first()).toHaveText(
|
||||
`fn cube = (pos, scale) => {`
|
||||
@ -287,7 +287,7 @@ test.describe('Copilot ghost text', () => {
|
||||
await page.keyboard.press('Enter')
|
||||
await expect(page.locator('.cm-ghostText').first()).toBeVisible()
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)`
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)`
|
||||
)
|
||||
await expect(page.locator('.cm-ghostText').first()).toHaveText(
|
||||
`fn cube = (pos, scale) => {`
|
||||
@ -315,7 +315,7 @@ test.describe('Copilot ghost text', () => {
|
||||
await page.keyboard.press('Enter')
|
||||
await expect(page.locator('.cm-ghostText').first()).toBeVisible()
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)`
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)`
|
||||
)
|
||||
await expect(page.locator('.cm-ghostText').first()).toHaveText(
|
||||
`fn cube = (pos, scale) => {`
|
||||
@ -326,7 +326,7 @@ test.describe('Copilot ghost text', () => {
|
||||
await expect(page.locator('.cm-ghostText').first()).toBeVisible()
|
||||
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)`
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)`
|
||||
)
|
||||
})
|
||||
|
||||
@ -348,7 +348,7 @@ test.describe('Copilot ghost text', () => {
|
||||
await page.keyboard.press('Enter')
|
||||
await expect(page.locator('.cm-ghostText').first()).toBeVisible()
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)`
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)`
|
||||
)
|
||||
await expect(page.locator('.cm-ghostText').first()).toHaveText(
|
||||
`fn cube = (pos, scale) => {`
|
||||
@ -409,7 +409,7 @@ test.describe('Copilot ghost text', () => {
|
||||
await page.keyboard.press('Enter')
|
||||
await expect(page.locator('.cm-ghostText').first()).toBeVisible()
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`{thing: "blah"}fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)`
|
||||
`{thing: "blah"}fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)`
|
||||
)
|
||||
await expect(page.locator('.cm-ghostText').first()).toHaveText(
|
||||
`fn cube = (pos, scale) => {`
|
||||
@ -450,7 +450,7 @@ test.describe('Copilot ghost text', () => {
|
||||
await page.keyboard.press('Enter')
|
||||
await expect(page.locator('.cm-ghostText').first()).toBeVisible()
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)`
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)`
|
||||
)
|
||||
await expect(page.locator('.cm-ghostText').first()).toHaveText(
|
||||
`fn cube = (pos, scale) => {`
|
||||
@ -483,7 +483,7 @@ test.describe('Copilot ghost text', () => {
|
||||
await page.keyboard.press('Enter')
|
||||
await expect(page.locator('.cm-ghostText').first()).toBeVisible()
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)`
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)`
|
||||
)
|
||||
await expect(page.locator('.cm-ghostText').first()).toHaveText(
|
||||
`fn cube = (pos, scale) => {`
|
||||
@ -514,7 +514,7 @@ test.describe('Copilot ghost text', () => {
|
||||
await page.keyboard.press('Enter')
|
||||
await expect(page.locator('.cm-ghostText').first()).toBeVisible()
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)`
|
||||
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)`
|
||||
)
|
||||
await expect(page.locator('.cm-ghostText').first()).toHaveText(
|
||||
`fn cube = (pos, scale) => {`
|
||||
|
@ -20,7 +20,7 @@ test.describe('Debug pane', () => {
|
||||
}) => {
|
||||
const code = `sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([1, 1], %)
|
||||
|> line(end = [1, 1])
|
||||
`
|
||||
const u = await getUtils(page)
|
||||
await page.setBodyDimensions({ width: 1200, height: 500 })
|
||||
@ -61,7 +61,7 @@ test.describe('Debug pane', () => {
|
||||
}
|
||||
})
|
||||
await test.step('Enter a comment', async () => {
|
||||
await page.keyboard.type('|> line([2, 2], %)', { delay: 0 })
|
||||
await page.keyboard.type('|> line(end = [2, 2])', { delay: 0 })
|
||||
// Wait for keyboard input debounce and updated artifact graph.
|
||||
await page.waitForTimeout(1000)
|
||||
})
|
||||
|
@ -23,9 +23,9 @@ test.describe('Editor tests', () => {
|
||||
await u.codeLocator.click()
|
||||
await page.keyboard.type(`sketch001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([-20, 0], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close(%)`)
|
||||
|
||||
await page.keyboard.down('ControlOrMeta')
|
||||
@ -35,9 +35,9 @@ test.describe('Editor tests', () => {
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([-20, 0], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
// |> close(%)`)
|
||||
|
||||
// uncomment the code
|
||||
@ -48,9 +48,9 @@ test.describe('Editor tests', () => {
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([-20, 0], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close(%)`)
|
||||
})
|
||||
|
||||
@ -67,9 +67,9 @@ test.describe('Editor tests', () => {
|
||||
await u.codeLocator.click()
|
||||
await page.keyboard.type(`sketch001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([-20, 0], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close(%)`)
|
||||
|
||||
// Ensure we execute the first time.
|
||||
@ -116,9 +116,9 @@ test.describe('Editor tests', () => {
|
||||
await u.codeLocator.click()
|
||||
await page.keyboard.type(`sketch001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([-20, 0], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close(%)`)
|
||||
|
||||
// Ensure we execute the first time.
|
||||
@ -171,9 +171,9 @@ test.describe('Editor tests', () => {
|
||||
await u.codeLocator.click()
|
||||
await page.keyboard.type(`sketch001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([-20, 0], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close(%)`)
|
||||
await page.locator('#code-pane button:first-child').click()
|
||||
await page.locator('button:has-text("Format code")').click()
|
||||
@ -181,9 +181,9 @@ test.describe('Editor tests', () => {
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([-20, 0], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close(%)`)
|
||||
})
|
||||
|
||||
@ -202,9 +202,9 @@ test.describe('Editor tests', () => {
|
||||
await u.codeLocator.click()
|
||||
await page.keyboard.type(`sketch_001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([-20, 0], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close(%)`)
|
||||
|
||||
await u.openDebugPanel()
|
||||
@ -230,9 +230,9 @@ test.describe('Editor tests', () => {
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch_001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([-20, 0], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close(%)`)
|
||||
|
||||
// error in guter
|
||||
@ -248,18 +248,18 @@ test.describe('Editor tests', () => {
|
||||
test('fold gutters work', async ({ page, homePage }) => {
|
||||
const fullCode = `sketch001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([-20, 0], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close(%)`
|
||||
await page.addInitScript(async () => {
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([-20, 0], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close(%)`
|
||||
)
|
||||
})
|
||||
@ -326,9 +326,9 @@ test.describe('Editor tests', () => {
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([-20, 0], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close(%)`
|
||||
)
|
||||
})
|
||||
@ -371,9 +371,9 @@ test.describe('Editor tests', () => {
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([-20, 0], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close(%)`
|
||||
)
|
||||
localStorage.setItem('disableAxis', 'true')
|
||||
@ -398,9 +398,9 @@ test.describe('Editor tests', () => {
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([-20, 0], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close(%)`)
|
||||
})
|
||||
|
||||
@ -414,9 +414,9 @@ test.describe('Editor tests', () => {
|
||||
'persistCode',
|
||||
`sketch_001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([-20, 0], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close(%)`
|
||||
)
|
||||
localStorage.setItem('disableAxis', 'true')
|
||||
@ -451,9 +451,9 @@ test.describe('Editor tests', () => {
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch_001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([-20, 0], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close(%)`)
|
||||
|
||||
// error in guter
|
||||
@ -519,8 +519,8 @@ test.describe('Editor tests', () => {
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([3.29, 7.86], %)
|
||||
|> line([2.48, 2.44], %)
|
||||
|> line([2.66, 1.17], %)
|
||||
|> line(end = [2.48, 2.44])
|
||||
|> line(end = [2.66, 1.17])
|
||||
|> close(%)
|
||||
`
|
||||
)
|
||||
@ -535,7 +535,7 @@ test.describe('Editor tests', () => {
|
||||
|
||||
await u.codeLocator.click()
|
||||
|
||||
await page.getByText(' |> line([2.48, 2.44], %)').click()
|
||||
await page.getByText(' |> line(end = [2.48, 2.44])').click()
|
||||
|
||||
await expect(
|
||||
page.locator('.cm-lint-marker-error').first()
|
||||
@ -643,9 +643,9 @@ test.describe('Editor tests', () => {
|
||||
fn squareHole = (l, w) => {
|
||||
squareHoleSketch = startSketchOn('XY')
|
||||
|> startProfileAt([-width / 2, -length / 2], %)
|
||||
|> lineTo([width / 2, -length / 2], %)
|
||||
|> lineTo([width / 2, length / 2], %)
|
||||
|> lineTo([-width / 2, length / 2], %)
|
||||
|> line(endAbsolute = [width / 2, -length / 2])
|
||||
|> line(endAbsolute = [width / 2, length / 2])
|
||||
|> line(endAbsolute = [-width / 2, length / 2])
|
||||
|> close(%)
|
||||
return squareHoleSketch
|
||||
}
|
||||
@ -684,7 +684,7 @@ test.describe('Editor tests', () => {
|
||||
await page.keyboard.type(`extrusion = startSketchOn('XY')
|
||||
|> circle({ center: [0, 0], radius: dia/2 }, %)
|
||||
|> hole(squareHole(length, width, height), %)
|
||||
|> extrude(height, %)`)
|
||||
|> extrude(length = height)`)
|
||||
|
||||
// error in gutter
|
||||
await expect(page.locator('.cm-lint-marker-error').first()).toBeVisible()
|
||||
@ -707,17 +707,17 @@ test.describe('Editor tests', () => {
|
||||
'persistCode',
|
||||
`box = startSketchOn('XY')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([0, 10], %)
|
||||
|> line([10, 0], %)
|
||||
|> line([0, -10], %, $revolveAxis)
|
||||
|> line(end = [0, 10])
|
||||
|> line(end = [10, 0])
|
||||
|> line(end = [0, -10], tag = $revolveAxis)
|
||||
|> close(%)
|
||||
|> extrude(10, %)
|
||||
|> extrude(length = 10)
|
||||
|
||||
sketch001 = startSketchOn(box, revolveAxis)
|
||||
|> startProfileAt([5, 10], %)
|
||||
|> line([0, -10], %)
|
||||
|> line([2, 0], %)
|
||||
|> line([0, -10], %)
|
||||
|> line(end = [0, -10])
|
||||
|> line(end = [2, 0])
|
||||
|> line(end = [0, -10])
|
||||
|> close(%)
|
||||
|> revolve({
|
||||
axis: revolveAxis,
|
||||
@ -899,7 +899,7 @@ test.describe('Editor tests', () => {
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([4.61, -14.01], %)
|
||||
|> line([12.73, -0.09], %)
|
||||
|> line(end = [12.73, -0.09])
|
||||
|> tangentialArcTo([24.95, -5.38], %)
|
||||
|> close(%)`
|
||||
)
|
||||
@ -949,7 +949,7 @@ test.describe('Editor tests', () => {
|
||||
|
||||
// expect the code to have changed
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`sketch001 = startSketchOn('XZ') |> startProfileAt([4.61, -14.01], %) |> line([12.73, -0.09], %) |> tangentialArcTo([24.95, -5.38], %) |> close(%)extrude001 = extrude(5, sketch001)`
|
||||
`sketch001 = startSketchOn('XZ') |> startProfileAt([4.61, -14.01], %) |> line(end = [12.73, -0.09], %) |> tangentialArcTo([24.95, -5.38]) |> close(%)extrude001 = extrude(sketch001, length = 5)`
|
||||
)
|
||||
|
||||
// Now hit undo
|
||||
@ -961,7 +961,7 @@ test.describe('Editor tests', () => {
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([4.61, -14.01], %)
|
||||
|> line([12.73, -0.09], %)
|
||||
|> line(end = [12.73, -0.09])
|
||||
|> tangentialArcTo([24.95, -5.38], %)
|
||||
|> close(%)`)
|
||||
})
|
||||
@ -976,10 +976,10 @@ test.describe('Editor tests', () => {
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([4.61, -10.01], %)
|
||||
|> line([12.73, -0.09], %)
|
||||
|> line(end = [12.73, -0.09])
|
||||
|> tangentialArcTo([24.95, -0.38], %)
|
||||
|> close(%)
|
||||
|> extrude(5, %)`
|
||||
|> extrude(length = 5)`
|
||||
)
|
||||
})
|
||||
|
||||
@ -1067,10 +1067,10 @@ test.describe('Editor tests', () => {
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([2.71, -2.71], %)
|
||||
|> line([15.4, -2.78], %)
|
||||
|> line(end = [15.4, -2.78])
|
||||
|> tangentialArcTo([27.6, -3.05], %)
|
||||
|> close(%)
|
||||
|> extrude(5, %)
|
||||
|> extrude(length = 5)
|
||||
`)
|
||||
|
||||
// Hit undo
|
||||
@ -1081,10 +1081,10 @@ test.describe('Editor tests', () => {
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([2.71, -2.71], %)
|
||||
|> line([15.4, -2.78], %)
|
||||
|> line(end = [15.4, -2.78])
|
||||
|> tangentialArcTo([24.95, -0.38], %)
|
||||
|> close(%)
|
||||
|> extrude(5, %)`)
|
||||
|> extrude(length = 5)`)
|
||||
|
||||
// Hit undo again.
|
||||
await page.keyboard.down('Control')
|
||||
@ -1094,10 +1094,10 @@ test.describe('Editor tests', () => {
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([2.71, -2.71], %)
|
||||
|> line([12.73, -0.09], %)
|
||||
|> line(end = [12.73, -0.09])
|
||||
|> tangentialArcTo([24.95, -0.38], %)
|
||||
|> close(%)
|
||||
|> extrude(5, %)
|
||||
|> extrude(length = 5)
|
||||
`)
|
||||
|
||||
// Hit undo again.
|
||||
@ -1109,10 +1109,10 @@ test.describe('Editor tests', () => {
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([4.61, -10.01], %)
|
||||
|> line([12.73, -0.09], %)
|
||||
|> line(end = [12.73, -0.09])
|
||||
|> tangentialArcTo([24.95, -0.38], %)
|
||||
|> close(%)
|
||||
|> extrude(5, %)`)
|
||||
|> extrude(length = 5)`)
|
||||
})
|
||||
|
||||
test.fixme(
|
||||
|
@ -9,30 +9,30 @@ export fn triangle() {
|
||||
return startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> xLine(10, %)
|
||||
|> line([-10, -5], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [-10, -5])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
}
|
||||
|
||||
length001 = timesFive(1) * 5
|
||||
sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([20, 10], %)
|
||||
|> line([10, 10], %)
|
||||
|> line(end = [10, 10])
|
||||
|> angledLine([-45, length001], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
revolve001 = revolve({ axis = "X" }, sketch001)
|
||||
triangle()
|
||||
|> extrude(30, %)
|
||||
|> extrude(length = 30)
|
||||
plane001 = offsetPlane('XY', 10)
|
||||
sketch002 = startSketchOn(plane001)
|
||||
|> startProfileAt([-20, 0], %)
|
||||
|> line([5, -15], %)
|
||||
|> line(end = [5, -15])
|
||||
|> xLine(-10, %)
|
||||
|> lineTo([-40, 0], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(endAbsolute = [-40, 0])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
extrude001 = extrude(10, sketch002)
|
||||
extrude001 = extrude(sketch002, length = 10)
|
||||
`
|
||||
|
||||
test.describe('Feature Tree pane', () => {
|
||||
@ -97,7 +97,7 @@ test.describe('Feature Tree pane', () => {
|
||||
await testViewSource({
|
||||
operationName: 'Extrude',
|
||||
operationIndex: 1,
|
||||
expectedActiveLine: 'extrude001 = extrude(10, sketch002)',
|
||||
expectedActiveLine: 'extrude001 = extrude(sketch002, length = 10)',
|
||||
})
|
||||
await testViewSource({
|
||||
operationName: 'Revolve',
|
||||
|
@ -82,7 +82,7 @@ test('verify extruding circle works', async ({
|
||||
})
|
||||
await cmdBar.progressCmdBar()
|
||||
|
||||
const expectString = 'extrude001 = extrude(5, sketch001)'
|
||||
const expectString = 'extrude001 = extrude(sketch001, length = 5)'
|
||||
await editor.expectEditor.not.toContain(expectString)
|
||||
|
||||
await cmdBar.expectState({
|
||||
@ -228,7 +228,7 @@ test.describe('verify sketch on chamfer works', () => {
|
||||
segAng(rectangleSegmentA002),
|
||||
-segLen(rectangleSegmentA002)
|
||||
], %, $rectangleSegmentC001)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)`,
|
||||
})
|
||||
|
||||
@ -259,7 +259,7 @@ test.describe('verify sketch on chamfer works', () => {
|
||||
segAng(rectangleSegmentA003),
|
||||
-segLen(rectangleSegmentA003)
|
||||
], %, $rectangleSegmentC002)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)`,
|
||||
})
|
||||
await sketchOnAChamfer({
|
||||
@ -284,7 +284,7 @@ test.describe('verify sketch on chamfer works', () => {
|
||||
segAng(rectangleSegmentA003),
|
||||
-segLen(rectangleSegmentA003)
|
||||
], %, $rectangleSegmentC002)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)`,
|
||||
})
|
||||
/// last one
|
||||
@ -308,7 +308,7 @@ test.describe('verify sketch on chamfer works', () => {
|
||||
segAng(rectangleSegmentA005),
|
||||
-segLen(rectangleSegmentA005)
|
||||
], %, $rectangleSegmentC004)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)`,
|
||||
})
|
||||
|
||||
@ -326,9 +326,9 @@ test.describe('verify sketch on chamfer works', () => {
|
||||
segAng(rectangleSegmentA001),
|
||||
-segLen(rectangleSegmentA001)
|
||||
], %, $yo)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %, $seg02)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|
||||
|> close(%)
|
||||
extrude001 = extrude(100, sketch001)
|
||||
extrude001 = extrude(sketch001, length = 100)
|
||||
|> chamfer({
|
||||
length = 30,
|
||||
tags = [getOppositeEdge(seg01)]
|
||||
@ -353,7 +353,7 @@ test.describe('verify sketch on chamfer works', () => {
|
||||
segAng(rectangleSegmentA005),
|
||||
-segLen(rectangleSegmentA005)
|
||||
], %, $rectangleSegmentC004)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
sketch004 = startSketchOn(extrude001, seg05)
|
||||
|> startProfileAt([82.57,322.96], %)
|
||||
@ -366,7 +366,7 @@ test.describe('verify sketch on chamfer works', () => {
|
||||
segAng(rectangleSegmentA004),
|
||||
-segLen(rectangleSegmentA004)
|
||||
], %, $rectangleSegmentC003)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
sketch003 = startSketchOn(extrude001, seg04)
|
||||
|> startProfileAt([-209.64,255.28], %)
|
||||
@ -379,7 +379,7 @@ test.describe('verify sketch on chamfer works', () => {
|
||||
segAng(rectangleSegmentA003),
|
||||
-segLen(rectangleSegmentA003)
|
||||
], %, $rectangleSegmentC002)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
sketch002 = startSketchOn(extrude001, seg03)
|
||||
|> startProfileAt([205.96,254.59], %)
|
||||
@ -392,7 +392,7 @@ test.describe('verify sketch on chamfer works', () => {
|
||||
segAng(rectangleSegmentA002),
|
||||
-segLen(rectangleSegmentA002)
|
||||
], %, $rectangleSegmentC001)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
`,
|
||||
{ shouldNormalise: true }
|
||||
@ -447,7 +447,7 @@ test.describe('verify sketch on chamfer works', () => {
|
||||
segAng(rectangleSegmentA002),
|
||||
-segLen(rectangleSegmentA002)
|
||||
], %, $rectangleSegmentC001)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)`,
|
||||
})
|
||||
await editor.expectEditor.toContain(
|
||||
@ -462,9 +462,9 @@ test.describe('verify sketch on chamfer works', () => {
|
||||
segAng(rectangleSegmentA001),
|
||||
-segLen(rectangleSegmentA001)
|
||||
], %, $yo)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %, $seg02)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|
||||
|> close(%)
|
||||
extrude001 = extrude(100, sketch001)
|
||||
extrude001 = extrude(sketch001, length = 100)
|
||||
chamf = chamfer({
|
||||
length = 30,
|
||||
tags = [getOppositeEdge(seg01)]
|
||||
@ -488,7 +488,7 @@ sketch002 = startSketchOn(extrude001, seg03)
|
||||
segAng(rectangleSegmentA002),
|
||||
-segLen(rectangleSegmentA002)
|
||||
], %, $rectangleSegmentC001)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
`,
|
||||
{ shouldNormalise: true }
|
||||
@ -615,7 +615,7 @@ test(`Verify user can double-click to edit a sketch`, async ({
|
||||
|> circle({ center = [8, 5], radius = 2 }, %)
|
||||
openSketch = startSketchOn('XY')
|
||||
|> startProfileAt([-5, 0], %)
|
||||
|> lineTo([0, 5], %)
|
||||
|> line(endAbsolute = [0, 5])
|
||||
|> xLine(5, %)
|
||||
|> tangentialArcTo([10, 0], %)
|
||||
`
|
||||
@ -1310,12 +1310,12 @@ test(`Chamfer point-and-click`, async ({
|
||||
// Code samples
|
||||
const initialCode = `sketch001 = startSketchOn('XY')
|
||||
|> startProfileAt([-12, -6], %)
|
||||
|> line([0, 12], %)
|
||||
|> line([24, 0], %)
|
||||
|> line([0, -12], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [0, 12])
|
||||
|> line(end = [24, 0])
|
||||
|> line(end = [0, -12])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
extrude001 = extrude(-12, sketch001)
|
||||
extrude001 = extrude(sketch001, length = -12)
|
||||
`
|
||||
const firstChamferDeclaration = 'chamfer({ length = 5, tags = [seg01] }, %)'
|
||||
const secondChamferDeclaration =
|
||||
@ -1531,7 +1531,7 @@ shellPointAndClickCapCases.forEach(({ shouldPreselect }) => {
|
||||
test.skip(process.platform === 'win32', 'Skip on windows')
|
||||
const initialCode = `sketch001 = startSketchOn('XZ')
|
||||
|> circle({ center = [0, 0], radius = 30 }, %)
|
||||
extrude001 = extrude(30, sketch001)
|
||||
extrude001 = extrude(sketch001, length = 30)
|
||||
`
|
||||
await context.addInitScript((initialCode) => {
|
||||
localStorage.setItem('persistCode', initialCode)
|
||||
@ -1627,9 +1627,9 @@ test('Shell point-and-click wall', async ({
|
||||
|> xLine(40, %)
|
||||
|> yLine(-60, %)
|
||||
|> xLine(-40, %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
extrude001 = extrude(40, sketch001)
|
||||
extrude001 = extrude(sketch001, length = 40)
|
||||
`
|
||||
await context.addInitScript((initialCode) => {
|
||||
localStorage.setItem('persistCode', initialCode)
|
||||
@ -1705,19 +1705,19 @@ extrude001 = extrude(40, sketch001)
|
||||
const shellSketchOnFacesCases = [
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
|> circle({ center = [0, 0], radius = 100 }, %)
|
||||
|> extrude(100, %)
|
||||
|> extrude(length = 100)
|
||||
|
||||
sketch002 = startSketchOn(sketch001, 'END')
|
||||
|> circle({ center = [0, 0], radius = 50 }, %)
|
||||
|> extrude(50, %)
|
||||
|> extrude(length = 50)
|
||||
`,
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
|> circle({ center = [0, 0], radius = 100 }, %)
|
||||
extrude001 = extrude(100, sketch001)
|
||||
extrude001 = extrude(sketch001, length = 100)
|
||||
|
||||
sketch002 = startSketchOn(extrude001, 'END')
|
||||
|> circle({ center = [0, 0], radius = 50 }, %)
|
||||
extrude002 = extrude(50, sketch002)
|
||||
extrude002 = extrude(sketch002, length = 50)
|
||||
`,
|
||||
]
|
||||
shellSketchOnFacesCases.forEach((initialCode, index) => {
|
||||
|
@ -1461,12 +1461,12 @@ test.fixme(
|
||||
|
||||
await page.locator('.cm-content').fill(`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([-87.4, 282.92], %)
|
||||
|> line([324.07, 27.199], %, $seg01)
|
||||
|> line([118.328, -291.754], %)
|
||||
|> line([-180.04, -202.08], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [324.07, 27.199], tag = $seg01)
|
||||
|> line(end = [118.328, -291.754])
|
||||
|> line(end = [-180.04, -202.08])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
extrude001 = extrude(200, sketch001)`)
|
||||
extrude001 = extrude(sketch001, length = 200)`)
|
||||
await page.waitForTimeout(800)
|
||||
|
||||
async function getCameraZValue() {
|
||||
|
@ -4,21 +4,21 @@ import { test, expect } from './zoo-test'
|
||||
|
||||
const file = `sketch001 = startSketchOn('XZ')
|
||||
profile001 = startProfileAt([57.81, 250.51], sketch001)
|
||||
|> line([121.13, 56.63], %, $seg02)
|
||||
|> line([83.37, -34.61], %, $seg01)
|
||||
|> line([19.66, -116.4], %)
|
||||
|> line([-221.8, -41.69], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [121.13, 56.63], tag = $seg02)
|
||||
|> line(end = [83.37, -34.61], tag = $seg01)
|
||||
|> line(end = [19.66, -116.4])
|
||||
|> line(end = [-221.8, -41.69])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
extrude001 = extrude(200, profile001)
|
||||
extrude001 = extrude(profile001, length = 200)
|
||||
sketch002 = startSketchOn('XZ')
|
||||
|> startProfileAt([-73.64, -42.89], %)
|
||||
|> xLine(173.71, %)
|
||||
|> line([-22.12, -94.4], %)
|
||||
|> line(end = [-22.12, -94.4])
|
||||
|> xLine(-156.98, %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
extrude002 = extrude(50, sketch002)
|
||||
extrude002 = extrude(sketch002, length = 50)
|
||||
sketch003 = startSketchOn('XY')
|
||||
|> startProfileAt([52.92, 157.81], %)
|
||||
|> angledLine([0, 176.4], %, $rectangleSegmentA001)
|
||||
@ -30,9 +30,9 @@ sketch003 = startSketchOn('XY')
|
||||
segAng(rectangleSegmentA001),
|
||||
-segLen(rectangleSegmentA001)
|
||||
], %, $rectangleSegmentC001)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
extrude003 = extrude(20, sketch003)
|
||||
extrude003 = extrude(sketch003, length = 20)
|
||||
`
|
||||
|
||||
test.describe('Check the happy path, for basic changing color', () => {
|
||||
|
@ -21,9 +21,9 @@ test.describe('Regression tests', () => {
|
||||
'persistCode',
|
||||
`sketch2 = startSketchOn("XY")
|
||||
sketch001 = startSketchAt([-0, -0])
|
||||
|> line([0, 0], %)
|
||||
|> line([-4.84, -5.29], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [0, 0])
|
||||
|> line(end = [-4.84, -5.29])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)`
|
||||
)
|
||||
})
|
||||
@ -67,9 +67,9 @@ test.describe('Regression tests', () => {
|
||||
segAng(rectangleSegmentA001),
|
||||
-segLen(rectangleSegmentA001)
|
||||
], %, $rectangleSegmentC001)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
extrude001 = extrude(50, sketch001)
|
||||
extrude001 = extrude(sketch001, length = 50)
|
||||
`
|
||||
)
|
||||
})
|
||||
@ -126,9 +126,9 @@ extrude001 = extrude(50, sketch001)
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('-XZ')
|
||||
|> startProfileAt([-6.95, 4.98], %)
|
||||
|> line([25.1, 0.41], %)
|
||||
|> line([0.73, -14.93], %)
|
||||
|> line([-23.44, 0.52], %)`
|
||||
|> line(end = [25.1, 0.41])
|
||||
|> line(end = [0.73, -14.93])
|
||||
|> line(end = [-23.44, 0.52])`
|
||||
)
|
||||
})
|
||||
await page.setBodyDimensions({ width: 1000, height: 500 })
|
||||
@ -187,11 +187,11 @@ extrude001 = extrude(50, sketch001)
|
||||
'persistCode',
|
||||
`part = startSketchOn('XY')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([0, 1], %)
|
||||
|> line([1, 0], %)
|
||||
|> line([0, -1], %)
|
||||
|> line(end = [0, 1])
|
||||
|> line(end = [1, 0])
|
||||
|> line(end = [0, -1])
|
||||
|> close(%)
|
||||
|> extrude(1, %)
|
||||
|> extrude(length = 1)
|
||||
|> patternLinear3d({
|
||||
axis: [1, 0, 1],
|
||||
repetitions: 3,
|
||||
@ -258,7 +258,7 @@ extrude001 = extrude(50, sketch001)
|
||||
|> close(%)
|
||||
|>
|
||||
|
||||
example = extrude(5, exampleSketch)
|
||||
example = extrude(exampleSketch, length = 5)
|
||||
shell({ faces: ['end'], thickness: 0.25 }, exampleSketch)`
|
||||
)
|
||||
})
|
||||
|
@ -50,7 +50,7 @@ test.describe('Sketch tests', () => {
|
||||
|> xLine(-width * .5, %)
|
||||
|> close(%)
|
||||
|> hole(screwHole, %)
|
||||
|> extrude(thickness, %)
|
||||
|> extrude(length = thickness)
|
||||
|
||||
part002 = startSketchOn('-XZ')
|
||||
${startProfileAt3}
|
||||
@ -66,7 +66,7 @@ test.describe('Sketch tests', () => {
|
||||
|> yLine(-wireOffset, %)
|
||||
|> xLine(-width / 4, %)
|
||||
|> close(%)
|
||||
|> extrude(-height, %)
|
||||
|> extrude(length = -height)
|
||||
`
|
||||
)
|
||||
},
|
||||
@ -188,7 +188,7 @@ test.describe('Sketch tests', () => {
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([4.61, -14.01], %)
|
||||
|> line([12.73, -0.09], %)
|
||||
|> line(end = [12.73, -0.09])
|
||||
|> tangentialArcTo([24.95, -5.38], %)
|
||||
|> close(%)`
|
||||
)
|
||||
@ -228,7 +228,7 @@ test.describe('Sketch tests', () => {
|
||||
if (openPanes.includes('code')) {
|
||||
await expect(u.codeLocator).toHaveText(`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([4.61, -14.01], %)
|
||||
|> line([12.73, -0.09], %)
|
||||
|> line(end = [12.73, -0.09])
|
||||
|> tangentialArcTo([24.95, -5.38], %)
|
||||
|> close(%)`)
|
||||
} else {
|
||||
@ -305,9 +305,9 @@ test.describe('Sketch tests', () => {
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([6.44, -12.07], %)
|
||||
|> line([14.72, 1.97], %)
|
||||
|> line(end = [14.72, 1.97])
|
||||
|> tangentialArcTo([24.95, -5.38], %)
|
||||
|> line([1.97, 2.06], %)
|
||||
|> line(end = [1.97, 2.06])
|
||||
|> close(%)`)
|
||||
}
|
||||
test('code pane open at start-handles', async ({ page, homePage }) => {
|
||||
@ -439,10 +439,10 @@ test.describe('Sketch tests', () => {
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([4.61, -10.01], %)
|
||||
|> line([12.73, -0.09], %)
|
||||
|> line(end = [12.73, -0.09])
|
||||
|> tangentialArcTo([24.95, -0.38], %)
|
||||
|> close(%)
|
||||
|> extrude(5, %)`
|
||||
|> extrude(length = 5)`
|
||||
)
|
||||
})
|
||||
|
||||
@ -525,10 +525,10 @@ test.describe('Sketch tests', () => {
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([7.12, -12.68], %)
|
||||
|> line([12.68, -1.09], %)
|
||||
|> line(end = [12.68, -1.09])
|
||||
|> tangentialArcTo([24.89, 0.68], %)
|
||||
|> close(%)
|
||||
|> extrude(5, %)
|
||||
|> extrude(length = 5)
|
||||
`)
|
||||
})
|
||||
|
||||
@ -542,7 +542,7 @@ test.describe('Sketch tests', () => {
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([4.61, -14.01], %)
|
||||
|> line([12.73, -0.09], %)
|
||||
|> line(end = [12.73, -0.09])
|
||||
|> tangentialArcTo([24.95, -5.38], %)
|
||||
|> close(%)
|
||||
|> revolve({ axis = "X",}, %)`
|
||||
@ -627,9 +627,9 @@ test.describe('Sketch tests', () => {
|
||||
await expect(page.locator('.cm-content'))
|
||||
.toHaveText(`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([6.44, -12.07], %)
|
||||
|> line([14.72, 1.97], %)
|
||||
|> line(end = [14.72, 1.97])
|
||||
|> tangentialArcTo([24.95, -5.38], %)
|
||||
|> line([1.97, 2.06], %)
|
||||
|> line(end = [1.97, 2.06])
|
||||
|> close(%)
|
||||
|> revolve({ axis = "X" }, %)`)
|
||||
})
|
||||
@ -744,7 +744,7 @@ test.describe('Sketch tests', () => {
|
||||
|> startProfileAt([${roundOff(scale * 69.6)}, ${roundOff(scale * 34.8)}], %)
|
||||
|> xLine(${roundOff(scale * 139.19)}, %)
|
||||
|> yLine(-${roundOff(scale * 139.2)}, %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)`
|
||||
|
||||
await expect(
|
||||
@ -841,10 +841,10 @@ test.describe('Sketch tests', () => {
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([-0.45, 0.87], %)
|
||||
|> line([1.32, 0.38], %)
|
||||
|> line([1.02, -1.32], %, $seg01)
|
||||
|> line([-1.01, -0.77], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [1.32, 0.38])
|
||||
|> line(end = [1.02, -1.32], tag = $seg01)
|
||||
|> line(end = [-1.01, -0.77])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
`
|
||||
)
|
||||
@ -899,12 +899,12 @@ test.describe('Sketch tests', () => {
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([-0.45, 0.87], %)
|
||||
|> line([1.32, 0.38], %)
|
||||
|> line([1.02, -1.32], %, $seg01)
|
||||
|> line([-1.01, -0.77], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [1.32, 0.38])
|
||||
|> line(end = [1.02, -1.32], tag = $seg01)
|
||||
|> line(end = [-1.01, -0.77])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
extrude001 = extrude(5, sketch001)
|
||||
extrude001 = extrude(sketch001, length = 5)
|
||||
`
|
||||
)
|
||||
})
|
||||
@ -939,12 +939,12 @@ test.describe('Sketch tests', () => {
|
||||
await expect((await u.codeLocator.innerText()).replace(/\s/g, '')).toBe(
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([-0.45, 0.87], %)
|
||||
|> line([1.32, 0.38], %)
|
||||
|> line([1.02, -1.32], %, $seg01)
|
||||
|> line([-1.01, -0.77], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [1.32, 0.38])
|
||||
|> line(end = [1.02, -1.32], tag = $seg01)
|
||||
|> line(end = [-1.01, -0.77])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
extrude001 = extrude(5, sketch001)
|
||||
extrude001 = extrude(sketch001, length = 5)
|
||||
sketch002 = startSketchOn(extrude001, 'END')
|
||||
|>
|
||||
`.replace(/\s/g, '')
|
||||
@ -990,8 +990,8 @@ test.describe('Sketch tests', () => {
|
||||
|
||||
await u.codeLocator.fill(`sketch001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> xLine(-20, %)
|
||||
`)
|
||||
|
||||
@ -1029,7 +1029,7 @@ test.describe('Sketch tests', () => {
|
||||
await page.mouse.click(XYPlanePoint.x + 50, XYPlanePoint.y + 50)
|
||||
await expect(u.codeLocator).toHaveText(`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([11.8, 9.09], %)
|
||||
|> line([3.39, -3.39], %)
|
||||
|> line(end = [3.39, -3.39])
|
||||
`)
|
||||
|
||||
await page.addInitScript(async () => {
|
||||
@ -1037,7 +1037,7 @@ test.describe('Sketch tests', () => {
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([11.8, 9.09], %)
|
||||
|> line([3.39, -3.39], %)
|
||||
|> line(end = [3.39, -3.39])
|
||||
`
|
||||
)
|
||||
})
|
||||
@ -1148,12 +1148,12 @@ test.describe('Sketch tests', () => {
|
||||
railWideWidth / 2,
|
||||
railClampable / 2 + railBaseLength
|
||||
], %, $seg01)
|
||||
|> lineTo([railTop / 2, railBaseLength], %)
|
||||
|> lineTo([railBaseWidth / 2, railBaseLength], %)
|
||||
|> lineTo([railBaseWidth / 2, 0], %)
|
||||
|> lineTo([-railBaseWidth / 2, 0], %)
|
||||
|> lineTo([-railBaseWidth / 2, railBaseLength], %)
|
||||
|> lineTo([-railTop / 2, railBaseLength], %)
|
||||
|> line(endAbsolute = [railTop / 2, railBaseLength])
|
||||
|> line(endAbsolute = [railBaseWidth / 2, railBaseLength])
|
||||
|> line(endAbsolute = [railBaseWidth / 2, 0])
|
||||
|> line(endAbsolute = [-railBaseWidth / 2, 0])
|
||||
|> line(endAbsolute = [-railBaseWidth / 2, railBaseLength])
|
||||
|> line(endAbsolute = [-railTop / 2, railBaseLength])
|
||||
|> lineTo([
|
||||
-railWideWidth / 2,
|
||||
railClampable / 2 + railBaseLength
|
||||
@ -1163,7 +1163,7 @@ test.describe('Sketch tests', () => {
|
||||
railClampable + railBaseLength
|
||||
], %)
|
||||
|> close(%)
|
||||
|> extrude(in2mm(2), %)`
|
||||
|> extrude(length = in2mm(2))`
|
||||
)
|
||||
})
|
||||
|
||||
@ -1340,7 +1340,7 @@ test.describe(`Click based selection don't brick the app when clicked out of ran
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([3.14, 3.14], %)
|
||||
|> line(end = [3.14, 3.14])
|
||||
|> arcTo({
|
||||
end = [4, 2],
|
||||
interior = [1, 2]
|
||||
|
@ -106,7 +106,7 @@ part001 = startSketchOn('-XZ')
|
||||
|> angledLineToY([segAng(seg02, %) + 180, -baseHeight], %)
|
||||
|> xLineTo(ZERO, %)
|
||||
|> close(%)
|
||||
|> extrude(4, %)`
|
||||
|> extrude(length = 4)`
|
||||
)
|
||||
})
|
||||
await page.setViewportSize({ width: 1200, height: 500 })
|
||||
@ -340,12 +340,12 @@ const extrudeDefaultPlane = async (context: any, page: any, plane: string) => {
|
||||
|
||||
const code = `part001 = startSketchOn('${plane}')
|
||||
|> startProfileAt([7.00, 4.40], %)
|
||||
|> line([6.60, -0.20], %)
|
||||
|> line([2.80, 5.00], %)
|
||||
|> line([-5.60, 4.40], %)
|
||||
|> line([-5.40, -3.80], %)
|
||||
|> line(end = [6.60, -0.20])
|
||||
|> line(end = [2.80, 5.00])
|
||||
|> line(end = [-5.60, 4.40])
|
||||
|> line(end = [-5.40, -3.80])
|
||||
|> close(%)
|
||||
|> extrude(10.00, %)
|
||||
|> extrude(length = 10.00)
|
||||
`
|
||||
await page.addInitScript(async (code: string) => {
|
||||
localStorage.setItem('persistCode', code)
|
||||
@ -814,16 +814,16 @@ test(
|
||||
'persistCode',
|
||||
`part001 = startSketchOn('-XZ')
|
||||
|> startProfileAt([1.4, 2.47], %)
|
||||
|> line([9.31, 10.55], %, $seg01)
|
||||
|> line([11.91, -10.42], %)
|
||||
|> line(end = [9.31, 10.55], tag = $seg01)
|
||||
|> line(end = [11.91, -10.42])
|
||||
|> close(%)
|
||||
|> extrude(${KCL_DEFAULT_LENGTH}, %)
|
||||
|> extrude(length = ${KCL_DEFAULT_LENGTH})
|
||||
part002 = startSketchOn(part001, seg01)
|
||||
|> startProfileAt([8, 8], %)
|
||||
|> line([4.68, 3.05], %)
|
||||
|> line([0, -7.79], %)
|
||||
|> line(end = [4.68, 3.05])
|
||||
|> line(end = [0, -7.79])
|
||||
|> close(%)
|
||||
|> extrude(${KCL_DEFAULT_LENGTH}, %)
|
||||
|> extrude(length = ${KCL_DEFAULT_LENGTH})
|
||||
`
|
||||
)
|
||||
}, KCL_DEFAULT_LENGTH)
|
||||
@ -879,9 +879,9 @@ test(
|
||||
'persistCode',
|
||||
`part001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([-20, 0], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close(%)
|
||||
`
|
||||
)
|
||||
@ -922,11 +922,11 @@ test(
|
||||
'persistCode',
|
||||
`part001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([-20, 0], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close(%)
|
||||
|> extrude(10, %)
|
||||
|> extrude(length = 10)
|
||||
`
|
||||
)
|
||||
}, KCL_DEFAULT_LENGTH)
|
||||
@ -1111,11 +1111,11 @@ test.fixme('theme persists', async ({ page, context }) => {
|
||||
'persistCode',
|
||||
`part001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([-20, 0], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
|> close(%)
|
||||
|> extrude(10, %)
|
||||
|> extrude(length = 10)
|
||||
`
|
||||
)
|
||||
}, KCL_DEFAULT_LENGTH)
|
||||
@ -1181,11 +1181,11 @@ test.describe('code color goober', { tag: '@snapshot' }, () => {
|
||||
// Create a path for the sweep.
|
||||
sweepPath = startSketchOn('XZ')
|
||||
|> startProfileAt([0.05, 0.05], %)
|
||||
|> line([0, 7], %)
|
||||
|> line(end = [0, 7])
|
||||
|> tangentialArc({ offset = 90, radius = 5 }, %)
|
||||
|> line([-3, 0], %)
|
||||
|> line(end = [-3, 0])
|
||||
|> tangentialArc({ offset = -90, radius = 5 }, %)
|
||||
|> line([0, 7], %)
|
||||
|> line(end = [0, 7])
|
||||
|
||||
sweepSketch = startSketchOn('XY')
|
||||
|> startProfileAt([2, 0], %)
|
||||
@ -1229,11 +1229,11 @@ sweepSketch = startSketchOn('XY')
|
||||
// Create a path for the sweep.
|
||||
sweepPath = startSketchOn('XZ')
|
||||
|> startProfileAt([0.05, 0.05], %)
|
||||
|> line([0, 7], %)
|
||||
|> line(end = [0, 7])
|
||||
|> tangentialArc({ offset = 90, radius = 5 }, %)
|
||||
|> line([-3, 0], %)
|
||||
|> line(end = [-3, 0])
|
||||
|> tangentialArc({ offset = -90, radius = 5 }, %)
|
||||
|> line([0, 7], %)
|
||||
|> line(end = [0, 7])
|
||||
|
||||
sweepSketch = startSketchOn('XY')
|
||||
|> startProfileAt([2, 0], %)
|
||||
|
@ -76,9 +76,9 @@ export const TEST_SETTINGS_CORRUPTED = {
|
||||
|
||||
export const TEST_CODE_GIZMO = `part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([20, 0], %)
|
||||
|> line([7.13, 4 + 0], %)
|
||||
|> line(end = [7.13, 4 + 0])
|
||||
|> angledLine({ angle: 3 + 0, length: 3.14 + 0 }, %)
|
||||
|> lineTo([20.14 + 0, -0.14 + 0], %)
|
||||
|> line(endAbsolute = [20.14 + 0, -0.14 + 0])
|
||||
|> xLineTo(29 + 0, %)
|
||||
|> yLine(-3.14 + 0, %, $a)
|
||||
|> xLine(1.63, %)
|
||||
@ -93,7 +93,7 @@ export const TEST_CODE_GIZMO = `part001 = startSketchOn('XZ')
|
||||
}, %)
|
||||
|> tangentialArcTo([13.14 + 0, 13.14], %)
|
||||
|> close(%)
|
||||
|> extrude(5 + 7, %)
|
||||
|> extrude(length = 5 + 7)
|
||||
`
|
||||
|
||||
export const TEST_CODE_LONG_WITH_ERROR_OUT_OF_VIEW = `width = 50.8
|
||||
@ -103,41 +103,41 @@ keychainHoleSize = 3
|
||||
|
||||
keychain = startSketchOn("XY")
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> lineTo([width, 0], %)
|
||||
|> lineTo([width, height], %)
|
||||
|> lineTo([0, height], %)
|
||||
|> line(endAbsolute = [width, 0])
|
||||
|> line(endAbsolute = [width, height])
|
||||
|> line(endAbsolute = [0, height])
|
||||
|> close(%)
|
||||
|> extrude(thickness, %)
|
||||
|> extrude(length = thickness)
|
||||
|
||||
keychain1 = startSketchOn("XY")
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> lineTo([width, 0], %)
|
||||
|> lineTo([width, height], %)
|
||||
|> lineTo([0, height], %)
|
||||
|> line(endAbsolute = [width, 0])
|
||||
|> line(endAbsolute = [width, height])
|
||||
|> line(endAbsolute = [0, height])
|
||||
|> close(%)
|
||||
|> extrude(thickness, %)
|
||||
|> extrude(length = thickness)
|
||||
|
||||
keychain2 = startSketchOn("XY")
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> lineTo([width, 0], %)
|
||||
|> lineTo([width, height], %)
|
||||
|> lineTo([0, height], %)
|
||||
|> line(endAbsolute = [width, 0])
|
||||
|> line(endAbsolute = [width, height])
|
||||
|> line(endAbsolute = [0, height])
|
||||
|> close(%)
|
||||
|> extrude(thickness, %)
|
||||
|> extrude(length = thickness)
|
||||
|
||||
box = startSketchOn('XY')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([0, 10], %)
|
||||
|> line([10, 0], %)
|
||||
|> line([0, -10], %, $revolveAxis)
|
||||
|> line(end = [0, 10])
|
||||
|> line(end = [10, 0])
|
||||
|> line(end = [0, -10], tag = $revolveAxis)
|
||||
|> close(%)
|
||||
|> extrude(10, %)
|
||||
|> extrude(length = 10)
|
||||
|
||||
sketch001 = startSketchOn(box, revolveAxis)
|
||||
|> startProfileAt([5, 10], %)
|
||||
|> line([0, -10], %)
|
||||
|> line([2, 0], %)
|
||||
|> line([0, -10], %)
|
||||
|> line(end = [0, -10])
|
||||
|> line(end = [2, 0])
|
||||
|> line(end = [0, -10])
|
||||
|> close(%)
|
||||
|> revolve({
|
||||
axis: revolveAxis,
|
||||
|
@ -188,7 +188,7 @@ test.describe('Test network and connection issues', () => {
|
||||
.toBe(`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([12.34, -12.34], %)
|
||||
|> xLine(12.34, %)
|
||||
|> line([-12.34, 12.34], %)
|
||||
|> line(end = [-12.34, 12.34])
|
||||
|
||||
`)
|
||||
await page.waitForTimeout(100)
|
||||
@ -198,7 +198,7 @@ test.describe('Test network and connection issues', () => {
|
||||
.toBe(`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([12.34, -12.34], %)
|
||||
|> xLine(12.34, %)
|
||||
|> line([-12.34, 12.34], %)
|
||||
|> line(end = [-12.34, 12.34])
|
||||
|> xLine(-12.34, %)
|
||||
|
||||
`)
|
||||
|
@ -229,10 +229,10 @@ test.describe('Testing Camera Movement', () => {
|
||||
code += `\n |> startProfileAt([8.12, -12.98], %)`
|
||||
// await expect(u.codeLocator).toHaveText(code)
|
||||
await u.canvasLocator.click({ position: { x, y } })
|
||||
code += `\n |> line([11.18, 0], %)`
|
||||
code += `\n |> line(end = [11.18, 0])`
|
||||
// await expect(u.codeLocator).toHaveText(code)
|
||||
await u.canvasLocator.click({ position: { x, y: 275 } })
|
||||
code += `\n |> line([0, 6.99], %)`
|
||||
code += `\n |> line(end = [0, 6.99])`
|
||||
// await expect(u.codeLocator).toHaveText(code)
|
||||
|
||||
// click the line button
|
||||
|
@ -16,8 +16,8 @@ test.describe('Testing constraints', () => {
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> xLine(-20, %)
|
||||
`
|
||||
)
|
||||
@ -57,7 +57,7 @@ test.describe('Testing constraints', () => {
|
||||
.click()
|
||||
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`length001 = 20sketch001 = startSketchOn('XY') |> startProfileAt([-10, -10], %) |> line([20, 0], %) |> angledLine([90, length001], %) |> xLine(-20, %)`
|
||||
`length001 = 20sketch001 = startSketchOn('XY') |> startProfileAt([-10, -10], %) |> line(end = [20, 0], %) |> angledLine([90, length001], %) |> xLine(-20)`
|
||||
)
|
||||
|
||||
// Make sure we didn't pop out of sketch mode.
|
||||
@ -83,16 +83,16 @@ test.describe('Testing constraints', () => {
|
||||
`yo = 79
|
||||
part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([-7.54, -26.74], %)
|
||||
|> line([74.36, 130.4], %, $seg01)
|
||||
|> line([78.92, -120.11], %)
|
||||
|> line(end = [74.36, 130.4], tag = $seg01)
|
||||
|> line(end = [78.92, -120.11])
|
||||
|> angledLine([segAng(seg01), yo], %)
|
||||
|> line([41.19, 58.97 + 5], %)
|
||||
|> line(end = [41.19, 58.97 + 5])
|
||||
part002 = startSketchOn('XZ')
|
||||
|> startProfileAt([299.05, 120], %)
|
||||
|> xLine(-385.34, %, $seg_what)
|
||||
|> yLine(-170.06, %)
|
||||
|> xLine(segLen(seg_what), %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)`
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])`
|
||||
)
|
||||
})
|
||||
const u = await getUtils(page)
|
||||
@ -121,7 +121,7 @@ test.describe('Testing constraints', () => {
|
||||
await page.getByText('line([39.13, 68.63], %)').click()
|
||||
await pollEditorLinesSelectedLength(page, 1)
|
||||
const activeLinesContent = await page.locator('.cm-activeLine').all()
|
||||
await expect(activeLinesContent[0]).toHaveText('|> line([39.13, 68.63], %)')
|
||||
await expect(activeLinesContent[0]).toHaveText('|> line(end = [39.13, 68.63])')
|
||||
|
||||
// checking the count of the overlays is a good proxy check that the client sketch scene is in a good state
|
||||
await expect(page.getByTestId('segment-overlay')).toHaveCount(4)
|
||||
@ -147,16 +147,16 @@ test.describe('Testing constraints', () => {
|
||||
`yo = 5
|
||||
part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([-7.54, -26.74], %)
|
||||
|> line([74.36, 130.4], %, $seg01)
|
||||
|> line([78.92, -120.11], %)
|
||||
|> line(end = [74.36, 130.4], tag = $seg01)
|
||||
|> line(end = [78.92, -120.11])
|
||||
|> angledLine([segAng(seg01), 78.33], %)
|
||||
|> line([51.19, 48.97], %)
|
||||
|> line(end = [51.19, 48.97])
|
||||
part002 = startSketchOn('XZ')
|
||||
|> startProfileAt([299.05, 231.45], %)
|
||||
|> xLine(-425.34, %, $seg_what)
|
||||
|> yLine(-264.06, %)
|
||||
|> xLine(segLen(seg_what), %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)`
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])`
|
||||
)
|
||||
|
||||
const isChecked = await createNewVariableCheckbox.isChecked()
|
||||
@ -177,7 +177,7 @@ test.describe('Testing constraints', () => {
|
||||
await pollEditorLinesSelectedLength(page, 2)
|
||||
const activeLinesContent = await page.locator('.cm-activeLine').all()
|
||||
await expect(activeLinesContent[0]).toHaveText(
|
||||
`|> line([74.36, 130.4], %, $seg01)`
|
||||
`|> line(end = [74.36, 130.4], tag = $seg01)`
|
||||
)
|
||||
await expect(activeLinesContent[1]).toHaveText(`}, %)`)
|
||||
|
||||
@ -239,7 +239,7 @@ test.describe('Testing constraints', () => {
|
||||
await pollEditorLinesSelectedLength(page, 2)
|
||||
const activeLinesContent = await page.locator('.cm-activeLine').all()
|
||||
await expect(activeLinesContent[0]).toHaveText(
|
||||
`|> line([74.36, 130.4], %, $seg01)`
|
||||
`|> line(end = [74.36, 130.4], tag = $seg01)`
|
||||
)
|
||||
await expect(activeLinesContent[1]).toHaveText(`}, %)`)
|
||||
|
||||
@ -281,16 +281,16 @@ test.describe('Testing constraints', () => {
|
||||
`yo = 5
|
||||
part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([-7.54, -26.74], %)
|
||||
|> line([74.36, 130.4], %)
|
||||
|> line([78.92, -120.11], %)
|
||||
|> line([9.16, 77.79], %)
|
||||
|> line([51.19, 48.97], %)
|
||||
|> line(end = [74.36, 130.4])
|
||||
|> line(end = [78.92, -120.11])
|
||||
|> line(end = [9.16, 77.79])
|
||||
|> line(end = [51.19, 48.97])
|
||||
part002 = startSketchOn('XZ')
|
||||
|> startProfileAt([299.05, 231.45], %)
|
||||
|> xLine(-425.34, %, $seg_what)
|
||||
|> yLine(-264.06, %)
|
||||
|> xLine(segLen(seg_what), %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)`
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])`
|
||||
)
|
||||
})
|
||||
const u = await getUtils(page)
|
||||
@ -336,8 +336,8 @@ test.describe('Testing constraints', () => {
|
||||
|
||||
// checking activeLines assures the cursors are where they should be
|
||||
const codeAfter = [
|
||||
`|> line([74.36, 130.4], %, $seg01)`,
|
||||
`|> lineTo([${value}], %)`,
|
||||
`|> line(end = [74.36, 130.4], tag = $seg01)`,
|
||||
`|> line(endAbsolute = [${value}])`,
|
||||
]
|
||||
|
||||
const activeLinesContent = await page.locator('.cm-activeLine').all()
|
||||
@ -391,16 +391,16 @@ test.describe('Testing constraints', () => {
|
||||
`yo = 5
|
||||
part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([-7.54, -26.74], %)
|
||||
|> line([74.36, 130.4], %)
|
||||
|> line([78.92, -120.11], %)
|
||||
|> line([9.16, 77.79], %)
|
||||
|> line([51.19, 48.97], %)
|
||||
|> line(end = [74.36, 130.4])
|
||||
|> line(end = [78.92, -120.11])
|
||||
|> line(end = [9.16, 77.79])
|
||||
|> line(end = [51.19, 48.97])
|
||||
part002 = startSketchOn('XZ')
|
||||
|> startProfileAt([299.05, 231.45], %)
|
||||
|> xLine(-425.34, %, $seg_what)
|
||||
|> yLine(-264.06, %)
|
||||
|> xLine(segLen(seg_what), %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)`
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])`
|
||||
)
|
||||
})
|
||||
const u = await getUtils(page)
|
||||
@ -451,7 +451,7 @@ test.describe('Testing constraints', () => {
|
||||
.click()
|
||||
|
||||
// checking activeLines assures the cursors are where they should be
|
||||
const codeAfter = [`|> lineTo([${value}], %)`]
|
||||
const codeAfter = [`|> line(endAbsolute = [${value}])`]
|
||||
|
||||
const activeLinesContent = await page.locator('.cm-activeLine').all()
|
||||
await Promise.all(
|
||||
@ -506,16 +506,16 @@ test.describe('Testing constraints', () => {
|
||||
`yo = 5
|
||||
part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([-7.54, -26.74], %)
|
||||
|> line([74.36, 130.4], %)
|
||||
|> line([78.92, -120.11], %)
|
||||
|> line([9.16, 77.79], %)
|
||||
|> line([51.19, 48.97], %)
|
||||
|> line(end = [74.36, 130.4])
|
||||
|> line(end = [78.92, -120.11])
|
||||
|> line(end = [9.16, 77.79])
|
||||
|> line(end = [51.19, 48.97])
|
||||
part002 = startSketchOn('XZ')
|
||||
|> startProfileAt([299.05, 231.45], %)
|
||||
|> xLine(-425.34, %, $seg_what)
|
||||
|> yLine(-264.06, %)
|
||||
|> xLine(segLen(seg_what), %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)`
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])`
|
||||
)
|
||||
})
|
||||
const u = await getUtils(page)
|
||||
@ -564,7 +564,7 @@ test.describe('Testing constraints', () => {
|
||||
|
||||
// checking activeLines assures the cursors are where they should be
|
||||
const codeAfter = [
|
||||
'|> line([74.36, 130.4], %, $seg01)',
|
||||
'|> line(end = [74.36, 130.4], tag = $seg01)',
|
||||
`|> angledLine([${value}, 78.33], %)`,
|
||||
]
|
||||
if (axisSelect) codeAfter.shift()
|
||||
@ -608,16 +608,16 @@ test.describe('Testing constraints', () => {
|
||||
`yo = 5
|
||||
part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([-7.54, -26.74], %)
|
||||
|> line([74.36, 130.4], %)
|
||||
|> line([78.92, -120.11], %)
|
||||
|> line([9.16, 77.79], %)
|
||||
|> line([51.19, 48.97], %)
|
||||
|> line(end = [74.36, 130.4])
|
||||
|> line(end = [78.92, -120.11])
|
||||
|> line(end = [9.16, 77.79])
|
||||
|> line(end = [51.19, 48.97])
|
||||
part002 = startSketchOn('XZ')
|
||||
|> startProfileAt([299.05, 231.45], %)
|
||||
|> xLine(-425.34, %, $seg_what)
|
||||
|> yLine(-264.06, %)
|
||||
|> xLine(segLen(seg_what), %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)`
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])`
|
||||
)
|
||||
})
|
||||
const u = await getUtils(page)
|
||||
@ -696,16 +696,16 @@ test.describe('Testing constraints', () => {
|
||||
`yo = 5
|
||||
part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([-7.54, -26.74], %)
|
||||
|> line([74.36, 130.4], %)
|
||||
|> line([78.92, -120.11], %)
|
||||
|> line([9.16, 77.79], %)
|
||||
|> line([51.19, 48.97], %)
|
||||
|> line(end = [74.36, 130.4])
|
||||
|> line(end = [78.92, -120.11])
|
||||
|> line(end = [9.16, 77.79])
|
||||
|> line(end = [51.19, 48.97])
|
||||
part002 = startSketchOn('XZ')
|
||||
|> startProfileAt([299.05, 231.45], %)
|
||||
|> xLine(-425.34, %, $seg_what)
|
||||
|> yLine(-264.06, %)
|
||||
|> xLine(segLen(seg_what), %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)`
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])`
|
||||
)
|
||||
})
|
||||
const u = await getUtils(page)
|
||||
@ -774,16 +774,16 @@ part002 = startSketchOn('XZ')
|
||||
`yo = 5
|
||||
part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([-7.54, -26.74], %)
|
||||
|> line([74.36, 130.4], %)
|
||||
|> line([78.92, -120.11], %)
|
||||
|> line([9.16, 77.79], %)
|
||||
|> line([51.19, 48.97], %)
|
||||
|> line(end = [74.36, 130.4])
|
||||
|> line(end = [78.92, -120.11])
|
||||
|> line(end = [9.16, 77.79])
|
||||
|> line(end = [51.19, 48.97])
|
||||
part002 = startSketchOn('XZ')
|
||||
|> startProfileAt([299.05, 231.45], %)
|
||||
|> xLine(-425.34, %, $seg_what)
|
||||
|> yLine(-264.06, %)
|
||||
|> xLine(segLen(seg_what), %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)`
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])`
|
||||
)
|
||||
})
|
||||
const u = await getUtils(page)
|
||||
@ -861,11 +861,11 @@ part002 = startSketchOn('XZ')
|
||||
constraintName: 'Parallel',
|
||||
},
|
||||
{
|
||||
codeAfter: `|> lineTo([segEndX(seg01), 61.34], %)`,
|
||||
codeAfter: `|> line(endAbsolute = [segEndX(seg01), 61.34])`,
|
||||
constraintName: 'Vertically Align',
|
||||
},
|
||||
{
|
||||
codeAfter: `|> lineTo([154.9, segEndY(seg01)], %)`,
|
||||
codeAfter: `|> line(endAbsolute = [154.9, segEndY(seg01)])`,
|
||||
constraintName: 'Horizontally Align',
|
||||
},
|
||||
] as const
|
||||
@ -877,15 +877,15 @@ part002 = startSketchOn('XZ')
|
||||
`yo = 5
|
||||
part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([-7.54, -26.74], %)
|
||||
|> line([74.36, 130.4], %)
|
||||
|> line([78.92, -120.11], %)
|
||||
|> line([9.16, 77.79], %)
|
||||
|> line(end = [74.36, 130.4])
|
||||
|> line(end = [78.92, -120.11])
|
||||
|> line(end = [9.16, 77.79])
|
||||
part002 = startSketchOn('XZ')
|
||||
|> startProfileAt([299.05, 231.45], %)
|
||||
|> xLine(-425.34, %, $seg_what)
|
||||
|> yLine(-264.06, %)
|
||||
|> xLine(segLen(seg_what), %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)`
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])`
|
||||
)
|
||||
})
|
||||
const u = await getUtils(page)
|
||||
@ -931,7 +931,7 @@ part002 = startSketchOn('XZ')
|
||||
|
||||
// check both cursors are where they should be after constraint is applied
|
||||
await expect(activeLinesContent[0]).toHaveText(
|
||||
'|> line([74.36, 130.4], %, $seg01)'
|
||||
'|> line(end = [74.36, 130.4], tag = $seg01)'
|
||||
)
|
||||
await expect(activeLinesContent[1]).toHaveText(codeAfter)
|
||||
})
|
||||
@ -940,12 +940,12 @@ part002 = startSketchOn('XZ')
|
||||
test.describe('Axis & segment - no modal constraints', () => {
|
||||
const cases = [
|
||||
{
|
||||
codeAfter: `|> lineTo([154.9, ZERO], %)`,
|
||||
codeAfter: `|> line(endAbsolute = [154.9, ZERO])`,
|
||||
axisClick: { x: 950, y: 250 },
|
||||
constraintName: 'Snap To X',
|
||||
},
|
||||
{
|
||||
codeAfter: `|> lineTo([ZERO, 61.34], %)`,
|
||||
codeAfter: `|> line(endAbsolute = [ZERO, 61.34])`,
|
||||
axisClick: { x: 600, y: 150 },
|
||||
constraintName: 'Snap To Y',
|
||||
},
|
||||
@ -958,15 +958,15 @@ part002 = startSketchOn('XZ')
|
||||
`yo = 5
|
||||
part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([-7.54, -26.74], %)
|
||||
|> line([74.36, 130.4], %)
|
||||
|> line([78.92, -120.11], %)
|
||||
|> line([9.16, 77.79], %)
|
||||
|> line(end = [74.36, 130.4])
|
||||
|> line(end = [78.92, -120.11])
|
||||
|> line(end = [9.16, 77.79])
|
||||
part002 = startSketchOn('XZ')
|
||||
|> startProfileAt([299.05, 231.45], %)
|
||||
|> xLine(-425.34, %, $seg_what)
|
||||
|> yLine(-264.06, %)
|
||||
|> xLine(segLen(seg_what), %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)`
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])`
|
||||
)
|
||||
})
|
||||
const u = await getUtils(page)
|
||||
@ -1020,8 +1020,8 @@ part002 = startSketchOn('XZ')
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XY')
|
||||
|> startProfileAt([-1.05, -1.07], %)
|
||||
|> line([3.79, 2.68], %, $seg01)
|
||||
|> line([3.13, -2.4], %)`
|
||||
|> line(end = [3.79, 2.68], tag = $seg01)
|
||||
|> line(end = [3.13, -2.4])`
|
||||
)
|
||||
})
|
||||
const u = await getUtils(page)
|
||||
|
@ -275,7 +275,7 @@ test.describe(`Testing gizmo, fixture-based`, () => {
|
||||
center: [818.33, 168.1],
|
||||
radius: 182.8
|
||||
}, %)
|
||||
|> extrude(50, %)
|
||||
|> extrude(length = 50)
|
||||
`
|
||||
)
|
||||
})
|
||||
|
@ -209,9 +209,9 @@ test.describe('Testing segment overlays', () => {
|
||||
'persistCode',
|
||||
`part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([5 + 0, 20 + 0], %)
|
||||
|> line([0.5, -14 + 0], %)
|
||||
|> line(end = [0.5, -14 + 0])
|
||||
|> angledLine({ angle = 3 + 0, length = 32 + 0 }, %)
|
||||
|> lineTo([5 + 33, 20 + 11.5 + 0], %)
|
||||
|> line(endAbsolute = [5 + 33, 20 + 11.5 + 0])
|
||||
|> xLineTo(5 + 9 - 5, %)
|
||||
|> yLineTo(20 + -10.77, %, $a)
|
||||
|> xLine(26.04, %)
|
||||
@ -279,9 +279,9 @@ test.describe('Testing segment overlays', () => {
|
||||
await clickConstrained({
|
||||
hoverPos: { x: line.x, y: line.y },
|
||||
constraintType: 'yRelative',
|
||||
expectBeforeUnconstrained: '|> line([0.5, -14 + 0], %)',
|
||||
expectAfterUnconstrained: '|> line([0.5, -14], %)',
|
||||
expectFinal: '|> line([0.5, yRel001], %)',
|
||||
expectBeforeUnconstrained: '|> line(end = [0.5, -14 + 0])',
|
||||
expectAfterUnconstrained: '|> line(end = [0.5, -14])',
|
||||
expectFinal: '|> line(end = [0.5, yRel001])',
|
||||
ang: ang + 180,
|
||||
locator: '[data-overlay-toolbar-index="0"]',
|
||||
})
|
||||
@ -289,9 +289,9 @@ test.describe('Testing segment overlays', () => {
|
||||
await clickUnconstrained({
|
||||
hoverPos: { x: line.x, y: line.y },
|
||||
constraintType: 'xRelative',
|
||||
expectBeforeUnconstrained: '|> line([0.5, yRel001], %)',
|
||||
expectBeforeUnconstrained: '|> line(end = [0.5, yRel001])',
|
||||
expectAfterUnconstrained: 'line([xRel001, yRel001], %)',
|
||||
expectFinal: '|> line([0.5, yRel001], %)',
|
||||
expectFinal: '|> line(end = [0.5, yRel001])',
|
||||
ang: ang + 180,
|
||||
locator: '[data-overlay-index="0"]',
|
||||
})
|
||||
@ -382,9 +382,9 @@ test.describe('Testing segment overlays', () => {
|
||||
xAbs002 = 4
|
||||
part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([0.5, yRel001], %)
|
||||
|> line(end = [0.5, yRel001])
|
||||
|> angledLine({ angle = angle001, length = len001 }, %)
|
||||
|> lineTo([33, yAbs001], %)
|
||||
|> line(endAbsolute = [33, yAbs001])
|
||||
|> xLineTo(xAbs002, %)
|
||||
|> yLineTo(-10.77, %, $a)
|
||||
|> xLine(26.04, %)
|
||||
@ -455,9 +455,9 @@ test.describe('Testing segment overlays', () => {
|
||||
'persistCode',
|
||||
`part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([0.5, -14 + 0], %)
|
||||
|> line(end = [0.5, -14 + 0])
|
||||
|> angledLine({ angle = 3 + 0, length = 32 + 0 }, %)
|
||||
|> lineTo([33, 11.5 + 0], %)
|
||||
|> line(endAbsolute = [33, 11.5 + 0])
|
||||
|> xLineTo(9 - 5, %)
|
||||
|> yLineTo(-10.77, %, $a)
|
||||
|> xLine(26.04, %)
|
||||
@ -586,9 +586,9 @@ test.describe('Testing segment overlays', () => {
|
||||
'persistCode',
|
||||
`part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([0.5, -14 + 0], %)
|
||||
|> line(end = [0.5, -14 + 0])
|
||||
|> angledLine({ angle = 3 + 0, length = 32 + 0 }, %)
|
||||
|> lineTo([33, 11.5 + 0], %)
|
||||
|> line(endAbsolute = [33, 11.5 + 0])
|
||||
|> xLineTo(9 - 5, %)
|
||||
|> yLineTo(-10.77, %, $a)
|
||||
|> xLine(26.04, %)
|
||||
@ -747,9 +747,9 @@ test.describe('Testing segment overlays', () => {
|
||||
'persistCode',
|
||||
`part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([0.5, -14 + 0], %)
|
||||
|> line(end = [0.5, -14 + 0])
|
||||
|> angledLine({ angle = 3 + 0, length = 32 + 0 }, %)
|
||||
|> lineTo([33, 11.5 + 0], %)
|
||||
|> line(endAbsolute = [33, 11.5 + 0])
|
||||
|> xLineTo(9 - 5, %)
|
||||
|> yLineTo(-10.77, %, $a)
|
||||
|> xLine(26.04, %)
|
||||
@ -937,9 +937,9 @@ test.describe('Testing segment overlays', () => {
|
||||
'persistCode',
|
||||
`part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([0.5, -14 + 0], %)
|
||||
|> line(end = [0.5, -14 + 0])
|
||||
|> angledLine({ angle = 3 + 0, length = 32 + 0 }, %)
|
||||
|> lineTo([33, 11.5 + 0], %)
|
||||
|> line(endAbsolute = [33, 11.5 + 0])
|
||||
|> xLineTo(9 - 5, %)
|
||||
|> yLineTo(-10.77, %, $a)
|
||||
|> xLine(26.04, %)
|
||||
@ -1174,7 +1174,7 @@ test.describe('Testing segment overlays', () => {
|
||||
`part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([5, 6], %)
|
||||
|> ${lineToBeDeleted}
|
||||
|> line([-10, -15], %)
|
||||
|> line(end = [-10, -15])
|
||||
|> angledLine([-176, segLen(seg01)], %)
|
||||
${extraLine ? 'myVar = segLen(seg01)' : ''}`
|
||||
)
|
||||
@ -1338,7 +1338,7 @@ test.describe('Testing segment overlays', () => {
|
||||
`part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([5, 6], %)
|
||||
|> ${lineToBeDeleted}
|
||||
|> line([-10, -15], %)
|
||||
|> line(end = [-10, -15])
|
||||
|> angledLine([-176, segLen(seg01)], %)`
|
||||
)
|
||||
},
|
||||
|
@ -264,61 +264,61 @@ test.describe('Testing selections', () => {
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([-79.26, 95.04], %)
|
||||
|> line([112.54, 127.64], %, $seg02)
|
||||
|> line([170.36, -121.61], %, $seg01)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [112.54, 127.64], tag = $seg02)
|
||||
|> line(end = [170.36, -121.61], tag = $seg01)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
extrude001 = extrude(50, sketch001)
|
||||
extrude001 = extrude(sketch001, length = 50)
|
||||
sketch005 = startSketchOn(extrude001, 'END')
|
||||
|> startProfileAt([23.24, 136.52], %)
|
||||
|> line([-8.44, 36.61], %)
|
||||
|> line([49.4, 2.05], %)
|
||||
|> line([29.69, -46.95], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [-8.44, 36.61])
|
||||
|> line(end = [49.4, 2.05])
|
||||
|> line(end = [29.69, -46.95])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
sketch003 = startSketchOn(extrude001, seg01)
|
||||
|> startProfileAt([21.23, 17.81], %)
|
||||
|> line([51.97, 21.32], %)
|
||||
|> line([4.07, -22.75], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [51.97, 21.32])
|
||||
|> line(end = [4.07, -22.75])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
sketch002 = startSketchOn(extrude001, seg02)
|
||||
|> startProfileAt([-100.54, 16.99], %)
|
||||
|> line([0, 20.03], %)
|
||||
|> line([62.61, 0], %, $seg03)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [0, 20.03])
|
||||
|> line(end = [62.61, 0], tag = $seg03)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
extrude002 = extrude(50, sketch002)
|
||||
extrude002 = extrude(sketch002, length = 50)
|
||||
sketch004 = startSketchOn(extrude002, seg03)
|
||||
|> startProfileAt([57.07, 134.77], %)
|
||||
|> line([-4.72, 22.84], %)
|
||||
|> line([28.8, 6.71], %)
|
||||
|> line([9.19, -25.33], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [-4.72, 22.84])
|
||||
|> line(end = [28.8, 6.71])
|
||||
|> line(end = [9.19, -25.33])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
extrude003 = extrude(20, sketch004)
|
||||
extrude003 = extrude(sketch004, length = 20)
|
||||
pipeLength = 40
|
||||
pipeSmallDia = 10
|
||||
pipeLargeDia = 20
|
||||
thickness = 0.5
|
||||
part009 = startSketchOn('XY')
|
||||
|> startProfileAt([pipeLargeDia - (thickness / 2), 38], %)
|
||||
|> line([thickness, 0], %)
|
||||
|> line([0, -1], %)
|
||||
|> line(end = [thickness, 0])
|
||||
|> line(end = [0, -1])
|
||||
|> angledLineToX({
|
||||
angle = 60,
|
||||
to = pipeSmallDia + thickness
|
||||
}, %)
|
||||
|> line([0, -pipeLength], %)
|
||||
|> line(end = [0, -pipeLength])
|
||||
|> angledLineToX({
|
||||
angle = -60,
|
||||
to = pipeLargeDia + thickness
|
||||
}, %)
|
||||
|> line([0, -1], %)
|
||||
|> line([-thickness, 0], %)
|
||||
|> line([0, 1], %)
|
||||
|> line(end = [0, -1])
|
||||
|> line(end = [-thickness, 0])
|
||||
|> line(end = [0, 1])
|
||||
|> angledLineToX({ angle = 120, to = pipeSmallDia }, %)
|
||||
|> line([0, pipeLength], %)
|
||||
|> line(end = [0, pipeLength])
|
||||
|> angledLineToX({ angle = 60, to = pipeLargeDia }, %)
|
||||
|> close(%)
|
||||
rev = revolve({ axis: 'y' }, part009)
|
||||
@ -362,7 +362,7 @@ test.describe('Testing selections', () => {
|
||||
await page.mouse.click(revolve.x, revolve.y)
|
||||
await page.waitForTimeout(100)
|
||||
await expect(page.locator('.cm-activeLine')).toHaveText(
|
||||
'|> line([0, -pipeLength], %)'
|
||||
'|> line(end = [0, -pipeLength])'
|
||||
)
|
||||
await u.clearCommandLogs()
|
||||
await page.keyboard.press('Backspace')
|
||||
@ -377,14 +377,14 @@ test.describe('Testing selections', () => {
|
||||
await page.mouse.click(parentExtrude.x, parentExtrude.y)
|
||||
await page.waitForTimeout(100)
|
||||
await expect(page.locator('.cm-activeLine')).toHaveText(
|
||||
'|> line([170.36, -121.61], %, $seg01)'
|
||||
'|> line(end = [170.36, -121.61], tag = $seg01)'
|
||||
)
|
||||
await u.clearCommandLogs()
|
||||
await page.keyboard.press('Backspace')
|
||||
await u.expectCmdLog('[data-message-type="execution-done"]', 10_000)
|
||||
await page.waitForTimeout(200)
|
||||
await expect(u.codeLocator).not.toContainText(
|
||||
`extrude001 = extrude(50, sketch001)`
|
||||
`extrude001 = extrude(sketch001, length = 50)`
|
||||
)
|
||||
await expect(u.codeLocator).toContainText(`sketch005 = startSketchOn({
|
||||
plane = {
|
||||
@ -433,17 +433,17 @@ test.describe('Testing selections', () => {
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([-79.26, 95.04], %)
|
||||
|> line([112.54, 127.64], %, $seg02)
|
||||
|> line([170.36, -121.61], %, $seg01)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [112.54, 127.64], tag = $seg02)
|
||||
|> line(end = [170.36, -121.61], tag = $seg01)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
extrude001 = extrude(50, sketch001)
|
||||
extrude001 = extrude(sketch001, length = 50)
|
||||
launderExtrudeThroughVar = extrude001
|
||||
sketch002 = startSketchOn(launderExtrudeThroughVar, seg02)
|
||||
|> startProfileAt([-100.54, 16.99], %)
|
||||
|> line([0, 20.03], %)
|
||||
|> line([62.61, 0], %, $seg03)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [0, 20.03])
|
||||
|> line(end = [62.61, 0], tag = $seg03)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
`
|
||||
)
|
||||
@ -481,7 +481,7 @@ test.describe('Testing selections', () => {
|
||||
await page.mouse.click(930, 139)
|
||||
await page.waitForTimeout(100)
|
||||
await expect(page.locator('.cm-activeLine')).toHaveText(
|
||||
'|> line([170.36, -121.61], %, $seg01)'
|
||||
'|> line(end = [170.36, -121.61], tag = $seg01)'
|
||||
)
|
||||
await u.clearCommandLogs()
|
||||
await page.keyboard.press('Backspace')
|
||||
@ -500,9 +500,9 @@ test.describe('Testing selections', () => {
|
||||
'persistCode',
|
||||
`part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([20, 0], %)
|
||||
|> line([7.13, 4 + 0], %)
|
||||
|> line(end = [7.13, 4 + 0])
|
||||
|> angledLine({ angle = 3 + 0, length = 3.14 + 0 }, %)
|
||||
|> lineTo([20.14 + 0, -0.14 + 0], %)
|
||||
|> line(endAbsolute = [20.14 + 0, -0.14 + 0])
|
||||
|> xLineTo(29 + 0, %)
|
||||
|> yLine(-3.14 + 0, %, $a)
|
||||
|> xLine(1.63, %)
|
||||
@ -517,7 +517,7 @@ test.describe('Testing selections', () => {
|
||||
}, %)
|
||||
|> tangentialArcTo([13.14 + 0, 13.14], %)
|
||||
|> close(%)
|
||||
|> extrude(5 + 7, %)
|
||||
|> extrude(length = 5 + 7)
|
||||
`
|
||||
)
|
||||
}, KCL_DEFAULT_LENGTH)
|
||||
@ -733,9 +733,9 @@ test.describe('Testing selections', () => {
|
||||
segAng(rectangleSegmentA001),
|
||||
-segLen(rectangleSegmentA001)
|
||||
], %, $yo)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %, $seg02)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|
||||
|> close(%)
|
||||
extrude001 = extrude(100, sketch001)
|
||||
extrude001 = extrude(sketch001, length = 100)
|
||||
|> chamfer({
|
||||
length = 30,
|
||||
tags = [
|
||||
@ -843,18 +843,18 @@ test.describe('Testing selections', () => {
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([3.29, 7.86], %)
|
||||
|> line([2.48, 2.44], %)
|
||||
|> line([2.66, 1.17], %)
|
||||
|> line([3.75, 0.46], %)
|
||||
|> line([4.99, -0.46], %, $seg01)
|
||||
|> line([3.3, -2.12], %)
|
||||
|> line([2.16, -3.33], %)
|
||||
|> line([0.85, -3.08], %)
|
||||
|> line([-0.18, -3.36], %)
|
||||
|> line([-3.86, -2.73], %)
|
||||
|> line([-17.67, 0.85], %)
|
||||
|> line(end = [2.48, 2.44])
|
||||
|> line(end = [2.66, 1.17])
|
||||
|> line(end = [3.75, 0.46])
|
||||
|> line(end = [4.99, -0.46], tag = $seg01)
|
||||
|> line(end = [3.3, -2.12])
|
||||
|> line(end = [2.16, -3.33])
|
||||
|> line(end = [0.85, -3.08])
|
||||
|> line(end = [-0.18, -3.36])
|
||||
|> line(end = [-3.86, -2.73])
|
||||
|> line(end = [-17.67, 0.85])
|
||||
|> close(%)
|
||||
extrude001 = extrude(10, sketch001)
|
||||
extrude001 = extrude(sketch001, length = 10)
|
||||
`
|
||||
)
|
||||
})
|
||||
@ -886,9 +886,9 @@ test.describe('Testing selections', () => {
|
||||
const codeToAdd = `${await u.codeLocator.allInnerTexts()}
|
||||
sketch002 = startSketchOn(extrude001, $seg01)
|
||||
|> startProfileAt([-12.94, 6.6], %)
|
||||
|> line([2.45, -0.2], %)
|
||||
|> line([-2, -1.25], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [2.45, -0.2])
|
||||
|> line(end = [-2, -1.25])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
`
|
||||
await u.codeLocator.fill(codeToAdd)
|
||||
@ -940,9 +940,9 @@ test.describe('Testing selections', () => {
|
||||
part001 = startSketchOn('XZ')
|
||||
|> startProfileAt([-7.54, -26.74], %)
|
||||
|> ${cases[0].expectedCode}
|
||||
|> line([-3.19, -138.43], %)
|
||||
|> line(end = [-3.19, -138.43])
|
||||
|> ${cases[1].expectedCode}
|
||||
|> line([41.19, 28.97 + 5], %)
|
||||
|> line(end = [41.19, 28.97 + 5])
|
||||
|> ${cases[2].expectedCode}`
|
||||
)
|
||||
},
|
||||
@ -991,11 +991,11 @@ test.describe('Testing selections', () => {
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([-79.26, 95.04], %)
|
||||
|> line([112.54, 127.64], %)
|
||||
|> line([170.36, -121.61], %, $seg01)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [112.54, 127.64])
|
||||
|> line(end = [170.36, -121.61], tag = $seg01)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
extrude001 = extrude(50, sketch001)
|
||||
extrude001 = extrude(sketch001, length = 50)
|
||||
`
|
||||
)
|
||||
})
|
||||
@ -1105,33 +1105,33 @@ test.describe('Testing selections', () => {
|
||||
'persistCode',
|
||||
`part001 = startSketchOn('XZ')
|
||||
${extrudeAndEditBlocked}
|
||||
|> line([25.96, 2.93], %)
|
||||
|> line([5.25, -5.72], %)
|
||||
|> line([-2.01, -10.35], %)
|
||||
|> line([-27.65, -2.78], %)
|
||||
|> line(end = [25.96, 2.93])
|
||||
|> line(end = [5.25, -5.72])
|
||||
|> line(end = [-2.01, -10.35])
|
||||
|> line(end = [-27.65, -2.78])
|
||||
|> close(%)
|
||||
|> extrude(5, %)
|
||||
|> extrude(length = 5)
|
||||
sketch002 = startSketchOn('XZ')
|
||||
${extrudeAndEditAllowed}
|
||||
|> line([10.32, 6.47], %)
|
||||
|> line([9.71, -6.16], %)
|
||||
|> line([-3.08, -9.86], %)
|
||||
|> line([-12.02, -1.54], %)
|
||||
|> line(end = [10.32, 6.47])
|
||||
|> line(end = [9.71, -6.16])
|
||||
|> line(end = [-3.08, -9.86])
|
||||
|> line(end = [-12.02, -1.54])
|
||||
|> close(%)
|
||||
sketch003 = startSketchOn('XZ')
|
||||
${editOnly}
|
||||
|> line([27.55, -1.65], %)
|
||||
|> line([4.95, -8], %)
|
||||
|> line([-20.38, -10.12], %)
|
||||
|> line([-15.79, 17.08], %)
|
||||
|> line(end = [27.55, -1.65])
|
||||
|> line(end = [4.95, -8])
|
||||
|> line(end = [-20.38, -10.12])
|
||||
|> line(end = [-15.79, 17.08])
|
||||
|
||||
fn yohey = (pos) => {
|
||||
sketch004 = startSketchOn('XZ')
|
||||
${extrudeAndEditBlockedInFunction}
|
||||
|> line([27.55, -1.65], %)
|
||||
|> line([4.95, -10.53], %)
|
||||
|> line([-20.38, -8], %)
|
||||
|> line([-15.79, 17.08], %)
|
||||
|> line(end = [27.55, -1.65])
|
||||
|> line(end = [4.95, -10.53])
|
||||
|> line(end = [-20.38, -8])
|
||||
|> line(end = [-15.79, 17.08])
|
||||
return ''
|
||||
}
|
||||
|
||||
|
@ -714,12 +714,12 @@ test.describe('Testing settings', () => {
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> line([5, 0], %)
|
||||
|> line([0, 5], %)
|
||||
|> line([-5, 0], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [5, 0])
|
||||
|> line(end = [0, 5])
|
||||
|> line(end = [-5, 0])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
extrude001 = extrude(5, sketch001)
|
||||
extrude001 = extrude(sketch001, length = 5)
|
||||
`
|
||||
)
|
||||
})
|
||||
|
@ -77,7 +77,7 @@ part001 = startSketchOn('-XZ')
|
||||
|> angledLineToY([segAng(seg02) + 180, -baseHeight], %)
|
||||
|> xLineTo(ZERO, %)
|
||||
|> close(%)
|
||||
|> extrude(4, %)`
|
||||
|> extrude(length = 4)`
|
||||
)
|
||||
})
|
||||
await page.setBodyDimensions({ width: 1200, height: 500 })
|
||||
@ -452,18 +452,18 @@ test('Sketch on face', async ({ page, homePage }) => {
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn('XZ')
|
||||
|> startProfileAt([3.29, 7.86], %)
|
||||
|> line([2.48, 2.44], %)
|
||||
|> line([2.66, 1.17], %)
|
||||
|> line([3.75, 0.46], %)
|
||||
|> line([4.99, -0.46], %)
|
||||
|> line([3.3, -2.12], %)
|
||||
|> line([2.16, -3.33], %)
|
||||
|> line([0.85, -3.08], %)
|
||||
|> line([-0.18, -3.36], %)
|
||||
|> line([-3.86, -2.73], %)
|
||||
|> line([-17.67, 0.85], %)
|
||||
|> line(end = [2.48, 2.44])
|
||||
|> line(end = [2.66, 1.17])
|
||||
|> line(end = [3.75, 0.46])
|
||||
|> line(end = [4.99, -0.46])
|
||||
|> line(end = [3.3, -2.12])
|
||||
|> line(end = [2.16, -3.33])
|
||||
|> line(end = [0.85, -3.08])
|
||||
|> line(end = [-0.18, -3.36])
|
||||
|> line(end = [-3.86, -2.73])
|
||||
|> line(end = [-17.67, 0.85])
|
||||
|> close(%)
|
||||
extrude001 = extrude(5 + 7, sketch001)`
|
||||
extrude001 = extrude(sketch001, length = 5 + 7)`
|
||||
)
|
||||
})
|
||||
|
||||
@ -520,9 +520,9 @@ extrude001 = extrude(5 + 7, sketch001)`
|
||||
await expect.poll(u.normalisedEditorCode).toContain(
|
||||
u.normalisedCode(`sketch002 = startSketchOn(extrude001, seg01)
|
||||
|> startProfileAt([-12.94, 6.6], %)
|
||||
|> line([2.45, -0.2], %)
|
||||
|> line([-2.6, -1.25], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [2.45, -0.2])
|
||||
|> line(end = [-2.6, -1.25])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)
|
||||
`)
|
||||
)
|
||||
@ -558,9 +558,9 @@ extrude001 = extrude(5 + 7, sketch001)`
|
||||
|
||||
const result = makeTemplate`sketch002 = startSketchOn(extrude001, seg01)
|
||||
|> startProfileAt([-12.83, 6.7], %)
|
||||
|> line([${[2.28, 2.35]}, -${0.07}], %)
|
||||
|> line([-3.05, -1.47], %)
|
||||
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||
|> line(end = [${[2.28, 2.35]}, -${0.07}])
|
||||
|> line(end = [-3.05, -1.47])
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close(%)`
|
||||
|
||||
await expect(page.locator('.cm-content')).toHaveText(result.regExp)
|
||||
@ -585,6 +585,6 @@ extrude001 = extrude(5 + 7, sketch001)`
|
||||
await page.getByRole('button', { name: 'checkmark Submit command' }).click()
|
||||
|
||||
const result2 = result.genNext`
|
||||
const sketch002 = extrude(${[5, 5]} + 7, sketch002)`
|
||||
const sketch002 = extrude(sketch002, length = ${[5, 5]} + 7)`
|
||||
await expect(page.locator('.cm-content')).toHaveText(result2.regExp)
|
||||
})
|
||||
|
Reference in New Issue
Block a user