test(e2e/agents): add create-agent spec for Validation #2

Open New Agent dialog, fill name + model, submit; assert the new row
shows up in the table within 5s. Definition only — no VM.
This commit is contained in:
Ishaan Jaffer 2026-05-06 15:09:14 -07:00
parent 9b3b656671
commit f4e29c1c74
No known key found for this signature in database

View file

@ -0,0 +1,26 @@
/**
* LIT-2881 Validation #2 Create an Agent definition flow.
*
* Click + New Agent, fill name/model/system_prompt, submit; the new row
* appears in the /agents list within 5s. Definition only no VM.
*/
import { test, expect } from "@playwright/test";
import { gotoAgentsList } from "./_helpers";
test("create new agent definition appears in list", async ({ page }) => {
await gotoAgentsList(page);
await page.getByTestId("new-agent-btn").click();
const dialog = page.getByTestId("new-agent-dialog");
await expect(dialog).toBeVisible();
const nameInput = page.getByTestId("new-agent-name").locator("input");
const modelInput = page.getByTestId("new-agent-model").locator("input");
await nameInput.fill("e2e-test-agent");
await modelInput.fill("claude-3-5-sonnet-20241022");
await page.getByRole("button", { name: "Create" }).click();
await expect(dialog).not.toBeVisible({ timeout: 5_000 });
// appears in the list (within 5s)
await expect(page.getByText("e2e-test-agent")).toBeVisible({ timeout: 5_000 });
});