test(e2e): align Agent tool credential states (#39698)

This commit is contained in:
yyh
2026-07-28 13:41:23 +00:00
committed by GitHub
parent a048f35099
commit 93e7d50845
2 changed files with 13 additions and 6 deletions
@@ -247,11 +247,12 @@ Then('I should see the Agent v2 tool state fixture tools', async function (this:
const toolsSection = page.getByRole('region', { name: 'Tools' })
await expect(toolsSection).toBeVisible({ timeout: 30_000 })
await expect(
toolsSection.getByRole('button', { exact: true, name: 'Not authorized' }),
).toHaveCount(2)
const { action: jsonReplaceAction, tool: jsonTool } = await expectProviderToolActionVisible(
const {
action: jsonReplaceAction,
provider: jsonProvider,
tool: jsonTool,
} = await expectProviderToolActionVisible(
toolsSection,
agentBuilderPreseededResources.jsonReplaceTool,
)
@@ -269,10 +270,16 @@ Then('I should see the Agent v2 tool state fixture tools', async function (this:
}),
).toBeVisible()
await expectProviderToolActionVisible(
const { provider: tavilyProvider } = await expectProviderToolActionVisible(
toolsSection,
agentBuilderPreseededResources.tavilySearchTool,
)
await expect(
tavilyProvider.locator('..').getByRole('button', { exact: true, name: 'Not authorized' }),
).toBeVisible()
await expect(
jsonProvider.locator('..').getByRole('button', { exact: true, name: 'Not authorized' }),
).toHaveCount(0)
})
Then('I should see the Agent v2 dual retrieval fixture settings', async function (this: DifyWorld) {
@@ -276,7 +276,7 @@ export const expectProviderToolActionVisible = async (
const action = toolsSection.getByText(tool.actionName, { exact: true })
await expect(action).toBeVisible()
return { action, tool }
return { action, provider, tool }
}
export const openAgentKnowledgeRetrievalDialog = async (