playwright robustness: "can do many at once and get many prompts back, and interact with many" (#3524)
* playwright robustness * try fix the close button
This commit is contained in:
@ -495,11 +495,13 @@ test.describe('Text-to-CAD tests', () => {
|
||||
const generatingToastMessage = page.getByText(
|
||||
`Generating parametric model...`
|
||||
)
|
||||
await expect(generatingToastMessage.first()).toBeVisible({ timeout: 10000 })
|
||||
await expect(generatingToastMessage.first()).toBeVisible({
|
||||
timeout: 10_000,
|
||||
})
|
||||
|
||||
const successToastMessage = page.getByText(`Text-to-CAD successful`)
|
||||
// We should have three success toasts.
|
||||
await expect(successToastMessage).toHaveCount(3, { timeout: 15000 })
|
||||
await expect(successToastMessage).toHaveCount(3, { timeout: 25_000 })
|
||||
|
||||
await expect(page.getByText('Copied')).not.toBeVisible()
|
||||
|
||||
@ -541,12 +543,7 @@ test.describe('Text-to-CAD tests', () => {
|
||||
await expect(page.locator('.cm-content')).toContainText(`2x8`)
|
||||
|
||||
// Find the toast close button.
|
||||
const closeButton = page
|
||||
.getByRole('status')
|
||||
.locator('div')
|
||||
.filter({ hasText: 'Text-to-CAD successfulPrompt' })
|
||||
.first()
|
||||
.getByRole('button', { name: 'Close' })
|
||||
const closeButton = page.locator('[data-negative-button="close"]').first()
|
||||
await expect(closeButton).toBeVisible()
|
||||
await closeButton.click()
|
||||
|
||||
@ -699,7 +696,7 @@ async function sendPromptFromCommandBar(page: Page, promptStr: string) {
|
||||
|
||||
// Type the prompt.
|
||||
await page.keyboard.type(promptStr)
|
||||
await page.waitForTimeout(1000)
|
||||
await page.waitForTimeout(200)
|
||||
await page.keyboard.press('Enter')
|
||||
})
|
||||
}
|
||||
|
@ -251,6 +251,7 @@ export function ToastTextToCadSuccess({
|
||||
iconStart={{
|
||||
icon: 'close',
|
||||
}}
|
||||
data-negative-button={hasCopied ? 'close' : 'reject'}
|
||||
name={hasCopied ? 'Close' : 'Reject'}
|
||||
onClick={() => {
|
||||
if (!hasCopied) {
|
||||
|
Reference in New Issue
Block a user