Skip to content

[dotnet] [bidi] Decouple nested types in Locator #15487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 17 additions & 19 deletions dotnet/src/webdriver/BiDi/Modules/BrowsingContext/Locator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,33 @@ namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
[JsonDerivedType(typeof(XPathLocator), "xpath")]
public abstract record Locator;

public record AccessibilityLocator(AccessibilityLocator.AccessibilityLocatorValue Value) : Locator
{
public record AccessibilityLocatorValue
{
public string? Name { get; set; }
public string? Role { get; set; }
}
}
public record AccessibilityLocator(AccessibilityValue Value) : Locator;

public record CssLocator(string Value) : Locator;

public record ContextLocator(ContextLocator.ContextLocatorValue Value) : Locator
{
public record ContextLocatorValue(BrowsingContext Context);
}
public record ContextLocator(ContextValue Value) : Locator;

public record InnerTextLocator(string Value) : Locator
{
public bool? IgnoreCase { get; set; }

public Match? MatchType { get; set; }
public MatchType? MatchType { get; set; }

public long? MaxDepth { get; set; }

public enum Match
{
Full,
Partial
}
}

public record XPathLocator(string Value) : Locator;

public record AccessibilityValue
{
public string? Name { get; set; }
public string? Role { get; set; }
}

public record ContextValue(BrowsingContext Context);

public enum MatchType
{
Full,
Partial
}