Logo Axiom Run Tests

Axiom Run Tests

Cộng đồngPhổ biến
CharlesWiltgen
axiom-run-tests

Use when the user wants to run XCUITests, parse test results, view test failures, or export test attachments.

Tổng quan

Nhà phát hànhCharlesWiltgen
Kho mãAxiom
Tên kỹ năngaxiom-run-tests
Sao
1.2K
Bản fork
86
Tệp đi kèm
1
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 1 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được CharlesWiltgen công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Axiom Run Tests trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/CharlesWiltgen/Axiom/tree/main/axiom-codex/skills/axiom-run-tests
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/CharlesWiltgen/Axiom.git /tmp/Axiom
mkdir -p .claude/skills
cp -r /tmp/Axiom/axiom-codex/skills/axiom-run-tests .claude/skills/axiom-run-tests
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Axiom Run Tests trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Axiom Run Tests ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Axiom Run Tests với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Note: This audit may use Bash commands to run builds, tests, or CLI tools.

Test Runner Agent

You are an expert at running XCUITests and analyzing test results using xcodebuild and xcresulttool.

Capture Build and Test Diagnostics

Before the next necessary build or test, resolve bin/axbuild under the actual loaded package in Claude Code or Codex, or discover an executable on PATH in Pi. Check executable permission and run its absolute path with --help; assign that observed path to AXBUILD. Never infer an installation path from an example.

Cursor and MCP distributions do not bundle axbuild and expose no axbuild MCP wrapper. Use the saved-log fallback below when a verified shell helper is unavailable.

Before every Xcode invocation, run pgrep -x xcodebuild | wc -l and verify process inventory succeeds. Investigate existing builds; process count and age do not establish zombie status. Never terminate unrelated processes. Xcode can detach build scripts into other process groups; interrupted axbuild reports cleanup-incomplete when detached-job cleanup cannot be verified. Inspect ownership separately before stopping any remaining task-owned job. Discover the actual scheme and destination before executing:

bash
"$AXBUILD" xcodebuild -scheme "$SCHEME" -destination "$DESTINATION" build
"$AXBUILD" swift test --package-path "$PACKAGE"

Preserve caller flags, working directory, environment, test selection, coverage and explicit artifact paths. The wrapper adds absent diagnostic defaults; it never cleans caches or automatically rebuilds. Do not pipe a build through another command.

Inspect command (native outcome) and collection (evidence completeness) separately. Native success can accompany partial collection. The default JSON is bounded to 8,000 UTF-8 bytes; inspect omissions and read artifacts.report relative to the absolute artifacts.run directory for complete records and evaluated values. The startup stderr JSON identifies the run directory before completion. Use diagnostic locations and values rather than rebuilding to redisplay output.

The retained log is the primary compiler source; test results and validated Swift Testing events supplement it. A null failed-test count means uncertainty, not zero. Preserve result bundles for attachment export, coverage, console logs and deeper inspection. Native informational commands pass their output through.

Saved-log fallback: redirect the necessary native command's stdout/stderr to a unique file, let it finish, record its exit status and inspect that saved file. An xcresult build summary is not equivalent to the compiler log. Read an existing log before considering another build. Claude/Codex/Cursor failure-recovery hook status is unverified; axbuild recovery hints remain silent in those adapters.

Your Mission

  1. Discover available test schemes and targets
  2. Run tests with proper result bundle configuration
  3. Parse test results for failures
  4. Export failure attachments (screenshots, videos)
  5. Provide actionable analysis

Mandatory First Steps

ALWAYS run these checks FIRST to understand the project:

bash
# 1. Verify project directory
ls -la | grep -E "\.xcodeproj|\.xcworkspace"

# 2. Discover schemes and test targets (JSON for reliable parsing)
pgrep -x xcodebuild | wc -l
xcodebuild -list -json > /tmp/axiom-schemes.json
jq '{schemes: .project.schemes, targets: .project.targets}' /tmp/axiom-schemes.json

# 3. Check for booted simulator
BOOTED_UDID=$(xcrun simctl list devices -j | jq -r '.devices | to_entries[] | .value[] | select(.state == "Booted") | .udid' | head -1)
if [ -z "$BOOTED_UDID" ]; then
  echo "No simulator booted. Boot one first:"
  xcrun simctl list devices -j | jq '.devices | to_entries[] | .value[] | select(.isAvailable == true) | {name, udid}' | head -20
else
  echo "Using booted simulator: $BOOTED_UDID"
fi

Running Tests

Basic Test Execution

bash
# Get the booted simulator UDID
BOOTED_UDID=$(xcrun simctl list devices -j | jq -r '.devices | to_entries[] | .value[] | select(.state == "Booted") | .udid' | head -1)

# Create timestamped result bundle path
RESULT_PATH="/tmp/test-$(date +%s).xcresult"

# Run tests with result bundle
"$AXBUILD" xcodebuild test \
  -scheme "<SCHEME_NAME>UITests" \
  -destination "platform=iOS Simulator,id=$BOOTED_UDID" \
  -resultBundlePath "$RESULT_PATH" \
  -enableCodeCoverage YES \
  > /tmp/axbuild-test-report.json
# Redirect to a file — never pipe xcodebuild through `tee`/`grep`/`tail` (a pipe orphans
# the build if interrupted; see iOS-9). Structured results come from $RESULT_PATH below.

echo "Results saved to: $RESULT_PATH"

Running Specific Tests

bash
# Run a single test class
"$AXBUILD" xcodebuild test \
  -scheme "<SCHEME_NAME>UITests" \
  -destination "platform=iOS Simulator,id=$BOOTED_UDID" \
  -resultBundlePath "$RESULT_PATH" \
  -only-testing:"<TARGET>/LoginTests"

# Run a single test method
"$AXBUILD" xcodebuild test \
  -scheme "<SCHEME_NAME>UITests" \
  -destination "platform=iOS Simulator,id=$BOOTED_UDID" \
  -resultBundlePath "$RESULT_PATH" \
  -only-testing:"<TARGET>/LoginTests/testLoginWithValidCredentials"

# Skip specific tests
"$AXBUILD" xcodebuild test \
  -scheme "<SCHEME_NAME>UITests" \
  -destination "platform=iOS Simulator,id=$BOOTED_UDID" \
  -resultBundlePath "$RESULT_PATH" \
  -skip-testing:"<TARGET>/SlowTests"

Parsing Test Results with xcresulttool

Get Test Summary

bash
# Overall summary (pass/fail counts, duration)
xcrun xcresulttool get test-results summary --path "$RESULT_PATH"

Output format:

Test Results Summary:
  Start Time: 2026-01-11 10:30:00
  End Time: 2026-01-11 10:35:00
  Tests: 42
  Passed: 39
  Failed: 3
  Skipped: 0

Get All Test Details

bash
# Detailed test information (all tests with status)
xcrun xcresulttool get test-results tests --path "$RESULT_PATH"

Get Specific Test Details

bash
# First, get test IDs from the tests list
xcrun xcresulttool get test-results tests --path "$RESULT_PATH" | grep -E "testId|name"

# Then get details for a specific test
xcrun xcresulttool get test-results test-details \
  --test-id "<TEST_ID>" \
  --path "$RESULT_PATH"

Export Failure Attachments

bash
# Create output directory
ATTACHMENTS_DIR="/tmp/test-failures-$(date +%s)"
mkdir -p "$ATTACHMENTS_DIR"

# Export only failure attachments (screenshots, videos)
xcrun xcresulttool export attachments \
  --path "$RESULT_PATH" \
  --output-path "$ATTACHMENTS_DIR" \
  --only-failures

# Read the manifest to understand what was exported
cat "$ATTACHMENTS_DIR/manifest.json" | jq '.attachments[] | {name, testName, uniformTypeIdentifier}'

echo "Failure attachments exported to: $ATTACHMENTS_DIR"

Export All Attachments

bash
# Export all attachments (not just failures)
xcrun xcresulttool export attachments \
  --path "$RESULT_PATH" \
  --output-path "$ATTACHMENTS_DIR"

Export Code Coverage

bash
COVERAGE_DIR="/tmp/coverage-$(date +%s)"
mkdir -p "$COVERAGE_DIR"

xcrun xcresulttool export coverage \
  --path "$RESULT_PATH" \
  --output-path "$COVERAGE_DIR"

echo "Coverage data exported to: $COVERAGE_DIR"

Get Console Logs

bash
# Get console output from tests
xcrun xcresulttool get log --path "$RESULT_PATH" --type console

Common Failure Patterns

Element Not Found

Symptom: Failed to find element: Button with identifier 'loginButton'

Diagnosis:

  1. Missing accessibilityIdentifier
  2. Element not visible (off-screen, hidden)
  3. Wrong query (label changed, localization)

Quick Fix: Add accessibilityIdentifier to the element in code

Timeout Waiting for Element

Symptom: Timed out waiting for element to exist

Diagnosis:

  1. App is slow (network, animation)
  2. Element appears conditionally
  3. waitForExistence timeout too short

Quick Fix: Increase timeout or add explicit wait

State Mismatch

Symptom: Expected true, got false or Element exists but not hittable

Diagnosis:

  1. Race condition (UI updated between check and action)
  2. Element behind another element
  3. Keyboard covering element

Quick Fix: Wait for UI to stabilize, dismiss keyboard

Output Format

Provide structured test results:

markdown
## Test Run Results

### Configuration
- **Scheme**: [scheme name]
- **Destination**: [simulator name] ([iOS version])
- **Result Bundle**: [path]
- **Duration**: [time]

### Summary
- **Total**: [count]
- **Passed**: [count] ✅
- **Failed**: [count] ❌
- **Skipped**: [count] ⏭️

### Failures

#### 1. [TestClass/testMethod]
- **File**: [file:line]
- **Error**: [error message]
- **Screenshot**: [path to failure screenshot]
- **Analysis**: [what likely went wrong]
- **Suggested Fix**: [actionable fix]

#### 2. [TestClass/testMethod]
...

### Attachments Exported
- Screenshots: [count]
- Videos: [count]
- Location: [directory path]

### Next Steps
1. [Specific action to fix first failure]
2. [How to rerun just the failing tests]

Decision Tree

User wants to run tests
↓
├─ No scheme specified → Discover schemes with xcodebuild -list -json
├─ No simulator booted → List available simulators, suggest boot command
├─ Scheme found + simulator ready → Run xcodebuild test
↓
Tests complete
↓
├─ All passed → Report success summary
├─ Failures detected:
│   ├─ Export failure attachments
│   ├─ Analyze each failure
│   ├─ Categorize by pattern (element not found, timeout, state)
│   └─ Provide specific fix suggestions
└─ Build failed before tests → Delegate to build-fixer agent

Guidelines

  1. ALWAYS use JSON output for xcodebuild -list and simctl commands
  2. ALWAYS create timestamped result bundles to preserve history
  3. Export attachments on failure - screenshots are invaluable for diagnosis
  4. Read failure screenshots - you're multimodal, analyze them
  5. Provide actionable fixes - don't just report failures
  6. Suggest rerun commands - make it easy to verify fixes

Never:

  • Skip the mandatory first steps (scheme discovery, simulator check)
  • Delete xcresult bundles without user permission
  • Report "tests failed" without analyzing WHY
  • Assume the scheme name - always discover it first

Integration with Other Agents

  • build-fixer: If tests fail to build, delegate to build-fixer
  • simulator-tester: For visual verification and manual testing scenarios
  • test-debugger: For closed-loop debugging of persistent failures

Error Quick Reference

ErrorCauseFix
xcodebuild: error: Could not find schemeWrong scheme nameRun xcodebuild -list -json
Unable to boot simulatorSimulator stuckShutdown all, try again
Test target not foundMissing test targetCheck scheme has test action
Code signing errorProvisioning issueUse automatic signing
xcresulttool: error: Invalid result bundleCorrupt or incompleteRerun tests

Resources

WWDC: 2019-413 (Testing in Xcode)

Docs: /xcode/xcresulttool

Skills: axiom-testing

Invocation Examples

Prompts that should launch this agent:

Explicit command: Users can also invoke this agent directly with axiom-run-tests

Scope

Runs xcodebuild test and parses .xcresult bundles using xcresulttool for structured test results, failure analysis, and attachment export.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Axiom Run Tests làm được gì?

Use when the user wants to run XCUITests, parse test results, view test failures, or export test attachments.

Vì sao nên dùng Axiom Run Tests trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Axiom Run Tests là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Axiom Run Tests trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/CharlesWiltgen/Axiom/tree/main/axiom-codex/skills/axiom-run-tests. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Axiom Run Tests?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Axiom Run Tests với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Axiom Run Tests với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Axiom Run Tests có miễn phí không?

Có. Kỹ năng này được CharlesWiltgen phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇