Skip to content

Commit

Permalink
Make "Extrude from command bar" test selection via 3D scene, not code (
Browse files Browse the repository at this point in the history
  • Loading branch information
franknoirot authored May 8, 2024
1 parent 3a05211 commit cb0b7e8
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions e2e/playwright/flow-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1001,13 +1001,13 @@ test.describe('Command bar tests', () => {
localStorage.setItem(
'persistCode',
`const distance = sqrt(20)
const part001 = startSketchOn('-XZ')
|> startProfileAt([-6.95, 4.98], %)
|> line([25.1, 0.41], %)
|> line([0.73, -14.93], %)
|> line([-23.44, 0.52], %)
|> close(%)
`
const part001 = startSketchOn('-XZ')
|> startProfileAt([-6.95, 10.98], %)
|> line([25.1, 0.41], %)
|> line([0.73, -20.93], %)
|> line([-23.44, 0.52], %)
|> close(%)
`
)
})

Expand All @@ -1024,7 +1024,6 @@ test.describe('Command bar tests', () => {
page.getByRole('button', { name: 'Start Sketch' })
).not.toBeDisabled()
await u.clearCommandLogs()
await page.getByText('|> line([0.73, -14.93], %)').click()
await page.getByRole('button', { name: 'Extrude' }).isEnabled()

let cmdSearchBar = page.getByPlaceholder('Search commands')
Expand All @@ -1034,6 +1033,12 @@ test.describe('Command bar tests', () => {
// Search for extrude command and choose it
await page.getByRole('option', { name: 'Extrude' }).click()

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

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

Expand Down Expand Up @@ -1067,9 +1072,9 @@ test.describe('Command bar tests', () => {
`const distance = sqrt(20)
const distance001 = 5 + 7
const part001 = startSketchOn('-XZ')
|> startProfileAt([-6.95, 4.98], %)
|> startProfileAt([-6.95, 10.98], %)
|> line([25.1, 0.41], %)
|> line([0.73, -14.93], %)
|> line([0.73, -20.93], %)
|> line([-23.44, 0.52], %)
|> close(%)
|> extrude(distance001, %)`.replace(/(\r\n|\n|\r)/gm, '') // remove newlines
Expand Down

0 comments on commit cb0b7e8

Please sign in to comment.