@@ -82,11 +82,11 @@ export const page: {
8282 /**
8383 * Add a trace marker when browser tracing is enabled.
8484 */
85- mark(name : string , options ? : { stack? : string }): Promise <void >
85+ mark(name : string , options ? : { stack? : string ; kind ? : BrowserTraceEntryKind }): Promise <void >
8686 /**
8787 * Group multiple operations under a trace marker when browser tracing is enabled.
8888 */
89- mark<T >(name : string , body : () => T | Promise <T >, options ? : { stack? : string }): Promise <T >
89+ mark<T >(name : string , body : () => T | Promise <T >, options ? : { stack? : string ; kind ? : BrowserTraceEntryKind }): Promise <T >
9090 /**
9191 * Extend default `page` object with custom methods.
9292 */
@@ -127,18 +127,20 @@ The `path` is also ignored in that case.
127127### mark
128128
129129` ` ` ts
130- function mark(name : string , options ? : { stack? : string }): Promise <void >
130+ function mark(name : string , options ? : { stack? : string ; kind ? : BrowserTraceEntryKind }): Promise <void >
131131function mark<T >(
132132 name : string ,
133133 body : () => T | Promise <T >,
134- options ? : { stack? : string },
134+ options ? : { stack? : string ; kind ? : BrowserTraceEntryKind },
135135): Promise <T >
136136```
137137
138138Adds a named marker to the trace timeline for the current test .
139139
140140Pass ` 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 .
141141
142+ Pass ` options.kind ` to categorize your marker as specific type , for example as ` 'action' ` .
143+
142144If you pass a callback , Vitest creates a trace group with this name , runs the callback , and closes the group automatically .
143145
144146` ` ` ts
@@ -151,7 +153,7 @@ await page.mark('after submit')
151153await page.mark('submit flow', async () => {
152154 await page.getByRole('textbox', { name: 'Email' }).fill('john@example.com')
153155 await page.getByRole('button', { name: 'Submit' }).click()
154- })
156+ }, { kind: 'action' } )
155157` ` `
156158
157159::: tip
0 commit comments