Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1522,21 +1522,6 @@
"FAIL"
]
},
{
"comment": "This is part of organizing the webdriver bidi implementation, We will remove it one by one",
"testIdPattern": "[page.spec] *Page.setContent*",
"platforms": [
"darwin",
"linux",
"win32"
],
"parameters": [
"webDriverBiDi"
],
"expectations": [
"FAIL"
]
},
{
"comment": "This is part of organizing the webdriver bidi implementation, We will remove it one by one",
"testIdPattern": "[proxy.spec] *",
Expand Down
4 changes: 0 additions & 4 deletions lib/PuppeteerSharp.Tests/NavigationTests/PageGoBackTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ namespace PuppeteerSharp.Tests.NavigationTests
{
public class PageGoBackTests : PuppeteerPageBaseTest
{
public PageGoBackTests() : base()
{
}

//TODO: This is working in puppeteer. I don't know why is hanging here.
[Test, PuppeteerTest("navigation.spec", "navigation Page.goBack", "should work")]
public async Task ShouldWork()
Expand Down
6 changes: 3 additions & 3 deletions lib/PuppeteerSharp.Tests/PageTests/SetContentTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace PuppeteerSharp.Tests.PageTests
{
public class SetContentTests : PuppeteerPageBaseTest
{
const string ExpectedOutput = "<html><head></head><body><div>hello</div></body></html>";
private const string ExpectedOutput = "<html><head></head><body><div>hello</div></body></html>";

public async Task Usage(IBrowser browser)
{
Expand Down Expand Up @@ -65,7 +65,7 @@ public async Task ShouldRespectTimeout()
Timeout = 1
}));

Assert.That(exception.Message, Does.Contain("Timeout of 1 ms exceeded"));
Assert.That(exception!.Message, Does.Contain("Timeout of 1 ms exceeded"));
}

[Test, PuppeteerTest("page.spec", "Page Page.setContent", "should respect default navigation timeout")]
Expand All @@ -79,7 +79,7 @@ public async Task ShouldRespectDefaultTimeout()
var exception = Assert.ThrowsAsync<TimeoutException>(async () =>
await Page.SetContentAsync($"<img src='{TestConstants.ServerUrl + imgPath}'></img>"));

Assert.That(exception.Message, Does.Contain("Timeout of 1 ms exceeded"));
Assert.That(exception!.Message, Does.Contain("Timeout of 1 ms exceeded"));
}

[Test, PuppeteerTest("page.spec", "Page Page.setContent", "should await resources to load")]
Expand Down
11 changes: 9 additions & 2 deletions lib/PuppeteerSharp.Tests/PuppeteerBrowserBaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@ public async Task InitializeAsync()
[TearDown]
public async Task TearDownAsync()
{
if (Browser is not null)
try
{
await Browser.DisposeAsync();
if (Browser is not null)
{
await Browser.DisposeAsync();
}
}
catch
{
// Ignore exceptions during browser disposal
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions lib/PuppeteerSharp/Bidi/BidiElementHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
// * SOFTWARE.

using System.Threading.Tasks;
using PuppeteerSharp.Cdp.Messaging;
using PuppeteerSharp.QueryHandlers;
using WebDriverBiDi.Script;

Expand All @@ -40,15 +39,15 @@ internal class BidiElementHandle(RemoteValue value, BidiRealm realm) : ElementHa

internal override CustomQuerySelectorRegistry CustomQuerySelectorRegistry { get; } = new();

protected override Page Page { get; }
internal BidiFrame BidiFrame => realm.Environment as BidiFrame;

protected override Page Page => BidiFrame.BidiPage;

public static IJSHandle From(RemoteValue value, BidiRealm realm)
{
return new BidiElementHandle(value, realm);
}

public override ValueTask DisposeAsync() => throw new System.NotImplementedException();

public override Task UploadFileAsync(bool resolveFilePaths, params string[] filePaths) => throw new System.NotImplementedException();

public override Task<IFrame> ContentFrameAsync() => throw new System.NotImplementedException();
Expand Down
Loading
Loading