Skip to content

Commit 341329a

Browse files
authored
Add SVG clicking test (#1141)
1 parent 87bf1ad commit 341329a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/PuppeteerSharp.Tests/InputTests/ClickTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ public async Task ShouldClickTheButton()
2222
Assert.Equal("Clicked", await Page.EvaluateExpressionAsync<string>("result"));
2323
}
2424

25+
[Fact]
26+
public async Task ShouldClickSvg()
27+
{
28+
await Page.SetContentAsync($@"
29+
<svg height=""100"" width=""100"">
30+
<circle onclick=""javascript:window.__CLICKED=42"" cx=""50"" cy=""50"" r=""40"" stroke=""black"" stroke-width=""3"" fill=""red""/>
31+
</svg>
32+
");
33+
await Page.ClickAsync("circle");
34+
Assert.Equal(42, await Page.EvaluateFunctionAsync<int>("() => window.__CLICKED"));
35+
}
36+
2537
[Fact]
2638
public async Task ShouldClickTheButtonIfWindowNodeIsRemoved()
2739
{

0 commit comments

Comments
 (0)