Skip to content

Releases: DataficationSDK/Motus

motus-v1.0.6

30 Mar 21:23

Choose a tag to compare

Feature release with major codegen improvements, trace viewer enhancements, cookie banner removal for screenshot/PDF commands, and colored console output.

New Features

  • Codegen --headed mode - Launch a visible browser with motus codegen --headed, navigate to any page yourself, then press Enter to analyze. Supports providing URLs upfront (navigates then waits for Enter) or no URLs (opens a blank tab for free navigation).
  • Codegen --connect mode - Attach to an already-running browser with motus codegen --connect ws://localhost:9222 to analyze the active tab without launching a new browser instance. Works with or without URLs.
  • Codegen --scope option - Limit element discovery to a specific container with a CSS selector (e.g. --scope "#login-form", --scope ".modal-dialog"). Only elements inside the scoped container are analyzed and emitted.
  • Cookie banner removal - motus screenshot and motus pdf now support --hide-banners to remove cookie consent, privacy, and overlay banners before capture. Targets well-known selectors (OneTrust, CookieBot, Usercentrics, generic patterns) and clears body scroll locks.
  • Screenshot and PDF options - Both commands gained --timeout, --wait-until, and --delay options for better control over navigation and rendering. motus pdf also gained --width for viewport control.
  • Colored console reporter - Test results now display with ANSI color codes (green for pass, red for fail, gray for duration). Colors are automatically disabled when output is redirected.

Improvements

  • Codegen selector generation - Significantly improved selector hit rate through three changes:
    • Element handles are now stored at crawl time (window.__mtusElements), preventing stale references when the DOM mutates between discovery and resolution
    • Per-strategy error handling prevents one slow or failing strategy from blocking all remaining elements
    • Attribute-based CSS fallback generates selectors from name, placeholder, href, type, and aria-label when all strategies fail, verified for uniqueness before emitting
  • Implicit ARIA role inference - The role selector strategy now infers implicit roles from HTML semantics (<button> as button, <a href> as link, <input type="checkbox"> as checkbox, <select> as listbox, text inputs as textbox). This produces more stable selectors like role=button[name="Submit"] instead of falling through to text or CSS.
  • Trace viewer - Rewrote the trace viewer service to extract real timestamps, durations, and human-readable action labels from CDP trace events. Screenshots are aligned to timeline events via binary search. HAR network requests are loaded and matched to events by time window. The viewer now filters to significant events only.
  • Trace viewer layout - The sidebar and test explorer are hidden in trace mode since there are no tests to discover. The toolbar shows the trace filename and event count instead of run controls.
  • Browser launch timing - The visual runner now opens the browser after the server is fully listening (ApplicationStarted callback) instead of before, eliminating the need for a manual refresh on startup.

Bug Fixes

  • Null-check in MotusTestBase cleanup - TestContext.CurrentTestOutcome could throw a NullReferenceException during test cleanup if the TestContext was not initialized. Added a null-conditional check.

motus-v1.0.5

30 Mar 01:01

Choose a tag to compare

Patch release fixing the visual runner when installed as a global tool, plus CLI and logging improvements.

Bug Fixes

  • Fixed static assets 404 in global tool install - The visual runner (motus run --visual, motus trace show) returned 404 for _framework/blazor.web.js and other static resources when Motus.Cli was installed as a dotnet global tool. The tool package now bundles wwwroot content (app.css, screencast.js, scoped CSS) alongside the static web assets manifest. At startup, the runner detects whether the manifest's build-time paths are valid; if not (global tool install from CI), it falls back to Production mode and serves the bundled wwwroot via a PhysicalFileProvider while letting the ASP.NET Core framework handle _framework/ files through its standard pipeline.

Improvements

  • Suppressed ASP.NET Core log noise - The visual runner no longer prints info/warn log messages from Kestrel and the request pipeline. Only errors are shown by default. A verbose parameter is available on RunnerHost.StartAsync for diagnostics.
  • Added shutdown hint - The visual runner now prints Press Ctrl+C to stop. after the startup URL.
  • Fixed CLI command references in README - Changed dotnet motus ... to motus ... throughout the README since it is installed as a global tool.

motus-v1.0.1

29 Mar 14:44

Choose a tag to compare

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 IPluginContext available 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 in await using)

Test Framework Integrations

  • Motus.Testing.MSTest with shared browser across the assembly, per-test context isolation, and [Parallelize] support
  • Motus.Testing.xUnit with collection and class fixtures for parallel execution
  • Motus.Testing.NUnit with 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 PomEmitter with automatic form field grouping
  • Supports MSTest, xUnit, and NUnit output frameworks

CLI Tool (dotnet motus)

  • motus run discovers and runs tests with parallel workers, filtering, and multiple reporters (console, JUnit XML, HTML, TRX)
  • motus record launches a headed browser and emits test code from recorded interactions
  • motus install downloads browser binaries (Chromium, Chrome, Edge, Firefox) with optional revision pinning
  • motus trace show opens recorded traces in the visual runner
  • motus screenshot and motus pdf for 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)