Skip to content

Commit 66056c8

Browse files
kblokMeir017
authored andcommitted
Add a test for queryObjects with navigation (#1097)
1 parent 11d092a commit 66056c8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/PuppeteerSharp.Tests/ExecutionContextTests/QueryObjectsTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ public async Task ShouldWork()
2424
Assert.Equal(new[] { "hello", "world" }, values);
2525
}
2626

27+
[Fact(Skip = "See https://github.com/GoogleChrome/puppeteer/issues/4263")]
28+
public async Task ShouldWorkForNonBlankPage()
29+
{
30+
// Instantiate an object
31+
await Page.GoToAsync(TestConstants.EmptyPage);
32+
await Page.EvaluateFunctionAsync("() => window.set = new Set(['hello', 'world'])");
33+
var prototypeHandle = await Page.EvaluateFunctionHandleAsync("() => Set.prototype");
34+
var objectsHandle = await Page.QueryObjectsAsync(prototypeHandle);
35+
var count = await Page.EvaluateFunctionAsync<int>("objects => objects.length", objectsHandle);
36+
Assert.Equal(1, count);
37+
}
38+
2739
[Fact]
2840
public async Task ShouldFailForDisposedHandles()
2941
{

0 commit comments

Comments
 (0)