@twai/generator-playwright
v0.0.7
Published
Playwright test generator for TWAI (Test With AI) testing framework
Downloads
788
Readme
@twai/generator-playwright
Playwright test code generator for the TWAI (Test With AI) testing framework.
Installation
pnpm add @twai/generator-playwrightUsage
import { PlaywrightGenerator } from "@twai/generator-playwright";
import type { TestCase } from "@twai/core";
const generator = new PlaywrightGenerator();
const testCase: TestCase = {
id: "login-test",
name: "User can login",
steps: [
{ id: "1", action: "navigate", target: "/login" },
{ id: "2", action: "fill", target: "#email", value: "[email protected]" },
{ id: "3", action: "fill", target: "#password", value: "password" },
{ id: "4", action: "click", target: "button[type=submit]" },
],
};
const generated = generator.generate(testCase, {
outputDir: "./tests",
includeComments: true,
});
console.log(generated.content);Exports
PlaywrightGenerator- Test code generator- Types:
GeneratorOptions,GeneratedTest
