Compare commits
	
		
			7 Commits
		
	
	
		
			safe-reset
			...
			pierremtb/
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 5713526e99 | |||
| 3612c195eb | |||
| 53a04d0f24 | |||
| 089b3397b6 | |||
| 77a072cc38 | |||
| 3090827cc1 | |||
| 3daf6acf4e | 
| @ -850,159 +850,157 @@ openSketch = startSketchOn('XY') | |||||||
|     }) |     }) | ||||||
|   }) |   }) | ||||||
|  |  | ||||||
|   test(`Shift-click to select and deselect sketch segments`, async ({ |   test.fixme( | ||||||
|     page, |     `Shift-click to select and deselect sketch segments`, | ||||||
|     homePage, |     async ({ page, homePage, scene, editor }) => { | ||||||
|     scene, |       // Locators | ||||||
|     editor, |       const firstPointLocation = { x: 200, y: 100 } | ||||||
|   }) => { |       const secondPointLocation = { x: 800, y: 100 } | ||||||
|     // Locators |       const thirdPointLocation = { x: 800, y: 400 } | ||||||
|     const firstPointLocation = { x: 200, y: 100 } |       const fristSegmentLocation = { x: 750, y: 100 } | ||||||
|     const secondPointLocation = { x: 800, y: 100 } |       const secondSegmentLocation = { x: 800, y: 150 } | ||||||
|     const thirdPointLocation = { x: 800, y: 400 } |       const planeLocation = { x: 700, y: 200 } | ||||||
|     const fristSegmentLocation = { x: 750, y: 100 } |  | ||||||
|     const secondSegmentLocation = { x: 800, y: 150 } |  | ||||||
|     const planeLocation = { x: 700, y: 200 } |  | ||||||
|  |  | ||||||
|     // Click helpers |       // Click helpers | ||||||
|     const [clickFirstPoint] = scene.makeMouseHelpers( |       const [clickFirstPoint] = scene.makeMouseHelpers( | ||||||
|       firstPointLocation.x, |         firstPointLocation.x, | ||||||
|       firstPointLocation.y |         firstPointLocation.y | ||||||
|     ) |       ) | ||||||
|     const [clickSecondPoint] = scene.makeMouseHelpers( |       const [clickSecondPoint] = scene.makeMouseHelpers( | ||||||
|       secondPointLocation.x, |         secondPointLocation.x, | ||||||
|       secondPointLocation.y |         secondPointLocation.y | ||||||
|     ) |       ) | ||||||
|     const [clickThirdPoint] = scene.makeMouseHelpers( |       const [clickThirdPoint] = scene.makeMouseHelpers( | ||||||
|       thirdPointLocation.x, |         thirdPointLocation.x, | ||||||
|       thirdPointLocation.y |         thirdPointLocation.y | ||||||
|     ) |       ) | ||||||
|     const [clickFirstSegment] = scene.makeMouseHelpers( |       const [clickFirstSegment] = scene.makeMouseHelpers( | ||||||
|       fristSegmentLocation.x, |         fristSegmentLocation.x, | ||||||
|       fristSegmentLocation.y |         fristSegmentLocation.y | ||||||
|     ) |       ) | ||||||
|     const [clickSecondSegment] = scene.makeMouseHelpers( |       const [clickSecondSegment] = scene.makeMouseHelpers( | ||||||
|       secondSegmentLocation.x, |         secondSegmentLocation.x, | ||||||
|       secondSegmentLocation.y |         secondSegmentLocation.y | ||||||
|     ) |       ) | ||||||
|     const [clickPlane] = scene.makeMouseHelpers( |       const [clickPlane] = scene.makeMouseHelpers( | ||||||
|       planeLocation.x, |         planeLocation.x, | ||||||
|       planeLocation.y |         planeLocation.y | ||||||
|     ) |  | ||||||
|  |  | ||||||
|     // Colors |  | ||||||
|     const edgeColorWhite: [number, number, number] = [220, 220, 220] |  | ||||||
|     const edgeColorBlue: [number, number, number] = [20, 20, 200] |  | ||||||
|     const backgroundColor: [number, number, number] = [30, 30, 30] |  | ||||||
|     const tolerance = 40 |  | ||||||
|     const timeout = 150 |  | ||||||
|  |  | ||||||
|     // Setup |  | ||||||
|     await test.step(`Initial test setup`, async () => { |  | ||||||
|       await page.setBodyDimensions({ width: 1000, height: 500 }) |  | ||||||
|       await homePage.goToModelingScene() |  | ||||||
|  |  | ||||||
|       // Wait for the scene and stream to load |  | ||||||
|       await scene.expectPixelColor( |  | ||||||
|         backgroundColor, |  | ||||||
|         secondPointLocation, |  | ||||||
|         tolerance |  | ||||||
|       ) |       ) | ||||||
|     }) |  | ||||||
|  |  | ||||||
|     await test.step('Select and deselect a single sketch segment', async () => { |       // Colors | ||||||
|       await test.step('Get into sketch mode', async () => { |       const edgeColorWhite: [number, number, number] = [220, 220, 220] | ||||||
|         await editor.closePane() |       const edgeColorBlue: [number, number, number] = [20, 20, 200] | ||||||
|         await page.waitForTimeout(timeout) |       const backgroundColor: [number, number, number] = [30, 30, 30] | ||||||
|         await page.getByRole('button', { name: 'Start Sketch' }).click() |       const tolerance = 40 | ||||||
|         await page.waitForTimeout(timeout) |       const timeout = 150 | ||||||
|         await clickPlane() |  | ||||||
|         await page.waitForTimeout(1000) |       // Setup | ||||||
|       }) |       await test.step(`Initial test setup`, async () => { | ||||||
|       await test.step('Draw sketch', async () => { |         await page.setBodyDimensions({ width: 1000, height: 500 }) | ||||||
|         await clickFirstPoint() |         await homePage.goToModelingScene() | ||||||
|         await page.waitForTimeout(timeout) |  | ||||||
|         await clickSecondPoint() |         // Wait for the scene and stream to load | ||||||
|         await page.waitForTimeout(timeout) |  | ||||||
|         await clickThirdPoint() |  | ||||||
|         await page.waitForTimeout(timeout) |  | ||||||
|       }) |  | ||||||
|       await test.step('Deselect line tool', async () => { |  | ||||||
|         const btnLine = page.getByTestId('line') |  | ||||||
|         const btnLineAriaPressed = await btnLine.getAttribute('aria-pressed') |  | ||||||
|         if (btnLineAriaPressed === 'true') { |  | ||||||
|           await btnLine.click() |  | ||||||
|         } |  | ||||||
|         await page.waitForTimeout(timeout) |  | ||||||
|       }) |  | ||||||
|       await test.step('Select the first segment', async () => { |  | ||||||
|         await page.waitForTimeout(timeout) |  | ||||||
|         await clickFirstSegment() |  | ||||||
|         await page.waitForTimeout(timeout) |  | ||||||
|         await scene.expectPixelColor( |         await scene.expectPixelColor( | ||||||
|           edgeColorBlue, |           backgroundColor, | ||||||
|           fristSegmentLocation, |           secondPointLocation, | ||||||
|           tolerance |  | ||||||
|         ) |  | ||||||
|         await scene.expectPixelColor( |  | ||||||
|           edgeColorWhite, |  | ||||||
|           secondSegmentLocation, |  | ||||||
|           tolerance |           tolerance | ||||||
|         ) |         ) | ||||||
|       }) |       }) | ||||||
|       await test.step('Select the second segment (Shift-click)', async () => { |  | ||||||
|         await page.keyboard.down('Shift') |       await test.step('Select and deselect a single sketch segment', async () => { | ||||||
|         await page.waitForTimeout(timeout) |         await test.step('Get into sketch mode', async () => { | ||||||
|         await clickSecondSegment() |           await editor.closePane() | ||||||
|         await page.waitForTimeout(timeout) |           await page.waitForTimeout(timeout) | ||||||
|         await page.keyboard.up('Shift') |           await page.getByRole('button', { name: 'Start Sketch' }).click() | ||||||
|         await scene.expectPixelColor( |           await page.waitForTimeout(timeout) | ||||||
|           edgeColorBlue, |           await clickPlane() | ||||||
|           fristSegmentLocation, |           await page.waitForTimeout(1000) | ||||||
|           tolerance |         }) | ||||||
|         ) |         await test.step('Draw sketch', async () => { | ||||||
|         await scene.expectPixelColor( |           await clickFirstPoint() | ||||||
|           edgeColorBlue, |           await page.waitForTimeout(timeout) | ||||||
|           secondSegmentLocation, |           await clickSecondPoint() | ||||||
|           tolerance |           await page.waitForTimeout(timeout) | ||||||
|         ) |           await clickThirdPoint() | ||||||
|  |           await page.waitForTimeout(timeout) | ||||||
|  |         }) | ||||||
|  |         await test.step('Deselect line tool', async () => { | ||||||
|  |           const btnLine = page.getByTestId('line') | ||||||
|  |           const btnLineAriaPressed = await btnLine.getAttribute('aria-pressed') | ||||||
|  |           if (btnLineAriaPressed === 'true') { | ||||||
|  |             await btnLine.click() | ||||||
|  |           } | ||||||
|  |           await page.waitForTimeout(timeout) | ||||||
|  |         }) | ||||||
|  |         await test.step('Select the first segment', async () => { | ||||||
|  |           await page.waitForTimeout(timeout) | ||||||
|  |           await clickFirstSegment() | ||||||
|  |           await page.waitForTimeout(timeout) | ||||||
|  |           await scene.expectPixelColor( | ||||||
|  |             edgeColorBlue, | ||||||
|  |             fristSegmentLocation, | ||||||
|  |             tolerance | ||||||
|  |           ) | ||||||
|  |           await scene.expectPixelColor( | ||||||
|  |             edgeColorWhite, | ||||||
|  |             secondSegmentLocation, | ||||||
|  |             tolerance | ||||||
|  |           ) | ||||||
|  |         }) | ||||||
|  |         await test.step('Select the second segment (Shift-click)', async () => { | ||||||
|  |           await page.keyboard.down('Shift') | ||||||
|  |           await page.waitForTimeout(timeout) | ||||||
|  |           await clickSecondSegment() | ||||||
|  |           await page.waitForTimeout(timeout) | ||||||
|  |           await page.keyboard.up('Shift') | ||||||
|  |           await scene.expectPixelColor( | ||||||
|  |             edgeColorBlue, | ||||||
|  |             fristSegmentLocation, | ||||||
|  |             tolerance | ||||||
|  |           ) | ||||||
|  |           await scene.expectPixelColor( | ||||||
|  |             edgeColorBlue, | ||||||
|  |             secondSegmentLocation, | ||||||
|  |             tolerance | ||||||
|  |           ) | ||||||
|  |         }) | ||||||
|  |         await test.step('Deselect the first segment', async () => { | ||||||
|  |           await page.keyboard.down('Shift') | ||||||
|  |           await page.waitForTimeout(timeout) | ||||||
|  |           await clickFirstSegment() | ||||||
|  |           await page.waitForTimeout(timeout) | ||||||
|  |           await page.keyboard.up('Shift') | ||||||
|  |           await scene.expectPixelColor( | ||||||
|  |             edgeColorWhite, | ||||||
|  |             fristSegmentLocation, | ||||||
|  |             tolerance | ||||||
|  |           ) | ||||||
|  |           await scene.expectPixelColor( | ||||||
|  |             edgeColorBlue, | ||||||
|  |             secondSegmentLocation, | ||||||
|  |             tolerance | ||||||
|  |           ) | ||||||
|  |         }) | ||||||
|  |         await test.step('Deselect the second segment', async () => { | ||||||
|  |           await page.keyboard.down('Shift') | ||||||
|  |           await page.waitForTimeout(timeout) | ||||||
|  |           await clickSecondSegment() | ||||||
|  |           await page.waitForTimeout(timeout) | ||||||
|  |           await page.keyboard.up('Shift') | ||||||
|  |           await scene.expectPixelColor( | ||||||
|  |             edgeColorWhite, | ||||||
|  |             fristSegmentLocation, | ||||||
|  |             tolerance | ||||||
|  |           ) | ||||||
|  |           await scene.expectPixelColor( | ||||||
|  |             edgeColorWhite, | ||||||
|  |             secondSegmentLocation, | ||||||
|  |             tolerance | ||||||
|  |           ) | ||||||
|  |         }) | ||||||
|       }) |       }) | ||||||
|       await test.step('Deselect the first segment', async () => { |     } | ||||||
|         await page.keyboard.down('Shift') |   ) | ||||||
|         await page.waitForTimeout(timeout) |  | ||||||
|         await clickFirstSegment() |  | ||||||
|         await page.waitForTimeout(timeout) |  | ||||||
|         await page.keyboard.up('Shift') |  | ||||||
|         await scene.expectPixelColor( |  | ||||||
|           edgeColorWhite, |  | ||||||
|           fristSegmentLocation, |  | ||||||
|           tolerance |  | ||||||
|         ) |  | ||||||
|         await scene.expectPixelColor( |  | ||||||
|           edgeColorBlue, |  | ||||||
|           secondSegmentLocation, |  | ||||||
|           tolerance |  | ||||||
|         ) |  | ||||||
|       }) |  | ||||||
|       await test.step('Deselect the second segment', async () => { |  | ||||||
|         await page.keyboard.down('Shift') |  | ||||||
|         await page.waitForTimeout(timeout) |  | ||||||
|         await clickSecondSegment() |  | ||||||
|         await page.waitForTimeout(timeout) |  | ||||||
|         await page.keyboard.up('Shift') |  | ||||||
|         await scene.expectPixelColor( |  | ||||||
|           edgeColorWhite, |  | ||||||
|           fristSegmentLocation, |  | ||||||
|           tolerance |  | ||||||
|         ) |  | ||||||
|         await scene.expectPixelColor( |  | ||||||
|           edgeColorWhite, |  | ||||||
|           secondSegmentLocation, |  | ||||||
|           tolerance |  | ||||||
|         ) |  | ||||||
|       }) |  | ||||||
|     }) |  | ||||||
|   }) |  | ||||||
|  |  | ||||||
|   test(`Offset plane point-and-click`, async ({ |   test(`Offset plane point-and-click`, async ({ | ||||||
|     context, |     context, | ||||||
|  | |||||||
| @ -35,7 +35,7 @@ sketch003 = startSketchOn('XY') | |||||||
| extrude003 = extrude(sketch003, length = 20) | extrude003 = extrude(sketch003, length = 20) | ||||||
| ` | ` | ||||||
|  |  | ||||||
| test.describe('Prompt-to-edit tests', { tag: '@skipWin' }, () => { | test.fixme('Prompt-to-edit tests', { tag: '@skipWin' }, () => { | ||||||
|   test.describe('Check the happy path, for basic changing color', () => { |   test.describe('Check the happy path, for basic changing color', () => { | ||||||
|     const cases = [ |     const cases = [ | ||||||
|       { |       { | ||||||
|  | |||||||
| @ -491,7 +491,7 @@ extrude001 = extrude(sketch001, length = 50) | |||||||
|     } |     } | ||||||
|   ) |   ) | ||||||
|  |  | ||||||
|   test( |   test.fixme( | ||||||
|     `Network health indicator only appears in modeling view`, |     `Network health indicator only appears in modeling view`, | ||||||
|     { tag: '@electron' }, |     { tag: '@electron' }, | ||||||
|     async ({ context, page }, testInfo) => { |     async ({ context, page }, testInfo) => { | ||||||
|  | |||||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB | 
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 68 KiB | 
| @ -452,19 +452,15 @@ profile003 = startProfileAt([40.16, -120.48], sketch006) | |||||||
|     await page.waitForTimeout(200) |     await page.waitForTimeout(200) | ||||||
|     await expect(u.codeLocator).not.toContainText(codeToBeDeletedSnippet) |     await expect(u.codeLocator).not.toContainText(codeToBeDeletedSnippet) | ||||||
|   }) |   }) | ||||||
|   test('parent Solid should be select and deletable and uses custom planes to position children', async ({ |   test.fixme( | ||||||
|     page, |     'parent Solid should be select and deletable and uses custom planes to position children', | ||||||
|     homePage, |     async ({ page, homePage, scene, cmdBar, editor }) => { | ||||||
|     scene, |       test.setTimeout(90_000) | ||||||
|     cmdBar, |       const u = await getUtils(page) | ||||||
|     editor, |       await page.addInitScript(async () => { | ||||||
|   }) => { |         localStorage.setItem( | ||||||
|     test.setTimeout(90_000) |           'persistCode', | ||||||
|     const u = await getUtils(page) |           `part001 = startSketchOn('XY') | ||||||
|     await page.addInitScript(async () => { |  | ||||||
|       localStorage.setItem( |  | ||||||
|         'persistCode', |  | ||||||
|         `part001 = startSketchOn('XY') |  | ||||||
| yo = startProfileAt([4.83, 12.56], part001) | yo = startProfileAt([4.83, 12.56], part001) | ||||||
|   |> line(end = [15.1, 2.48]) |   |> line(end = [15.1, 2.48]) | ||||||
|   |> line(end = [3.15, -9.85], tag = $seg01) |   |> line(end = [3.15, -9.85], tag = $seg01) | ||||||
| @ -495,34 +491,35 @@ profile001 = startProfileAt([7.49, 9.96], sketch001) | |||||||
|   |> close() |   |> close() | ||||||
|  |  | ||||||
| ` | ` | ||||||
|  |         ) | ||||||
|  |       }, KCL_DEFAULT_LENGTH) | ||||||
|  |       await page.setBodyDimensions({ width: 1000, height: 500 }) | ||||||
|  |  | ||||||
|  |       await homePage.goToModelingScene() | ||||||
|  |       await scene.settled(cmdBar) | ||||||
|  |  | ||||||
|  |       const extrudeWall = { x: 575, y: 238 } | ||||||
|  |  | ||||||
|  |       // DELETE with selection on face of parent | ||||||
|  |       await page.mouse.click(extrudeWall.x, extrudeWall.y) | ||||||
|  |       await page.waitForTimeout(100) | ||||||
|  |       await expect(page.locator('.cm-activeLine')).toHaveText( | ||||||
|  |         '|> line(end = [-15.17, -4.1])' | ||||||
|       ) |       ) | ||||||
|     }, KCL_DEFAULT_LENGTH) |       await u.openAndClearDebugPanel() | ||||||
|     await page.setBodyDimensions({ width: 1000, height: 500 }) |       await page.keyboard.press('Delete') | ||||||
|  |       await u.expectCmdLog('[data-message-type="execution-done"]', 10_000) | ||||||
|  |       await page.waitForTimeout(200) | ||||||
|  |  | ||||||
|     await homePage.goToModelingScene() |       await editor.expectEditor.not.toContain(`yoo = extrude(yo, length = 4)`, { | ||||||
|     await scene.settled(cmdBar) |         shouldNormalise: true, | ||||||
|  |       }) | ||||||
|     const extrudeWall = { x: 575, y: 238 } |       await editor.expectEditor.toContain(`startSketchOn({plane={origin`, { | ||||||
|  |         shouldNormalise: true, | ||||||
|     // DELETE with selection on face of parent |       }) | ||||||
|     await page.mouse.click(extrudeWall.x, extrudeWall.y) |       await editor.snapshot() | ||||||
|     await page.waitForTimeout(100) |     } | ||||||
|     await expect(page.locator('.cm-activeLine')).toHaveText( |   ) | ||||||
|       '|> line(end = [-15.17, -4.1])' |  | ||||||
|     ) |  | ||||||
|     await u.openAndClearDebugPanel() |  | ||||||
|     await page.keyboard.press('Delete') |  | ||||||
|     await u.expectCmdLog('[data-message-type="execution-done"]', 10_000) |  | ||||||
|     await page.waitForTimeout(200) |  | ||||||
|  |  | ||||||
|     await editor.expectEditor.not.toContain(`yoo = extrude(yo, length = 4)`, { |  | ||||||
|       shouldNormalise: true, |  | ||||||
|     }) |  | ||||||
|     await editor.expectEditor.toContain(`startSketchOn({plane={origin`, { |  | ||||||
|       shouldNormalise: true, |  | ||||||
|     }) |  | ||||||
|     await editor.snapshot() |  | ||||||
|   }) |  | ||||||
|   test('Hovering over 3d features highlights code, clicking puts the cursor in the right place and sends selection id to engine', async ({ |   test('Hovering over 3d features highlights code, clicking puts the cursor in the right place and sends selection id to engine', async ({ | ||||||
|     page, |     page, | ||||||
|     homePage, |     homePage, | ||||||
|  | |||||||
| @ -4,7 +4,7 @@ import { getUtils, createProject } from './test-utils' | |||||||
| import { join } from 'path' | import { join } from 'path' | ||||||
| import fs from 'fs' | import fs from 'fs' | ||||||
|  |  | ||||||
| test.describe('Text-to-CAD tests', { tag: ['@skipWin'] }, () => { | test.fixme('Text-to-CAD tests', { tag: ['@skipWin'] }, () => { | ||||||
|   test('basic lego happy case', async ({ page, homePage }) => { |   test('basic lego happy case', async ({ page, homePage }) => { | ||||||
|     const u = await getUtils(page) |     const u = await getUtils(page) | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	