Browse QA Engineers Section 3: Automation Scripts

XCUITest Script from Test Case (iOS)

6 fill-in slots · from The AI Prompt Handbook for QA Engineers

Your details

0/6 filled

XCUITest Script from Test Case (iOS)

Write an XCUITest (Swift) automation script for this test case.

TEST CASE:
[Paste the manual test case — steps, expected results, test data]

APP CONTEXT:
- Framework: SwiftUI / UIKit
- Accessibility identifiers available: [List the IDs from the story's accessibility spec]
- Navigation pattern: [Tab bar / Navigation stack / Modal]

Generate a complete XCUITest function that:
1. Follows the Page Object pattern (separate page class and test class)
2. Uses accessibility identifiers for element lookup (not string matching)
3. Includes explicit waits (waitForExistence) instead of sleep
4. Asserts on expected outcomes
5. Handles loading states and animations
6. Includes meaningful assertion failure messages
7. Is ready to paste into an existing test target

Include both:
- The Page Object class
- The test function

Use our naming convention: test_[feature]_[scenario]_[expectedOutcome]

Highlighted [slots] are still empty. Downloads are plain .txt — paste into any AI assistant.