Skip to content

Commit 889dee7

Browse files
authored
[dotnet] [bidi] Decouple nested types in Locator (#15487)
1 parent ca9de17 commit 889dee7

File tree

1 file changed

+17
-19
lines changed
  • dotnet/src/webdriver/BiDi/Modules/BrowsingContext

1 file changed

+17
-19
lines changed

dotnet/src/webdriver/BiDi/Modules/BrowsingContext/Locator.cs

+17-19
Original file line numberDiff line numberDiff line change
@@ -29,35 +29,33 @@ namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
2929
[JsonDerivedType(typeof(XPathLocator), "xpath")]
3030
public abstract record Locator;
3131

32-
public record AccessibilityLocator(AccessibilityLocator.AccessibilityLocatorValue Value) : Locator
33-
{
34-
public record AccessibilityLocatorValue
35-
{
36-
public string? Name { get; set; }
37-
public string? Role { get; set; }
38-
}
39-
}
32+
public record AccessibilityLocator(AccessibilityValue Value) : Locator;
4033

4134
public record CssLocator(string Value) : Locator;
4235

43-
public record ContextLocator(ContextLocator.ContextLocatorValue Value) : Locator
44-
{
45-
public record ContextLocatorValue(BrowsingContext Context);
46-
}
36+
public record ContextLocator(ContextValue Value) : Locator;
4737

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

52-
public Match? MatchType { get; set; }
42+
public MatchType? MatchType { get; set; }
5343

5444
public long? MaxDepth { get; set; }
55-
56-
public enum Match
57-
{
58-
Full,
59-
Partial
60-
}
6145
}
6246

6347
public record XPathLocator(string Value) : Locator;
48+
49+
public record AccessibilityValue
50+
{
51+
public string? Name { get; set; }
52+
public string? Role { get; set; }
53+
}
54+
55+
public record ContextValue(BrowsingContext Context);
56+
57+
public enum MatchType
58+
{
59+
Full,
60+
Partial
61+
}

0 commit comments

Comments
 (0)