Skip to content

Commit

Permalink
#47: Add -WaitVisible to Wait-MonocleElement as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Badgerati committed Feb 12, 2020
1 parent 76f112c commit d600142
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Public/Elements.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ function Wait-MonocleElement
[int]
$Timeout = 600,

[switch]
$WaitVisible,

[switch]
$All
)
Expand All @@ -342,6 +345,13 @@ function Wait-MonocleElement
Set-MonocleElementId -Element $_ -Id $result.Id
}

# wait for the elements to be visible
if ($WaitVisible) {
@($result.Element) | ForEach-Object {
$_ | Wait-MonocleElementVisible | Out-Null
}
}

# return the element
return $result.Element
}
Expand Down

0 comments on commit d600142

Please sign in to comment.