Skip to content

Commit 3c59eb9

Browse files
committed
Updated Android attribute extensions to include an option for an element wrapper
1 parent 9b16c04 commit 3c59eb9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Legerity.Android/Extensions/AttributeExtensions.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,19 @@ public static string GetContentDescription(this IWebElement element)
1616
{
1717
return element.GetAttribute("content-desc");
1818
}
19+
20+
/// <summary>
21+
/// Gets the value of the Android content description for this element.
22+
/// </summary>
23+
/// <typeparam name="TElement">
24+
/// The type of <see cref="IWebElement"/>.
25+
/// </typeparam>
26+
/// <param name="element">The <see cref="IElementWrapper{TElement}"/> to retrieve a content description for.</param>
27+
/// <returns>The element's content description.</returns>
28+
public static string GetContentDescription<TElement>(this IElementWrapper<TElement> element)
29+
where TElement : IWebElement
30+
{
31+
return GetContentDescription(element.Element);
32+
}
1933
}
2034
}

0 commit comments

Comments
 (0)