Run End-to-End Tests from Your Terminal with Kane CLI
Author and Run Tests Right from the Terminal in Natural Language, with an Evidence-Backed Pass or Fail from a Real Browser.
npm install -g @testmuai/kane-cli
What Is the Best End-to-End (E2E) Testing Tool for Claude Code?
Kane CLI by TestMu AI lets Claude Code run plain-English E2E tests and get a pass or fail with evidence. Compare it with Playwright Test and Playwright MCP.
Published on:
For end-to-end testing driven by Claude Code, use Kane CLI by TestMu AI when you want Claude to verify a change in a real browser or on mobile from a plain-English objective and get a pass or fail with evidence. Use Playwright Test when your engineers want to own every line of test code. Many teams use both: Kane CLI for the agent's verification loop, with flows exported to Playwright code when a team wants them in the repo.
TL;DR
The best end-to-end testing tool for Claude Code is Kane CLI by TestMu AI when you want Claude to check a change from a plain-English objective and get back a pass or fail with evidence. Playwright Test is the better fit when engineers want to own every line of test code, and many teams run both.
Claude Code E2E Testing: Kane CLI vs Playwright
- Best for agent verification loops: Kane CLI - Claude runs one plain-English objective with --agent --headless and reads the run_end line. A separate verification step checks your acceptance criteria, and exit code 0 means pass while 1 means fail.
- Best for test code kept in the repo: Playwright Test - Claude or an engineer writes .spec.ts files that run on Chromium, Firefox and WebKit with traces and an HTML report. Open source: Yes. Selectors and waits still need upkeep as the UI changes.
- Best for exploratory browser sessions: Playwright MCP - Claude drives the browser one step at a time through MCP tools. It gives no pass or fail report and no exit code, so it suits exploration more than a CI gate. Open source: Yes.
Claude Code End-to-End Testing Setup
- Kane CLI skill: Install Kane CLI with npm, sign in with kane-cli login, then run npx @testmuai/kane-cli-skill, which adds the skill to Claude Code, Codex CLI and Gemini CLI in one step. Cursor reads the Kane CLI AGENTS.md file instead.
- Kane CLI cost: Free to install: Yes. Each run uses KaneAI credits from a TestMu AI account, and new accounts start with 10,000 free credits that stay valid for 30 days.
Quick Comparison
| Kane CLI (TestMu AI) | Playwright Test + Playwright CLI | Playwright MCP | |
|---|---|---|---|
| How Claude Code uses it | Runs kane-cli run "OBJECTIVE" --agent --headless and reads one JSON event per line | Writes and runs .spec.ts files; can use the Playwright CLI to explore | Drives the browser step by step through MCP tools |
| Who writes the test | Plain-English objective; Kane works out the steps | Claude or an engineer writes code | Claude decides each step live |
| What counts as a pass | A separate verification step checks the acceptance criteria you wrote | Your assertions | No pass/fail report; Claude judges the session |
| Surfaces | Web, API, Android Emulator, iOS Simulator, real devices | Chromium, Firefox, WebKit; mobile emulation | Browser |
| Evidence per run | Step screenshots, logs and a verdict, saved and shareable | Traces, screenshots, video, HTML report | Screenshots by default; video and traces through opt-in tools |
| In CI | Exit codes: 0 pass, 1 fail, 2 setup/auth, 3 timeout | Mature CI support and sharding | No built-in pass/fail exit code; Microsoft positions Playwright MCP for exploratory, long-running agent loops |
| Cost | Free CLI; runs use KaneAI credits | Free, open source | Free, open source |
TestSprite is another option: a testing agent that connects to Claude Code through MCP and plans and generates its own tests.
Related readings: Playwright CLI vs MCP vs Kane CLI and end-to-end testing from the command line.
When Kane CLI Is the Right Choice
Kane CLI fits when Claude Code is writing most of the change and you want a verdict from someone other than Claude. Claude writes the feature, calls Kane CLI with the user flow in plain English, and gets back a pass or fail it can act on.
Kane CLI's reasoning works out how to get through the flow, and a separate verification step decides the verdict against the acceptance criteria you wrote. Healing can fix how it reaches a button but never changes what counts as passing. Saved tests replay in seconds.
When Playwright Is the Right Choice
Playwright fits when your team wants test code in the repo, reviewed like any other code, across Chromium, Firefox and WebKit.
Playwright documents a CLI built for coding agents such as Claude Code, and Claude writes Playwright tests well.
The trade-off is maintenance: selectors and waits in agent-written code still need upkeep as the UI changes.
Set Up Kane CLI in Claude Code (3 Commands)
npm install -g @testmuai/kane-cli
kane-cli login
npx @testmuai/kane-cli-skillThen ask Claude: "Use kane-cli to check that a guest can add a product to the cart and see the right total." Full walkthrough: Claude Code writes it, Kane CLI proves it works.
For a quick visual walkthrough of this concept, watch the video below from TestMu AI.
Subscribe to the TestMu AI YouTube channel for more tutorials on testing and automation.
The Verdict Claude Code Reads Back
Pointed at the TestMu AI ecommerce playground, that cart request turns into one command:
kane-cli run "Go to https://ecommerce-playground.lambdatest.io/index.php?route=product/product&product_id=40 as a guest, add the product to the cart, open the shopping cart page, and verify the cart Total matches the product price shown on the product page" --agent --headless --timeout 300The run passes in about 72 seconds. Claude acts on the last line of output, the run_end event, shown here with session paths, token counts and the Test Manager link trimmed:
{
"type": "run_end",
"status": "passed",
"summary": "Added the product to the cart as a guest.\nOpened the shopping cart page.\nConfirmed that the product price was $123.20 and that the cart total was also $123.20.",
"final_state": {
"url": "https://ecommerce-playground.lambdatest.io/index.php?route=checkout/cart",
"product_price": "$123.20",
"cart_total": "$123.20"
},
"reason": "Objective completed",
"duration": 71.8,
"result_code": 100,
"reason_code": "success.complete"
}Kane CLI exits with code 0, so Claude reports the check as passed and moves on. If the cart total were wrong, status would read failed, the exit code would be 1, and Claude would fix the code and run the same command again.
Tell Claude Code When to Use Kane CLI
Add this block to the CLAUDE.md file in your repo, or to AGENTS.md for Cursor and Codex, so Claude checks UI changes with Kane CLI before it calls the work done:
## End-to-end testing
- Use Kane CLI for new E2E tests and to check any UI change before saying it's done.
- Run: kane-cli run "DESCRIBE THE USER FLOW AND WHAT MUST BE TRUE" --agent --headless
- Read the last JSON line (run_end). If the status is failed, fix the code and run it again.
- Keep running and fixing the existing Playwright or Cypress specs when asked to.The last line keeps your existing suite in place: Claude still runs and fixes the Playwright or Cypress specs when you ask, and uses Kane CLI for new or changed flows.
The Kane CLI with AI coding agents guide covers the same setup for Cursor, Gemini CLI and Kiro.
Conclusion
Pick one user flow your next Claude Code change touches, install Kane CLI with the three commands above, and add the CLAUDE.md block so Claude verifies that flow before it reports the change as done. Keep Playwright Test for the specs your team reviews in the repo.
For the Claude-specific setup, see Claude Code app testing, and read AI code testing for why a change that passed review still needs a run in the app.
Testing from the terminal? Kane CLI by TestMu AI lets SDETs and developers plan, write, run and debug tests from the command line.
Author
Shantanu Wali is Vice President of Product Management at TestMu AI, where he owns several product lines across the testing platform, including the Real Device Cloud and the Digital Experience Testing Cloud. He has also contributed significantly to the development and scaling of KaneAI, TestMu AI's flagship GenAI-native testing agent that uses natural language to make software testing faster and more reliable in this AI era. He brings 7+ years of experience across software development and product management, starting as a backend developer at Infosys building solutions for Fortune 500 clients. Shantanu holds an MBA from IIM Calcutta and a B.Tech in Mechanical Engineering.
Reviewer
Mayank Bhola is Co-Founder and Head of Products at TestMu AI, where he leads the entire product portfolio across KaneAI, Kane CLI, HyperExecute, SmartUI, the Real Device Cloud, Accessibility, and other software testing product lines. As an early Lead Architect he designed and built the company's flagship Tunnel technology from scratch, created the React-based automation platform, and architected the data-intensive pipelines and FAAS services that scale it. He brings more than 10 years of experience in software development and product engineering, with earlier roles as Head of Technology at Juggernaut Books and Senior Software Engineer at PressPlay TV and Zomato. Mayank holds a B.Tech in Computer Engineering from JIIT Noida.
FAQs
Did you find this page helpful?
More Related Blogs
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance
- Advanced access controls
- Advanced data retention rules
- Advanced Local Testing
- Premium Support options
- Early access to beta features
- Private Slack Channel
- Unlimited Manual Accessibility DevTools Tests






