Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Tests Uno Platform apps. Playwright for WASM, platform-specific patterns, runtime heads.
allowed-tools
["Read","Grep","Glob","Bash","Write","Edit"]
dotnet-uno-testing
Testing Uno Platform applications across target heads (WASM, Desktop, Mobile). Covers Playwright-based browser
automation for Uno WASM apps, platform-specific testing patterns for different runtime heads, and test infrastructure
for cross-platform Uno projects.
Version assumptions: .NET 8.0+ baseline, Uno Platform 5.x+, Playwright 1.40+ for WASM testing. Uno Platform uses
single-project structure with multiple target frameworks.
Scope
Playwright-based browser automation for Uno WASM apps
Platform-specific testing patterns for different runtime heads
Test infrastructure for cross-platform Uno projects
Playwright fundamentals (installation, CI caching, trace viewer) -- see [skill:dotnet-playwright]
Test project scaffolding -- see [skill:dotnet-add-testing]
Prerequisites: Uno Platform application with WASM head configured. For WASM testing: Playwright browsers installed
(see [skill:dotnet-playwright]). For mobile testing: platform SDKs configured (Android SDK, Xcode).
Cross-references: [skill:dotnet-ui-testing-core] for page object model and selector strategies,
[skill:dotnet-playwright] for Playwright installation, CI caching, and trace viewer, [skill:dotnet-uno-platform] for Uno
Extensions, MVUX, Toolkit, and theme guidance, [skill:dotnet-uno-targets] for per-target deployment and
platform-specific gotchas.
Uno Testing Strategy by Head
Uno Platform apps run on multiple heads (WASM, Desktop/Skia, iOS, Android, Windows). Each head has different testing
tools and trade-offs.
Head
Testing Approach
Tool
Speed
Fidelity
WASM
Browser automation
Playwright
Medium
High -- real browser rendering
Desktop (Skia/GTK, WPF)
UI automation
Appium / WinAppDriver
Medium
High -- real desktop rendering
iOS
Simulator automation
Appium + XCUITest
Slow
Highest -- real iOS rendering
Android
Emulator automation
Appium + UIAutomator2
Slow
Highest -- real Android rendering
Unit (shared logic)
In-memory
xUnit (no UI)
Fast
N/A -- logic only
Recommended priority: Test shared business logic with unit tests first. Use Playwright against the WASM head for UI
verification -- it is the fastest UI testing path with the broadest coverage. Add platform-specific Appium tests only
for behaviors that differ between heads.
Playwright for Uno WASM
The WASM head renders Uno apps in a browser, making Playwright the natural choice for UI testing.
Test Infrastructure
// NuGet: Microsoft.PlaywrightpublicclassUnoWasmFixture : IAsyncLifetime
{
public IPlaywright Playwright { get; privateset; } = null!;
public IBrowser Browser { get; privateset; } = null!;
public IPage Page { get; privateset; } = null!;
private Process? _serverProcess;
publicasync ValueTask InitializeAsync()
{
// Start the WASM app (dotnet run or serve the published output)
_serverProcess = await StartWasmServerAsync();
Playwright = await Microsoft.Playwright.Playwright.CreateAsync();
Browser = await Playwright.Chromium.LaunchAsync(new BrowserTypeLaunchOptions
{
Headless = true
});
Page = await Browser.NewPageAsync();
// Wait for Uno WASM app to fully loadawait Page.GotoAsync("http://localhost:5000");
await WaitForUnoAppReadyAsync();
}
publicasync ValueTask DisposeAsync()
{
await Page.CloseAsync();
await Browser.CloseAsync();
Playwright.Dispose();
_serverProcess?.Kill(entireProcessTree: true);
_serverProcess?.Dispose();
}
{
Page.WaitForSelectorAsync(
,
() { State = WaitForSelectorState.Visible, Timeout = _000 });
Page.WaitForFunctionAsync(
,
,
() { Timeout = _000 });
}
{
process = Process
{
StartInfo = ProcessStartInfo
{
FileName = ,
Arguments = ,
UseShellExecute = ,
RedirectStandardOutput = ,
RedirectStandardError =
}
};
process.Start();
httpClient = HttpClient();
deadline = DateTime.UtcNow.AddSeconds();
(DateTime.UtcNow < deadline)
{
{
resp = httpClient.GetAsync();
(resp.IsSuccessStatusCode) ;
}
(HttpRequestException)
{
}
Task.Delay();
}
process;
}
}
```text
```csharp
: <>
{
IPage _page;
{
_page = fixture.Page;
}
[]
{
title = _page.Locator();
Expect(title).ToBeVisibleAsync();
Expect(title).ToHaveTextAsync();
}
[]
{
_page.ClickAsync();
settingsHeader = _page.Locator();
Expect(settingsHeader).ToBeVisibleAsync();
Expect(settingsHeader).ToHaveTextAsync();
}
}
```text
```csharp
[]
{
_page.FillAsync(, );
_page.FillAsync(, );
_page.ClickAsync();
dashboard = _page.Locator();
Expect(dashboard).ToBeVisibleAsync(
() { Timeout = _000 });
}
[]
{
_page.FillAsync(, );
_page.ClickAsync();
items = _page.Locator();
Expect(items).ToHaveCountAsync();
Expect(items.First).ToContainTextAsync();
}
```text
---
Uno maps `AutomationProperties.AutomationId` to each platformtheme-toggleapp-rootupload-btn-name{automationId}{automationId}{automationId}{automationId}s MVVM pattern means most business logic testable without any UI framework.
- **Use Playwright + WASM the primary UI testing path.** It faster than mobile emulators provides real rendering fidelity a browser.
- **Use `AutomationProperties.AutomationId` all testable controls.** It the only selector strategy that works identically across all Uno heads.
- **Separate shared tests platform-specific tests.** Use classes shared test logic, concrete subclasses per platform.
- **Add platform-specific tests only platform-divergent behavior.** File pickers, hardware buttons, gestures, notifications differ across platforms; test these separately.
---
**Do assume Uno WASM apps load instantly.** ; CSS classes are unstable. Use `data-testid` ( `AutomationProperties.AutomationId`) exclusively.
**Do forget to build the WASM head before running Playwright tests.** `dotnet run` builds demand, but `dotnet publish` needed production-like testing. Stale builds cause confusing test failures.
**Do test mobile-specific features the WASM head.** File system access, push notifications, biometrics, NFC are available the browser. Skip mock these WASM tests.
**Do run all platform tests a single CI job.**
Code Navigation (Serena MCP)
Primary approach: Use Serena symbol operations for efficient code navigation:
Find definitions: serena_find_symbol instead of text search
Understand structure: serena_get_symbols_overview for file organization
Track references: serena_find_referencing_symbols for impact analysis
Precise edits: serena_replace_symbol_body for clean modifications
When to use Serena vs traditional tools:
Use Serena: Navigation, refactoring, dependency analysis, precise edits
Use Read/Grep: Reading full files, pattern matching, simple text operations
Fallback: If Serena unavailable, traditional tools work fine
The Uno runtime must initialize (mono WASM bootstrap), which takes several seconds. Always wait for the app root element before interacting.
2. **Do not use CSS selectors for Uno WASM elements.** Uno generates its own DOM structure
internal
and
from
3.
not
on
is
for
4.
not
in
and
not
in
or
in
5.
not
in
Each platform requires its own SDK (Android SDK, Xcode, WinAppDriver). Use separate CI jobs per platform with appropriate runners.
---
## References
- [Uno Platform Testing Documentation](https://platform.uno/docs/articles/features/working-with-accessibility.html)
- [Playwright for .NET](https://playwright.dev/dotnet/)
- [Uno Platform WASM Head](https://platform.uno/docs/articles/getting-started/wizard/wasm.html)
- [AutomationProperties in UWP/WinUI](https://learn.microsoft.com/en-us/windows/apps/design/accessibility/basic-accessibility-information)
- [Uno Platform GitHub](https://github.com/unoplatform/uno)