diff --git a/e2e/playwright/feature-tree-pane.spec.ts b/e2e/playwright/feature-tree-pane.spec.ts index 28f05559df..0456315304 100644 --- a/e2e/playwright/feature-tree-pane.spec.ts +++ b/e2e/playwright/feature-tree-pane.spec.ts @@ -447,7 +447,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 2441ce8c08..be26221215 100644 --- a/e2e/playwright/point-click.spec.ts +++ b/e2e/playwright/point-click.spec.ts @@ -2313,7 +2313,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 d97268d765..a81891e420 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 d995adb66d..b888a0f4dc 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 c195584a6f..b14ff44bf2 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 27a254e569..e134882778 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 c195584a6f..b14ff44bf2 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 882a14b7b1..e134882778 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 4366d0eeb1..4a81b0d5c5 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 16acfdaa19..de970b97a9 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 656fd616c2..597d169adb 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 30c85375b8..20894b7ee1 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 c3207ec227..7434af8801 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 ee6fa426ca..a04c838edc 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 1fd87f41c2..8f96c56150 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 bf6dc4b6bc..ec7ce0b410 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 bf5f304f69..14970b240c 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 be948ae9e7..4fd9ebd9c4 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 a1cac23d79..a1f35f3550 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 ac77605e04..8bdd6e0f73 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 a30d701c45..5957fba32c 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 9f817cbb37..972476cddf 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 dbaa39031c..a68789edbe 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 3711938dfc..63101ca167 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 23f7b5cabc..0790a09860 100644 --- a/e2e/playwright/test-utils.ts +++ b/e2e/playwright/test-utils.ts @@ -59,7 +59,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 b99996fc77..89934dff5d 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 77ceda6375..10a213c27d 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() }) diff --git a/src/lib/resetCameraPosition.ts b/src/lib/resetCameraPosition.ts index dee640d431..bc8c8a1e21 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, + }) }