Aller au contenu principal

Automation Extension Development

Automation Extensions provide custom test step types that appear in the Aethrix test automation step picker alongside built-in steps.

Note: This section is a placeholder. Detailed API reference and examples will be added once the Automation Extension SDK is finalized. Check the GitHub repository for the latest development status.

Overview​

An Automation Extension implements the ITestStep interface from Aethrix.Automation, defining:

  • Step configuration model (properties exposed in the UI)
  • Execution logic (Execute method)
  • Diagnostics and logging

Custom step icons​

Every step type in the Add-Step menu, the item presenter and the search palette renders through one funnel (TestAutomationViewModel.GetImageSource). By default a step shows the generic VS2026.Step glyph. A plugin can declare its own icon — the artwork lives inside the plugin's own assembly, so nothing needs to be installed into Studio.

Quickest path: ship one icon dictionary and tag the steps​

  1. Add a resource dictionary to the extension project (it is compiled into the assembly as an Avalonia resource):

    <!-- Icons/Icons.axaml -->
    <ResourceDictionary xmlns="https://github.com/avaloniaui"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <DrawingGroup x:Key="Db.MySql" Transform="0.8,0,0,0.8,-1.6,-1.6">
    <GeometryDrawing Brush="#4479A1" Geometry="M16.405 5.501c-.115 0 ..." />
    </DrawingGroup>
    </ResourceDictionary>
  2. Tag each step type:

    using Aethrix.Core.Services.Attributes;

    [IconKey("Db.MySql", ResourceUri = "avares://Aethrix.Database.Providers/Icons/Icons.axaml")]
    public sealed class MySqlQueryTestStep : AssertionStepBase { ... }

Studio merges the referenced dictionary into the application resources when the extension loads (once per dictionary, on the extension event plus a startup sweep), and the key resolves everywhere a step icon shows. No Studio-side registration is needed. Steps whose icon is an in-box glyph can still use the plain form — [IconKey("VS2026.SQLDatabase")] resolves against the host's own dictionary.

Drawing the icon (16×16 cell)​

The step menu renders icons in a 16×16 cell. Conventions that make artwork survive that size:

  • Draw on a 24-unit grid and place it with the DrawingGroup's Transform. The transform is a Matrix — six comma-separated numbers M11,M12,M21,M22,dx,dy (scale-x, 0, 0, scale-y, offset-x, offset-y), not a CSS scale() string. Fit the ink to the 0..16 cell and keep the aspect uniform.

  • Fill beats line art at this size. A detailed vendor mark (wordmarks, thin-featured animals) dissolves into ~1px strokes at 16px; a bold single silhouette stays readable. Measure the parsed ink bounds and verify by rendering the icon at its real size before shipping.

  • Theme-tune colors when they need to read on both surfaces. Declare Light/Dark variants in the dictionary's ThemeDictionaries and reference them with {DynamicResource ...} — Studio re-resolves them on theme switch. Steps' geometry merges theme-free, but brushes this sharp stay legible on both the dark and the white menu surfaces:

    <ResourceDictionary.ThemeDictionaries>
    <ResourceDictionary x:Key="Light">
    <SolidColorBrush x:Key="Brush.MySql" Color="#3A6790" />
    </ResourceDictionary>
    <ResourceDictionary x:Key="Dark">
    <SolidColorBrush x:Key="Brush.MySql" Color="#62A0D8" />
    </ResourceDictionary>
    </ResourceDictionary.ThemeDictionaries>
  • The icon stays merged for the session — an extension runtime update that changes icons applies on the next Studio start.

Reference​

  • [IconKey(string iconKey, string? ResourceUri = null)] — Aethrix.Core.Services.Attributes. iconKey is the dictionary key; ResourceUri is the optional avares:// URI of the dictionary that carries it (absent for host in-box keys). Steps without the attribute keep the generic VS2026.Step glyph.
  • Dictionary shape: the value of each key is a DrawingGroup (a DrawingImage is accepted too); geometry rides verbatim on its native grid, all placement is Transform, all color is Brush.

Third-party artwork and licensing​

If the icon is not your own drawing, its license travels with the pack:

  • Ship a LICENSE-NOTICE.txt (or similar) inside the .pkg: declare it in the pack definition's Files list. Never add non-DLL files to AssemblyFiles — that list is loaded as assemblies and a text file there fails the load.
  • Font/icon collections carry their own obligations. Example: ForkAwesome glyphs are SIL OFL 1.1 — redistribution must carry the OFL notice and derivatives stay under the same license; the wrapper code may carry a separate MIT attribution. Simple Icons is CC0 (no obligations). Vendor logos additionally grant no trademark rights: using a vendor's mark to label your driver for that vendor is nominative use, but imply nothing about endorsement.
  • A reference implementation of all of the above (dictionary, theme brushes, notice file, definition.json wiring) is the Aethrix.Database.Providers pack in the aethrix-extensions repository.

Next Steps​