Skip to content

Commit e3fb28f

Browse files
authored
Update navigation tests (#1794)
1 parent fdcbdd8 commit e3fb28f

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using Microsoft.AspNetCore.Http;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.IO;
5+
using System.Net;
6+
using System.Threading.Tasks;
7+
using Xunit;
8+
using Xunit.Abstractions;
9+
using PuppeteerSharp.Helpers;
10+
using PuppeteerSharp.Tests.Attributes;
11+
using PuppeteerSharp.Xunit;
12+
13+
namespace PuppeteerSharp.Tests.NavigationTests
14+
{
15+
[Collection(TestConstants.TestFixtureCollectionName)]
16+
public class PageReloadTests : PuppeteerPageBaseTest
17+
{
18+
public PageReloadTests(ITestOutputHelper output) : base(output)
19+
{
20+
}
21+
22+
[PuppeteerTest("navigation.spec.ts", "Page.reload", "should work")]
23+
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
24+
public async Task ShouldWork()
25+
{
26+
await Page.GoToAsync(TestConstants.EmptyPage);
27+
await Page.EvaluateFunctionAsync("() => (globalThis._foo = 10)");
28+
await Page.ReloadAsync();
29+
Assert.Null(await Page.EvaluateFunctionAsync("() => globalThis._foo"));
30+
}
31+
}
32+
}

lib/PuppeteerSharp.Tests/WontImplementTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ public WontImplementTests(ITestOutputHelper output) : base(output)
1717
[PuppeteerTest("chromiumonly.spec.ts", "Puppeteer.launch |pipe| option", "should support the pipe option")]
1818
[PuppeteerTest("chromiumonly.spec.ts", "Puppeteer.launch |pipe| option", "should support the pipe argument")]
1919
[PuppeteerTest("chromiumonly.spec.ts", "Puppeteer.launch |pipe| option", "should fire \"disconnected\" when closing with pipe")]
20+
[PuppeteerTest("navigation.spec.ts", "should not leak listeners during navigation")]
21+
[PuppeteerTest("navigation.spec.ts", "should not leak listeners during bad navigation")]
22+
[PuppeteerTest("navigation.spec.ts", "should not leak listeners during navigation of 11 pages")]
23+
[PuppeteerTest("navigation.spec.ts", "should throw if networkidle is passed as an option")]
2024
[Fact(Timeout = TestConstants.DefaultTestTimeout)]
2125
public void TheseTesstWontBeImplemented()
2226
{

0 commit comments

Comments
 (0)