···4242 save?: boolean
4343}
44444545+export type BrowserTraceEntryKind = 'action' | 'expect' | 'mark' | 'lifecycle'
4646+4547export interface MarkOptions {
4648 /**
4749 * Optional stack string used to resolve marker location.
4850 * Useful for wrapper libraries that need to forward the end-user callsite.
4951 */
5052 stack?: string
5353+5454+ /**
5555+ * Optional marker kind that's used to categorize the marker in the trace viewer.
5656+ * @default 'mark'
5757+ */
5858+ kind?: BrowserTraceEntryKind
5159}
52605361interface StandardScreenshotComparators {
+7-5
docs/api/browser/context.md
···8282 /**
8383 * Add a trace marker when browser tracing is enabled.
8484 */
8585- mark(name: string, options?: { stack?: string }): Promise<void>
8585+ 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 */
8989- mark<T>(name: string, body: () => T | Promise<T>, options?: { stack?: string }): Promise<T>
8989+ 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 */
···127127### mark
128128129129```ts
130130-function mark(name: string, options?: { stack?: string }): Promise<void>
130130+function mark(name: string, options?: { stack?: string; kind?: BrowserTraceEntryKind }): Promise<void>
131131function mark<T>(
132132 name: string,
133133 body: () => T | Promise<T>,
134134- options?: { stack?: string },
134134+ options?: { stack?: string; kind?: BrowserTraceEntryKind },
135135): Promise<T>
136136```
137137138138Adds a named marker to the trace timeline for the current test.
139139140140Pass `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+142142+Pass `options.kind` to categorize your marker as specific type, for example as `'action'`.
141143142144If you pass a callback, Vitest creates a trace group with this name, runs the callback, and closes the group automatically.
143145···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()
154154-})
156156+}, { kind: 'action' })
155157```
156158157159::: tip
+3-1
docs/api/browser/locators.md
···846846### mark
847847848848```ts
849849-function mark(name: string, options?: { stack?: string }): Promise<void>
849849+function mark(name: string, options?: { stack?: string; kind?: BrowserTraceEntryKind }): Promise<void>
850850```
851851852852Adds a named marker to the trace timeline and uses the current locator as marker context.
853853854854Pass `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.
855855+856856+Pass `options.kind` to categorize your marker as specific type, for example as `'action'`.
855857856858```ts
857859import { page } from 'vitest/browser'