File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
PuppeteerSharp.Tests/FrameTests Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -178,10 +178,19 @@ public async Task ShouldRespectTimeout()
178178 var exception = await Assert . ThrowsAsync < WaitTaskTimeoutException > ( async ( )
179179 => await Page . WaitForSelectorAsync ( "div" , new WaitForSelectorOptions { Timeout = 10 } ) ) ;
180180
181- Assert . NotNull ( exception ) ;
182181 Assert . Contains ( "waiting for selector 'div' failed: timeout" , exception . Message ) ;
183182 }
184183
184+ [ Fact ]
185+ public async Task ShouldHaveAnErrorMessageSpecificallyForAwaitingAnElementToBeHidden ( )
186+ {
187+ await Page . SetContentAsync ( "<div></div>" ) ;
188+ var exception = await Assert . ThrowsAsync < WaitTaskTimeoutException > ( async ( )
189+ => await Page . WaitForSelectorAsync ( "div" , new WaitForSelectorOptions { Hidden = true , Timeout = 10 } ) ) ;
190+
191+ Assert . Contains ( "waiting for selector 'div' to be hidden failed: timeout" , exception . Message ) ;
192+ }
193+
185194 [ Fact ]
186195 public async Task ShouldRespondToNodeAttributeMutation ( )
187196 {
Original file line number Diff line number Diff line change @@ -547,7 +547,7 @@ function hasVisibleBoundingBox() {
547547 this ,
548548 predicate ,
549549 false ,
550- $ "{ ( isXPath ? "XPath" : "selector" ) } '{ selectorOrXPath } '",
550+ $ "{ ( isXPath ? "XPath" : "selector" ) } '{ selectorOrXPath } '{ ( options . Hidden ? " to be hidden" : "" ) } ",
551551 options . Polling ,
552552 options . PollingInterval ,
553553 options . Timeout ,
@@ -557,7 +557,7 @@ function hasVisibleBoundingBox() {
557557 isXPath ,
558558 options . Visible ,
559559 options . Hidden
560- } ) . Task . ConfigureAwait ( false ) ;
560+ } ) . Task . ConfigureAwait ( false ) ;
561561 return handle as ElementHandle ;
562562 }
563563
You can’t perform that action at this time.
0 commit comments