Only show "Edit sketch" button when code pane is focused with sketch selected (#5691)

* Only show "Edit sketch" button when code pane is focused with sketch selected

Closes #4273. WIP until tests are updated, since this will impact many
that look for the "Edit sketch" button.

* Start removing "edit sketch" point-and-click from E2E

* Update more E2E tests

* Update more tests that assumed Edit Sketch button

* A snapshot a day keeps the bugs away! 📷🐛

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Frank Noirot
2025-03-20 13:10:28 -04:00
committed by GitHub
parent 612d03bf73
commit b36e416ab2
10 changed files with 61 additions and 47 deletions

View File

@ -724,7 +724,14 @@ test.describe('Testing settings', () => {
})
})
test('Changing theme in sketch mode', async ({ context, page, homePage }) => {
test('Changing theme in sketch mode', async ({
context,
page,
homePage,
toolbar,
scene,
cmdBar,
}) => {
// TODO: fix this test on windows after the electron migration
test.skip(process.platform === 'win32', 'Skip on windows')
const u = await getUtils(page)
@ -744,11 +751,10 @@ test.describe('Testing settings', () => {
})
await page.setBodyDimensions({ width: 1200, height: 500 })
await homePage.goToModelingScene()
await u.waitForPageLoad()
await scene.settled(cmdBar)
await page.waitForTimeout(1000)
// Selectors and constants
const editSketchButton = page.getByRole('button', { name: 'Edit Sketch' })
const lineToolButton = page.getByTestId('line')
const segmentOverlays = page.getByTestId('segment-overlay')
const sketchOriginLocation = { x: 600, y: 250 }
@ -757,8 +763,7 @@ test.describe('Testing settings', () => {
await test.step(`Get into sketch mode`, async () => {
await page.mouse.click(700, 200)
await expect(editSketchButton).toBeVisible()
await editSketchButton.click()
await toolbar.editSketch()
// We use the line tool as a proxy for sketch mode
await expect(lineToolButton).toBeVisible()