Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
acc6d41
WIP: Extend point-and-click edit flows to non-variable sweep declarat…
pierremtb Apr 22, 2025
5119a90
Merge branch 'main' into pierremtb/issue6434-Extend-point-and-click-e…
pierremtb Apr 23, 2025
2c5c59c
Merge branch 'main' into pierremtb/issue6434-Extend-point-and-click-e…
pierremtb Apr 25, 2025
56dbaa1
Merge branch 'main' into pierremtb/issue6434-Extend-point-and-click-e…
pierremtb Apr 28, 2025
8a8678e
Clean up
pierremtb Apr 28, 2025
7c9387d
Clean up more and break out to external hopefully testable function
pierremtb Apr 28, 2025
4450402
Apply the same principles to Revolve
pierremtb Apr 28, 2025
c312420
Add variable insertion for revolve and extrude
pierremtb Apr 28, 2025
1f205bb
More clean up ahead of sweep migration
pierremtb Apr 28, 2025
f37c3ac
Merge branch 'main' into pierremtb/issue6434-Extend-point-and-click-e…
pierremtb Apr 28, 2025
f517bd3
Fix more tests
pierremtb Apr 28, 2025
6b0cdb5
Lint
pierremtb Apr 28, 2025
7cdb181
Remove skips on extrude and revolve
pierremtb Apr 29, 2025
8c7c145
Migrate sweep
pierremtb Apr 29, 2025
d756fc6
Fix a few tests
pierremtb Apr 29, 2025
f18cf36
Merge branch 'main' into pierremtb/issue6434-Extend-point-and-click-e…
pierremtb Apr 29, 2025
5c766a2
Fix more tests
pierremtb Apr 29, 2025
6b4fae0
Extend point-and-click edit flows to non-variable sweep declarations
pierremtb May 1, 2025
cfa5d6e
Ensure we can edit all three extrude from sample bracket with test
pierremtb May 1, 2025
190701c
Fix all but one test
pierremtb May 1, 2025
0cc704a
One more
pierremtb May 1, 2025
0e2e811
Merge branch 'main' into pierremtb/issue6434-Extend-point-and-click-e…
pierremtb May 2, 2025
7420c63
Fix more
pierremtb May 2, 2025
fd3b7b7
Another fix
pierremtb May 2, 2025
630410e
Another fix
pierremtb May 2, 2025
692138c
Update src/lang/modifyAst/addSweep.ts
pierremtb May 2, 2025
92f11ff
Big arg naming alignment with KCL, move Loft into the mix for consist…
pierremtb May 2, 2025
cf0ad74
Fix sweep validation and WIP multi profile tests for all sweeps
pierremtb May 2, 2025
c632304
Fix tests
pierremtb May 2, 2025
b568888
Lint
pierremtb May 2, 2025
be80053
Extend point-and-click edit flows to non-variable sweep declarations
pierremtb May 5, 2025
288e46a
Fix lofts
pierremtb May 5, 2025
86a6ed1
Another oopsie in global replace
pierremtb May 5, 2025
00d2140
Clean up operations.ts
pierremtb May 5, 2025
c939a9b
Merge branch 'main' into pierremtb/issue6434-Extend-point-and-click-e…
pierremtb May 6, 2025
7f060cb
Add Frank's suggestions
pierremtb May 6, 2025
6bb8293
Fix up some messssss
pierremtb May 6, 2025
2d1410e
Last fix hopefully
pierremtb May 6, 2025
a9cf5ec
Lint
pierremtb May 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 31 additions & 13 deletions e2e/playwright/command-bar-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ test.describe('Command bar tests', () => {
test('Extrude from command bar selects extrude line after', async ({
page,
homePage,
toolbar,
cmdBar,
}) => {
await page.addInitScript(async () => {
localStorage.setItem(
Expand All @@ -35,20 +37,35 @@ test.describe('Command bar tests', () => {

// Click the line of code for xLine.
await page.getByText(`close()`).click() // TODO remove this and reinstate // await topHorzSegmentClick()
await page.waitForTimeout(100)

await page.getByRole('button', { name: 'Extrude' }).click()
await page.waitForTimeout(200)
await page.keyboard.press('Enter')
await page.waitForTimeout(200)
await page.keyboard.press('Enter')
await page.waitForTimeout(200)
await toolbar.extrudeButton.click()
await cmdBar.expectState({
stage: 'arguments',
commandName: 'Extrude',
currentArgKey: 'sketches',
currentArgValue: '',
headerArguments: {
Sketches: '',
Length: '',
},
highlightedHeaderArg: 'sketches',
})
await cmdBar.progressCmdBar()
await cmdBar.progressCmdBar()
await cmdBar.expectState({
stage: 'review',
commandName: 'Extrude',
headerArguments: {
Sketches: '1 segment',
Length: '5',
},
})
await cmdBar.progressCmdBar()
Comment on lines +41 to +63
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the changes here and below are to account for:

  1. the need to press next on selections now that we can select multiple sketches and can't have skip: true
  2. changing "Selection" for "Sketches"

And I took the opportunity to modernize those tests a bit to new fixtures

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 🔥

await expect(page.locator('.cm-activeLine')).toHaveText(
`extrude001 = extrude(sketch001, length = ${KCL_DEFAULT_LENGTH})`
)
})

// TODO: fix this test after the electron migration
test('Fillet from command bar', async ({ page, homePage }) => {
await page.addInitScript(async () => {
localStorage.setItem(
Expand Down Expand Up @@ -269,21 +286,22 @@ test.describe('Command bar tests', () => {
await cmdBar.cmdOptions.getByText('Extrude').click()

// Assert that we're on the selection step
await expect(page.getByRole('button', { name: 'selection' })).toBeDisabled()
await expect(page.getByRole('button', { name: 'sketches' })).toBeDisabled()
// Select a face
await page.mouse.move(700, 200)
await page.mouse.click(700, 200)
await cmdBar.progressCmdBar()

// Assert that we're on the distance step
await expect(
page.getByRole('button', { name: 'distance', exact: false })
page.getByRole('button', { name: 'length', exact: false })
).toBeDisabled()

// Assert that the an alternative variable name is chosen,
// since the default variable name is already in use (distance)
await page.getByRole('button', { name: 'Create new variable' }).click()
await expect(page.getByPlaceholder('Variable name')).toHaveValue(
'distance001'
'length001'
)

const continueButton = page.getByRole('button', { name: 'Continue' })
Expand All @@ -297,7 +315,7 @@ test.describe('Command bar tests', () => {

// Assert we're back on the distance step
await expect(
page.getByRole('button', { name: 'distance', exact: false })
page.getByRole('button', { name: 'length', exact: false })
).toBeDisabled()

await continueButton.click()
Expand All @@ -306,7 +324,7 @@ test.describe('Command bar tests', () => {
await u.waitForCmdReceive('extrude')

await expect(page.locator('.cm-content')).toContainText(
'extrude001 = extrude(sketch001, length = distance001)'
'extrude001 = extrude(sketch001, length = length001)'
)
})

Expand Down
38 changes: 27 additions & 11 deletions e2e/playwright/editor-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,9 @@ sketch001 = startSketchOn(XZ)
page,
context,
homePage,
toolbar,
cmdBar,
scene,
}) => {
const u = await getUtils(page)
await context.addInitScript(async () => {
Expand Down Expand Up @@ -1128,17 +1131,30 @@ sketch001 = startSketchOn(XZ)
await page.waitForTimeout(100)

await page.getByText('startProfile(at = [4.61, -14.01])').click()
await expect(page.getByRole('button', { name: 'Extrude' })).toBeVisible()
await page.getByRole('button', { name: 'Extrude' }).click()

await expect(page.getByTestId('command-bar')).toBeVisible()
await page.waitForTimeout(100)

await page.getByRole('button', { name: 'arrow right Continue' }).click()
await page.waitForTimeout(100)
await expect(page.getByText('Confirm Extrude')).toBeVisible()
await page.getByRole('button', { name: 'checkmark Submit command' }).click()
await page.waitForTimeout(100)
await toolbar.extrudeButton.click()
await cmdBar.progressCmdBar()
await cmdBar.expectState({
stage: 'arguments',
currentArgKey: 'length',
currentArgValue: '5',
headerArguments: {
Sketches: '1 face',
Length: '',
},
highlightedHeaderArg: 'length',
commandName: 'Extrude',
})
await cmdBar.progressCmdBar()
await cmdBar.expectState({
stage: 'review',
headerArguments: {
Sketches: '1 face',
Length: '5',
},
commandName: 'Extrude',
})
await cmdBar.progressCmdBar()
await scene.settled(cmdBar)

// expect the code to have changed
await expect(page.locator('.cm-content')).toHaveText(
Expand Down
10 changes: 5 additions & 5 deletions e2e/playwright/feature-tree-pane.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ test.describe('Feature Tree pane', () => {
const initialCode = `sketch001 = startSketchOn(XZ)
|> circle(center = [0, 0], radius = 5)
renamedExtrude = extrude(sketch001, length = ${initialInput})`
const newConstantName = 'distance001'
const newConstantName = 'length001'
const expectedCode = `${newConstantName} = 23
sketch001 = startSketchOn(XZ)
|> circle(center = [0, 0], radius = 5)
Expand Down Expand Up @@ -270,12 +270,12 @@ test.describe('Feature Tree pane', () => {
await cmdBar.expectState({
commandName: 'Extrude',
stage: 'arguments',
currentArgKey: 'distance',
currentArgKey: 'length',
currentArgValue: initialInput,
headerArguments: {
Distance: initialInput,
Length: initialInput,
},
highlightedHeaderArg: 'distance',
highlightedHeaderArg: 'length',
})
})

Expand All @@ -290,7 +290,7 @@ test.describe('Feature Tree pane', () => {
stage: 'review',
headerArguments: {
// The calculated value is shown in the argument summary
Distance: initialInput,
Length: initialInput,
},
commandName: 'Extrude',
})
Expand Down
Loading
Loading