mirror of
https://github.com/hanzoai/vitest.git
synced 2026-09-24 17:04:25 +00:00
36 lines
896 B
TypeScript
36 lines
896 B
TypeScript
import type { BrowserCommand } from 'vitest/node'
|
|
import { playwright } from '@vitest/browser-playwright'
|
|
import { defineConfig } from 'vitest/config'
|
|
|
|
// mousedown through custom command
|
|
// https://github.com/vitest-dev/vitest/issues/8190
|
|
const mousedownCommand: BrowserCommand<[selector: string]> = async (ctx, selector) => {
|
|
await ctx.iframe.locator(selector).hover()
|
|
await ctx.page.mouse.down()
|
|
}
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
ui: true,
|
|
includeTaskLocation: true,
|
|
browser: {
|
|
enabled: true,
|
|
provider: playwright(),
|
|
instances: [
|
|
{ browser: 'chromium' },
|
|
],
|
|
headless: true,
|
|
ui: false,
|
|
traceView: {
|
|
enabled: true,
|
|
// enabled only on html reporter e2e
|
|
// inlineImages: true,
|
|
},
|
|
screenshotFailures: false,
|
|
commands: {
|
|
mousedown: mousedownCommand,
|
|
},
|
|
},
|
|
},
|
|
})
|