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(
|
const generatingToastMessage = page.getByText(
|
||||||
`Generating parametric model...`
|
`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`)
|
const successToastMessage = page.getByText(`Text-to-CAD successful`)
|
||||||
// We should have three success toasts.
|
// 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()
|
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`)
|
await expect(page.locator('.cm-content')).toContainText(`2x8`)
|
||||||
|
|
||||||
// Find the toast close button.
|
// Find the toast close button.
|
||||||
const closeButton = page
|
const closeButton = page.locator('[data-negative-button="close"]').first()
|
||||||
.getByRole('status')
|
|
||||||
.locator('div')
|
|
||||||
.filter({ hasText: 'Text-to-CAD successfulPrompt' })
|
|
||||||
.first()
|
|
||||||
.getByRole('button', { name: 'Close' })
|
|
||||||
await expect(closeButton).toBeVisible()
|
await expect(closeButton).toBeVisible()
|
||||||
await closeButton.click()
|
await closeButton.click()
|
||||||
|
|
||||||
@ -699,7 +696,7 @@ async function sendPromptFromCommandBar(page: Page, promptStr: string) {
|
|||||||
|
|
||||||
// Type the prompt.
|
// Type the prompt.
|
||||||
await page.keyboard.type(promptStr)
|
await page.keyboard.type(promptStr)
|
||||||
await page.waitForTimeout(1000)
|
await page.waitForTimeout(200)
|
||||||
await page.keyboard.press('Enter')
|
await page.keyboard.press('Enter')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -251,6 +251,7 @@ export function ToastTextToCadSuccess({
|
|||||||
iconStart={{
|
iconStart={{
|
||||||
icon: 'close',
|
icon: 'close',
|
||||||
}}
|
}}
|
||||||
|
data-negative-button={hasCopied ? 'close' : 'reject'}
|
||||||
name={hasCopied ? 'Close' : 'Reject'}
|
name={hasCopied ? 'Close' : 'Reject'}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (!hasCopied) {
|
if (!hasCopied) {
|
||||||
|
Reference in New Issue
Block a user