leoyeai/openclaw-master-skills/fosmvvm-ui-tests-generator
Claude Code and agent skill by leoyeai/openclaw-master-skills
- community
Checking that the SKILL.md file is still in the repository.
Generate UI tests for FOSMVVM SwiftUI views using XCTest and FOSTestingUI. Covers accessibility identifiers, ViewModelOperations, and test data transport.
Install
npx vskill@latest install leoyeai/openclaw-master-skills/fosmvvm-ui-tests-generatorSKILL.md
The same SKILL.md was published earlier as leoyeai/openclaw-master-skills/fosmvvm-ui-tests-generator.
FOSMVVM UI Tests Generator
Generate comprehensive UI tests for ViewModelViews in FOSMVVM applications.
Conceptual Foundation
For full architecture context, see FOSMVVMArchitecture.md | OpenClaw reference
UI testing in FOSMVVM follows a specific pattern that leverages:
- FOSTestingUI framework for test infrastructure
- ViewModelOperations for verifying business logic was invoked
- Accessibility identifiers for finding UI elements
- Test data transporter for passing operation stubs to the app
Core Components
1. Base Test Case Class
Every project should have a base test case that inherits from ViewModelViewTestCase:
Key points:
- Generic over
ViewModelandViewModelOperations - Wraps FOSTestingUI's
presentView()with project-specific configuration - Sets up bundle and app bundle identifier
continueAfterFailure = falsestops tests immediately on failure
2. Individual UI Test Files
Each ViewModelView gets a corresponding UI test file.
For views WITH operations:
For views WITHOUT operations (display-only):
Use an empty stub operations protocol:
When to use each:
- With operations: Interactive views that perform actions (forms, buttons that call APIs, etc.)
- Without operations: Display-only views (cards, detail views, static content)
3. XCUIElement Helper Extensions
Common helpers for interacting with UI elements:
4. View Requirements
For views WITH operations:
For views WITHOUT operations (display-only):
Critical patterns (for views WITH operations):
@State private var repaintToggle = falsefor triggering test data transport.testDataTransporter(viewModelOps:repaintToggle:)modifier in DEBUGtoggleRepaint()called after every operation invocationoperationsstored as property fromviewModel.operations
Display-only views:
- No
repaintToggleneeded - No
.testDataTransporter()modifier needed - Just add
.uiTestingIdentifier()to elements you want to test
ViewModelOperations: Optional
Not all views need ViewModelOperations:
Views that NEED operations:
- Forms with submit/cancel actions
- Views that call business logic or APIs
- Interactive views that trigger app state changes
- Views with user-initiated async operations
Views that DON'T NEED operations:
- Display-only cards or detail views
- Static content views
- Pure navigation containers
- Server-hosted views that just render data
For views without operations:
Create an empty operations file alongside your ViewModel:
Then use it in tests:
The view itself doesn't need:
repaintTogglestate.testDataTransporter()modifieroperationspropertytoggleRepaint()function
Just add .uiTestingIdentifier() to elements you want to verify.
Test Categories
UI State Tests
Verify that the UI displays correctly based on ViewModel state:
Operation Tests
Verify that user interactions invoke the correct operations:
Navigation Tests
Verify navigation flows work correctly:
When to Use This Skill
- Adding UI tests for a new ViewModelView
- Setting up UI test infrastructure for a FOSMVVM project
- Following an implementation plan that requires test coverage
- Validating user interaction flows
What This Skill Generates
Initial Setup (once per project)
| File | Location | Purpose | |
|---|---|---|---|
{ProjectName}ViewModelViewTestCase.swift | Tests/UITests/Support/ | Base test case for all UI tests | |
XCUIElement.swift | Tests/UITests/Support/ | Helper extensions for XCUIElement |
Per ViewModelView
| File | Location | Purpose | |
|---|---|---|---|
{ViewName}ViewModelOperations.swift | Sources/{ViewModelsTarget}/{Feature}/ | Operations protocol and stub (if view has interactions) | |
{ViewName}UITests.swift | Tests/UITests/Views/{Feature}/ | UI tests for the view |
Note: Views without user interactions use an empty operations file with just the protocol and minimal stub.
Project Structure Configuration
| Placeholder | Description | Example | |
|---|---|---|---|
{ProjectName} | Your project/app name | MyApp, TaskManager | |
{ViewName} | The ViewModelView name (without "View" suffix) | TaskList, Dashboard | |
{Feature} | Feature/module grouping | Tasks, Settings |
How to Use This Skill
Invocation: /fosmvvm-ui-tests-generator
Prerequisites:
- View and ViewModel structure understood from conversation context
- ViewModelOperations type identified (or confirmed as display-only)
- Interactive elements and user flows discussed
Workflow integration: This skill is typically used after implementing ViewModelViews. The skill references conversation context automatically—no file paths or Q&A needed. Often follows fosmvvm-swiftui-view-generator or fosmvvm-react-view-generator.
Pattern Implementation
This skill references conversation context to determine test structure:
Test Type Detection
From conversation context, the skill identifies:
- First test vs additional test (whether base test infrastructure exists)
- ViewModel type (from prior discussion or View implementation)
- ViewModelOperations type (from View implementation or context)
- Interactive vs display-only (whether operations need verification)
View Analysis
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/fosmvvm-ui-tests-generator/SKILL.md
Popularity
- Repository stars
- 2,157
- Repository forks
- 324
- 7-day trend score
- 43
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 6 Nov 2026, 21 days ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/leoyeai/openclaw-master-skills/fosmvvm-ui-tests-generator)