Multi-profile sweeps and more robust edit flows in point-and-click (#6437)
This commit is contained in:
@ -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)'
|
||||
)
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user