Skip to content

Guide · Agent skill

How to use the E2E Testing skill for Qwen Code agents

Updated · written with AI from the project's own documentation and checked against our catalogue data

The e2e-testing skill is a playbook that tells an AI coding agent how to test the Qwen Code command-line tool the way a real user would: against a live model, through a terminal session, and with the raw API requests recorded. It is written for maintainers and contributors working inside the Qwen Code repository. After this guide you will know what the skill does, how to install it, how to trigger it with plain requests, and which safety precautions apply.

End-to-End Testing for Qwen CodeQwenLM/qwen-code · Apache-2.0

Quick start

  1. 1Download and unzip the skill. Download the ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder, or upload it under Settings → Capabilities → Skills in the Claude apps.
  2. 2Check the prerequisites. Confirm Node.js, npm, Python 3, tmux and the Qwen Code CLI are available, and that model credentials are stored in ~/.qwen.
  3. 3Describe the test in plain language. Ask the agent to verify a bug, fix or MCP integration, and say whether a real model call is needed.
  4. 4Choose headless or interactive mode. Use headless JSON output for structured checks and tmux for terminal rendering or keyboard behaviour.
  5. 5Capture API traffic if needed. Add --openai-logging and --openai-logging-dir to inspect the exact requests and responses.
  6. 6Review the results and clean up. Check the output, summarise token usage if relevant, and kill any tmux session you started.

What the skill makes the agent do

Without the skill, an agent has to work out the steps for end-to-end testing on its own. With it, the agent follows a documented process: choose the right binary, run the CLI in headless JSON mode or in an interactive tmux session, and capture the raw requests sent to the model.

The skill also points to helper files: a zero-dependency MCP test server template, a mock OpenAI-style model server for scripted scenarios, and a token usage summary script for logged requests.

  • Reproduce user-reported bugs using the globally installed qwen command
  • Verify fixes by building and running node dist/cli.js
  • Test MCP tool integrations with a custom test server
  • Inspect raw API request and response payloads
  • Summarise token usage from logged API calls

How do you install the e2e-testing skill?

Download the skill ZIP from this page and unzip it into one of two locations. For a personal setup, unzip it into ~/.claude/skills/. For a single project, unzip it into that project's .claude/skills/ folder.

In the Claude apps you can instead upload the ZIP under Settings → Capabilities → Skills.

  • Personal: ~/.claude/skills/
  • Project: .claude/skills/ inside your project
  • Claude apps: Settings → Capabilities → Skills

What do you need before running the tests?

The skill assumes the Qwen Code repository and its setup. Plan for the following before asking the agent to run anything.

  • Node.js and npm, to build and run the CLI
  • Python 3, for scripts/token-stats.py
  • tmux, for interactive terminal testing
  • The Qwen Code CLI installed globally or built from the repository
  • Model provider credentials stored in ~/.qwen (for example an OpenAI-compatible or Anthropic key), needed for real model calls
  • Network access, since the tests call a live model

How do you trigger the skill with natural requests?

The skill's description lists the phrases that should activate it. You do not need to name the skill. Ask for what you want verified, using words such as E2E testing, headless testing, MCP tool testing, or reproducing an issue.

Describe the bug or behaviour in the request and say whether you want a real model call. The agent will then choose headless or interactive mode based on what you need to see.

  • Run an E2E test of this bug report against a real model in headless mode
  • Verify my fix works in the built bundle with real model calls
  • Test how the CLI handles my custom MCP tool server
  • Capture the raw API requests for this prompt and show the tool arguments
  • Reproduce this issue end to end and report the token usage

How do headless and interactive modes work?

Headless mode runs the CLI non-interactively and prints one JSON array of messages at the end of the turn. Interactive mode runs the CLI inside a tmux session, which is useful for checking what the user sees, permission prompts, slash commands and keyboard input.

To force a known provider, the skill passes --auth-type together with --model. --model alone does not switch providers.

  • Headless: use --output-format json and filter with jq, starting with .[]
  • Interactive: launch in tmux, send prompts, poll for the esc to cancel status line, then capture the pane
  • Use QWEN_RUNTIME_DIR to keep test runs out of your real chat history
<qwen> "your prompt here" --approval-mode yolo --output-format json 2>/dev/null

How do you test MCP servers and inspect API traffic?

For MCP testing, the skill says MCP servers must be configured in .qwen/settings.json under mcpServers. Other locations such as .mcp.json or a --mcp-config flag do not work for Qwen Code. The CLI also needs a git repository to load project settings.

To inspect raw traffic, add the logging flags. Each API call is written as a JSON file in the directory you specify. The file's request.messages holds the conversation history, and response.choices holds the model's reply.

  • MCP config: .qwen/settings.json under mcpServers
  • Use references/mcp-testing.md and scripts/mcp-test-server.js as the starting point
  • Use references/mock-openai-server.md when you need deterministic or unusual model responses
  • Summarise token usage with python3 scripts/token-stats.py 20
<qwen> "prompt" --approval-mode yolo --output-format json --openai-logging --openai-logging-dir /tmp/api-logs

What safety precautions apply?

The tests use real API keys from ~/.qwen. A real model call can cost money, and a run that is not isolated can write to your chat history or auto-memory. The skill includes scripts and makes network calls, so read them before running them on a machine you care about.

Use a throwaway directory and QWEN_RUNTIME_DIR for experiments. Avoid running the skill against real accounts on shared machines without care.

  • Real keys in ~/.qwen can spend money on each model call
  • Runs can write chat recordings, auto-memory and history unless QWEN_RUNTIME_DIR is set
  • The skill runs scripts and uses the network, so review them first
  • Unsupported key combinations in tmux may need manual testing

Tips for reliable E2E runs

Keep the runs small and specific. Use headless mode for structured output and interactive mode only when the bug involves the terminal interface. When polling a tmux session, wait for the esc to cancel status line to disappear rather than sleeping for a fixed time, because the footer placeholder is always visible.

  • Split prompt text and Enter with a short delay in tmux, or the submit may be swallowed
  • Use --auth-type with --model to pick a provider reliably
  • Use tmux capture-pane -p -S -100 to read the last 100 lines of scrollback
  • Kill the tmux session when you finish
tmux kill-session -t test

What people use it for

  • Maintainers reproducing a user-reported bug end to end with the globally installed qwen command
  • Contributors confirming that a fix works in the built dist/cli.js bundle with real model calls
  • Developers testing how the CLI loads and uses a custom MCP tool server defined in .qwen/settings.json
  • Engineers debugging wrong tool arguments by reading the logged request and response files
  • Teams checking prompt caching or unexpected token counts with token-stats.py

Frequently asked questions

Is the e2e-testing skill free and what is its licence?

The item is listed under the Apache-2.0 licence. The skill is a set of instructions and helper files for an agent, and it is meant for use inside the Qwen Code repository.

What do I need to install before using this skill?

You need Node.js and npm to build and run the CLI, Python 3 for the token stats script, tmux for interactive testing, and the Qwen Code CLI. Real model calls also need provider credentials stored in ~/.qwen.

Where do I put the skill folder?

Unzip the downloaded ZIP into ~/.claude/skills/ for personal use or into a project's .claude/skills/ folder. In the Claude apps you can upload the ZIP under Settings → Capabilities → Skills.

Can I use this skill outside the Qwen Code repository?

The source describes it as specific to Qwen Code. Its commands, paths and setup assume the Qwen Code repository, so it is not meant for projects that do not use Qwen Code.

Why does my headless run fail with a missing key error?

The skill says --model alone does not switch providers. Pass --auth-type (for example openai or anthropic) along with --model so the CLI uses the right credentials instead of the default provider.

Will running these tests change my chat history?

It can. The skill says QWEN_RUNTIME_DIR redirects chat recordings, auto-memory and history into a directory you choose. Use it for repeated test runs unless the bug depends on your real history.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits Qwen Code maintainers and contributors who need to reproduce bugs or verify fixes with real model calls, MCP servers and raw API logs. It is not a good fit for ordinary Qwen Code users or for other projects, and anyone running it should use isolated directories and be aware that real keys can spend money.

Download the skill