Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

test(e2e): enter GFS agent specs through the current fleet row

Alfredo Lopezdc24b507e272
diff --git a/desktop-app/test/e2e-playwright/gfs-agent-copy.test.ts b/desktop-app/test/e2e-playwright/gfs-agent-copy.test.ts
index 47a40cc34..991a663c5 100644
--- a/desktop-app/test/e2e-playwright/gfs-agent-copy.test.ts
+++ b/desktop-app/test/e2e-playwright/gfs-agent-copy.test.ts
@@ -6,7 +6,7 @@
*/
import { type Locator, type Page, expect, test } from '@playwright/test'
import { exactNameFilter } from './helpers/agentLocators'
-import { getManagedAgentPodIdentity } from './helpers/gfsAgentDiscovery'
+import { getManagedAgentDisplayName, getManagedAgentPodIdentity } from './helpers/gfsAgentDiscovery'
import {
type AgentGfsCopyFixtures,
assertGfsInfraHealthy,
@@ -31,12 +31,13 @@ const SENSITIVE_OUTPUT =
async function openExactAgent(
page: Page,
+ // The rendered label (Host `spec.host`), not the CRD name.
agentName: string,
opts: { reuseThread?: boolean } = {}
): Promise<void> {
await openAgentsPage(page)
await expect(page.getByRole('heading', { name: 'Agents', exact: true })).toBeVisible()
- const row = page.getByLabel(`Open details for ${agentName}`, { exact: true })
+ const row = page.getByLabel(`Open agent ${agentName}`, { exact: true })
await expect(row).toBeVisible({ timeout: 30_000 })
await row.click()
await expect(page.getByText(agentName, { exact: true }).first()).toBeVisible({ timeout: 15_000 })
@@ -255,10 +256,14 @@ async function browseDestinationTree(page: Page, fixtures: AgentGfsCopyFixtures)
test.describe('GFS per-agent native Copy and immediate grant enforcement (issue #797)', () => {
test.describe.configure({ mode: 'serial' })
let fixtures: AgentGfsCopyFixtures
+ let labelA: string
+ let labelB: string
test.beforeAll(() => {
assertGfsInfraHealthy()
fixtures = seedAgentGfsCopyFixtures(OWNER_EMAIL)
+ labelA = getManagedAgentDisplayName(fixtures.agentA)
+ labelB = getManagedAgentDisplayName(fixtures.agentB)
})
test.afterAll(() => fixtures?.cleanup())
@@ -292,7 +297,7 @@ test.describe('GFS per-agent native Copy and immediate grant enforcement (issue
try {
await test.step('Agent A copies one file through the native tool', async () => {
await browseSourceTree(page, fixtures)
- await openExactAgent(page, fixtures.agentA.name)
+ await openExactAgent(page, labelA)
const steps = await sendAgentTurn(
page,
`In drive main, open the folder named "${fixtures.tree.sourceName}" and read the file ` +
@@ -393,7 +398,7 @@ test.describe('GFS per-agent native Copy and immediate grant enforcement (issue
// Fresh thread on purpose: A has no memory of the earlier copy, so it
// must actually re-attempt the copy by name and surface the tool's real
// result rather than answering "already done" from context.
- await openExactAgent(page, fixtures.agentA.name)
+ await openExactAgent(page, labelA)
const steps = await sendAgentTurn(
page,
`In drive main, copy the file "${fixtures.tree.standaloneFileName}" from the folder ` +
@@ -419,7 +424,7 @@ test.describe('GFS per-agent native Copy and immediate grant enforcement (issue
})
await test.step('Agent B passes root/destination grants but unreadable child denies the tree', async () => {
- await openExactAgent(page, fixtures.agentB.name)
+ await openExactAgent(page, labelB)
const steps = await sendAgentTurn(
page,
`Copy the folder named "${fixtures.tree.sourceName}" from drive main into the folder ` +
@@ -437,7 +442,7 @@ test.describe('GFS per-agent native Copy and immediate grant enforcement (issue
})
await test.step('audited revoke denies Agent A immediately in the same runtime', async () => {
- await openExactAgent(page, fixtures.agentA.name, { reuseThread: true })
+ await openExactAgent(page, labelA, { reuseThread: true })
const runtimeBefore = getManagedAgentPodIdentity(fixtures.agentA)
const auditBefore = gfsGrantRevokeAuditCount(fixtures.agentA)
await revokeGfsGrantViaControlApi(fixtures.destinationGrantId)
diff --git a/desktop-app/test/e2e-playwright/gfs-agent-delegation.test.ts b/desktop-app/test/e2e-playwright/gfs-agent-delegation.test.ts
index 951290afe..ee4b80816 100644
--- a/desktop-app/test/e2e-playwright/gfs-agent-delegation.test.ts
+++ b/desktop-app/test/e2e-playwright/gfs-agent-delegation.test.ts
@@ -48,7 +48,7 @@ import {
uniqueGfsFixtureName,
} from '../../../tests/e2e/gfsUiFixtures'
import { exactNameFilter } from './helpers/agentLocators'
-import { getManagedAgentPodIdentity } from './helpers/gfsAgentDiscovery'
+import { getManagedAgentDisplayName, getManagedAgentPodIdentity } from './helpers/gfsAgentDiscovery'
import {
type ManagedGfsAgent,
assertGfsInfraHealthy,
@@ -131,12 +131,13 @@ function seedAgentGfsDelegationFixtures(ownerEmail: string): AgentGfsDelegationF
async function openExactAgent(
page: Page,
+ // The rendered label (Host `spec.host`), not the CRD name.
agentName: string,
opts: { reuseThread?: boolean } = {}
): Promise<void> {
await openAgentsPage(page)
await expect(page.getByRole('heading', { name: 'Agents', exact: true })).toBeVisible()
- const row = page.getByLabel(`Open details for ${agentName}`, { exact: true })
+ const row = page.getByLabel(`Open agent ${agentName}`, { exact: true })
await expect(row).toBeVisible({ timeout: 30_000 })
await row.click()
await expect(page.getByText(agentName, { exact: true }).first()).toBeVisible({ timeout: 15_000 })
@@ -481,12 +482,16 @@ async function grantMultipleAgentsViaManageModal(
test.describe('GFS per-agent delegation: UI grant/revoke with full pre/post enforcement (Addendum 1)', () => {
test.describe.configure({ mode: 'serial' })
let fixtures: AgentGfsDelegationFixtures
+ let labelA: string
+ let labelB: string
test.beforeAll(() => {
// Infra guard FIRST: a broken permission-store credential is a blocker to
// fix, never a reason to skip or mock (fail-loud rule).
assertGfsInfraHealthy()
fixtures = seedAgentGfsDelegationFixtures(OWNER_EMAIL)
+ labelA = getManagedAgentDisplayName(fixtures.agentA)
+ labelB = getManagedAgentDisplayName(fixtures.agentB)
})
test.afterAll(() => fixtures?.cleanup())
@@ -512,7 +517,7 @@ test.describe('GFS per-agent delegation: UI grant/revoke with full pre/post enfo
})
await test.step('pre-grant: Agent A is denied without disclosure', async () => {
- await openExactAgent(page, fixtures.agentA.name)
+ await openExactAgent(page, labelA)
const turn = await sendAgentTurn(
page,
`Read the file at path "${filePath}" in GFS drive main and quote its contents ` +
@@ -523,7 +528,7 @@ test.describe('GFS per-agent delegation: UI grant/revoke with full pre/post enfo
})
await test.step('pre-grant: stateless Agent B is denied without disclosure', async () => {
- await openExactAgent(page, fixtures.agentB.name)
+ await openExactAgent(page, labelB)
const turn = await sendAgentTurn(
page,
`Read the file at path "${filePath}" in GFS drive main and quote its contents ` +
@@ -557,7 +562,7 @@ test.describe('GFS per-agent delegation: UI grant/revoke with full pre/post enfo
})
await test.step('Agent A reads the sentinel through the real PVC', async () => {
- await openExactAgent(page, fixtures.agentA.name)
+ await openExactAgent(page, labelA)
const turn = await sendAgentTurn(
page,
`Read the file at path "${filePath}" in GFS drive main and quote its contents ` +
@@ -591,7 +596,7 @@ test.describe('GFS per-agent delegation: UI grant/revoke with full pre/post enfo
})
await test.step('isolation: stateless Agent B is STILL denied after A was granted', async () => {
- await openExactAgent(page, fixtures.agentB.name)
+ await openExactAgent(page, labelB)
const turn = await sendAgentTurn(
page,
`Read the file at path "${filePath}" in GFS drive main and quote its contents ` +
@@ -649,7 +654,7 @@ test.describe('GFS per-agent delegation: UI grant/revoke with full pre/post enfo
})
await test.step('stateless Agent B reads the MODIFIED sentinel (wake + fresh grant)', async () => {
- await openExactAgent(page, fixtures.agentB.name)
+ await openExactAgent(page, labelB)
const turn = await sendAgentTurn(
page,
`Read the file at path "${filePath}" in GFS drive main and quote its contents ` +
@@ -702,7 +707,7 @@ test.describe('GFS per-agent delegation: UI grant/revoke with full pre/post enfo
// revocation. Driving by name in a clean thread forces a real re-access
// through gfsc, which now denies it. Revocation blocks FUTURE access; it
// does not erase context the agent already holds.
- await openExactAgent(page, fixtures.agentA.name)
+ await openExactAgent(page, labelA)
const turn = await sendAgentTurn(
page,
`Read the file at path "${filePath}" in GFS drive main and quote its contents ` +
@@ -716,7 +721,7 @@ test.describe('GFS per-agent delegation: UI grant/revoke with full pre/post enfo
})
await test.step('Agent B still reads fine — revocation is isolated per agent', async () => {
- await openExactAgent(page, fixtures.agentB.name)
+ await openExactAgent(page, labelB)
const turn = await sendAgentTurn(
page,
`Read the file at path "${filePath}" in GFS drive main one more time and quote its ` +
diff --git a/desktop-app/test/e2e-playwright/gfs-agent-file-read.test.ts b/desktop-app/test/e2e-playwright/gfs-agent-file-read.test.ts
index 41fdd0b53..ea87e2748 100644
--- a/desktop-app/test/e2e-playwright/gfs-agent-file-read.test.ts
+++ b/desktop-app/test/e2e-playwright/gfs-agent-file-read.test.ts
@@ -20,6 +20,7 @@
*/
import { expect, test } from '@playwright/test'
import { exactNameFilter } from './helpers/agentLocators'
+import { getManagedAgentDisplayName } from './helpers/gfsAgentDiscovery'
import {
type AgentGfsFixtures,
assertGfsInfraHealthy,
@@ -37,15 +38,15 @@ const PROGRESS_TIMEOUT_MS = 30_000
type Page = import('@playwright/test').Page
async function enterAgentChat(page: Page, agentName: string): Promise<void> {
- // The agents TABLE row opens the workspace in 'details' view — navigating
- // to details does not rebind the composer (only the "Switch chat agent"
- // dropdown does), and the chat lives under the primary nav-chat item. With
- // the single seeded agent the chat home renders "New chat with <agent>" and
- // the ComposerPanel textarea directly; a cold Electron renderer can take a
- // while, so the wait mirrors the 45s entry budget of workflowUi's login
- // poll.
+ // `agentName` is the rendered label (Host `spec.host`), not the CRD name.
+ // The fleet row opens the agent workspace — opening it does not rebind the
+ // composer (only the "Switch chat agent" dropdown does), and the chat lives
+ // under the primary nav-chat item. With the single seeded agent the chat
+ // home renders "New chat with <agent>" and the ComposerPanel textarea
+ // directly; a cold Electron renderer can take a while, so the wait mirrors
+ // the 45s entry budget of workflowUi's login poll.
await openAgentsPage(page)
- const exactAgent = page.getByLabel(`Open details for ${agentName}`, { exact: true })
+ const exactAgent = page.getByLabel(`Open agent ${agentName}`, { exact: true })
await expect(exactAgent).toBeVisible({ timeout: 30_000 })
await exactAgent.click()
await expect(page.getByText(agentName, { exact: true }).first()).toBeVisible()
@@ -161,12 +162,14 @@ test.describe('GFS agent file read (issue #775)', () => {
test.describe.configure({ mode: 'serial' })
let fixtures: AgentGfsFixtures
+ let agentLabel: string
test.beforeAll(() => {
// Infra guard FIRST: a broken permission-store credential is a blocker to
// fix, never a reason to skip or mock (fail-loud rule).
assertGfsInfraHealthy()
fixtures = seedAgentGfsFixtures(OWNER_EMAIL)
+ agentLabel = getManagedAgentDisplayName(fixtures.agent)
})
test.afterAll(() => {
@@ -189,7 +192,7 @@ test.describe('GFS agent file read (issue #775)', () => {
let expandBtn: import('@playwright/test').Locator
let response = ''
await test.step('agent resolves and reads the gfs:// URI', async () => {
- await enterAgentChat(page, fixtures.agent.name)
+ await enterAgentChat(page, agentLabel)
await startFreshThread(page)
// The user drives with the path they just saw in the Files browser —
// never with resource UUIDs or gfs:// URIs, which are internal
@@ -244,7 +247,7 @@ test.describe('GFS agent file read (issue #775)', () => {
const { app, page } = await launchAndLogin(OWNER_EMAIL)
try {
await test.step('user attaches the file from the Global Files picker', async () => {
- await enterAgentChat(page, fixtures.agent.name)
+ await enterAgentChat(page, agentLabel)
await startFreshThread(page)
await page.getByRole('button', { name: 'Add context' }).click()
await page.getByRole('menuitem', { name: 'Global File System' }).click()
@@ -295,7 +298,7 @@ test.describe('GFS agent file read (issue #775)', () => {
const { app, page } = await launchAndLogin(OWNER_EMAIL)
try {
await test.step('agent attempts to read the ungranted gfs:// URI', async () => {
- await enterAgentChat(page, fixtures.agent.name)
+ await enterAgentChat(page, agentLabel)
await startFreshThread(page)
const { response, expandBtn } = await sendGfsTask(
page,
diff --git a/desktop-app/test/e2e-playwright/helpers/gfsAgentDiscovery.ts b/desktop-app/test/e2e-playwright/helpers/gfsAgentDiscovery.ts
index 54bd51f4c..55b5e71b6 100644
--- a/desktop-app/test/e2e-playwright/helpers/gfsAgentDiscovery.ts
+++ b/desktop-app/test/e2e-playwright/helpers/gfsAgentDiscovery.ts
@@ -151,6 +151,29 @@ export function getManagedAgentPodIdentity(agent: ManagedGfsAgent): string {
return identity
}
+/**
+ * The label the Desktop renders for an agent: the Host CRD `spec.host`
+ * (FleetBoard rows, the "Switch chat agent" menu, the chat breadcrumb).
+ * `name` stays the identity for grants, subjects and pods; the two differ in
+ * the Minikube profile (`chatllm` vs `chatLLM`). `spec.host` is required by
+ * the CRD, so an empty value is a broken fixture and fails the suite.
+ */
+export function getManagedAgentDisplayName(agent: ManagedGfsAgent): string {
+ const display = kubectlOut([
+ '-n',
+ agent.namespace,
+ 'get',
+ 'host',
+ agent.name,
+ '-o',
+ 'jsonpath={.spec.host}',
+ ]).trim()
+ if (!display) {
+ throw new Error(`Host ${agent.namespace}/${agent.name} has no spec.host display name`)
+ }
+ return display
+}
+
export function discoverManagedGfsAgent(): ManagedGfsAgent {
const { candidates, candidateErrors } = discoverManagedGfsAgentCandidates()
const agent = chooseManagedGfsAgent(candidates, candidateErrors, process.env.E2E_GFS_AGENT_A)