Logo de Axiom Run Tests

Axiom Run Tests

ComunidadePopular
CharlesWiltgen
axiom-run-tests

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

Visão geral

Publicado porCharlesWiltgen
RepositórioAxiom
Nome da habilidadeaxiom-run-tests
Estrelas
1.2K
Forks
86
Arquivos incluídos
1
LicençaMIT
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    As habilidades de IA são escritas em Markdown simples, não em código específico de um provedor. Por isso, funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Arquivos incluídos: 1

    Scripts, templates e referências que o modelo pode ler enquanto trabalha. Os arquivos são somente para leitura e nunca são executados.

  • Código aberto

    Publicada por CharlesWiltgen no GitHub. Leia os arquivos da habilidade antes de instalá-la.

Instalação

Instale a habilidade de IA Axiom Run Tests no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL abaixo, que aponta para a pasta da habilidade, e confirme.
    https://github.com/CharlesWiltgen/Axiom/tree/main/axiom-codex/skills/axiom-run-tests
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Adicionar habilidade → Via URL do GitHub. Depois, cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

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
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Axiom Run Tests em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Axiom Run Tests automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Axiom Run Tests não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

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.

Arquivos incluídos

O modelo lê esses arquivos sob demanda enquanto a habilidade está carregada. Eles são disponibilizados para leitura e nunca são executados.

Perguntas frequentes

O que a habilidade de IA Axiom Run Tests faz?

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

Por que usar Axiom Run Tests no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. A habilidade Axiom Run Tests é escrita em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. No TypingMind, você usa suas próprias chaves de API e paga diretamente aos provedores, em vez de pagar uma assinatura por licença de usuário. Suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Axiom Run Tests no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/CharlesWiltgen/Axiom/tree/main/axiom-codex/skills/axiom-run-tests. O TypingMind lê o arquivo SKILL.md, reúne os arquivos da habilidade e a instala para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Axiom Run Tests?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Axiom Run Tests?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Axiom Run Tests com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Axiom Run Tests é gratuita?

Sim. A habilidade é publicada no GitHub por CharlesWiltgen sob a licença MIT. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, templates ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas que ele pode acionar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA dá ao modelo o conhecimento e as orientações de que ele precisa: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇