More fixes

This commit is contained in:
Pierre Jacquier
2025-06-17 15:19:53 -04:00
parent 92bd8a9f61
commit 2042339c99
5 changed files with 16 additions and 24 deletions

View File

@ -54,9 +54,7 @@ test(
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
// Click the checkbox // Click the checkbox
const submitButton = page.getByText('Confirm Export') await cmdBar.submit()
await expect(submitButton).toBeVisible()
await page.keyboard.press('Enter')
// Expect it to succeed // Expect it to succeed
const errorToastMessage = page.getByText(`Error while exporting`) const errorToastMessage = page.getByText(`Error while exporting`)
@ -119,9 +117,7 @@ test(
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
// Click the checkbox // Click the checkbox
const submitButton = page.getByText('Confirm Export') await cmdBar.submit()
await expect(submitButton).toBeVisible()
await page.keyboard.press('Enter')
// Look out for the toast message // Look out for the toast message
const exportingToastMessage = page.getByText(`Exporting...`) const exportingToastMessage = page.getByText(`Exporting...`)

View File

@ -1,6 +1,7 @@
import path from 'path' import path from 'path'
import { bracket } from '@e2e/playwright/fixtures/bracket' import { bracket } from '@e2e/playwright/fixtures/bracket'
import type { Page } from '@playwright/test' import type { Page } from '@playwright/test'
import type { CmdBarFixture } from '@e2e/playwright/fixtures/cmdBarFixture'
import { reportRejection } from '@src/lib/trap' import { reportRejection } from '@src/lib/trap'
import * as fsp from 'fs/promises' import * as fsp from 'fs/promises'
@ -421,10 +422,7 @@ extrude002 = extrude(profile002, length = 150)
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
// Click the checkbox // Click the checkbox
const submitButton = page.getByText('Confirm Export') await cmdBar.submit()
await expect(submitButton).toBeVisible()
await page.keyboard.press('Enter')
// Find the toast. // Find the toast.
// Look out for the toast message // Look out for the toast message
@ -461,8 +459,7 @@ extrude002 = extrude(profile002, length = 150)
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
// Click the checkbox // Click the checkbox
await expect(submitButton).toBeVisible() await cmdBar.submit()
await page.keyboard.press('Enter')
// Find the toast. // Find the toast.
// Look out for the toast message // Look out for the toast message
@ -482,6 +479,7 @@ extrude002 = extrude(profile002, length = 150)
test('ensure you CAN export while an export is already going', async ({ test('ensure you CAN export while an export is already going', async ({
page, page,
homePage, homePage,
cmdBar,
}) => { }) => {
const u = await getUtils(page) const u = await getUtils(page)
await test.step('Set up the code and durations', async () => { await test.step('Set up the code and durations', async () => {
@ -516,11 +514,11 @@ extrude002 = extrude(profile002, length = 150)
const successToastMessage = page.getByText(`Exported successfully`) const successToastMessage = page.getByText(`Exported successfully`)
await test.step('second export', async () => { await test.step('second export', async () => {
await clickExportButton(page) await clickExportButton(page, cmdBar)
await expect(exportingToastMessage).toBeVisible() await expect(exportingToastMessage).toBeVisible()
await clickExportButton(page) await clickExportButton(page, cmdBar)
await test.step('The first export still succeeds', async () => { await test.step('The first export still succeeds', async () => {
await Promise.all([ await Promise.all([
@ -537,7 +535,7 @@ extrude002 = extrude(profile002, length = 150)
await test.step('Successful, unblocked export', async () => { await test.step('Successful, unblocked export', async () => {
// Try exporting again. // Try exporting again.
await clickExportButton(page) await clickExportButton(page, cmdBar)
// Find the toast. // Find the toast.
// Look out for the toast message // Look out for the toast message
@ -880,7 +878,7 @@ s2 = startSketchOn(XY)
}) })
}) })
async function clickExportButton(page: Page) { async function clickExportButton(page: Page, cmdBar: CmdBarFixture) {
await test.step('Running export flow', async () => { await test.step('Running export flow', async () => {
// export the model // export the model
const exportButton = page.getByTestId('export-pane-button') const exportButton = page.getByTestId('export-pane-button')
@ -896,9 +894,6 @@ async function clickExportButton(page: Page) {
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
// Click the checkbox // Click the checkbox
const submitButton = page.getByText('Confirm Export') await cmdBar.submit()
await expect(submitButton).toBeVisible()
await page.keyboard.press('Enter')
}) })
} }

View File

@ -782,8 +782,6 @@ export const doExport = async (
.click() .click()
await page.locator('#arg-form').waitFor({ state: 'detached' }) await page.locator('#arg-form').waitFor({ state: 'detached' })
} }
await expect(page.getByText('Confirm Export')).toBeVisible()
await cmdBar.submit() await cmdBar.submit()
await expect(page.getByText('Exported successfully')).toBeVisible() await expect(page.getByText('Exported successfully')).toBeVisible()

View File

@ -574,8 +574,7 @@ profile001 = startProfile(sketch002, at = [-12.34, 12.34])
await cmdBar.progressCmdBar() await cmdBar.progressCmdBar()
await cmdBar.progressCmdBar() await cmdBar.progressCmdBar()
await expect(page.getByText('Confirm Extrude')).toBeVisible() await cmdBar.submit()
await cmdBar.progressCmdBar()
const result2 = result.genNext` const result2 = result.genNext`
const sketch002 = extrude(sketch002, length = ${[5, 5]} + 7)` const sketch002 = extrude(sketch002, length = ${[5, 5]} + 7)`

View File

@ -275,6 +275,10 @@ export const modelingMachineCommandConfig: StateMachineCommandSetConfig<
['gltf', 'stl', 'ply'].includes( ['gltf', 'stl', 'ply'].includes(
commandContext.argumentsToSubmit.type as string commandContext.argumentsToSubmit.type as string
), ),
hidden: (commandContext) =>
!['gltf', 'stl', 'ply'].includes(
commandContext.argumentsToSubmit.type as string
),
options: (commandContext) => { options: (commandContext) => {
const type = commandContext.argumentsToSubmit.type as const type = commandContext.argumentsToSubmit.type as
| OutputTypeKey | OutputTypeKey