Skip to content

Commit 46f33d5

Browse files
authored
Add missing tracing tests (#2286)
1 parent 618e642 commit 46f33d5

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

lib/PuppeteerSharp.Tests/TracingTests/TracingTests.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,25 @@ await Page.Tracing.StartAsync(new TracingOptions
9090
}
9191
}
9292

93+
[PuppeteerTest("tracing.spec.ts", "Tracing", "should run with default categories")]
94+
[Skip(SkipAttribute.Targets.Firefox)]
95+
public async Task ShouldRunWithDefaultCategories()
96+
{
97+
await Page.Tracing.StartAsync(new TracingOptions
98+
{
99+
Path = _file,
100+
});
101+
102+
await Page.Tracing.StopAsync();
103+
104+
using (var file = File.OpenText(_file))
105+
using (var reader = new JsonTextReader(file))
106+
{
107+
var traceJson = JToken.ReadFrom(reader);
108+
StringAssert.Contains("toplevel", traceJson["traceEvents"].ToString());
109+
}
110+
}
111+
93112
[PuppeteerTest("tracing.spec.ts", "Tracing", "should throw if tracing on two pages")]
94113
[Skip(SkipAttribute.Targets.Firefox)]
95114
public async Task ShouldThrowIfTracingOnTwoPages()

lib/PuppeteerSharp.Tests/WontImplementTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public WontImplementTests(): base()
4949
[PuppeteerTest("page.spec.ts", "Page.exposeFunction", "should support throwing \"null\"")]
5050
[PuppeteerTest("page.spec.ts", "Page.exposeFunction", "should work with function shorthands")]
5151
[PuppeteerTest("elementhandle.spec.ts", "Custom queries", "should wait correctly with waitFor")]
52+
[PuppeteerTest("tracing.spec.ts", "Tracing", "should return undefined in case of Buffer error")]
5253
[PuppeteerTimeout]
5354
public void TheseTesstWontBeImplemented()
5455
{

0 commit comments

Comments
 (0)