@@ -81,11 +81,11 @@ export const page: {
8181 /**
8282 * Add a trace marker when browser tracing is enabled.
8383 */
84- mark(name : string , options ? : { stack? : string }): Promise <void >
84+ mark(name : string , options ? : { stack? : string ; kind ? : BrowserTraceEntryKind }): Promise <void >
8585 /**
8686 * Group multiple operations under a trace marker when browser tracing is enabled.
8787 */
88- mark<T >(name : string , body : () => T | Promise <T >, options ? : { stack? : string }): Promise <T >
88+ mark<T >(name : string , body : () => T | Promise <T >, options ? : { stack? : string ; kind ? : BrowserTraceEntryKind }): Promise <T >
8989 /**
9090 * Extend default `page` object with custom methods.
9191 */
@@ -126,18 +126,20 @@ export const page: {
126126### mark
127127
128128` ` ` ts
129- function mark(name : string , options ? : { stack? : string }): Promise <void >
129+ function mark(name : string , options ? : { stack? : string ; kind ? : BrowserTraceEntryKind }): Promise <void >
130130function mark<T >(
131131 name : string ,
132132 body : () => T | Promise <T >,
133- options ? : { stack? : string },
133+ options ? : { stack? : string ; kind ? : BrowserTraceEntryKind },
134134): Promise <T >
135135```
136136
137137Adds a named marker to the trace timeline for the current test .
138138
139139Pass ` options.stack ` to override the callsite location in trace metadata . This is useful for wrapper libraries that need to preserve the end - user source location .
140140
141+ Pass ` options.kind ` to categorize your marker as specific type , for example as ` 'action' ` .
142+
141143If you pass a callback , Vitest creates a trace group with this name , runs the callback , and closes the group automatically .
142144
143145` ` ` ts
@@ -150,7 +152,7 @@ await page.mark('after submit')
150152await page.mark('submit flow', async () => {
151153 await page.getByRole('textbox', { name: 'Email' }).fill('john@example.com')
152154 await page.getByRole('button', { name: 'Submit' }).click()
153- })
155+ }, { kind: 'action' } )
154156` ` `
155157
156158::: tip
0 commit comments