Skip to content

Commit

Permalink
fix firefox test
Browse files Browse the repository at this point in the history
  • Loading branch information
kblok committed Nov 21, 2023
1 parent 7836154 commit 72a9987
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/PuppeteerSharp.Tests/ElementHandleTests/ClickTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@ public async Task ShouldNotWorkForTextNodes()
var buttonTextNode = (IElementHandle)await Page.EvaluateExpressionHandleAsync(
"document.querySelector('button').firstChild");
var exception = Assert.ThrowsAsync<EvaluationFailedException>(async () => await buttonTextNode.ClickAsync());
Assert.That(exception.Message, Does.Contain("is not of type 'Element'"));

if (TestConstants.IsChrome)
{
Assert.That(exception.Message, Does.Contain("is not of type 'Element'"));
}
else
{
Assert.That(exception.Message, Does.Contain("implement interface Element"));
}
}

[PuppeteerTest("elementhandle.spec.ts", "ElementHandle.click", "should throw for detached nodes")]
Expand Down

0 comments on commit 72a9987

Please sign in to comment.