Skip to content

Commit d24d993

Browse files
heavygeecursoragent
andcommitted
chore(dev): harden voice settings Playwright dogfood wait strategy
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent abe1ef5 commit d24d993

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

scripts/dev/voice-settings-dogfood-playwright.mjs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,21 @@ const page = await context.newPage()
3535
const errors = []
3636
page.on('pageerror', (err) => errors.push(String(err)))
3737

38-
await page.goto(`${BASE_URL}/settings`, { waitUntil: 'networkidle', timeout: 60000 })
39-
await page.waitForTimeout(2000)
38+
await page.goto(`${BASE_URL}/settings`, { waitUntil: 'domcontentloaded', timeout: 60000 })
39+
await page.waitForTimeout(3000)
4040

4141
const bodyText = await page.locator('body').innerText()
4242
const hasHint = bodyText.includes('voice character notes') || bodyText.includes('Voice character notes')
4343
const hasBackend = bodyText.includes('Voice backend') || bodyText.includes('Gemini Live')
4444

45-
// Open voice picker
46-
const voiceRow = page.getByRole('button', { name: /^Voice\b/i }).first()
47-
await voiceRow.click({ timeout: 15000 }).catch(() => {})
48-
await page.waitForTimeout(500)
45+
// Open voice picker (trigger shows Voice label + current value on the right)
46+
const voicePicker = page.locator('button[aria-haspopup="listbox"]').filter({ hasText: /^Voice$/ }).first()
47+
if (await voicePicker.count() === 0) {
48+
await page.getByRole('button', { name: /Voice\s+/ }).first().click({ timeout: 15000 }).catch(() => {})
49+
} else {
50+
await voicePicker.click({ timeout: 15000 })
51+
}
52+
await page.waitForTimeout(800)
4953

5054
const afterOpen = await page.locator('body').innerText()
5155
const hasDescription = afterOpen.includes('Conversational, friendly')

0 commit comments

Comments
 (0)