feat(browser): support custom kind in page.mark by AriPerkkio · Pull Request #10302 · vitest-dev/vitest (original) (raw)
Is it important that your
markto show up exactly like current action? I'm thinkingkindis mostly (randomly-chosen) initial color labeling, which may not be a proper API, so it maybe be better to let mark caller pick the color.
It's not 100% necessary, but I think it makes sense for users to be able to categorize their custom marks with kind. I would expect users to have their custom kind: 'expect', kind: 'lifecycle' and kind: 'action'. Having kind: 'mark' is good default.
Unrelated, but I wonder if it makes sense to expose mark on the server (when running a command) too so there is no extra calls if you already execute a command
@sheremet-va I'm not following what this means. Can you explain the idea more detail?
I think that means being able to call page.mark on server side, in custom command? That would be very useful.
export default defineConfig({ test: { browser: { provider: playwright(), commands: { example(context) { context.page.mark("example") } } } }, });