{"name":"Shortest: AI-Powered Natural Language End-to-End Testing Framework","description":"Shortest is an innovative AI-powered end-to-end testing framework that leverages natural language for test creation and execution. Built on Playwright and utilizing the Anthropic Claude API, it simplifies the QA process by allowing users to define tests in plain English. This tool integrates seamlessly into development workflows, offering features like GitHub 2FA support and email validation.","github":"https://github.com/antiwork/shortest","url":"https://osrepos.com/repo/antiwork-shortest","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/antiwork-shortest","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/antiwork-shortest.md","json":"https://osrepos.com/repo/antiwork-shortest.json","topics":["TypeScript","AI","QA","E2E Testing","Playwright","Anthropic","Test Automation","Natural Language Processing"],"keywords":["TypeScript","AI","QA","E2E Testing","Playwright","Anthropic","Test Automation","Natural Language Processing"],"stars":null,"summary":"Shortest is an innovative AI-powered end-to-end testing framework that leverages natural language for test creation and execution. Built on Playwright and utilizing the Anthropic Claude API, it simplifies the QA process by allowing users to define tests in plain English. This tool integrates seamlessly into development workflows, offering features like GitHub 2FA support and email validation.","content":"## Introduction\n\nShortest is an advanced AI-powered end-to-end testing framework designed to streamline quality assurance through natural language. It enables developers and QA engineers to write comprehensive tests using plain English, abstracting away complex automation details. Built on top of Playwright, Shortest provides robust browser automation capabilities, enhanced by the intelligence of the Anthropic Claude API for dynamic test execution.\n\nKey features include:\n\n*   Natural language-driven E2E testing.\n*   AI-powered test execution using Anthropic Claude API.\n*   Foundation on Playwright for reliable browser interaction.\n*   Seamless GitHub integration, including 2FA support.\n*   Email validation capabilities with Mailosaur.\n\n## Installation\n\nGetting started with Shortest is straightforward. Use the `shortest init` command to quickly set up the framework in your project.\n\nsh\nnpx @antiwork/shortest init\n\n\nThis command automates several steps:\n\n*   Installs the `@antiwork/shortest` package as a dev dependency if not already present.\n*   Creates a default `shortest.config.ts` file with boilerplate configuration.\n*   Generates a `.env.local` file (if absent) with placeholders for essential environment variables, such as `ANTHROPIC_API_KEY`.\n*   Adds `.env.local` and `.shortest/` to your `.gitignore` file.\n\nAfter installation, configure your `shortest.config.ts` file and provide your Anthropic API key.\n\ntypescript\nimport type { ShortestConfig } from \"@antiwork/shortest\";\n\nexport default {\n  headless: false,\n  baseUrl: \"http://localhost:3000\",\n  browser: {\n    contextOptions: {\n      ignoreHTTPSErrors: true\n    },\n  },\n  testPattern: \"**/*.test.ts\",\n  ai: {\n    provider: \"anthropic\",\n  },\n} satisfies ShortestConfig;\n\n\n## Examples\n\nShortest offers a flexible and powerful way to define your tests.\n\n### Basic Test\n\nCreate test files following the pattern specified in your configuration, for example, `app/login.test.ts`:\n\ntypescript\nimport { shortest } from \"@antiwork/shortest\";\n\nshortest(\"Login to the app using email and password\", {\n  username: process.env.GITHUB_USERNAME,\n  password: process.env.GITHUB_PASSWORD,\n});\n\n\n### Using Callback Functions\n\nYou can extend tests with callback functions for additional assertions or logic after the browser execution.\n\ntypescript\nimport { shortest } from \"@antiwork/shortest\";\nimport { db } from \"@/lib/db/drizzle\";\nimport { users } from \"@/lib/db/schema\";\nimport { eq } from \"drizzle-orm\";\n\nshortest(\"Login to the app using username and password\", {\n  username: process.env.USERNAME,\n  password: process.env.PASSWORD,\n}).after(async ({ page }) => {\n  const clerkId = await page.evaluate(() => {\n    return window.localStorage.getItem(\"clerk-user\");\n  });\n\n  if (!clerkId) {\n    throw new Error(\"User not found in database\");\n  }\n\n  const [user] = await db\n    .select()\n    .from(users)\n    .where(eq(users.clerkId, clerkId))\n    .limit(1);\n\n  expect(user).toBeDefined();\n});\n\n\n### Lifecycle Hooks\n\nExecute code before and after test suites or individual tests using lifecycle hooks.\n\ntypescript\nimport { shortest } from \"@antiwork/shortest\";\n\nshortest.beforeAll(async ({ page }) => {\n  // Setup before all tests\n});\n\nshortest.beforeEach(async ({ page }) => {\n  // Setup before each test\n});\n\nshortest.afterEach(async ({ page }) => {\n  await page.close();\n});\n\nshortest.afterAll(async ({ page }) => {\n  // Teardown after all tests\n});\n\n\n### Chaining Tests\n\nShortest supports chaining tests for sequential execution or reusable test flows.\n\ntypescript\n// Sequential test chain\nshortest([\n  \"user can login with email and password\",\n  \"user can modify their account-level refund policy\",\n]);\n\n// Combine flows with spread operator\nconst loginAsLawyer = \"login as lawyer with valid credentials\";\nconst allAppActions = [\"send invoice to company\", \"view invoices\"];\nshortest([loginAsLawyer, ...allAppActions]);\n\n\n### API Testing\n\nTest API endpoints using natural language descriptions or explicit requests.\n\ntypescript\nconst req = new APIRequest({\n  baseURL: API_BASE_URI,\n});\n\nshortest(\n  \"Ensure the response contains only active users\",\n  req.fetch({\n    url: \"/users\",\n    method: \"GET\",\n    params: new URLSearchParams({\n      active: true,\n    }),\n  }),\n);\n\n\nOr a simpler natural language approach:\n\ntypescript\nshortest(`\n  Test the API GET endpoint ${API_BASE_URI}/users with query parameter { \"active\": true }\n  Expect the response to contain only active users\n`);\n\n\n## Why Use Shortest?\n\nShortest revolutionizes the testing process by making it more accessible and efficient. Its natural language interface allows non-technical team members to understand and even contribute to test definitions, fostering better collaboration. The integration of AI, specifically Anthropic Claude, enables more dynamic and intelligent test execution, adapting to UI changes and reducing maintenance overhead. With its Playwright foundation, Shortest ensures reliable and robust end-to-end testing across various browsers. Features like GitHub 2FA login and Mailosaur email validation address common real-world testing challenges, making it a comprehensive solution for modern web applications.\n\n## Links\n\n*   **GitHub Repository**: [https://github.com/antiwork/shortest](https://github.com/antiwork/shortest){target=\"_blank\"}\n*   **NPM Package**: [https://www.npmjs.com/package/@antiwork/shortest](https://www.npmjs.com/package/@antiwork/shortest){target=\"_blank\"}\n*   **Video Tutorial**: [https://github.com/antiwork/shortest/issues/143#issuecomment-2564488173](https://github.com/antiwork/shortest/issues/143#issuecomment-2564488173){target=\"_blank\"}\n*   **CI Setup Example**: [https://github.com/antiwork/shortest/blob/main/.github/workflows/shortest.yml](https://github.com/antiwork/shortest/blob/main/.github/workflows/shortest.yml){target=\"_blank\"}","metrics":{"detailViews":5,"githubClicks":4},"dates":{"published":null,"modified":"2026-05-08T19:13:34.000Z"}}