@@ -66,13 +66,13 @@ await Context.Tracing.StartAsync(new()
6666 string [ ] expectedActionApiNames = new string [ ] { "BrowserContext.NewPageAsync" , "Page.GotoAsync" , "Page.SetContentAsync" , "Page.ClickAsync" , "Mouse.MoveAsync" , "Mouse.DblClickAsync" , "Keyboard.InsertTextAsync" , "Page.WaitForTimeoutAsync" , "Page.CloseAsync" } ;
6767 Assert . AreEqual ( expectedActionApiNames , actualActionApiNames ) ;
6868
69- Assert . GreaterOrEqual ( events . Where ( e => e ? . ApiName == "Page.GotoAsync" ) . Count ( ) , 1 ) ;
70- Assert . GreaterOrEqual ( events . Where ( e => e ? . ApiName == "Page.SetContentAsync" ) . Count ( ) , 1 ) ;
71- Assert . GreaterOrEqual ( events . Where ( e => e ? . ApiName == "Page.ClickAsync" ) . Count ( ) , 1 ) ;
72- Assert . GreaterOrEqual ( events . Where ( e => e ? . ApiName == "Mouse.MoveAsync" ) . Count ( ) , 1 ) ;
73- Assert . GreaterOrEqual ( events . Where ( e => e ? . ApiName == "Mouse.DblClickAsync" ) . Count ( ) , 1 ) ;
74- Assert . GreaterOrEqual ( events . Where ( e => e ? . ApiName == "Keyboard.InsertTextAsync" ) . Count ( ) , 1 ) ;
75- Assert . GreaterOrEqual ( events . Where ( e => e ? . ApiName == "Page.CloseAsync" ) . Count ( ) , 1 ) ;
69+ Assert . GreaterOrEqual ( events . Where ( e => e ? . Title == "Page.GotoAsync" ) . Count ( ) , 1 ) ;
70+ Assert . GreaterOrEqual ( events . Where ( e => e ? . Title == "Page.SetContentAsync" ) . Count ( ) , 1 ) ;
71+ Assert . GreaterOrEqual ( events . Where ( e => e ? . Title == "Page.ClickAsync" ) . Count ( ) , 1 ) ;
72+ Assert . GreaterOrEqual ( events . Where ( e => e ? . Title == "Mouse.MoveAsync" ) . Count ( ) , 1 ) ;
73+ Assert . GreaterOrEqual ( events . Where ( e => e ? . Title == "Mouse.DblClickAsync" ) . Count ( ) , 1 ) ;
74+ Assert . GreaterOrEqual ( events . Where ( e => e ? . Title == "Keyboard.InsertTextAsync" ) . Count ( ) , 1 ) ;
75+ Assert . GreaterOrEqual ( events . Where ( e => e ? . Title == "Page.CloseAsync" ) . Count ( ) , 1 ) ;
7676
7777 Assert . GreaterOrEqual ( events . Where ( x => x . Type == "frame-snapshot" ) . Count ( ) , 1 ) ;
7878 Assert . GreaterOrEqual ( events . Where ( x => x . Type == "screencast-frame" ) . Count ( ) , 1 ) ;
@@ -101,21 +101,21 @@ public async Task ShouldCollectTwoTraces()
101101 {
102102 var ( events , resources ) = ParseTrace ( trace1Path ) ;
103103 Assert . AreEqual ( "context-options" , events [ 0 ] . Type ) ;
104- Assert . GreaterOrEqual ( events . Where ( x => x ? . ApiName == "Page.GotoAsync" ) . Count ( ) , 1 ) ;
105- Assert . GreaterOrEqual ( events . Where ( x => x ? . ApiName == "Page.SetContentAsync" ) . Count ( ) , 1 ) ;
106- Assert . GreaterOrEqual ( events . Where ( x => x ? . ApiName == "Page.ClickAsync" ) . Count ( ) , 1 ) ;
107- Assert . AreEqual ( 0 , events . Where ( x => x ? . ApiName == "Page.CloseAsync" ) . Count ( ) ) ;
108- Assert . AreEqual ( 0 , events . Where ( x => x ? . ApiName == "Page.DblClickAsync" ) . Count ( ) ) ;
104+ Assert . GreaterOrEqual ( events . Where ( x => x ? . Title == "Page.GotoAsync" ) . Count ( ) , 1 ) ;
105+ Assert . GreaterOrEqual ( events . Where ( x => x ? . Title == "Page.SetContentAsync" ) . Count ( ) , 1 ) ;
106+ Assert . GreaterOrEqual ( events . Where ( x => x ? . Title == "Page.ClickAsync" ) . Count ( ) , 1 ) ;
107+ Assert . AreEqual ( 0 , events . Where ( x => x ? . Title == "Page.CloseAsync" ) . Count ( ) ) ;
108+ Assert . AreEqual ( 0 , events . Where ( x => x ? . Title == "Page.DblClickAsync" ) . Count ( ) ) ;
109109 }
110110
111111 {
112112 var ( events , resources ) = ParseTrace ( trace2Path ) ;
113113 Assert . AreEqual ( "context-options" , events [ 0 ] . Type ) ;
114- Assert . AreEqual ( 0 , events . Where ( x => x ? . ApiName == "Page.GottoAsync" ) . Count ( ) ) ;
115- Assert . AreEqual ( 0 , events . Where ( x => x ? . ApiName == "Page.SetContentAsync" ) . Count ( ) ) ;
116- Assert . AreEqual ( 0 , events . Where ( x => x ? . ApiName == "Page.ClickAsync" ) . Count ( ) ) ;
117- Assert . GreaterOrEqual ( events . Where ( x => x ? . ApiName == "Page.CloseAsync" ) . Count ( ) , 1 ) ;
118- Assert . GreaterOrEqual ( events . Where ( x => x ? . ApiName == "Page.DblClickAsync" ) . Count ( ) , 1 ) ;
114+ Assert . AreEqual ( 0 , events . Where ( x => x ? . Title == "Page.GottoAsync" ) . Count ( ) ) ;
115+ Assert . AreEqual ( 0 , events . Where ( x => x ? . Title == "Page.SetContentAsync" ) . Count ( ) ) ;
116+ Assert . AreEqual ( 0 , events . Where ( x => x ? . Title == "Page.ClickAsync" ) . Count ( ) ) ;
117+ Assert . GreaterOrEqual ( events . Where ( x => x ? . Title == "Page.CloseAsync" ) . Count ( ) , 1 ) ;
118+ Assert . GreaterOrEqual ( events . Where ( x => x ? . Title == "Page.DblClickAsync" ) . Count ( ) , 1 ) ;
119119 }
120120
121121 }
@@ -415,6 +415,7 @@ private static (IReadOnlyList<TraceEventEntry> Events, Dictionary<string, byte[]
415415 private class TraceEventEntry
416416 {
417417 public string Type { get ; set ; }
418+ public string Title { get ; set ; }
418419 public string ApiName { get ; set ; }
419420 public TraceEventError Error { get ; set ; }
420421 public double StartTime { get ; set ; }
@@ -428,5 +429,5 @@ private class TraceEventError
428429 public string Message { get ; set ; }
429430 }
430431
431- string [ ] GetActions ( IReadOnlyList < TraceEventEntry > events ) => events . Where ( action => action . Type == "action" ) . OrderBy ( action => action . StartTime ) . Select ( action => action . ApiName ) . ToArray ( ) ;
432+ string [ ] GetActions ( IReadOnlyList < TraceEventEntry > events ) => events . Where ( action => action . Type == "action" ) . OrderBy ( action => action . StartTime ) . Select ( action => action . Title ) . ToArray ( ) ;
432433}
0 commit comments