diff --git a/tests/runner-e2e/chat-catalog-domains/runtime-session.ts b/tests/runner-e2e/chat-catalog-domains/runtime-session.ts index adaf2a55026..726a994fb6d 100644 --- a/tests/runner-e2e/chat-catalog-domains/runtime-session.ts +++ b/tests/runner-e2e/chat-catalog-domains/runtime-session.ts @@ -53,11 +53,12 @@ export const runtimeSessionCases = [runtimeDefinition("runs-adapters.reset-sessi state.agentResetStatus = await probeAgentPermission(ctx, `/api/agents/${worker.id}/runtime-state/reset-session`, "POST", {}); state.sessionPresentBeforeHuman = (await ctx.input.api.get(`/api/agents/${worker.id}/task-sessions`)).length > 0; const source = ctx.input.page.url(); await openRuntimeAgentProfile(ctx, worker, query); - const profile = ctx.input.page.locator("#main-content"); - await expect(profile.getByRole("heading", { name: worker.name!, exact: true })).toBeVisible(); + // The profile header's h1 is Morgan's title; openRuntimeAgentProfile already confirmed whose + // profile this is by its named avatar. The reset control lives in the header's actions menu. + const profile = ctx.input.page.getByRole("main"); await profile.getByRole("button", { name: `Open actions for ${worker.name}`, exact: true }).click(); chatCatalogNativePhaseRemainingBudget(ctx)?.(); - await ctx.input.page.getByRole("button", { name: "Reset Sessions", exact: true }).click(); + await ctx.input.page.getByRole("button", { name: /^Reset sessions$/i }).click(); await pollUntil({ label: "Human reset clears the real task session", deadlineAt: Date.now() + 30_000, load: () => ctx.input.api.get(`/api/agents/${worker.id}/task-sessions`), accept: rows => rows.length === 0 }); state.humanReset = true; state.sessionsEmptyAfterHuman = true;