File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
PuppeteerSharp.TestServer/wwwroot
PuppeteerSharp.Tests/ElementHandleTests Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 1+ < html >
2+
3+ < body >
4+ < iframe src ="https://example.com "> </ iframe >
5+ </ body >
6+
7+ </ html >
Original file line number Diff line number Diff line change @@ -10,8 +10,12 @@ namespace PuppeteerSharp.Tests.ElementHandleTests
1010 [ Collection ( TestConstants . TestFixtureCollectionName ) ]
1111 public class ContentFrameTests : PuppeteerPageBaseTest
1212 {
13+ private readonly LaunchOptions _headfulOptions ;
14+
1315 public ContentFrameTests ( ITestOutputHelper output ) : base ( output )
1416 {
17+ _headfulOptions = TestConstants . DefaultBrowserOptions ( ) ;
18+ _headfulOptions . Headless = false ;
1519 }
1620
1721 [ PuppeteerTest ( "elementhandle.spec.ts" , "ElementHandle.contentFrame" , "should work" ) ]
@@ -24,5 +28,16 @@ public async Task ShouldWork()
2428 var frame = await elementHandle . ContentFrameAsync ( ) ;
2529 Assert . Equal ( Page . FirstChildFrame ( ) , frame ) ;
2630 }
31+
32+ [ PuppeteerFact ]
33+ public async Task ShouldWorkHeadful ( )
34+ {
35+ await using var Browser = await Puppeteer . LaunchAsync ( _headfulOptions ) ;
36+ await using var Page = await Browser . NewPageAsync ( ) ;
37+ await Page . GoToAsync ( $ "{ TestConstants . ServerUrl } /frame-example.html") ;
38+ var elementHandle = await Page . QuerySelectorAsync ( "iframe" ) ;
39+ var frame = await elementHandle . ContentFrameAsync ( ) ;
40+ Assert . Equal ( Page . FirstChildFrame ( ) , frame ) ;
41+ }
2742 }
2843}
You can’t perform that action at this time.
0 commit comments