Skip to content

v1.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 02 Dec 16:19
042264b

v1.0.0

Breaking Changes

Target Framework

  • Dropped .NET Standard 2.0 support. All libraries now target .NET 10.0 exclusively. Consumers on .NET Framework or older .NET Core versions will need to upgrade.
  • Test projects, samples, and tools updated from .NET 6.0 to .NET 10.0.

Appium 9 Migration

  • Upgraded Appium.WebDriver from 4.4.5 to 9.0.0. Appium 9 strong-name signs its assembly. Rebuild any custom integrations against the updated client rather than reusing binaries built against earlier Appium versions.
  • AppiumWebElement replaced by AppiumElement. All element wrappers, constructors, and implicit operators now use AppiumElement from OpenQA.Selenium.Appium.
  • Platform-specific element types removed. WindowsElement, AndroidElement, and IOSElement have been replaced by AppiumElement in platform wrappers.
  • Generic driver types removed. WindowsDriver<WindowsElement>, AndroidDriver<AndroidElement>, and IOSDriver<IOSElement> are now simply WindowsDriver, AndroidDriver, and IOSDriver.
  • AddAdditionalCapability replaced. Use AppiumOptions properties (PlatformName, DeviceName, PlatformVersion, App, AutomationName) or AddAdditionalAppiumOption() for vendor-specific capabilities.
  • MobileCapabilityType enum removed. Capability constants are no longer used; capabilities are set via typed properties on AppiumOptions.

Selenium 4.x Migration

  • Upgraded Selenium.WebDriver from 3.x to 4.54.0 as a direct minimum dependency.
  • RemoteWebDriver replaced by WebDriver. All driver references, properties, and method signatures now use OpenQA.Selenium.WebDriver as the common base type. This includes AppManager.App, BasePage.App, and LegerityTestClass.App.
  • RemoteWebElement replaced by WebElement. All element references now use OpenQA.Selenium.WebElement. Implicit operators on element wrappers accept WebElement instead of RemoteWebElement.
  • FindElementByXPath(), FindElementById(), FindElementByName() removed. Use FindElement(By.XPath(...)), FindElement(By.Id(...)), FindElement(By.Name(...)) instead.

Removed Browser Support

  • Opera (WebAppDriverType.Opera) - removed, Opera browser support was dropped in Selenium 4.
  • Internet Explorer (WebAppDriverType.InternetExplorer) - removed, IE is end-of-life.
  • Edge Chromium (WebAppDriverType.EdgeChromium) - removed, redundant since WebAppDriverType.Edge is Chromium-based by default in Selenium 4.

Removed Dependencies

  • Microsoft.Edge.SeleniumTools - removed. Edge is now handled natively by Selenium 4's EdgeDriver.

Removed Packages

  • Legerity.MADE - removed. MADE.NET control wrappers (DropDownList, InputValidator).
  • Legerity.Telerik.Uwp - removed. Telerik UWP control wrappers (RadAutoCompleteBox, RadBulletGraph, RadBusyIndicator, RadNumericBox).
  • Legerity.WCT - removed. Windows Community Toolkit control wrappers (BladeView, Carousel, Expander, InAppNotification, RadialGauge).
  • Associated test projects and sample applications for the above packages have also been removed.

New Features

Standalone Windows Driver

Legerity.WindowsDriver is a standalone WebDriver server that launches native Windows desktop apps, attaches to existing windows, and interacts with controls through Windows UI Automation. Self-contained executables for Windows x64 and ARM64 are available from GitHub Releases.

Use the driver with the Legerity framework or connect directly with Appium's .NET WindowsDriver client without installing Legerity or running a separate Appium server. See the Windows Driver documentation for setup and usage.

Fluent Selector Chaining

A new fluent API for composing element locator queries, available as extension methods on By:

Simple shortcuts (extend any By locator):

  • .WithText(text) - match elements with exact text content
  • .WithPartialText(text) - match elements with partial text content
  • .WithAttribute(name, value) - match elements with an exact attribute value
  • .WithPartialAttribute(name, value) - match elements with a partial attribute value
  • .And(otherBy) - combine with another locator (intersection)
  • .ThenFind(childBy) - find children within matched elements

Builder API (for complex multi-constraint queries):

  • .That(by => ...) - add same-element constraints via a builder (intersection)
  • .ThenFind(by => ...) - scope into children via a builder (nesting)

Builder methods: .TagName(), .Id(), .ClassName(), .CssSelector(), .XPath(), .Name(), .HasText(), .HasPartialText(), .HasAttribute(), .HasPartialAttribute(), .Matching(By)

Platform-specific builder extensions:

  • Windows: .HasAutomationId(), .WithAutomationId(), .ThenFindByAutomationId()
  • Android: .HasContentDescription(), .HasPartialContentDescription(), .WithContentDescription(), .WithPartialContentDescription()
  • iOS: .HasLabel(), .HasPartialLabel(), .HasValue(), .HasPartialValue(), .WithLabel(), .WithPartialLabel(), .WithValue(), .WithPartialValue()
  • Web: .HasInputType(), .ThenFindByInputType(), .ThenFindListItems(), .ThenFindOptions(), .ThenFindTableRows()

Example usage:

// Before
page.FindElement(new ByAll(By.TagName("button"), ByExtras.Text("Accept")));
page.FindElements(new ByNested(By.TagName("form"), By.XPath(".//input[@type='radio']")));

// After - simple
page.FindElement(By.TagName("button").WithText("Accept"));

// After - builder
page.FindElement(By.TagName("form")
    .ThenFind(by => by.TagName("input").HasAttribute("type", "radio")));

Bug Fixes

ByAll Intersection Logic

  • ByAll.FindElements() queries each locator it evaluates only once. It uses hash-based membership when comparing standard WebElement and AppiumElement instances, and falls back to Equals() when custom wrappers are involved. Matching elements retain their order and any duplicates from the first locator's results.

Thread-Safe Driver Lifecycle

  • AppManager.App is scoped to the current execution context. Pass the driver explicitly across separate setup, test, and teardown callbacks; AppManager.BeginAppScope() is for awaited helpers within a single callback.
  • AppManager.Apps tracks running drivers through a concurrent dictionary.
  • AppManager.StopApp() now uses TryRemove for idempotent cleanup. Only the first caller to remove a driver will call Quit(), preventing ObjectDisposedException when multiple threads attempt cleanup.
  • LegerityTestClass.App uses the same ambient driver as parameterless page objects. Explicit launch options no longer overwrite the defaults on a fixture shared by parallel tests.
  • Automatically launched Windows hosts are tracked separately per port and remain running while another session uses them.
  • LegerityTestClass.apps now uses ConcurrentBag<WebDriver> for thread-safe collection access.

Resilient Driver Disposal

  • AppManager.StopApp() and AppManager.StopApps() now catch exceptions during Quit() to handle partially initialized or already-disposed drivers gracefully, preventing teardown failures from masking real test failures.

Migration Guide

Updating Element Wrapper Code

// Before (v0.14)
public class MyButton : WindowsElementWrapper
{
    public MyButton(WindowsElement element) : base(element) { }
    public static implicit operator MyButton(WindowsElement e) => new(e);
    public static implicit operator MyButton(AppiumWebElement e) => new(e as WindowsElement);
    public static implicit operator MyButton(RemoteWebElement e) => new(e as WindowsElement);
}

// After (v1.0)
public class MyButton : WindowsElementWrapper
{
    public MyButton(AppiumElement element) : base(element) { }
    public static implicit operator MyButton(WebElement e) => new(e as AppiumElement);
}

Updating Driver References

// Before (v0.14)
WindowsDriver<WindowsElement> app = ...;
RemoteWebDriver webApp = ...;

// After (v1.0)
WindowsDriver app = ...;
WebDriver webApp = ...;

Updating Appium Options

// Before (v0.14)
options.AddAdditionalCapability(MobileCapabilityType.PlatformName, "Android");
options.AddAdditionalCapability(MobileCapabilityType.DeviceName, "Pixel");

// After (v1.0)
options.PlatformName = "Android";
options.DeviceName = "Pixel";

Updating Browser Configuration

// Before (v0.14) - remove these
WebAppDriverType.Opera
WebAppDriverType.InternetExplorer
WebAppDriverType.EdgeChromium

// After (v1.0) - use these
WebAppDriverType.Chrome
WebAppDriverType.Firefox
WebAppDriverType.Safari
WebAppDriverType.Edge  // Chromium-based by default