|
22 | 22 | namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
|
23 | 23 |
|
24 | 24 | [JsonPolymorphic(TypeDiscriminatorPropertyName = "type")]
|
25 |
| -[JsonDerivedType(typeof(Accessibility), "accessibility")] |
26 |
| -[JsonDerivedType(typeof(Css), "css")] |
27 |
| -[JsonDerivedType(typeof(InnerText), "innerText")] |
28 |
| -[JsonDerivedType(typeof(XPath), "xpath")] |
29 |
| -public abstract record Locator |
| 25 | +[JsonDerivedType(typeof(AccessibilityLocator), "accessibility")] |
| 26 | +[JsonDerivedType(typeof(CssLocator), "css")] |
| 27 | +[JsonDerivedType(typeof(ContextLocator), "context")] |
| 28 | +[JsonDerivedType(typeof(InnerTextLocator), "innerText")] |
| 29 | +[JsonDerivedType(typeof(XPathLocator), "xpath")] |
| 30 | +public abstract record Locator; |
| 31 | + |
| 32 | +public record AccessibilityLocator(AccessibilityLocator.AccessibilityLocatorValue Value) : Locator |
30 | 33 | {
|
31 |
| - public record Accessibility(Accessibility.AccessibilityValue Value) : Locator |
| 34 | + public record AccessibilityLocatorValue |
32 | 35 | {
|
33 |
| - public record AccessibilityValue |
34 |
| - { |
35 |
| - public string? Name { get; set; } |
36 |
| - public string? Role { get; set; } |
37 |
| - } |
| 36 | + public string? Name { get; set; } |
| 37 | + public string? Role { get; set; } |
38 | 38 | }
|
| 39 | +} |
39 | 40 |
|
40 |
| - public record Css(string Value) : Locator; |
| 41 | +public record CssLocator(string Value) : Locator; |
41 | 42 |
|
42 |
| - public record InnerText(string Value) : Locator |
43 |
| - { |
44 |
| - public bool? IgnoreCase { get; set; } |
| 43 | +public record ContextLocator(ContextLocator.ContextLocatorValue Value) : Locator |
| 44 | +{ |
| 45 | + public record ContextLocatorValue(BrowsingContext Context); |
| 46 | +} |
45 | 47 |
|
46 |
| - public MatchType? MatchType { get; set; } |
| 48 | +public record InnerTextLocator(string Value) : Locator |
| 49 | +{ |
| 50 | + public bool? IgnoreCase { get; set; } |
47 | 51 |
|
48 |
| - public long? MaxDepth { get; set; } |
49 |
| - } |
| 52 | + public Match? MatchType { get; set; } |
50 | 53 |
|
51 |
| - public record XPath(string Value) : Locator; |
52 |
| -} |
| 54 | + public long? MaxDepth { get; set; } |
53 | 55 |
|
54 |
| -public enum MatchType |
55 |
| -{ |
56 |
| - Full, |
57 |
| - Partial |
| 56 | + public enum Match |
| 57 | + { |
| 58 | + Full, |
| 59 | + Partial |
| 60 | + } |
58 | 61 | }
|
| 62 | + |
| 63 | +public record XPathLocator(string Value) : Locator; |
0 commit comments