Multi-profile sweeps and more robust edit flows in point-and-click (#6437)

This commit is contained in:
Pierre Jacquier
2025-05-06 17:57:27 -04:00
committed by GitHub
parent 8fb1563f2d
commit 996517f5c4
15 changed files with 1353 additions and 928 deletions

View File

@ -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(
@ -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()
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(
@ -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' })
@ -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()
@ -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)'
)
})