diff --git a/e2e/playwright/feature-tree-pane.spec.ts b/e2e/playwright/feature-tree-pane.spec.ts index d4eb6a52da6..91b94d83026 100644 --- a/e2e/playwright/feature-tree-pane.spec.ts +++ b/e2e/playwright/feature-tree-pane.spec.ts @@ -446,7 +446,7 @@ profile003 = startProfile(sketch001, at = [0, -4.93]) }) // One dumb hardcoded screen pixel value const testPoint = { x: 650, y: 250 } - const sketchColor: [number, number, number] = [149, 149, 149] + const sketchColor: [number, number, number] = [187, 187, 187] const planeColor: [number, number, number] = [74, 74, 74] await homePage.openProject('test-sample') diff --git a/e2e/playwright/point-click.spec.ts b/e2e/playwright/point-click.spec.ts index 596f5442a05..6c344f3d8a4 100644 --- a/e2e/playwright/point-click.spec.ts +++ b/e2e/playwright/point-click.spec.ts @@ -2302,7 +2302,7 @@ extrude001 = extrude(sketch001, length = 30) // One dumb hardcoded screen pixel value // Any idea here how to select a cap without clicking in the scene? - const testPoint = { x: 575, y: 200 } + const testPoint = { x: 490, y: 200 } const [clickOnCap] = scene.makeMouseHelpers(testPoint.x, testPoint.y) const shellDeclaration = 'shell001 = shell(extrude001, faces = END, thickness = 5)' diff --git a/e2e/playwright/prompt-to-edit-snapshot-tests.spec.ts b/e2e/playwright/prompt-to-edit-snapshot-tests.spec.ts index d97268d7656..a81891e4209 100644 --- a/e2e/playwright/prompt-to-edit-snapshot-tests.spec.ts +++ b/e2e/playwright/prompt-to-edit-snapshot-tests.spec.ts @@ -80,19 +80,8 @@ test.describe('edit with AI example snapshots', () => { await homePage.openProject(project) await scene.settled(cmdBar) - const body1CapCoords = { x: 571, y: 351 } - const [clickBody1Cap] = scene.makeMouseHelpers( - body1CapCoords.x, - body1CapCoords.y - ) - - await test.step('wait for scene to load select body and check selection came through', async () => { - await clickBody1Cap() - await editor.expectState({ - highlightedCode: '', - activeLines: ['|>startProfile(at=[-73.64,-42.89])'], - diagnostics: [], - }) + await test.step('wait for scene to load select body', async () => { + await editor.selectText('startProfile(at = [-73.64, -42.89])') }) await test.step('fire off edit prompt', async () => { diff --git a/e2e/playwright/regression-tests.spec.ts b/e2e/playwright/regression-tests.spec.ts index fa1dcab4d3e..e8a76574b01 100644 --- a/e2e/playwright/regression-tests.spec.ts +++ b/e2e/playwright/regression-tests.spec.ts @@ -349,11 +349,9 @@ extrude002 = extrude(profile002, length = 150)` 'ratio' ) - await scene.expectPixelColor( - TEST_COLORS.DARK_MODE_BKGD, - offModelBefore, - 15 - ) + // not sure why old DARK_MODE_BKGD doesn't work anymore + const bgColor: [number, number, number] = [30, 30, 30] + await scene.expectPixelColor(bgColor, offModelBefore, 15) const standardModelGrey: TestColor = [100, 100, 100] await scene.expectPixelColor(standardModelGrey, onModelBefore, 15) @@ -371,11 +369,7 @@ extrude002 = extrude(profile002, length = 150)` 'ratio' ) - await scene.expectPixelColor( - TEST_COLORS.DARK_MODE_BKGD, - offModelAfter, - 15 - ) + await scene.expectPixelColor(bgColor, offModelAfter, 15) await scene.expectPixelColor(standardModelGrey, onModelAfter, 15) } ) @@ -591,7 +585,7 @@ extrude002 = extrude(profile002, length = 150)` // Constants and locators const planeColor: [number, number, number] = [80, 60, 60] - const bgColor: [number, number, number] = [30, 30, 30] + const bgColor: [number, number, number] = TEST_COLORS.DARK_MODE_BKGD const middlePixelIsColor = async (color: [number, number, number]) => { return u.getGreatestPixDiff({ x: 600, y: 250 }, color) } diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Inch-scale-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Inch-scale-1-Google-Chrome-linux.png index 492ff6afbd1..0c93a8054aa 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Inch-scale-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Inch-scale-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Inch-scale-2-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Inch-scale-2-Google-Chrome-linux.png index d82bb3795ef..66a21ba9f0e 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Inch-scale-2-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Inch-scale-2-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Millimeter-scale-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Millimeter-scale-1-Google-Chrome-linux.png index 492ff6afbd1..ec9c6ae25d4 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Millimeter-scale-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Millimeter-scale-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Millimeter-scale-2-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Millimeter-scale-2-Google-Chrome-linux.png index 5a629e53aac..034ea00b6a1 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Millimeter-scale-2-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Millimeter-scale-2-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Draft-rectangles-should-look-right-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Draft-rectangles-should-look-right-1-Google-Chrome-linux.png index 033e527a644..f593ad3964e 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Draft-rectangles-should-look-right-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Draft-rectangles-should-look-right-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-off-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-off-1-Google-Chrome-linux.png index 0d5fe4735d0..ee8a18696b2 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-off-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-off-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-off-to-on-via-command-bar-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-off-to-on-via-command-bar-1-Google-Chrome-linux.png index 5fa29777c20..bde9538b371 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-off-to-on-via-command-bar-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-off-to-on-via-command-bar-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-on-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-on-1-Google-Chrome-linux.png index 878105f4349..2552c5bbfba 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-on-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-on-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Sketch-on-face-with-none-z-up-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Sketch-on-face-with-none-z-up-1-Google-Chrome-linux.png index 93062455239..119815595dc 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Sketch-on-face-with-none-z-up-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Sketch-on-face-with-none-z-up-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Zoom-to-fit-on-load---solid-2d-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Zoom-to-fit-on-load---solid-2d-1-Google-Chrome-linux.png index e3ec14d7cdf..7f9f4bd5ebb 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Zoom-to-fit-on-load---solid-2d-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Zoom-to-fit-on-load---solid-2d-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Zoom-to-fit-on-load---solid-3d-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Zoom-to-fit-on-load---solid-3d-1-Google-Chrome-linux.png index 8ce8de9125f..6dd17191824 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Zoom-to-fit-on-load---solid-3d-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Zoom-to-fit-on-load---solid-3d-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/code-color-goober-code-color-goober-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/code-color-goober-code-color-goober-1-Google-Chrome-linux.png index 1ae57c97528..4782a69491d 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/code-color-goober-code-color-goober-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/code-color-goober-code-color-goober-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/code-color-goober-code-color-goober-opening-window-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/code-color-goober-code-color-goober-opening-window-1-Google-Chrome-linux.png index ccb39654c48..0e218bef06e 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/code-color-goober-code-color-goober-opening-window-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/code-color-goober-code-color-goober-opening-window-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/code-color-goober-code-color-goober-works-with-single-quotes-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/code-color-goober-code-color-goober-works-with-single-quotes-1-Google-Chrome-linux.png index 663f884c17f..a7205bee809 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/code-color-goober-code-color-goober-works-with-single-quotes-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/code-color-goober-code-color-goober-works-with-single-quotes-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XY-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XY-1-Google-Chrome-linux.png index 2e6cfea5c08..92f0fef2234 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XY-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XY-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XZ-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XZ-1-Google-Chrome-linux.png index 4980e09b0f5..153eaedfe3b 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XZ-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XZ-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--YZ-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--YZ-1-Google-Chrome-linux.png index 9267c80fcc2..5277203a02e 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--YZ-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--YZ-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XY-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XY-1-Google-Chrome-linux.png index 63cc466e03e..b44f10e0a4a 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XY-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XY-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XZ-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XZ-1-Google-Chrome-linux.png index ccbd5fde0d4..5ff3ccc59fc 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XZ-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XZ-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-YZ-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-YZ-1-Google-Chrome-linux.png index 16c977c0e25..77f2ee8d0b8 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-YZ-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-YZ-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/test-utils.ts b/e2e/playwright/test-utils.ts index f55b1680b44..419ee2ed031 100644 --- a/e2e/playwright/test-utils.ts +++ b/e2e/playwright/test-utils.ts @@ -52,7 +52,7 @@ export const TEST_COLORS: { [key: string]: TestColor } = { GREY: [142, 142, 142], YELLOW: [255, 255, 0], BLUE: [0, 0, 255], - DARK_MODE_BKGD: [27, 27, 27], + DARK_MODE_BKGD: [86, 66, 107], DARK_MODE_PLANE_XZ: [50, 50, 99], } as const diff --git a/e2e/playwright/testing-constraints.spec.ts b/e2e/playwright/testing-constraints.spec.ts index b99996fc775..89934dff5df 100644 --- a/e2e/playwright/testing-constraints.spec.ts +++ b/e2e/playwright/testing-constraints.spec.ts @@ -158,7 +158,7 @@ test.describe('Testing constraints', () => { ) }) const u = await getUtils(page) - await page.setBodyDimensions({ width: 1200, height: 500 }) + await page.setBodyDimensions({ width: 1200, height: 800 }) await homePage.goToModelingScene() await scene.settled(cmdBar) @@ -275,7 +275,7 @@ test.describe('Testing constraints', () => { ) }) const u = await getUtils(page) - await page.setBodyDimensions({ width: 1000, height: 500 }) + await page.setBodyDimensions({ width: 1200, height: 800 }) await homePage.goToModelingScene() await scene.settled(cmdBar) @@ -605,7 +605,7 @@ profile001 = startProfile(sketch001, at = [-70, -10]) ) }) const u = await getUtils(page) - await page.setBodyDimensions({ width: 1000, height: 500 }) + await page.setBodyDimensions({ width: 1200, height: 800 }) await homePage.goToModelingScene() await scene.settled(cmdBar) @@ -695,7 +695,7 @@ part002 = startSketchOn(XZ) ) }) const u = await getUtils(page) - await page.setBodyDimensions({ width: 1200, height: 500 }) + await page.setBodyDimensions({ width: 1200, height: 800 }) await homePage.goToModelingScene() await scene.settled(cmdBar) @@ -776,7 +776,7 @@ part002 = startSketchOn(XZ) ) }) const u = await getUtils(page) - await page.setBodyDimensions({ width: 1000, height: 500 }) + await page.setBodyDimensions({ width: 1200, height: 800 }) await homePage.goToModelingScene() await scene.settled(cmdBar) diff --git a/e2e/playwright/testing-gizmo.spec.ts b/e2e/playwright/testing-gizmo.spec.ts index 3d86082301e..d6e93c91366 100644 --- a/e2e/playwright/testing-gizmo.spec.ts +++ b/e2e/playwright/testing-gizmo.spec.ts @@ -286,27 +286,15 @@ test.describe(`Testing gizmo, fixture-based`, () => { await test.step(`Setup`, async () => { await scene.expectState({ camera: { - position: [11796.52, -39216.59, 21103.27], + position: [36352.69, -25191.17, 27757.58], target: [11796.52, -635, 3201.42], }, }) }) - const [clickCircle, moveToCircle] = scene.makeMouseHelpers( - 582 / bodyDimensions.width, - 217 / bodyDimensions.height, - { format: 'ratio' } - ) - await test.step(`Select an edge of this circle`, async () => { - const circleSnippet = 'circle(center = [818.33, 168.1], radius = 182.8)' - await moveToCircle() - await clickCircle() await editor.openPane() - await editor.expectState({ - activeLines: ['|>' + circleSnippet], - highlightedCode: '', - diagnostics: [], - }) + const circleSnippet = 'circle(center = [818.33, 168.1], radius = 182.8)' + await editor.selectText(circleSnippet) await editor.closePane() }) @@ -317,8 +305,8 @@ test.describe(`Testing gizmo, fixture-based`, () => { await test.step(`Verify the camera moved`, async () => { await scene.expectState({ camera: { - position: [20785.58, -39851.59, 22171.6], - target: [20785.58, -1270, 4269.74], + position: [24556.17, -24556.17, 24556.17], + target: [0, 0, 0], }, }) }) diff --git a/src/lib/resetCameraPosition.ts b/src/lib/resetCameraPosition.ts index dee640d431c..bc8c8a1e21e 100644 --- a/src/lib/resetCameraPosition.ts +++ b/src/lib/resetCameraPosition.ts @@ -1,38 +1,29 @@ -import { isPlaywright } from '@src/lib/isPlaywright' import { engineCommandManager, sceneInfra, settingsActor, } from '@src/lib/singletons' -import { engineStreamZoomToFit, engineViewIsometric } from '@src/lib/utils' +import { engineViewIsometric } from '@src/lib/utils' /** * Reset the camera position to a baseline, which is isometric for - * normal users and a deprecated "front-down" view for playwright tests. - * - * Gotcha: Playwright E2E tests will be zoom_to_fit, when you try to recreate the e2e test manually - * your localhost will do view_isometric. Turn this boolean on to have the same experience when manually - * debugging e2e tests + * normal users. */ export async function resetCameraPosition() { // We need a padding of 0.1 for zoom_to_fit for all E2E tests since they were originally // written with zoom_to_fit with padding 0.1 const padding = 0.1 - if (isPlaywright()) { - await engineStreamZoomToFit({ engineCommandManager, padding }) - } else { - // Get user camera projection - const cameraProjection = - settingsActor.getSnapshot().context.modeling.cameraProjection.current + // Get user camera projection + const cameraProjection = + settingsActor.getSnapshot().context.modeling.cameraProjection.current - // We need to keep the users projection setting when resetting their camera - if (cameraProjection === 'perspective') { - await sceneInfra.camControls.usePerspectiveCamera() - } - - await engineViewIsometric({ - engineCommandManager, - padding, - }) + // We need to keep the users projection setting when resetting their camera + if (cameraProjection === 'perspective') { + await sceneInfra.camControls.usePerspectiveCamera() } + + await engineViewIsometric({ + engineCommandManager, + padding, + }) }