Xcuitest

Prisma-Labs-Dev/apple-skills/skills/xcuitest

作者 Prisma-Labs-Dev498626005e65783ebe8570a103b2335cf397768c無授權條款收錄於 2026年10月9日更新於 2026年10月9日

API reference: XCUITest. Query for element queries, waiting patterns, Swift 6 @MainActor, assertions, screenshots, launch arguments.

AI 產生的概覽

用於撰寫可靠 Swift 6 XCUITest UI 測試的參考指南,涵蓋查詢、等待、斷言與截圖。

功能
此技能是 XCUITest 與 XCUIAutomation 的 API 參考。它提供附程式碼範例的主題指南,涵蓋元素查詢、互動、等待模式、Swift 6 並行、斷言、截圖、啟動參數、權限、測試輔助工具、疑難排解與進階模式。它也附帶本地下載的 XCTest 與 XCUIAutomation 類別與索引的 Apple 文件頁面。
適用情境
適用於在 Swift 中撰寫、偵錯或審查 Apple 平台的 XCUITest UI 測試時。適合查閱 waitForExistence、XCUIElementQuery、啟動參數或截圖附件等 API 細節。也有助於處理測試類別中的 Swift 6 嚴格並行問題。
執行需求
不含指令碼,僅為說明與 Markdown 參考檔案。閱讀隨附檔案無需套件或憑證,但技能建議在本地未涵蓋的主題上透過網路存取文件鏡像。

XCUITest Reference

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

Quick Reference

swift
// Basic test structure@MainActorfinal 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):

FileContent
element-queries.md [blocked]Core API classes: XCUIApplication, XCUIElement, XCUIElementQuery, XCUICoordinate
interactions.md [blocked]Taps, presses, text input, swipes, coordinate-based and other gestures
waiting.md [blocked]waitForExistence, XCTWaiter, non-existence, property waits, Xcode 26 KeyPath waits
swift6-concurrency.md [blocked]Swift 6 strict concurrency: @MainActor test classes, async setUp/tearDown, nonisolated
assertions.md [blocked]XCTAssert patterns, custom messages, existence checks
screenshots.md [blocked]Screenshots, XCTAttachment, screenshot-on-failure, extracting from .xcresult
launch-arguments.md [blocked]Launch arguments/environment, UserDefaults override, localization and accessibility testing
permissions.md [blocked]resetAuthorizationStatus, XCUIProtectedResource, interruption monitors, springboard/system alerts
test-helpers.md [blocked]Page Object Model, reusable helpers, timeout constants
troubleshooting.md [blocked]Common failures (element not found, flaky tests) and what's new in Xcode 26 / iOS 26
patterns.md [blocked]Advanced patterns: base test class, system dialogs, scroll/wait, debugging, test organization

Downloaded Reference Files

Apple documentation pages available locally:

FileContent
xctest-index.md [blocked]Full XCTest framework index
xcuiautomation-index.md [blocked]Full XCUIAutomation framework index
xcuiapplication.md [blocked]XCUIApplication class
xcuielement.md [blocked]XCUIElement class
xcuielementquery.md [blocked]XCUIElementQuery class
xcuicoordinate.md [blocked]XCUICoordinate class
xcuiprotectedresource.md [blocked]XCUIProtectedResource enum
xcuiscreenshot.md [blocked]XCUIScreenshot class

Sources

Apple Documentation

WWDC Sessions

Community Resources

Fetching More Apple Docs

  1. Search this skill's local .md files first.
  2. If the topic is not here, check the other installed Apple skills you have available by their names, descriptions, or SKILL.md frontmatter, then grep their local files. This is faster and uses less context than fetching new docs from the internet.
  3. If no installed skill has the page, use the relevant documentation path from the local XCTest or XCUIAutomation indexes with the sosumi.ai Markdown mirror. For example, /documentation/xcuiautomation/xcuielement maps to https://sosumi.ai/documentation/xcuiautomation/xcuielement.

來源與署名

來源:Prisma-Labs-Dev/apple-skills位於skills/xcuitest提交4986260

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架