motus-v1.0.1
·
107 commits
to main
since this release
Initial release of Motus, an extensible browser automation and testing framework for .NET. Motus communicates directly with browsers over WebSocket using source-generated protocol bindings, with no Node.js dependency.
Browser Automation Engine
- Direct WebSocket communication with Chromium over CDP and Firefox over WebDriver BiDi
- Source-generated protocol bindings via Roslyn incremental generator for NativeAOT compatibility
- Full Page API: navigation, locators (
GetByRole,GetByText,GetByLabel,GetByTestId, etc.), JavaScript evaluation, screenshots, PDF generation, and file downloads - Network interception and routing with request/response inspection
- Browser contexts with isolated cookies, cache, storage, geolocation, and permissions
- Keyboard, mouse, and touchscreen input simulation
- Tracing, HAR export, and video recording
Plugin System
- All built-in features (selector strategies, wait conditions, lifecycle hooks, reporters) are registered through the same
IPluginContextavailable to third-party authors [MotusPlugin]attribute with source-generated discovery via module initializer- Plugin interfaces:
ISelectorStrategy,IWaitCondition,ILifecycleHook,IReporter
Roslyn Analyzers
- Seven compile-time diagnostics (MOT001-MOT007) catching common automation mistakes: non-awaited async calls, hardcoded delays, fragile selectors, missing disposal, unused locators, deprecated selectors, and navigation without wait
- Automated code fixes for MOT001 (add
await), MOT002 (replace delay with wait), and MOT004 (wrap inawait using)
Test Framework Integrations
Motus.Testing.MSTestwith shared browser across the assembly, per-test context isolation, and[Parallelize]supportMotus.Testing.xUnitwith collection and class fixtures for parallel executionMotus.Testing.NUnitwith per-fixture browser and[Parallelizable(ParallelScope.All)]support- Automatic failure tracing captures a trace ZIP on test failure (MSTest and NUnit; manual in xUnit)
- Browser pool (
IBrowserPool) for concurrent test execution with configurable worker count
Test Recorder
- Record browser interactions in a headed session and emit compilable C# test code
- Selector inference ranks test IDs and accessible roles over fragile CSS paths
- Page Object Model generation via
PomEmitterwith automatic form field grouping - Supports MSTest, xUnit, and NUnit output frameworks
CLI Tool (dotnet motus)
motus rundiscovers and runs tests with parallel workers, filtering, and multiple reporters (console, JUnit XML, HTML, TRX)motus recordlaunches a headed browser and emits test code from recorded interactionsmotus installdownloads browser binaries (Chromium, Chrome, Edge, Firefox) with optional revision pinningmotus trace showopens recorded traces in the visual runnermotus screenshotandmotus pdffor quick page capture- Interactive visual runner with timeline, step debugging, and visual regression UI
Packages
| Package | Description |
|---|---|
Motus |
Core automation engine |
Motus.Abstractions |
Plugin interfaces and browser API types |
Motus.Codegen |
Roslyn source generator for CDP bindings and plugin discovery |
Motus.Analyzers |
Compile-time diagnostics and code fixes |
Motus.Recorder |
Interaction recorder and code emitter |
Motus.Testing |
Shared browser fixture (framework-agnostic) |
Motus.Testing.MSTest |
MSTest integration |
Motus.Testing.xUnit |
xUnit integration |
Motus.Testing.NUnit |
NUnit integration |
Motus.Cli |
Command-line tool (installed via dotnet tool install -g Motus.Cli) |