test(e2e): align agent model selector locators (#40862)

This commit is contained in:
yyh 2026-08-17 06:48:00 +00:00 committed by GitHub
parent 59c6a470bb
commit 4ce681d42f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,10 +42,10 @@ async function fillAgentPromptEditor(page: Page, prompt: string) {
}
async function selectAgentModel(page: Page, modelName: string) {
await page.getByRole('combobox').first().click()
await page.getByRole('button', { name: 'Configure model' }).click()
await page.getByPlaceholder('Search model').fill(modelName)
const escapedModelName = modelName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
await page.getByRole('option', { name: new RegExp(`${escapedModelName}(?:\\s|$)`) }).click()
await page.getByRole('button', { name: new RegExp(`${escapedModelName}(?:\\s|$)`) }).click()
}
async function expectAgentComposerPrompt(world: DifyWorld, agentId: string, prompt: string) {