Describe intent
Start from the acceptance criteria, written the way a product owner would say it.
Kane AI, LambdaTest's AI testing agent, turns plain-English intent into runnable test steps. I use it to get from acceptance criteria to a first draft fast, and I treat that draft the way I treat any pull request: it gets reviewed before it ships.
The speed comes from the agent. The trust comes from step three.
Start from the acceptance criteria, written the way a product owner would say it.
The agent breaks the intent into navigate, type, click and assert steps against the real app.
I check each assertion against the spec, add the edge cases, and fix anything that tests the wrong thing.
Reviewed tests become code in the repo, follow its conventions, and run in CI like everything else.
Pick a user story. The agent plans it, then the review step catches the one thing the AI got subtly wrong.
Pick a story to start.
Once it lands in the repo, AI-drafted code is held to the same standard as hand-written code.
import { test, expect } from "@playwright/test";
// The agent proposed the first case; review widened it into a table.
const cases = [
{ name: "wrong password", email: "ada@example.com", password: "nope", error: "Invalid email or password" },
{ name: "unknown email", email: "ghost@example.com", password: "Secret123!", error: "Invalid email or password" },
{ name: "empty password", email: "ada@example.com", password: "", error: "Password is required" },
];
for (const c of cases) {
test(`login rejects ${c.name}`, async ({ page, context }) => {
await page.goto("/login");
await page.getByLabel("Email").fill(c.email);
await page.getByLabel("Password").fill(c.password);
await page.getByRole("button", { name: "Sign in" }).click();
await expect(page.getByRole("alert")).toHaveText(c.error);
// Added in review: the outcome, not just the message
await expect(page).toHaveURL(/\/login/);
const cookies = await context.cookies();
expect(cookies.find((cookie) => cookie.name === "session")).toBeUndefined();
});
}
# Review checklist for AI-drafted tests
- [ ] Every assertion maps to an acceptance criterion, not just to "what the page showed"
- [ ] Asserts the outcome (state, data, session), not only the UI message
- [ ] Negative and boundary cases exist, not just the happy path
- [ ] Locators are role/label based; no brittle CSS chains
- [ ] Test data is synthetic: no real customer data in prompts or fixtures
- [ ] Follows repo conventions: fixtures, page objects, naming
- [ ] Runs green 3x in a row locally before it joins CI
Authoring comes first: better drafts in, faster, means more coverage by the time the execution stage runs.
AI makes writing tests cheap. It doesn't make knowing what to test cheap. That part stays with the engineer.