$npx skillfedfor your agent

xcuitest

XCUITest skills equip coding agents with comprehensive API documentation and practical examples for building robust UI tests in Swift. Access current iOS testing patterns, SwiftUI integration guides, and real-world automation workflows designed for modern Apple development.

XCUITest is Apple's framework for UI testing in Swift, with comprehensive API reference and code examples available through Xcode's built-in documentation. For Swift 6 support, XCUITest integrates with the latest concurrency patterns, including @MainActor annotations for thread-safe test execution. The framework provides access to current iOS testing patterns and real-world automation workflows designed for modern Apple development, allowing you to query elements, perform interactions, and validate UI behavior programmatically.

AI-generated summary based on this skill's SKILL.md

291 16 MITupdated by Prisma-Labs-Dev

Decision gist · record as of 2026-07-27

XCUITest is Apple's framework for UI testing in Swift, with comprehensive API reference and code examples available through Xcode's built-in documentation. For Swift 6 support, XCUITest integrates with the latest concurrency patterns, including @MainActor annotations for thread-safe test execution. The framework provides access to current iOS testing patterns and real-world automation workflows designed for modern Apple development, allowing you to query elements, perform interactions, and validate UI behavior programmatically.

manual: git clone https://github.com/Prisma-Labs-Dev/apple-skills → cp -r apple-skills/skills/xcuitest ~/.claude/skills/xcuitest
skills/xcuitest/SKILL.md · version 3c6df5d2

Use it when

  • XCUITest reliability depends on proper waiting patterns and assertions.
  • XCUITest's XCUIElement API enables you to query UI elements using predicates and accessibility identifiers.

Verify before relying

Read SKILL.md below before installing (20 files). Open directory: indexed for reading, not audited.

Same gist for agents: .md · .json

Install

Prisma-Labs-Dev/apple-skills/xcuitest · repository language: TypeScript

Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

What is XCUITest reference Swift 6 documentation and where do I find it?

XCUITest is Apple's framework for UI testing in Swift, with comprehensive API reference and code examples available through Xcode's built-in documentation. For Swift 6 support, XCUITest integrates with the latest concurrency patterns, including @MainActor annotations for thread-safe test execution. The framework provides access to current iOS testing patterns and real-world automation workflows designed for modern Apple development, allowing you to query elements, perform interactions, and validate UI behavior programmatically.

How do I write reliable XCUITest UI tests that aren't flaky?

XCUITest reliability depends on proper waiting patterns and assertions. Use waitForExistence to ensure elements are present before interacting with them, avoiding race conditions that cause flaky tests. XCUITest provides XCTAttachment for capturing screenshots during test execution, helping you debug failures. Implement proper setup and tearDown methods with async support to manage test state consistently. The framework's element queries and interactions are designed to work with SwiftUI integration guides and real-world automation workflows that prioritize test stability.

How do XCUIElement queries and interactions work in XCUITest?

XCUITest's XCUIElement API enables you to query UI elements using predicates and accessibility identifiers, then perform interactions like taps, swipes, and text input. The framework supports gesture handling through methods that simulate user actions on elements returned by your queries. XCUITest element queries are foundational to building robust UI tests—you locate elements using XCUIApplication, then chain interactions to validate UI behavior. Proper element identification and interaction patterns are essential for creating maintainable test automation workflows.

What are the Swift 6 @MainActor concurrency patterns in XCUITest?

XCUITest integrates with Swift 6's @MainActor concurrency model to ensure thread-safe test execution on the main thread. The framework supports async/await patterns in setup, tearDown, and test methods, allowing you to write modern asynchronous test code. XCUITest's @MainActor annotations guarantee that UI interactions and assertions execute on the correct thread, preventing concurrency-related crashes. This integration represents current iOS testing patterns that align with Swift 6's structured concurrency approach for reliable, maintainable UI automation.

How do I configure XCUITest launch arguments and environment variables for testing?

XCUITest allows you to configure launch arguments and environment variables through XCUIApplication initialization, enabling you to control app behavior during test execution. You can pass custom arguments to modify feature flags, disable animations, or enable debug logging. XCUITest also supports permissions and system alerts handling through interruption monitors and Springboard interaction. These configuration options are essential for real-world automation workflows, allowing you to test different app states and user scenarios without manual intervention.

What should I do when XCUITest elements are not found or tests fail?

XCUITest troubleshooting for element not found errors involves debugging element queries, verifying accessibility identifiers, and checking element visibility. Use XCUITest screenshots via XCTAttachment to capture the UI state when failures occur, providing visual context for debugging. Examine your XCUIElement queries for incorrect predicates or timing issues—often flaky tests result from elements not being ready when accessed. XCUITest's comprehensive API reference and code examples demonstrate proper waiting patterns and assertion strategies to resolve common failures and build more robust UI automation workflows.

SKILL.md

Rendered from the published skill. Quoted content, verbatim.

XCUITest Reference

Comprehensive reference for writing reliable XCUITest UI tests in Swift 6.

Quick Reference

// Basic test structure
@MainActor
final class MyUITests: XCTestCase {
    var app: XCUIApplication!

    override func setUp() {
        super.setUp()
        continueAfterFailure = false
        app = XCUIApplication()
        app.launch()
    }

    func testExample() {
        let button = app.buttons["Submit"]
        XCTAssertTrue(button.waitForExistence(timeout: 5))
        button.tap()
    }
}

Topic Guides

Curated guidance with code examples (grep-friendly):

File Content
element-queries.md Core API classes: XCUIApplication, XCUIElement, XCUIElementQuery, XCUICoordinate
interactions.md Taps, presses, text input, swipes, coordinate-based and other gestures
waiting.md waitForExistence, XCTWaiter, non-existence, property waits,

(truncated - see the full file via the links below)

File tree — 15 files
skills/xcuitest/SKILL.md
skills/xcuitest/assertions.md
skills/xcuitest/element-queries.md
skills/xcuitest/interactions.md
skills/xcuitest/launch-arguments.md
skills/xcuitest/patterns.md
skills/xcuitest/permissions.md
skills/xcuitest/screenshots.md
skills/xcuitest/swift6-concurrency.md
skills/xcuitest/test-helpers.md
skills/xcuitest/troubleshooting.md
skills/xcuitest/waiting.md
skills/xcuitest/xctest-index.md
skills/xcuitest/xcuiapplication.md
skills/xcuitest/xcuiautomation-index.md

Let your AI agent find skills like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.

wish › “Find comprehensive API reference and code examples for XCUITest UI testing in Swift”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

axiom-testing
by CharlesWiltgen · CharlesWiltgen/Axiom

Axiom Testing guides you through writing and debugging tests across all iOS scenarios—from unit tests with Swift Testing to UI automation with XCUITest. Navigate async testing patterns, flaky test fixes, and test architecture decisions with clear decision trees and critical patterns for each testing domain.

MITupdated Jul 2026
★ 1,095repo stars
xcuitest-skill
by LambdaTest · LambdaTest/agent-skills

This skill empowers you to rapidly generate XCUITest code for testing iOS and iPadOS user interfaces. Leverage AI-driven test automation to build comprehensive UI test suites without manual scripting overhead.

MITupdated Jul 2026
★ 339repo stars
Cometchat Ios Testing
by cometchat · cometchat/cometchat-skills

This skill enables developers to systematically test Cometchat's messaging capabilities on iOS devices, ensuring chat features work reliably across Apple platforms. Verify user interactions, message delivery, and real-time communication performance with structured testing workflows.

no license declared → metadata onlyupdated Jun 2026
★ 61repo stars
axiom-audit-testing
by CharlesWiltgen · CharlesWiltgen/Axiom

Axiom Audit Testing systematically scans your test files and production code to surface flaky patterns, missing coverage on critical paths, and opportunities to modernize your test suite. It identifies sleep calls and shared state that cause timing failures, flags tests that require unnecessary simulator overhead, and maps which auth, payment, persistence, and networking flows lack test coverage. The agent also spots XCTestCase candidates ready for Swift Testing migration and detects ungrounded AI evaluation gates that generate false failures.

MITupdated Jul 2026
★ 1,095repo stars
Swift Testing
by dpearson2699 · dpearson2699/swift-ios-skills

Master Swift Testing, the modern framework for Swift unit tests in Xcode 16+. Learn to write tests with @Test and @Suite, use #expect and #require for assertions, organize tests with traits, handle async patterns, and migrate from XCTest. This skill covers test attachments, exit testing, known issues, and version-gated APIs to help you build reliable test suites.

no license declared → metadata onlyupdated Jul 2026
★ 932repo stars
qa-testing-ios
by vasilyu1983 · vasilyu1983/AI-Agents-public

This skill streamlines iOS quality assurance by automating test runs through xcodebuild and simulator environments. It handles both unit and UI testing scenarios, enabling developers to validate app behavior consistently across test suites. Integrate it into your CI/CD pipeline for repeatable, reliable test execution.

MITupdated Jul 2026
★ 69repo stars

More skills Moai Lang Swift (unlicensed)

Tags
ios-ui-testingswift-concurrencyelement-interactiontest-automationxcode-frameworkgesture-handlingwait-strategiessystem-permissionstest-reliabilityaccessibility-testing