The test-runner.sh script provides a comprehensive, automated solution for building and testing the AXe iOS testing framework.
✅ Automated Build Process
- Builds the AXe CLI executable (
swift build) - Builds and installs the AxePlayground app on iPhone 16 simulator
- Handles simulator setup and management
✅ Comprehensive Testing
- Runs individual test suites or entire test plan
- Sequential execution to prevent state conflicts
- Proper environment variable setup (
SIMULATOR_UDID,AXE_E2E=1)
✅ Flexible Options
- Build-only mode for CI/CD pipelines
- Test-only mode for rapid iteration
- Clean build support
- Verbose output for debugging
- Xcode: Latest version with iOS simulator support
- Swift: For building the AXe CLI tool
- iPhone 16 Simulator: Must be available in Xcode Simulator
# Make script executable (first time only)
chmod +x test-runner.sh
# Run everything (build + test)
./test-runner.sh
# Show help
./test-runner.sh --help# Build AXe executable, install playground app, run all tests
./test-runner.sh
# Same as above but with clean build
./test-runner.sh --clean# Build everything and run only swipe tests
./test-runner.sh SwipeTests
# Run only tap tests (skip building)
./test-runner.sh --tests-only TapTests
# Run all tests with verbose output
./test-runner.sh --verbose# Just build everything (useful for CI)
./test-runner.sh --build-only
# Clean build without running tests
./test-runner.sh --clean --build-only| Test Suite | Description |
|---|---|
SwipeTests |
Swipe gesture testing with coordinate accuracy and direction detection |
TapTests |
Tap coordinate accuracy and timing |
KeyTests |
Keyboard input simulation |
TouchTests |
Low-level touch event sequences |
TypeTests |
Text input simulation |
ButtonTests |
Hardware button press simulation |
GestureTests |
Predefined gesture patterns |
ListSimulatorsTests |
Simulator discovery and listing |
| Option | Description |
|---|---|
-h, --help |
Show help message |
-b, --build-only |
Only build (skip tests) |
-t, --tests-only |
Only run tests (skip building) |
-c, --clean |
Clean build before building |
-s, --sequential |
Run tests sequentially (default) |
-v, --verbose |
Verbose output |
The script is pre-configured for:
- Simulator: iPhone 16 (UDID:
B34FF305-5EA8-412B-943F-1D0371CA17FF) - App: AxePlayground (
com.cameroncooke.AxePlayground) - Project:
AxePlaygroundApp/AxePlayground.xcodeproj
To change these settings, edit the configuration section at the top of test-runner.sh.
The script automatically sets up the following environment:
SIMULATOR_UDID: Set to the configured iPhone 16 simulatorAXE_E2E=1: Enables simulator E2E tests- Sequential test execution (prevents state conflicts)
- Clean app state between test suites
"Simulator not found"
# List available simulators
xcrun simctl list devices | grep iPhone
# Update SIMULATOR_UDID in script if needed"Build failed"
# Try a clean build
./test-runner.sh --clean --build-only
# Check Xcode and Swift installation
xcode-select --print-path
swift --version"Tests failed"
# Run specific test suite with verbose output
./test-runner.sh --verbose SwipeTests
# Check if app is properly installed
xcrun simctl list apps B34FF305-5EA8-412B-943F-1D0371CA17FF- Sequential Testing: Tests run sequentially by default to prevent state conflicts
- Build Time: Initial builds take longer; subsequent builds are incremental
- Test Duration: Full test suite takes ~5-10 minutes depending on system performance
- name: Run AXe Tests
run: |
chmod +x test-runner.sh
./test-runner.sh --verbose# In containerized environments
./test-runner.sh --build-only# Run multiple specific test suites
./test-runner.sh SwipeTests && ./test-runner.sh TapTests
# Test-driven development workflow
./test-runner.sh --tests-only SwipeTests --verbose# Run with maximum verbosity
./test-runner.sh --verbose --tests-only FailingTestSuite
# Check simulator state
xcrun simctl list devicesThe script provides clear visual feedback:
- 🎯 Blue: Section headers
- ✅ Green: Success messages
- ℹ️ Blue: Information
⚠️ Yellow: Warnings- ❌ Red: Errors
0: Success1: Build or test failure1: Missing prerequisites1: Invalid command line arguments