Skip to content

Commit 264c0c8

Browse files
committed
added IsPresent to WebElement
1 parent 212b964 commit 264c0c8

File tree

1 file changed

+15
-0
lines changed
  • src/Bellatrix.Playwright/syncplaywright/core/elements

1 file changed

+15
-0
lines changed

src/Bellatrix.Playwright/syncplaywright/core/elements/WebElement.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,21 @@ public ILocator WrappedLocator
6060

6161
public BrowserPage Page { get; internal init; }
6262

63+
public bool IsPresent
64+
{
65+
get
66+
{
67+
try
68+
{
69+
return All().Any();
70+
}
71+
catch
72+
{
73+
return false;
74+
}
75+
}
76+
}
77+
6378
public IReadOnlyList<WebElement> All()
6479
{
6580
IReadOnlyCollection<ILocator> nativeLocators;

0 commit comments

Comments
 (0)