Add skipWin to a large set of playwright tests (#5254)
* WIP: disable more tests * Fix lint and add 2 windows skips * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Two more skips on win * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * More skips * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * More skips * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * More skips * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * One more skip * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * More skips * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Replace many win32 skips with tag @skipWin * More clean upp --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
		@ -144,7 +144,7 @@ async function doBasicSketch(
 | 
				
			|||||||
  |> xLine(-segLen(seg01), %)`)
 | 
					  |> xLine(-segLen(seg01), %)`)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test.describe('Basic sketch', () => {
 | 
					test.describe('Basic sketch', { tag: ['@skipWin'] }, () => {
 | 
				
			||||||
  test.fixme('code pane open at start', async ({ page, homePage }) => {
 | 
					  test.fixme('code pane open at start', async ({ page, homePage }) => {
 | 
				
			||||||
    await doBasicSketch(page, homePage, ['code'])
 | 
					    await doBasicSketch(page, homePage, ['code'])
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
 | 
				
			|||||||
@ -4,7 +4,10 @@ import { getUtils } from './test-utils'
 | 
				
			|||||||
import { EngineCommand } from 'lang/std/artifactGraph'
 | 
					import { EngineCommand } from 'lang/std/artifactGraph'
 | 
				
			||||||
import { uuidv4 } from 'lib/utils'
 | 
					import { uuidv4 } from 'lib/utils'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test.describe('Can create sketches on all planes and their back sides', () => {
 | 
					test.describe(
 | 
				
			||||||
 | 
					  'Can create sketches on all planes and their back sides',
 | 
				
			||||||
 | 
					  { tag: ['@skipWin'] },
 | 
				
			||||||
 | 
					  () => {
 | 
				
			||||||
    const sketchOnPlaneAndBackSideTest = async (
 | 
					    const sketchOnPlaneAndBackSideTest = async (
 | 
				
			||||||
      page: Page,
 | 
					      page: Page,
 | 
				
			||||||
      homePage: HomePageFixture,
 | 
					      homePage: HomePageFixture,
 | 
				
			||||||
@ -88,11 +91,17 @@ test.describe('Can create sketches on all planes and their back sides', () => {
 | 
				
			|||||||
    })
 | 
					    })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    test('YZ', async ({ page, homePage }) => {
 | 
					    test('YZ', async ({ page, homePage }) => {
 | 
				
			||||||
    await sketchOnPlaneAndBackSideTest(page, homePage, 'YZ', { x: 700, y: 250 }) // green plane
 | 
					      await sketchOnPlaneAndBackSideTest(page, homePage, 'YZ', {
 | 
				
			||||||
 | 
					        x: 700,
 | 
				
			||||||
 | 
					        y: 250,
 | 
				
			||||||
 | 
					      }) // green plane
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    test('XZ', async ({ page, homePage }) => {
 | 
					    test('XZ', async ({ page, homePage }) => {
 | 
				
			||||||
    await sketchOnPlaneAndBackSideTest(page, homePage, '-XZ', { x: 700, y: 80 }) // blue plane
 | 
					      await sketchOnPlaneAndBackSideTest(page, homePage, '-XZ', {
 | 
				
			||||||
 | 
					        x: 700,
 | 
				
			||||||
 | 
					        y: 80,
 | 
				
			||||||
 | 
					      }) // blue plane
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    test('-XY', async ({ page, homePage }) => {
 | 
					    test('-XY', async ({ page, homePage }) => {
 | 
				
			||||||
@ -110,6 +119,10 @@ test.describe('Can create sketches on all planes and their back sides', () => {
 | 
				
			|||||||
    })
 | 
					    })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    test('-XZ', async ({ page, homePage }) => {
 | 
					    test('-XZ', async ({ page, homePage }) => {
 | 
				
			||||||
    await sketchOnPlaneAndBackSideTest(page, homePage, 'XZ', { x: 700, y: 427 }) // back of blue plane
 | 
					      await sketchOnPlaneAndBackSideTest(page, homePage, 'XZ', {
 | 
				
			||||||
 | 
					        x: 700,
 | 
				
			||||||
 | 
					        y: 427,
 | 
				
			||||||
 | 
					      }) // back of blue plane
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
})
 | 
					  }
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
				
			|||||||
@ -6,7 +6,7 @@ import { bracket } from 'lib/exampleKcl'
 | 
				
			|||||||
import { TEST_CODE_LONG_WITH_ERROR_OUT_OF_VIEW } from './storageStates'
 | 
					import { TEST_CODE_LONG_WITH_ERROR_OUT_OF_VIEW } from './storageStates'
 | 
				
			||||||
import fsp from 'fs/promises'
 | 
					import fsp from 'fs/promises'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test.describe('Code pane and errors', () => {
 | 
					test.describe('Code pane and errors', { tag: ['@skipWin'] }, () => {
 | 
				
			||||||
  test('Typing KCL errors induces a badge on the code pane button', async ({
 | 
					  test('Typing KCL errors induces a badge on the code pane button', async ({
 | 
				
			||||||
    page,
 | 
					    page,
 | 
				
			||||||
    homePage,
 | 
					    homePage,
 | 
				
			||||||
 | 
				
			|||||||
@ -4,7 +4,7 @@ import { executorInputPath, getUtils } from './test-utils'
 | 
				
			|||||||
import { KCL_DEFAULT_LENGTH } from 'lib/constants'
 | 
					import { KCL_DEFAULT_LENGTH } from 'lib/constants'
 | 
				
			||||||
import path from 'path'
 | 
					import path from 'path'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test.describe('Command bar tests', () => {
 | 
					test.describe('Command bar tests', { tag: ['@skipWin'] }, () => {
 | 
				
			||||||
  test('Extrude from command bar selects extrude line after', async ({
 | 
					  test('Extrude from command bar selects extrude line after', async ({
 | 
				
			||||||
    page,
 | 
					    page,
 | 
				
			||||||
    homePage,
 | 
					    homePage,
 | 
				
			||||||
 | 
				
			|||||||
@ -10,7 +10,7 @@ import {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import { join } from 'path'
 | 
					import { join } from 'path'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test.describe('Editor tests', () => {
 | 
					test.describe('Editor tests', { tag: ['@skipWin'] }, () => {
 | 
				
			||||||
  test('can comment out code with ctrl+/', async ({ page, homePage }) => {
 | 
					  test('can comment out code with ctrl+/', async ({ page, homePage }) => {
 | 
				
			||||||
    const u = await getUtils(page)
 | 
					    const u = await getUtils(page)
 | 
				
			||||||
    await page.setBodyDimensions({ width: 1000, height: 500 })
 | 
					    await page.setBodyDimensions({ width: 1000, height: 500 })
 | 
				
			||||||
 | 
				
			|||||||
@ -8,16 +8,15 @@ import { getUtils } from './test-utils'
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// test file is for testing point an click code gen functionality that's not sketch mode related
 | 
					// test file is for testing point an click code gen functionality that's not sketch mode related
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test('verify extruding circle works', async ({
 | 
					test.describe('Point-and-click tests', { tag: ['@skipWin'] }, () => {
 | 
				
			||||||
 | 
					  test('verify extruding circle works', async ({
 | 
				
			||||||
    context,
 | 
					    context,
 | 
				
			||||||
    homePage,
 | 
					    homePage,
 | 
				
			||||||
    cmdBar,
 | 
					    cmdBar,
 | 
				
			||||||
    editor,
 | 
					    editor,
 | 
				
			||||||
    toolbar,
 | 
					    toolbar,
 | 
				
			||||||
    scene,
 | 
					    scene,
 | 
				
			||||||
}) => {
 | 
					  }) => {
 | 
				
			||||||
  // TODO: fix this test on windows after the electron migration
 | 
					 | 
				
			||||||
  test.skip(process.platform === 'win32', 'Skip on windows')
 | 
					 | 
				
			||||||
    const file = await fs.readFile(
 | 
					    const file = await fs.readFile(
 | 
				
			||||||
      path.resolve(
 | 
					      path.resolve(
 | 
				
			||||||
        __dirname,
 | 
					        __dirname,
 | 
				
			||||||
@ -94,11 +93,9 @@ test('verify extruding circle works', async ({
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      await editor.expectEditor.toContain(expectString)
 | 
					      await editor.expectEditor.toContain(expectString)
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
})
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test.describe('verify sketch on chamfer works', () => {
 | 
					  test.describe('verify sketch on chamfer works', () => {
 | 
				
			||||||
  // TODO: fix this test on windows after the electron migration
 | 
					 | 
				
			||||||
  test.skip(process.platform === 'win32', 'Skip on windows')
 | 
					 | 
				
			||||||
    const _sketchOnAChamfer =
 | 
					    const _sketchOnAChamfer =
 | 
				
			||||||
      (
 | 
					      (
 | 
				
			||||||
        page: Page,
 | 
					        page: Page,
 | 
				
			||||||
@ -217,7 +214,8 @@ test.describe('verify sketch on chamfer works', () => {
 | 
				
			|||||||
      getOppositeEdge(seg01)
 | 
					      getOppositeEdge(seg01)
 | 
				
			||||||
    ]}, %)`,
 | 
					    ]}, %)`,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      afterChamferSelectSnippet: 'sketch002 = startSketchOn(extrude001, seg03)',
 | 
					        afterChamferSelectSnippet:
 | 
				
			||||||
 | 
					          'sketch002 = startSketchOn(extrude001, seg03)',
 | 
				
			||||||
        afterRectangle1stClickSnippet: 'startProfileAt([205.96, 254.59], %)',
 | 
					        afterRectangle1stClickSnippet: 'startProfileAt([205.96, 254.59], %)',
 | 
				
			||||||
        afterRectangle2ndClickSnippet: `angledLine([0, 11.39], %, $rectangleSegmentA002)
 | 
					        afterRectangle2ndClickSnippet: `angledLine([0, 11.39], %, $rectangleSegmentA002)
 | 
				
			||||||
    |> angledLine([
 | 
					    |> angledLine([
 | 
				
			||||||
@ -248,7 +246,8 @@ test.describe('verify sketch on chamfer works', () => {
 | 
				
			|||||||
         ]
 | 
					         ]
 | 
				
			||||||
       }, %)`,
 | 
					       }, %)`,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      afterChamferSelectSnippet: 'sketch003 = startSketchOn(extrude001, seg04)',
 | 
					        afterChamferSelectSnippet:
 | 
				
			||||||
 | 
					          'sketch003 = startSketchOn(extrude001, seg04)',
 | 
				
			||||||
        afterRectangle1stClickSnippet: 'startProfileAt([-209.64, 255.28], %)',
 | 
					        afterRectangle1stClickSnippet: 'startProfileAt([-209.64, 255.28], %)',
 | 
				
			||||||
        afterRectangle2ndClickSnippet: `angledLine([0, 11.56], %, $rectangleSegmentA003)
 | 
					        afterRectangle2ndClickSnippet: `angledLine([0, 11.56], %, $rectangleSegmentA003)
 | 
				
			||||||
    |> angledLine([
 | 
					    |> angledLine([
 | 
				
			||||||
@ -273,7 +272,8 @@ test.describe('verify sketch on chamfer works', () => {
 | 
				
			|||||||
           getNextAdjacentEdge(seg02)
 | 
					           getNextAdjacentEdge(seg02)
 | 
				
			||||||
         ]
 | 
					         ]
 | 
				
			||||||
       }, %)`,
 | 
					       }, %)`,
 | 
				
			||||||
      afterChamferSelectSnippet: 'sketch003 = startSketchOn(extrude001, seg04)',
 | 
					        afterChamferSelectSnippet:
 | 
				
			||||||
 | 
					          'sketch003 = startSketchOn(extrude001, seg04)',
 | 
				
			||||||
        afterRectangle1stClickSnippet: 'startProfileAt([75.8, 317.2], %)',
 | 
					        afterRectangle1stClickSnippet: 'startProfileAt([75.8, 317.2], %)',
 | 
				
			||||||
        afterRectangle2ndClickSnippet: `angledLine([0, 11.56], %, $rectangleSegmentA003)
 | 
					        afterRectangle2ndClickSnippet: `angledLine([0, 11.56], %, $rectangleSegmentA003)
 | 
				
			||||||
    |> angledLine([
 | 
					    |> angledLine([
 | 
				
			||||||
@ -296,7 +296,8 @@ test.describe('verify sketch on chamfer works', () => {
 | 
				
			|||||||
         length = 30,
 | 
					         length = 30,
 | 
				
			||||||
         tags = [getNextAdjacentEdge(yo)]
 | 
					         tags = [getNextAdjacentEdge(yo)]
 | 
				
			||||||
       }, %)`,
 | 
					       }, %)`,
 | 
				
			||||||
      afterChamferSelectSnippet: 'sketch005 = startSketchOn(extrude001, seg06)',
 | 
					        afterChamferSelectSnippet:
 | 
				
			||||||
 | 
					          'sketch005 = startSketchOn(extrude001, seg06)',
 | 
				
			||||||
        afterRectangle1stClickSnippet: 'startProfileAt([-23.43, 19.69], %)',
 | 
					        afterRectangle1stClickSnippet: 'startProfileAt([-23.43, 19.69], %)',
 | 
				
			||||||
        afterRectangle2ndClickSnippet: `angledLine([0, 9.1], %, $rectangleSegmentA005)
 | 
					        afterRectangle2ndClickSnippet: `angledLine([0, 9.1], %, $rectangleSegmentA005)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -436,7 +437,8 @@ test.describe('verify sketch on chamfer works', () => {
 | 
				
			|||||||
      getOppositeEdge(seg01)
 | 
					      getOppositeEdge(seg01)
 | 
				
			||||||
    ]}, extrude001)`,
 | 
					    ]}, extrude001)`,
 | 
				
			||||||
        beforeChamferSnippetEnd: '}, extrude001)',
 | 
					        beforeChamferSnippetEnd: '}, extrude001)',
 | 
				
			||||||
      afterChamferSelectSnippet: 'sketch002 = startSketchOn(extrude001, seg03)',
 | 
					        afterChamferSelectSnippet:
 | 
				
			||||||
 | 
					          'sketch002 = startSketchOn(extrude001, seg03)',
 | 
				
			||||||
        afterRectangle1stClickSnippet: 'startProfileAt([205.96, 254.59], %)',
 | 
					        afterRectangle1stClickSnippet: 'startProfileAt([205.96, 254.59], %)',
 | 
				
			||||||
        afterRectangle2ndClickSnippet: `angledLine([0, 11.39], %, $rectangleSegmentA002)
 | 
					        afterRectangle2ndClickSnippet: `angledLine([0, 11.39], %, $rectangleSegmentA002)
 | 
				
			||||||
    |> angledLine([
 | 
					    |> angledLine([
 | 
				
			||||||
@ -494,15 +496,15 @@ sketch002 = startSketchOn(extrude001, seg03)
 | 
				
			|||||||
        { shouldNormalise: true }
 | 
					        { shouldNormalise: true }
 | 
				
			||||||
      )
 | 
					      )
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
})
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test(`Verify axis, origin, and horizontal snapping`, async ({
 | 
					  test(`Verify axis, origin, and horizontal snapping`, async ({
 | 
				
			||||||
    page,
 | 
					    page,
 | 
				
			||||||
    homePage,
 | 
					    homePage,
 | 
				
			||||||
    editor,
 | 
					    editor,
 | 
				
			||||||
    toolbar,
 | 
					    toolbar,
 | 
				
			||||||
    scene,
 | 
					    scene,
 | 
				
			||||||
}) => {
 | 
					  }) => {
 | 
				
			||||||
    const viewPortSize = { width: 1200, height: 500 }
 | 
					    const viewPortSize = { width: 1200, height: 500 }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    await page.setBodyDimensions(viewPortSize)
 | 
					    await page.setBodyDimensions(viewPortSize)
 | 
				
			||||||
@ -599,16 +601,16 @@ test(`Verify axis, origin, and horizontal snapping`, async ({
 | 
				
			|||||||
        expectedCodeSnippets.afterSegmentDraggedOnYAxis
 | 
					        expectedCodeSnippets.afterSegmentDraggedOnYAxis
 | 
				
			||||||
      )
 | 
					      )
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
})
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test(`Verify user can double-click to edit a sketch`, async ({
 | 
					  test(`Verify user can double-click to edit a sketch`, async ({
 | 
				
			||||||
    context,
 | 
					    context,
 | 
				
			||||||
    page,
 | 
					    page,
 | 
				
			||||||
    homePage,
 | 
					    homePage,
 | 
				
			||||||
    editor,
 | 
					    editor,
 | 
				
			||||||
    toolbar,
 | 
					    toolbar,
 | 
				
			||||||
    scene,
 | 
					    scene,
 | 
				
			||||||
}) => {
 | 
					  }) => {
 | 
				
			||||||
    const u = await getUtils(page)
 | 
					    const u = await getUtils(page)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const initialCode = `closedSketch = startSketchOn('XZ')
 | 
					    const initialCode = `closedSketch = startSketchOn('XZ')
 | 
				
			||||||
@ -690,7 +692,11 @@ openSketch = startSketchOn('XY')
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    await test.step(`Double-click on the open sketch`, async () => {
 | 
					    await test.step(`Double-click on the open sketch`, async () => {
 | 
				
			||||||
      await moveToOpenPath()
 | 
					      await moveToOpenPath()
 | 
				
			||||||
    await scene.expectPixelColor([250, 250, 250], pointOnPathAfterSketching, 15)
 | 
					      await scene.expectPixelColor(
 | 
				
			||||||
 | 
					        [250, 250, 250],
 | 
				
			||||||
 | 
					        pointOnPathAfterSketching,
 | 
				
			||||||
 | 
					        15
 | 
				
			||||||
 | 
					      )
 | 
				
			||||||
      // There is a full execution after exiting sketch that clears the scene.
 | 
					      // There is a full execution after exiting sketch that clears the scene.
 | 
				
			||||||
      await page.waitForTimeout(500)
 | 
					      await page.waitForTimeout(500)
 | 
				
			||||||
      await dblClickOpenPath()
 | 
					      await dblClickOpenPath()
 | 
				
			||||||
@ -704,9 +710,9 @@ openSketch = startSketchOn('XY')
 | 
				
			|||||||
        diagnostics: [],
 | 
					        diagnostics: [],
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
})
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test(`Offset plane point-and-click`, async ({
 | 
					  test(`Offset plane point-and-click`, async ({
 | 
				
			||||||
    context,
 | 
					    context,
 | 
				
			||||||
    page,
 | 
					    page,
 | 
				
			||||||
    homePage,
 | 
					    homePage,
 | 
				
			||||||
@ -714,7 +720,7 @@ test(`Offset plane point-and-click`, async ({
 | 
				
			|||||||
    editor,
 | 
					    editor,
 | 
				
			||||||
    toolbar,
 | 
					    toolbar,
 | 
				
			||||||
    cmdBar,
 | 
					    cmdBar,
 | 
				
			||||||
}) => {
 | 
					  }) => {
 | 
				
			||||||
    // One dumb hardcoded screen pixel value
 | 
					    // One dumb hardcoded screen pixel value
 | 
				
			||||||
    const testPoint = { x: 700, y: 150 }
 | 
					    const testPoint = { x: 700, y: 150 }
 | 
				
			||||||
    const [clickOnXzPlane] = scene.makeMouseHelpers(testPoint.x, testPoint.y)
 | 
					    const [clickOnXzPlane] = scene.makeMouseHelpers(testPoint.x, testPoint.y)
 | 
				
			||||||
@ -767,13 +773,13 @@ test(`Offset plane point-and-click`, async ({
 | 
				
			|||||||
      await page.keyboard.press('Backspace')
 | 
					      await page.keyboard.press('Backspace')
 | 
				
			||||||
      await scene.expectPixelColor([50, 51, 96], testPoint, 15)
 | 
					      await scene.expectPixelColor([50, 51, 96], testPoint, 15)
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
})
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const loftPointAndClickCases = [
 | 
					  const loftPointAndClickCases = [
 | 
				
			||||||
    { shouldPreselect: true },
 | 
					    { shouldPreselect: true },
 | 
				
			||||||
    { shouldPreselect: false },
 | 
					    { shouldPreselect: false },
 | 
				
			||||||
]
 | 
					  ]
 | 
				
			||||||
loftPointAndClickCases.forEach(({ shouldPreselect }) => {
 | 
					  loftPointAndClickCases.forEach(({ shouldPreselect }) => {
 | 
				
			||||||
    test(`Loft point-and-click (preselected sketches: ${shouldPreselect})`, async ({
 | 
					    test(`Loft point-and-click (preselected sketches: ${shouldPreselect})`, async ({
 | 
				
			||||||
      context,
 | 
					      context,
 | 
				
			||||||
      page,
 | 
					      page,
 | 
				
			||||||
@ -859,16 +865,16 @@ loftPointAndClickCases.forEach(({ shouldPreselect }) => {
 | 
				
			|||||||
        await scene.expectPixelColor([254, 254, 254], testPoint, 15)
 | 
					        await scene.expectPixelColor([254, 254, 254], testPoint, 15)
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
})
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// TODO: merge with above test. Right now we're not able to delete a loft
 | 
					  // TODO: merge with above test. Right now we're not able to delete a loft
 | 
				
			||||||
// right after creation via selection for some reason, so we go with a new instance
 | 
					  // right after creation via selection for some reason, so we go with a new instance
 | 
				
			||||||
test('Loft and offset plane deletion via selection', async ({
 | 
					  test('Loft and offset plane deletion via selection', async ({
 | 
				
			||||||
    context,
 | 
					    context,
 | 
				
			||||||
    page,
 | 
					    page,
 | 
				
			||||||
    homePage,
 | 
					    homePage,
 | 
				
			||||||
    scene,
 | 
					    scene,
 | 
				
			||||||
}) => {
 | 
					  }) => {
 | 
				
			||||||
    const initialCode = `sketch001 = startSketchOn('XZ')
 | 
					    const initialCode = `sketch001 = startSketchOn('XZ')
 | 
				
			||||||
  |> circle({ center = [0, 0], radius = 30 }, %)
 | 
					  |> circle({ center = [0, 0], radius = 30 }, %)
 | 
				
			||||||
  plane001 = offsetPlane('XZ', 50)
 | 
					  plane001 = offsetPlane('XZ', 50)
 | 
				
			||||||
@ -885,7 +891,10 @@ loft001 = loft([sketch001, sketch002])
 | 
				
			|||||||
    // One dumb hardcoded screen pixel value
 | 
					    // One dumb hardcoded screen pixel value
 | 
				
			||||||
    const testPoint = { x: 575, y: 200 }
 | 
					    const testPoint = { x: 575, y: 200 }
 | 
				
			||||||
    const [clickOnSketch1] = scene.makeMouseHelpers(testPoint.x, testPoint.y)
 | 
					    const [clickOnSketch1] = scene.makeMouseHelpers(testPoint.x, testPoint.y)
 | 
				
			||||||
  const [clickOnSketch2] = scene.makeMouseHelpers(testPoint.x, testPoint.y + 80)
 | 
					    const [clickOnSketch2] = scene.makeMouseHelpers(
 | 
				
			||||||
 | 
					      testPoint.x,
 | 
				
			||||||
 | 
					      testPoint.y + 80
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    await test.step(`Delete loft`, async () => {
 | 
					    await test.step(`Delete loft`, async () => {
 | 
				
			||||||
      // Check for loft
 | 
					      // Check for loft
 | 
				
			||||||
@ -920,9 +929,9 @@ loft001 = loft([sketch001, sketch002])
 | 
				
			|||||||
      // Check for sketch 1
 | 
					      // Check for sketch 1
 | 
				
			||||||
      await scene.expectPixelColor([254, 254, 254], testPoint, 15)
 | 
					      await scene.expectPixelColor([254, 254, 254], testPoint, 15)
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
})
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test(`Sweep point-and-click`, async ({
 | 
					  test(`Sweep point-and-click`, async ({
 | 
				
			||||||
    context,
 | 
					    context,
 | 
				
			||||||
    page,
 | 
					    page,
 | 
				
			||||||
    homePage,
 | 
					    homePage,
 | 
				
			||||||
@ -930,7 +939,7 @@ test(`Sweep point-and-click`, async ({
 | 
				
			|||||||
    editor,
 | 
					    editor,
 | 
				
			||||||
    toolbar,
 | 
					    toolbar,
 | 
				
			||||||
    cmdBar,
 | 
					    cmdBar,
 | 
				
			||||||
}) => {
 | 
					  }) => {
 | 
				
			||||||
    const initialCode = `sketch001 = startSketchOn('YZ')
 | 
					    const initialCode = `sketch001 = startSketchOn('YZ')
 | 
				
			||||||
  |> circle({
 | 
					  |> circle({
 | 
				
			||||||
       center = [0, 0],
 | 
					       center = [0, 0],
 | 
				
			||||||
@ -951,7 +960,10 @@ sketch002 = startSketchOn('XZ')
 | 
				
			|||||||
    // One dumb hardcoded screen pixel value
 | 
					    // One dumb hardcoded screen pixel value
 | 
				
			||||||
    const testPoint = { x: 700, y: 250 }
 | 
					    const testPoint = { x: 700, y: 250 }
 | 
				
			||||||
    const [clickOnSketch1] = scene.makeMouseHelpers(testPoint.x, testPoint.y)
 | 
					    const [clickOnSketch1] = scene.makeMouseHelpers(testPoint.x, testPoint.y)
 | 
				
			||||||
  const [clickOnSketch2] = scene.makeMouseHelpers(testPoint.x - 50, testPoint.y)
 | 
					    const [clickOnSketch2] = scene.makeMouseHelpers(
 | 
				
			||||||
 | 
					      testPoint.x - 50,
 | 
				
			||||||
 | 
					      testPoint.y
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
    const sweepDeclaration = 'sweep001 = sweep({ path = sketch002 }, sketch001)'
 | 
					    const sweepDeclaration = 'sweep001 = sweep({ path = sketch002 }, sketch001)'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    await test.step(`Look for sketch001`, async () => {
 | 
					    await test.step(`Look for sketch001`, async () => {
 | 
				
			||||||
@ -1012,16 +1024,16 @@ sketch002 = startSketchOn('XZ')
 | 
				
			|||||||
      await toolbar.closePane('feature-tree')
 | 
					      await toolbar.closePane('feature-tree')
 | 
				
			||||||
      await scene.expectPixelColor([53, 53, 53], testPoint, 15)
 | 
					      await scene.expectPixelColor([53, 53, 53], testPoint, 15)
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
})
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test(`Sweep point-and-click failing validation`, async ({
 | 
					  test(`Sweep point-and-click failing validation`, async ({
 | 
				
			||||||
    context,
 | 
					    context,
 | 
				
			||||||
    page,
 | 
					    page,
 | 
				
			||||||
    homePage,
 | 
					    homePage,
 | 
				
			||||||
    scene,
 | 
					    scene,
 | 
				
			||||||
    toolbar,
 | 
					    toolbar,
 | 
				
			||||||
    cmdBar,
 | 
					    cmdBar,
 | 
				
			||||||
}) => {
 | 
					  }) => {
 | 
				
			||||||
    const initialCode = `sketch001 = startSketchOn('YZ')
 | 
					    const initialCode = `sketch001 = startSketchOn('YZ')
 | 
				
			||||||
  |> circle({
 | 
					  |> circle({
 | 
				
			||||||
       center = [0, 0],
 | 
					       center = [0, 0],
 | 
				
			||||||
@ -1042,7 +1054,10 @@ sketch002 = startSketchOn('XZ')
 | 
				
			|||||||
    // One dumb hardcoded screen pixel value
 | 
					    // One dumb hardcoded screen pixel value
 | 
				
			||||||
    const testPoint = { x: 700, y: 250 }
 | 
					    const testPoint = { x: 700, y: 250 }
 | 
				
			||||||
    const [clickOnSketch1] = scene.makeMouseHelpers(testPoint.x, testPoint.y)
 | 
					    const [clickOnSketch1] = scene.makeMouseHelpers(testPoint.x, testPoint.y)
 | 
				
			||||||
  const [clickOnSketch2] = scene.makeMouseHelpers(testPoint.x - 50, testPoint.y)
 | 
					    const [clickOnSketch2] = scene.makeMouseHelpers(
 | 
				
			||||||
 | 
					      testPoint.x - 50,
 | 
				
			||||||
 | 
					      testPoint.y
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    await test.step(`Look for sketch001`, async () => {
 | 
					    await test.step(`Look for sketch001`, async () => {
 | 
				
			||||||
      await toolbar.closePane('code')
 | 
					      await toolbar.closePane('code')
 | 
				
			||||||
@ -1081,9 +1096,9 @@ sketch002 = startSketchOn('XZ')
 | 
				
			|||||||
        page.getByText('Unable to sweep with the current selection. Reason:')
 | 
					        page.getByText('Unable to sweep with the current selection. Reason:')
 | 
				
			||||||
      ).toBeVisible()
 | 
					      ).toBeVisible()
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
})
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test(`Fillet point-and-click`, async ({
 | 
					  test(`Fillet point-and-click`, async ({
 | 
				
			||||||
    context,
 | 
					    context,
 | 
				
			||||||
    page,
 | 
					    page,
 | 
				
			||||||
    homePage,
 | 
					    homePage,
 | 
				
			||||||
@ -1091,7 +1106,7 @@ test(`Fillet point-and-click`, async ({
 | 
				
			|||||||
    editor,
 | 
					    editor,
 | 
				
			||||||
    toolbar,
 | 
					    toolbar,
 | 
				
			||||||
    cmdBar,
 | 
					    cmdBar,
 | 
				
			||||||
}) => {
 | 
					  }) => {
 | 
				
			||||||
    // Code samples
 | 
					    // Code samples
 | 
				
			||||||
    const initialCode = `sketch001 = startSketchOn('XY')
 | 
					    const initialCode = `sketch001 = startSketchOn('XY')
 | 
				
			||||||
  |> startProfileAt([-12, -6], %)
 | 
					  |> startProfileAt([-12, -6], %)
 | 
				
			||||||
@ -1305,7 +1320,10 @@ extrude001 = extrude(sketch001, length = -12)
 | 
				
			|||||||
      })
 | 
					      })
 | 
				
			||||||
      await test.step('Delete fillet via feature tree selection', async () => {
 | 
					      await test.step('Delete fillet via feature tree selection', async () => {
 | 
				
			||||||
        await editor.expectEditor.toContain(secondFilletDeclaration)
 | 
					        await editor.expectEditor.toContain(secondFilletDeclaration)
 | 
				
			||||||
      const operationButton = await toolbar.getFeatureTreeOperation('Fillet', 1)
 | 
					        const operationButton = await toolbar.getFeatureTreeOperation(
 | 
				
			||||||
 | 
					          'Fillet',
 | 
				
			||||||
 | 
					          1
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
        await operationButton.click({ button: 'left' })
 | 
					        await operationButton.click({ button: 'left' })
 | 
				
			||||||
        await page.keyboard.press('Backspace')
 | 
					        await page.keyboard.press('Backspace')
 | 
				
			||||||
        await page.waitForTimeout(500)
 | 
					        await page.waitForTimeout(500)
 | 
				
			||||||
@ -1314,16 +1332,16 @@ extrude001 = extrude(sketch001, length = -12)
 | 
				
			|||||||
        await scene.expectPixelColor(filletColor, firstEdgeLocation, 15) // stayed
 | 
					        await scene.expectPixelColor(filletColor, firstEdgeLocation, 15) // stayed
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
})
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test(`Fillet point-and-click delete`, async ({
 | 
					  test(`Fillet point-and-click delete`, async ({
 | 
				
			||||||
    context,
 | 
					    context,
 | 
				
			||||||
    page,
 | 
					    page,
 | 
				
			||||||
    homePage,
 | 
					    homePage,
 | 
				
			||||||
    scene,
 | 
					    scene,
 | 
				
			||||||
    editor,
 | 
					    editor,
 | 
				
			||||||
    toolbar,
 | 
					    toolbar,
 | 
				
			||||||
}) => {
 | 
					  }) => {
 | 
				
			||||||
    // Code samples
 | 
					    // Code samples
 | 
				
			||||||
    const initialCode = `sketch001 = startSketchOn('XY')
 | 
					    const initialCode = `sketch001 = startSketchOn('XY')
 | 
				
			||||||
  |> startProfileAt([-12, -6], %)
 | 
					  |> startProfileAt([-12, -6], %)
 | 
				
			||||||
@ -1457,9 +1475,9 @@ fillet04 = fillet({  radius = 5,  tags = [getOppositeEdge(seg02)]}, extrude001)
 | 
				
			|||||||
        })
 | 
					        })
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
})
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test(`Chamfer point-and-click`, async ({
 | 
					  test(`Chamfer point-and-click`, async ({
 | 
				
			||||||
    context,
 | 
					    context,
 | 
				
			||||||
    page,
 | 
					    page,
 | 
				
			||||||
    homePage,
 | 
					    homePage,
 | 
				
			||||||
@ -1467,7 +1485,7 @@ test(`Chamfer point-and-click`, async ({
 | 
				
			|||||||
    editor,
 | 
					    editor,
 | 
				
			||||||
    toolbar,
 | 
					    toolbar,
 | 
				
			||||||
    cmdBar,
 | 
					    cmdBar,
 | 
				
			||||||
}) => {
 | 
					  }) => {
 | 
				
			||||||
    // Code samples
 | 
					    // Code samples
 | 
				
			||||||
    const initialCode = `sketch001 = startSketchOn('XY')
 | 
					    const initialCode = `sketch001 = startSketchOn('XY')
 | 
				
			||||||
  |> startProfileAt([-12, -6], %)
 | 
					  |> startProfileAt([-12, -6], %)
 | 
				
			||||||
@ -1586,7 +1604,11 @@ extrude001 = extrude(sketch001, length = -12)
 | 
				
			|||||||
    })
 | 
					    })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    await test.step(`Confirm scene has changed`, async () => {
 | 
					    await test.step(`Confirm scene has changed`, async () => {
 | 
				
			||||||
    await scene.expectPixelColor(chamferColor, firstEdgeLocation, lowTolerance)
 | 
					      await scene.expectPixelColor(
 | 
				
			||||||
 | 
					        chamferColor,
 | 
				
			||||||
 | 
					        firstEdgeLocation,
 | 
				
			||||||
 | 
					        lowTolerance
 | 
				
			||||||
 | 
					      )
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Test 2: Command bar flow without preselected edges
 | 
					    // Test 2: Command bar flow without preselected edges
 | 
				
			||||||
@ -1679,23 +1701,26 @@ extrude001 = extrude(sketch001, length = -12)
 | 
				
			|||||||
      await page.waitForTimeout(500)
 | 
					      await page.waitForTimeout(500)
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
    await test.step('Delete chamfer via feature tree selection', async () => {
 | 
					    await test.step('Delete chamfer via feature tree selection', async () => {
 | 
				
			||||||
    const operationButton = await toolbar.getFeatureTreeOperation('Chamfer', 1)
 | 
					      const operationButton = await toolbar.getFeatureTreeOperation(
 | 
				
			||||||
 | 
					        'Chamfer',
 | 
				
			||||||
 | 
					        1
 | 
				
			||||||
 | 
					      )
 | 
				
			||||||
      await operationButton.click({ button: 'left' })
 | 
					      await operationButton.click({ button: 'left' })
 | 
				
			||||||
      await page.keyboard.press('Backspace')
 | 
					      await page.keyboard.press('Backspace')
 | 
				
			||||||
      await page.waitForTimeout(500)
 | 
					      await page.waitForTimeout(500)
 | 
				
			||||||
      await scene.expectPixelColor(edgeColorWhite, secondEdgeLocation, 15) // deleted
 | 
					      await scene.expectPixelColor(edgeColorWhite, secondEdgeLocation, 15) // deleted
 | 
				
			||||||
      await scene.expectPixelColor(chamferColor, firstEdgeLocation, 15) // stayed
 | 
					      await scene.expectPixelColor(chamferColor, firstEdgeLocation, 15) // stayed
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
})
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test(`Chamfer point-and-click delete`, async ({
 | 
					  test(`Chamfer point-and-click delete`, async ({
 | 
				
			||||||
    context,
 | 
					    context,
 | 
				
			||||||
    page,
 | 
					    page,
 | 
				
			||||||
    homePage,
 | 
					    homePage,
 | 
				
			||||||
    scene,
 | 
					    scene,
 | 
				
			||||||
    editor,
 | 
					    editor,
 | 
				
			||||||
    toolbar,
 | 
					    toolbar,
 | 
				
			||||||
}) => {
 | 
					  }) => {
 | 
				
			||||||
    // Code samples
 | 
					    // Code samples
 | 
				
			||||||
    const initialCode = `sketch001 = startSketchOn('XY')
 | 
					    const initialCode = `sketch001 = startSketchOn('XY')
 | 
				
			||||||
  |> startProfileAt([-12, -6], %)
 | 
					  |> startProfileAt([-12, -6], %)
 | 
				
			||||||
@ -1762,7 +1787,9 @@ chamfer04 = chamfer({  length = 5,  tags = [getOppositeEdge(seg02)]}, extrude001
 | 
				
			|||||||
          await editor.expectEditor.toContain(pipedChamferDeclaration)
 | 
					          await editor.expectEditor.toContain(pipedChamferDeclaration)
 | 
				
			||||||
          await editor.expectEditor.toContain(secondPipedChamferDeclaration)
 | 
					          await editor.expectEditor.toContain(secondPipedChamferDeclaration)
 | 
				
			||||||
          await editor.expectEditor.toContain(standaloneChamferDeclaration)
 | 
					          await editor.expectEditor.toContain(standaloneChamferDeclaration)
 | 
				
			||||||
        await editor.expectEditor.toContain(secondStandaloneChamferDeclaration)
 | 
					          await editor.expectEditor.toContain(
 | 
				
			||||||
 | 
					            secondStandaloneChamferDeclaration
 | 
				
			||||||
 | 
					          )
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
        await test.step('Verify test chamfers are present in the scene', async () => {
 | 
					        await test.step('Verify test chamfers are present in the scene', async () => {
 | 
				
			||||||
          await scene.expectPixelColor(
 | 
					          await scene.expectPixelColor(
 | 
				
			||||||
@ -1789,7 +1816,9 @@ chamfer04 = chamfer({  length = 5,  tags = [getOppositeEdge(seg02)]}, extrude001
 | 
				
			|||||||
          await editor.expectEditor.not.toContain(pipedChamferDeclaration)
 | 
					          await editor.expectEditor.not.toContain(pipedChamferDeclaration)
 | 
				
			||||||
          await editor.expectEditor.toContain(secondPipedChamferDeclaration)
 | 
					          await editor.expectEditor.toContain(secondPipedChamferDeclaration)
 | 
				
			||||||
          await editor.expectEditor.toContain(standaloneChamferDeclaration)
 | 
					          await editor.expectEditor.toContain(standaloneChamferDeclaration)
 | 
				
			||||||
        await editor.expectEditor.toContain(secondStandaloneChamferDeclaration)
 | 
					          await editor.expectEditor.toContain(
 | 
				
			||||||
 | 
					            secondStandaloneChamferDeclaration
 | 
				
			||||||
 | 
					          )
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
        await test.step('Verify piped chamfer is deleted but non-piped is not (in the scene)', async () => {
 | 
					        await test.step('Verify piped chamfer is deleted but non-piped is not (in the scene)', async () => {
 | 
				
			||||||
          await scene.expectPixelColor(
 | 
					          await scene.expectPixelColor(
 | 
				
			||||||
@ -1818,7 +1847,9 @@ chamfer04 = chamfer({  length = 5,  tags = [getOppositeEdge(seg02)]}, extrude001
 | 
				
			|||||||
        await test.step('Verify non-piped chamfer is deleted but other two chamfers are not (in the editor)', async () => {
 | 
					        await test.step('Verify non-piped chamfer is deleted but other two chamfers are not (in the editor)', async () => {
 | 
				
			||||||
          await editor.expectEditor.toContain(secondPipedChamferDeclaration)
 | 
					          await editor.expectEditor.toContain(secondPipedChamferDeclaration)
 | 
				
			||||||
          await editor.expectEditor.not.toContain(standaloneChamferDeclaration)
 | 
					          await editor.expectEditor.not.toContain(standaloneChamferDeclaration)
 | 
				
			||||||
        await editor.expectEditor.toContain(secondStandaloneChamferDeclaration)
 | 
					          await editor.expectEditor.toContain(
 | 
				
			||||||
 | 
					            secondStandaloneChamferDeclaration
 | 
				
			||||||
 | 
					          )
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
        await test.step('Verify non-piped chamfer is deleted but piped is not (in the scene)', async () => {
 | 
					        await test.step('Verify non-piped chamfer is deleted but piped is not (in the scene)', async () => {
 | 
				
			||||||
          await scene.expectPixelColor(
 | 
					          await scene.expectPixelColor(
 | 
				
			||||||
@ -1829,13 +1860,13 @@ chamfer04 = chamfer({  length = 5,  tags = [getOppositeEdge(seg02)]}, extrude001
 | 
				
			|||||||
        })
 | 
					        })
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
})
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const shellPointAndClickCapCases = [
 | 
					  const shellPointAndClickCapCases = [
 | 
				
			||||||
    { shouldPreselect: true },
 | 
					    { shouldPreselect: true },
 | 
				
			||||||
    { shouldPreselect: false },
 | 
					    { shouldPreselect: false },
 | 
				
			||||||
]
 | 
					  ]
 | 
				
			||||||
shellPointAndClickCapCases.forEach(({ shouldPreselect }) => {
 | 
					  shellPointAndClickCapCases.forEach(({ shouldPreselect }) => {
 | 
				
			||||||
    test(`Shell point-and-click cap (preselected sketches: ${shouldPreselect})`, async ({
 | 
					    test(`Shell point-and-click cap (preselected sketches: ${shouldPreselect})`, async ({
 | 
				
			||||||
      context,
 | 
					      context,
 | 
				
			||||||
      page,
 | 
					      page,
 | 
				
			||||||
@ -1845,8 +1876,6 @@ shellPointAndClickCapCases.forEach(({ shouldPreselect }) => {
 | 
				
			|||||||
      toolbar,
 | 
					      toolbar,
 | 
				
			||||||
      cmdBar,
 | 
					      cmdBar,
 | 
				
			||||||
    }) => {
 | 
					    }) => {
 | 
				
			||||||
    // TODO: fix this test on windows after the electron migration
 | 
					 | 
				
			||||||
    test.skip(process.platform === 'win32', 'Skip on windows')
 | 
					 | 
				
			||||||
      const initialCode = `sketch001 = startSketchOn('XZ')
 | 
					      const initialCode = `sketch001 = startSketchOn('XZ')
 | 
				
			||||||
    |> circle({ center = [0, 0], radius = 30 }, %)
 | 
					    |> circle({ center = [0, 0], radius = 30 }, %)
 | 
				
			||||||
    extrude001 = extrude(sketch001, length = 30)
 | 
					    extrude001 = extrude(sketch001, length = 30)
 | 
				
			||||||
@ -1929,9 +1958,9 @@ shellPointAndClickCapCases.forEach(({ shouldPreselect }) => {
 | 
				
			|||||||
        await scene.expectPixelColor([146, 146, 146], testPoint, 15)
 | 
					        await scene.expectPixelColor([146, 146, 146], testPoint, 15)
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
})
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test('Shell point-and-click wall', async ({
 | 
					  test('Shell point-and-click wall', async ({
 | 
				
			||||||
    context,
 | 
					    context,
 | 
				
			||||||
    page,
 | 
					    page,
 | 
				
			||||||
    homePage,
 | 
					    homePage,
 | 
				
			||||||
@ -1939,7 +1968,7 @@ test('Shell point-and-click wall', async ({
 | 
				
			|||||||
    editor,
 | 
					    editor,
 | 
				
			||||||
    toolbar,
 | 
					    toolbar,
 | 
				
			||||||
    cmdBar,
 | 
					    cmdBar,
 | 
				
			||||||
}) => {
 | 
					  }) => {
 | 
				
			||||||
    const initialCode = `sketch001 = startSketchOn('XY')
 | 
					    const initialCode = `sketch001 = startSketchOn('XY')
 | 
				
			||||||
  |> startProfileAt([-20, 20], %)
 | 
					  |> startProfileAt([-20, 20], %)
 | 
				
			||||||
  |> xLine(40, %)
 | 
					  |> xLine(40, %)
 | 
				
			||||||
@ -2018,9 +2047,9 @@ extrude001 = extrude(sketch001, length = 40)
 | 
				
			|||||||
      await page.keyboard.press('Backspace')
 | 
					      await page.keyboard.press('Backspace')
 | 
				
			||||||
      await scene.expectPixelColor([99, 99, 99], testPoint, 15)
 | 
					      await scene.expectPixelColor([99, 99, 99], testPoint, 15)
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
})
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const shellSketchOnFacesCases = [
 | 
					  const shellSketchOnFacesCases = [
 | 
				
			||||||
    `sketch001 = startSketchOn('XZ')
 | 
					    `sketch001 = startSketchOn('XZ')
 | 
				
			||||||
  |> circle({ center = [0, 0], radius = 100 }, %)
 | 
					  |> circle({ center = [0, 0], radius = 100 }, %)
 | 
				
			||||||
  |> extrude(length = 100)
 | 
					  |> extrude(length = 100)
 | 
				
			||||||
@ -2037,8 +2066,8 @@ sketch002 = startSketchOn(extrude001, 'END')
 | 
				
			|||||||
  |> circle({ center = [0, 0], radius = 50 }, %)
 | 
					  |> circle({ center = [0, 0], radius = 50 }, %)
 | 
				
			||||||
extrude002 = extrude(sketch002, length = 50)
 | 
					extrude002 = extrude(sketch002, length = 50)
 | 
				
			||||||
  `,
 | 
					  `,
 | 
				
			||||||
]
 | 
					  ]
 | 
				
			||||||
shellSketchOnFacesCases.forEach((initialCode, index) => {
 | 
					  shellSketchOnFacesCases.forEach((initialCode, index) => {
 | 
				
			||||||
    const hasExtrudesInPipe = index === 0
 | 
					    const hasExtrudesInPipe = index === 0
 | 
				
			||||||
    test(`Shell point-and-click sketch on face (extrudes in pipes: ${hasExtrudesInPipe})`, async ({
 | 
					    test(`Shell point-and-click sketch on face (extrudes in pipes: ${hasExtrudesInPipe})`, async ({
 | 
				
			||||||
      context,
 | 
					      context,
 | 
				
			||||||
@ -2110,9 +2139,9 @@ shellSketchOnFacesCases.forEach((initialCode, index) => {
 | 
				
			|||||||
        await scene.expectPixelColor([73, 73, 73], testPoint, 15)
 | 
					        await scene.expectPixelColor([73, 73, 73], testPoint, 15)
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
})
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test(`Shell dry-run validation rejects sweeps`, async ({
 | 
					  test(`Shell dry-run validation rejects sweeps`, async ({
 | 
				
			||||||
    context,
 | 
					    context,
 | 
				
			||||||
    page,
 | 
					    page,
 | 
				
			||||||
    homePage,
 | 
					    homePage,
 | 
				
			||||||
@ -2120,7 +2149,7 @@ test(`Shell dry-run validation rejects sweeps`, async ({
 | 
				
			|||||||
    editor,
 | 
					    editor,
 | 
				
			||||||
    toolbar,
 | 
					    toolbar,
 | 
				
			||||||
    cmdBar,
 | 
					    cmdBar,
 | 
				
			||||||
}) => {
 | 
					  }) => {
 | 
				
			||||||
    const initialCode = `sketch001 = startSketchOn('YZ')
 | 
					    const initialCode = `sketch001 = startSketchOn('YZ')
 | 
				
			||||||
  |> circle({
 | 
					  |> circle({
 | 
				
			||||||
       center = [0, 0],
 | 
					       center = [0, 0],
 | 
				
			||||||
@ -2168,9 +2197,9 @@ sweep001 = sweep({ path = sketch002 }, sketch001)
 | 
				
			|||||||
      ).toBeVisible()
 | 
					      ).toBeVisible()
 | 
				
			||||||
      await page.waitForTimeout(1000)
 | 
					      await page.waitForTimeout(1000)
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
})
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test.describe('Revolve point and click workflows', () => {
 | 
					  test.describe('Revolve point and click workflows', () => {
 | 
				
			||||||
    test('Base case workflow, auto spam continue in command bar', async ({
 | 
					    test('Base case workflow, auto spam continue in command bar', async ({
 | 
				
			||||||
      context,
 | 
					      context,
 | 
				
			||||||
      page,
 | 
					      page,
 | 
				
			||||||
@ -2328,4 +2357,5 @@ radius = 8.69
 | 
				
			|||||||
      const newCodeToFind = `revolve001 = revolve({ angle = 360, axis = seg01 }, sketch003)`
 | 
					      const newCodeToFind = `revolve001 = revolve({ angle = 360, axis = seg01 }, sketch003)`
 | 
				
			||||||
      expect(editor.expectEditor.toContain(newCodeToFind)).toBeTruthy()
 | 
					      expect(editor.expectEditor.toContain(newCodeToFind)).toBeTruthy()
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
				
			|||||||
@ -134,7 +134,7 @@ test.fixme('Check the happy path, for basic changing color', () => {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test.describe('bad path', () => {
 | 
					test.describe('bad path', { tag: ['@skipWin'] }, () => {
 | 
				
			||||||
  test(`bad edit prompt`, async ({
 | 
					  test(`bad edit prompt`, async ({
 | 
				
			||||||
    context,
 | 
					    context,
 | 
				
			||||||
    homePage,
 | 
					    homePage,
 | 
				
			||||||
 | 
				
			|||||||
@ -5,7 +5,7 @@ import { getUtils, executorInputPath } from './test-utils'
 | 
				
			|||||||
import { TEST_CODE_TRIGGER_ENGINE_EXPORT_ERROR } from './storageStates'
 | 
					import { TEST_CODE_TRIGGER_ENGINE_EXPORT_ERROR } from './storageStates'
 | 
				
			||||||
import { bracket } from 'lib/exampleKcl'
 | 
					import { bracket } from 'lib/exampleKcl'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test.describe('Regression tests', () => {
 | 
					test.describe('Regression tests', { tag: ['@skipWin'] }, () => {
 | 
				
			||||||
  // bugs we found that don't fit neatly into other categories
 | 
					  // bugs we found that don't fit neatly into other categories
 | 
				
			||||||
  test('bad model has inline error #3251', async ({
 | 
					  test('bad model has inline error #3251', async ({
 | 
				
			||||||
    context,
 | 
					    context,
 | 
				
			||||||
@ -239,12 +239,6 @@ extrude001 = extrude(sketch001, length = 50)
 | 
				
			|||||||
    'Position _ Is Out Of Range... regression test',
 | 
					    'Position _ Is Out Of Range... regression test',
 | 
				
			||||||
    { tag: ['@skipWin'] },
 | 
					    { tag: ['@skipWin'] },
 | 
				
			||||||
    async ({ context, page, homePage }) => {
 | 
					    async ({ context, page, homePage }) => {
 | 
				
			||||||
      // SKip on windows, its being weird.
 | 
					 | 
				
			||||||
      test.skip(
 | 
					 | 
				
			||||||
        process.platform === 'win32',
 | 
					 | 
				
			||||||
        'This test is being weird on windows'
 | 
					 | 
				
			||||||
      )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      const u = await getUtils(page)
 | 
					      const u = await getUtils(page)
 | 
				
			||||||
      // const PUR = 400 / 37.5 //pixeltoUnitRatio
 | 
					      // const PUR = 400 / 37.5 //pixeltoUnitRatio
 | 
				
			||||||
      await page.setBodyDimensions({ width: 1200, height: 500 })
 | 
					      await page.setBodyDimensions({ width: 1200, height: 500 })
 | 
				
			||||||
@ -425,13 +419,6 @@ extrude001 = extrude(sketch001, length = 50)
 | 
				
			|||||||
    'ensure you can not export while an export is already going',
 | 
					    'ensure you can not export while an export is already going',
 | 
				
			||||||
    { tag: ['@skipLinux', '@skipWin'] },
 | 
					    { tag: ['@skipLinux', '@skipWin'] },
 | 
				
			||||||
    async ({ page, homePage }) => {
 | 
					    async ({ page, homePage }) => {
 | 
				
			||||||
      // This is being weird on ubuntu and windows.
 | 
					 | 
				
			||||||
      test.skip(
 | 
					 | 
				
			||||||
        // eslint-disable-next-line jest/valid-title
 | 
					 | 
				
			||||||
        process.platform === 'linux' || process.platform === 'win32',
 | 
					 | 
				
			||||||
        'This test is being weird on ubuntu'
 | 
					 | 
				
			||||||
      )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      const u = await getUtils(page)
 | 
					      const u = await getUtils(page)
 | 
				
			||||||
      await test.step('Set up the code and durations', async () => {
 | 
					      await test.step('Set up the code and durations', async () => {
 | 
				
			||||||
        await page.addInitScript(
 | 
					        await page.addInitScript(
 | 
				
			||||||
@ -560,8 +547,6 @@ extrude001 = extrude(sketch001, length = 50)
 | 
				
			|||||||
    page,
 | 
					    page,
 | 
				
			||||||
    homePage,
 | 
					    homePage,
 | 
				
			||||||
  }) => {
 | 
					  }) => {
 | 
				
			||||||
    // TODO: fix this test on windows after the electron migration
 | 
					 | 
				
			||||||
    test.skip(process.platform === 'win32', 'Skip on windows')
 | 
					 | 
				
			||||||
    const u = await getUtils(page)
 | 
					    const u = await getUtils(page)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Constants and locators
 | 
					    // Constants and locators
 | 
				
			||||||
 | 
				
			|||||||
@ -10,7 +10,7 @@ import {
 | 
				
			|||||||
} from './test-utils'
 | 
					} from './test-utils'
 | 
				
			||||||
import { uuidv4, roundOff } from 'lib/utils'
 | 
					import { uuidv4, roundOff } from 'lib/utils'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test.describe('Sketch tests', () => {
 | 
					test.describe('Sketch tests', { tag: ['@skipWin'] }, () => {
 | 
				
			||||||
  test('multi-sketch file shows multiple Edit Sketch buttons', async ({
 | 
					  test('multi-sketch file shows multiple Edit Sketch buttons', async ({
 | 
				
			||||||
    page,
 | 
					    page,
 | 
				
			||||||
    context,
 | 
					    context,
 | 
				
			||||||
@ -644,8 +644,6 @@ test.describe('Sketch tests', () => {
 | 
				
			|||||||
  |> revolve({ axis = "X" }, %)`)
 | 
					  |> revolve({ axis = "X" }, %)`)
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
  test('Can add multiple sketches', async ({ page, homePage }) => {
 | 
					  test('Can add multiple sketches', async ({ page, homePage }) => {
 | 
				
			||||||
    // TODO: fix this test on windows after the electron migration
 | 
					 | 
				
			||||||
    test.skip(process.platform === 'win32', 'Skip on windows')
 | 
					 | 
				
			||||||
    const u = await getUtils(page)
 | 
					    const u = await getUtils(page)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const viewportSize = { width: 1200, height: 500 }
 | 
					    const viewportSize = { width: 1200, height: 500 }
 | 
				
			||||||
@ -843,8 +841,6 @@ test.describe('Sketch tests', () => {
 | 
				
			|||||||
    page,
 | 
					    page,
 | 
				
			||||||
    homePage,
 | 
					    homePage,
 | 
				
			||||||
  }) => {
 | 
					  }) => {
 | 
				
			||||||
    // TODO: fix this test on windows after the electron migration
 | 
					 | 
				
			||||||
    test.skip(process.platform === 'win32', 'Skip on windows')
 | 
					 | 
				
			||||||
    // this was a regression https://github.com/KittyCAD/modeling-app/issues/2832
 | 
					    // this was a regression https://github.com/KittyCAD/modeling-app/issues/2832
 | 
				
			||||||
    await page.addInitScript(async () => {
 | 
					    await page.addInitScript(async () => {
 | 
				
			||||||
      localStorage.setItem(
 | 
					      localStorage.setItem(
 | 
				
			||||||
 | 
				
			|||||||
@ -55,13 +55,6 @@ test.skip(
 | 
				
			|||||||
  'exports of each format should work',
 | 
					  'exports of each format should work',
 | 
				
			||||||
  { tag: ['@snapshot', '@skipWin', '@skipMacos'] },
 | 
					  { tag: ['@snapshot', '@skipWin', '@skipMacos'] },
 | 
				
			||||||
  async ({ page, context }) => {
 | 
					  async ({ page, context }) => {
 | 
				
			||||||
    // skip on macos and windows.
 | 
					 | 
				
			||||||
    test.skip(
 | 
					 | 
				
			||||||
      // eslint-disable-next-line jest/valid-title
 | 
					 | 
				
			||||||
      process.platform === 'darwin' || process.platform === 'win32',
 | 
					 | 
				
			||||||
      'Skip on macos and windows'
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // FYI this test doesn't work with only engine running locally
 | 
					    // FYI this test doesn't work with only engine running locally
 | 
				
			||||||
    // And you will need to have the KittyCAD CLI installed
 | 
					    // And you will need to have the KittyCAD CLI installed
 | 
				
			||||||
    const u = await getUtils(page)
 | 
					    const u = await getUtils(page)
 | 
				
			||||||
 | 
				
			|||||||
@ -3,13 +3,8 @@ import { EngineCommand } from 'lang/std/artifactGraph'
 | 
				
			|||||||
import { uuidv4 } from 'lib/utils'
 | 
					import { uuidv4 } from 'lib/utils'
 | 
				
			||||||
import { getUtils } from './test-utils'
 | 
					import { getUtils } from './test-utils'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test.describe('Testing Camera Movement', () => {
 | 
					test.describe('Testing Camera Movement', { tag: ['@skipWin'] }, () => {
 | 
				
			||||||
  test('Can move camera reliably', async ({ page, context, homePage }) => {
 | 
					  test('Can move camera reliably', async ({ page, context, homePage }) => {
 | 
				
			||||||
    // TODO: fix this test on windows too after the electron migration
 | 
					 | 
				
			||||||
    const winOrMac =
 | 
					 | 
				
			||||||
      process.platform === 'win32' || process.platform === 'darwin'
 | 
					 | 
				
			||||||
    // eslint-disable-next-line
 | 
					 | 
				
			||||||
    test.skip(winOrMac, 'Skip on windows')
 | 
					 | 
				
			||||||
    const u = await getUtils(page)
 | 
					    const u = await getUtils(page)
 | 
				
			||||||
    await page.setBodyDimensions({ width: 1200, height: 500 })
 | 
					    await page.setBodyDimensions({ width: 1200, height: 500 })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -347,8 +342,6 @@ test.describe('Testing Camera Movement', () => {
 | 
				
			|||||||
    homePage,
 | 
					    homePage,
 | 
				
			||||||
    page,
 | 
					    page,
 | 
				
			||||||
  }) => {
 | 
					  }) => {
 | 
				
			||||||
    // TODO: fix this test on windows after the electron migration
 | 
					 | 
				
			||||||
    test.skip(process.platform === 'win32', 'Skip on windows')
 | 
					 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Currently we only allow zooming by scroll when no other camera movement is happening,
 | 
					     * Currently we only allow zooming by scroll when no other camera movement is happening,
 | 
				
			||||||
     * set within cameraMouseDragGuards in cameraControls.ts,
 | 
					     * set within cameraMouseDragGuards in cameraControls.ts,
 | 
				
			||||||
 | 
				
			|||||||
@ -9,7 +9,7 @@ import {
 | 
				
			|||||||
import { XOR } from 'lib/utils'
 | 
					import { XOR } from 'lib/utils'
 | 
				
			||||||
import path from 'node:path'
 | 
					import path from 'node:path'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test.describe('Testing constraints', () => {
 | 
					test.describe('Testing constraints', { tag: ['@skipWin'] }, () => {
 | 
				
			||||||
  test('Can constrain line length', async ({ page, homePage }) => {
 | 
					  test('Can constrain line length', async ({ page, homePage }) => {
 | 
				
			||||||
    await page.addInitScript(async () => {
 | 
					    await page.addInitScript(async () => {
 | 
				
			||||||
      localStorage.setItem(
 | 
					      localStorage.setItem(
 | 
				
			||||||
@ -129,8 +129,6 @@ test.describe('Testing constraints', () => {
 | 
				
			|||||||
    await expect(page.getByTestId('segment-overlay')).toHaveCount(4)
 | 
					    await expect(page.getByTestId('segment-overlay')).toHaveCount(4)
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
  test.describe('Test perpendicular distance constraint', () => {
 | 
					  test.describe('Test perpendicular distance constraint', () => {
 | 
				
			||||||
    // TODO: fix this test on windows after the electron migration
 | 
					 | 
				
			||||||
    test.skip(process.platform === 'win32', 'Skip on windows')
 | 
					 | 
				
			||||||
    const cases = [
 | 
					    const cases = [
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        testName: 'Add variable',
 | 
					        testName: 'Add variable',
 | 
				
			||||||
@ -251,8 +249,6 @@ test.describe('Testing constraints', () => {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
  test.describe('Test distance between constraint', () => {
 | 
					  test.describe('Test distance between constraint', () => {
 | 
				
			||||||
    // TODO: fix this test on windows after the electron migration
 | 
					 | 
				
			||||||
    test.skip(process.platform === 'win32', 'Skip on windows')
 | 
					 | 
				
			||||||
    const cases = [
 | 
					    const cases = [
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        testName: 'Add variable',
 | 
					        testName: 'Add variable',
 | 
				
			||||||
@ -472,8 +468,6 @@ test.describe('Testing constraints', () => {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
  test.describe('Test Angle constraint double segment selection', () => {
 | 
					  test.describe('Test Angle constraint double segment selection', () => {
 | 
				
			||||||
    // TODO: fix this test on windows after the electron migration
 | 
					 | 
				
			||||||
    test.skip(process.platform === 'win32', 'Skip on windows')
 | 
					 | 
				
			||||||
    const cases = [
 | 
					    const cases = [
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        testName: 'Add variable',
 | 
					        testName: 'Add variable',
 | 
				
			||||||
@ -664,8 +658,6 @@ test.describe('Testing constraints', () => {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
  test.describe('Test Length constraint single selection', () => {
 | 
					  test.describe('Test Length constraint single selection', () => {
 | 
				
			||||||
    // TODO: fix this test on windows after the electron migration
 | 
					 | 
				
			||||||
    test.skip(process.platform === 'win32', 'Skip on windows')
 | 
					 | 
				
			||||||
    const cases = [
 | 
					    const cases = [
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        testName: 'Length - Add variable',
 | 
					        testName: 'Length - Add variable',
 | 
				
			||||||
@ -851,8 +843,6 @@ part002 = startSketchOn('XZ')
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
  test.describe('Two segment - no modal constraints', () => {
 | 
					  test.describe('Two segment - no modal constraints', () => {
 | 
				
			||||||
    // TODO: fix this test on windows after the electron migration
 | 
					 | 
				
			||||||
    test.skip(process.platform === 'win32', 'Skip on windows')
 | 
					 | 
				
			||||||
    const cases = [
 | 
					    const cases = [
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        codeAfter: `|> angledLine([83, segLen(seg01)], %)`,
 | 
					        codeAfter: `|> angledLine([83, segLen(seg01)], %)`,
 | 
				
			||||||
 | 
				
			|||||||
@ -3,9 +3,7 @@ import { getUtils } from './test-utils'
 | 
				
			|||||||
import { uuidv4 } from 'lib/utils'
 | 
					import { uuidv4 } from 'lib/utils'
 | 
				
			||||||
import { TEST_CODE_GIZMO } from './storageStates'
 | 
					import { TEST_CODE_GIZMO } from './storageStates'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test.describe('Testing Gizmo', () => {
 | 
					test.describe('Testing Gizmo', { tag: ['@skipWin'] }, () => {
 | 
				
			||||||
  // TODO: fix this test on windows after the electron migration
 | 
					 | 
				
			||||||
  test.skip(process.platform === 'win32', 'Skip on windows')
 | 
					 | 
				
			||||||
  const cases = [
 | 
					  const cases = [
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      testDescription: 'top view',
 | 
					      testDescription: 'top view',
 | 
				
			||||||
 | 
				
			|||||||
@ -5,10 +5,10 @@ import { LineInputsType } from 'lang/std/sketchcombos'
 | 
				
			|||||||
import { uuidv4 } from 'lib/utils'
 | 
					import { uuidv4 } from 'lib/utils'
 | 
				
			||||||
import { EditorFixture } from './fixtures/editorFixture'
 | 
					import { EditorFixture } from './fixtures/editorFixture'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test.describe('Testing segment overlays', () => {
 | 
					test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
 | 
				
			||||||
  // TODO: fix this test on windows after the electron migration
 | 
					  test.fixme(
 | 
				
			||||||
  test.skip(process.platform === 'win32', 'Skip on windows')
 | 
					    'Hover over a segment should show its overlay, hovering over the input overlays should show its popover, clicking the input overlay should constrain/unconstrain it:\nfor the following segments',
 | 
				
			||||||
  test.describe('Hover over a segment should show its overlay, hovering over the input overlays should show its popover, clicking the input overlay should constrain/unconstrain it:\nfor the following segments', () => {
 | 
					    () => {
 | 
				
			||||||
      // TODO: fix this test on mac after the electron migration
 | 
					      // TODO: fix this test on mac after the electron migration
 | 
				
			||||||
      test.skip(process.platform === 'darwin', 'Skip on mac')
 | 
					      test.skip(process.platform === 'darwin', 'Skip on mac')
 | 
				
			||||||
      /**
 | 
					      /**
 | 
				
			||||||
@ -557,7 +557,8 @@ test.describe('Testing segment overlays', () => {
 | 
				
			|||||||
            'angledLineOfYLength({ angle = -91, length = 19 + 0 }, %)',
 | 
					            'angledLineOfYLength({ angle = -91, length = 19 + 0 }, %)',
 | 
				
			||||||
          expectAfterUnconstrained:
 | 
					          expectAfterUnconstrained:
 | 
				
			||||||
            'angledLineOfYLength({ angle = angle002, length = 19 + 0 }, %)',
 | 
					            'angledLineOfYLength({ angle = angle002, length = 19 + 0 }, %)',
 | 
				
			||||||
        expectFinal: 'angledLineOfYLength({ angle = -91, length = 19 + 0 }, %)',
 | 
					          expectFinal:
 | 
				
			||||||
 | 
					            'angledLineOfYLength({ angle = -91, length = 19 + 0 }, %)',
 | 
				
			||||||
          ang: ang + 180,
 | 
					          ang: ang + 180,
 | 
				
			||||||
          steps: 6,
 | 
					          steps: 6,
 | 
				
			||||||
          locator: '[data-overlay-toolbar-index="8"]',
 | 
					          locator: '[data-overlay-toolbar-index="8"]',
 | 
				
			||||||
@ -656,7 +657,9 @@ test.describe('Testing segment overlays', () => {
 | 
				
			|||||||
          locator: '[data-overlay-toolbar-index="9"]',
 | 
					          locator: '[data-overlay-toolbar-index="9"]',
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      const angledLineToY = await u.getBoundingBox(`[data-overlay-index="10"]`)
 | 
					        const angledLineToY = await u.getBoundingBox(
 | 
				
			||||||
 | 
					          `[data-overlay-index="10"]`
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
        ang = await u.getAngle(`[data-overlay-index="10"]`)
 | 
					        ang = await u.getAngle(`[data-overlay-index="10"]`)
 | 
				
			||||||
        console.log('angledLineToY')
 | 
					        console.log('angledLineToY')
 | 
				
			||||||
        await clickUnconstrained({
 | 
					        await clickUnconstrained({
 | 
				
			||||||
@ -677,7 +680,8 @@ test.describe('Testing segment overlays', () => {
 | 
				
			|||||||
          constraintType: 'yAbsolute',
 | 
					          constraintType: 'yAbsolute',
 | 
				
			||||||
          expectBeforeUnconstrained:
 | 
					          expectBeforeUnconstrained:
 | 
				
			||||||
            'angledLineToY({ angle = 89, to = 9.14 + 0 }, %)',
 | 
					            'angledLineToY({ angle = 89, to = 9.14 + 0 }, %)',
 | 
				
			||||||
        expectAfterUnconstrained: 'angledLineToY({ angle = 89, to = 9.14 }, %)',
 | 
					          expectAfterUnconstrained:
 | 
				
			||||||
 | 
					            'angledLineToY({ angle = 89, to = 9.14 }, %)',
 | 
				
			||||||
          expectFinal: 'angledLineToY({ angle = 89, to = yAbs001 }, %)',
 | 
					          expectFinal: 'angledLineToY({ angle = 89, to = yAbs001 }, %)',
 | 
				
			||||||
          ang: ang + 180,
 | 
					          ang: ang + 180,
 | 
				
			||||||
          locator: '[data-overlay-toolbar-index="10"]',
 | 
					          locator: '[data-overlay-toolbar-index="10"]',
 | 
				
			||||||
@ -857,7 +861,8 @@ test.describe('Testing segment overlays', () => {
 | 
				
			|||||||
          constraintType: 'xAbsolute',
 | 
					          constraintType: 'xAbsolute',
 | 
				
			||||||
          expectBeforeUnconstrained:
 | 
					          expectBeforeUnconstrained:
 | 
				
			||||||
            'circle({ center = [1 + 0, 0], radius = 8 }, %)',
 | 
					            'circle({ center = [1 + 0, 0], radius = 8 }, %)',
 | 
				
			||||||
        expectAfterUnconstrained: 'circle({ center = [1, 0], radius = 8 }, %)',
 | 
					          expectAfterUnconstrained:
 | 
				
			||||||
 | 
					            'circle({ center = [1, 0], radius = 8 }, %)',
 | 
				
			||||||
          expectFinal: 'circle({ center = [xAbs001, 0], radius = 8 }, %)',
 | 
					          expectFinal: 'circle({ center = [xAbs001, 0], radius = 8 }, %)',
 | 
				
			||||||
          ang: ang + 105,
 | 
					          ang: ang + 105,
 | 
				
			||||||
          steps: 6,
 | 
					          steps: 6,
 | 
				
			||||||
@ -890,7 +895,8 @@ test.describe('Testing segment overlays', () => {
 | 
				
			|||||||
          locator: '[data-overlay-toolbar-index="0"]',
 | 
					          locator: '[data-overlay-toolbar-index="0"]',
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
  })
 | 
					    }
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
  test.describe('Testing deleting a segment', () => {
 | 
					  test.describe('Testing deleting a segment', () => {
 | 
				
			||||||
    const _deleteSegmentSequence =
 | 
					    const _deleteSegmentSequence =
 | 
				
			||||||
      (page: Page, editor: EditorFixture) =>
 | 
					      (page: Page, editor: EditorFixture) =>
 | 
				
			||||||
 | 
				
			|||||||
@ -5,15 +5,12 @@ import { Coords2d } from 'lang/std/sketch'
 | 
				
			|||||||
import { KCL_DEFAULT_LENGTH } from 'lib/constants'
 | 
					import { KCL_DEFAULT_LENGTH } from 'lib/constants'
 | 
				
			||||||
import { uuidv4 } from 'lib/utils'
 | 
					import { uuidv4 } from 'lib/utils'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test.describe('Testing selections', () => {
 | 
					test.describe('Testing selections', { tag: ['@skipWin'] }, () => {
 | 
				
			||||||
  test.setTimeout(90_000)
 | 
					  test.setTimeout(90_000)
 | 
				
			||||||
  test(
 | 
					  test('Selections work on fresh and edited sketch', async ({
 | 
				
			||||||
    'Selections work on fresh and edited sketch',
 | 
					    page,
 | 
				
			||||||
    { tag: ['@skipWin'] },
 | 
					    homePage,
 | 
				
			||||||
    async ({ page, homePage }) => {
 | 
					  }) => {
 | 
				
			||||||
      // Skip on windows its being weird.
 | 
					 | 
				
			||||||
      test.skip(process.platform === 'win32', 'Skip on windows')
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // tests mapping works on fresh sketch and edited sketch
 | 
					    // tests mapping works on fresh sketch and edited sketch
 | 
				
			||||||
    // tests using hovers which is the same as selections, because if
 | 
					    // tests using hovers which is the same as selections, because if
 | 
				
			||||||
    // source ranges are wrong, hovers won't work
 | 
					    // source ranges are wrong, hovers won't work
 | 
				
			||||||
@ -160,9 +157,7 @@ test.describe('Testing selections', () => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      // check the same selection again by putting cursor in code first then selecting axis
 | 
					      // check the same selection again by putting cursor in code first then selecting axis
 | 
				
			||||||
      await test.step(`Same selection but code selection then axis`, async () => {
 | 
					      await test.step(`Same selection but code selection then axis`, async () => {
 | 
				
			||||||
          await page
 | 
					        await page.getByText(`  |> xLine(${commonPoints.num2 * -1}, %)`).click()
 | 
				
			||||||
            .getByText(`  |> xLine(${commonPoints.num2 * -1}, %)`)
 | 
					 | 
				
			||||||
            .click()
 | 
					 | 
				
			||||||
        await page.keyboard.down('Shift')
 | 
					        await page.keyboard.down('Shift')
 | 
				
			||||||
        await constrainButton.click()
 | 
					        await constrainButton.click()
 | 
				
			||||||
        await expect(absXButton).toBeDisabled()
 | 
					        await expect(absXButton).toBeDisabled()
 | 
				
			||||||
@ -190,9 +185,7 @@ test.describe('Testing selections', () => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      await expect(page.locator('.cm-cursor')).toHaveCount(2)
 | 
					      await expect(page.locator('.cm-cursor')).toHaveCount(2)
 | 
				
			||||||
      await page.waitForTimeout(500)
 | 
					      await page.waitForTimeout(500)
 | 
				
			||||||
        await page.keyboard.up(
 | 
					      await page.keyboard.up(process.platform === 'linux' ? 'Control' : 'Meta')
 | 
				
			||||||
          process.platform === 'linux' ? 'Control' : 'Meta'
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
      // clear selection by clicking on nothing
 | 
					      // clear selection by clicking on nothing
 | 
				
			||||||
      await emptySpaceClick()
 | 
					      await emptySpaceClick()
 | 
				
			||||||
@ -253,8 +246,7 @@ test.describe('Testing selections', () => {
 | 
				
			|||||||
    await test.step(`Test hovering and selecting on edited sketch`, async () => {
 | 
					    await test.step(`Test hovering and selecting on edited sketch`, async () => {
 | 
				
			||||||
      await selectionSequence()
 | 
					      await selectionSequence()
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
    }
 | 
					  })
 | 
				
			||||||
  )
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  test('Solids should be select and deletable', async ({ page, homePage }) => {
 | 
					  test('Solids should be select and deletable', async ({ page, homePage }) => {
 | 
				
			||||||
    test.setTimeout(90_000)
 | 
					    test.setTimeout(90_000)
 | 
				
			||||||
@ -492,8 +484,6 @@ test.describe('Testing selections', () => {
 | 
				
			|||||||
    page,
 | 
					    page,
 | 
				
			||||||
    homePage,
 | 
					    homePage,
 | 
				
			||||||
  }) => {
 | 
					  }) => {
 | 
				
			||||||
    // TODO: fix this test on windows after the electron migration
 | 
					 | 
				
			||||||
    test.skip(process.platform === 'win32', 'Skip on windows')
 | 
					 | 
				
			||||||
    const u = await getUtils(page)
 | 
					    const u = await getUtils(page)
 | 
				
			||||||
    await page.addInitScript(async (KCL_DEFAULT_LENGTH) => {
 | 
					    await page.addInitScript(async (KCL_DEFAULT_LENGTH) => {
 | 
				
			||||||
      localStorage.setItem(
 | 
					      localStorage.setItem(
 | 
				
			||||||
 | 
				
			|||||||
@ -435,11 +435,6 @@ test.describe('Text-to-CAD tests', () => {
 | 
				
			|||||||
    async ({ page, homePage }) => {
 | 
					    async ({ page, homePage }) => {
 | 
				
			||||||
      // Let this test run longer since we've seen it timeout.
 | 
					      // Let this test run longer since we've seen it timeout.
 | 
				
			||||||
      test.setTimeout(180_000)
 | 
					      test.setTimeout(180_000)
 | 
				
			||||||
      // skip on windows
 | 
					 | 
				
			||||||
      test.skip(
 | 
					 | 
				
			||||||
        process.platform === 'win32',
 | 
					 | 
				
			||||||
        'This test is flaky, skipping for now'
 | 
					 | 
				
			||||||
      )
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
      const u = await getUtils(page)
 | 
					      const u = await getUtils(page)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user