nalexnnalexnCommunityยท1 Agent Skills Included

ViewInspector

Unit test SwiftUI views by inspecting state and simulating taps

Inspects SwiftUI view hierarchies at runtime so developers can verify view state, read hidden properties, and simulate user interactions like taps and gestures. Eliminates the black-box nature of SwiftUI views that made unit testing nearly impossible. Includes an AI skill that guides agents through adding introspection support for new SwiftUI APIs with proper tests.
npx skills add nalexn/ViewInspector --all -g -y
Available:

Instructs the AI agent on the library's architecture, build and test commands, and how to add introspection support for new SwiftUI views and modifiers.

All Skills in This Repository (1)

Pure Emerald Level Indicators

Frequently Asked Questions

FAQPage Schema
How to install ViewInspector?โ–ผ

Run `npx skills add nalexn/ViewInspector --all -g -y` in your terminal to install all tools in this suite globally.

How to unit test SwiftUI views?โ–ผ

ViewInspector lets you traverse the view hierarchy at runtime, read internal state, and assert on any view's properties using standard XCTest.

Can I simulate button taps in SwiftUI tests?โ–ผ

Yes. You can programmatically trigger callbacks like button taps, toggle switches, and onAppear events directly from your tests.

Does ViewInspector use private Apple APIs?โ–ผ

No. It relies only on the official Swift reflection API, so it is safe to use in any test target.

How to add support for a new SwiftUI API?โ–ผ

Use the included new-api-support skill, which guides your AI agent through reverse engineering the API, writing introspection code, and adding tests.

Related Repositories in Software Engineering

View All in Software Engineeringโ†’