diff --git a/packages/browser/providers/playwright.d.ts b/packages/browser/providers/playwright.d.ts index f98cee599724..0dc2049f59ce 100644 --- a/packages/browser/providers/playwright.d.ts +++ b/packages/browser/providers/playwright.d.ts @@ -27,13 +27,13 @@ declare module 'vitest/node' { } } -type PWHoverOptions = Parameters[1] -type PWClickOptions = Parameters[1] -type PWDoubleClickOptions = Parameters[1] -type PWFillOptions = Parameters[2] -type PWScreenshotOptions = Parameters[0] -type PWSelectOptions = Parameters[2] -type PWDragAndDropOptions = Parameters[2] +type PWHoverOptions = NonNullable[1]> +type PWClickOptions = NonNullable[1]> +type PWDoubleClickOptions = NonNullable[1]> +type PWFillOptions = NonNullable[2]> +type PWScreenshotOptions = NonNullable[0]> +type PWSelectOptions = NonNullable[2]> +type PWDragAndDropOptions = NonNullable[2]> declare module '@vitest/browser/context' { export interface UserEventHoverOptions extends PWHoverOptions {} diff --git a/packages/browser/src/node/commands/hover.ts b/packages/browser/src/node/commands/hover.ts index 392b7e3e6f85..fee141acc949 100644 --- a/packages/browser/src/node/commands/hover.ts +++ b/packages/browser/src/node/commands/hover.ts @@ -16,7 +16,7 @@ export const hover: UserEventCommand = async ( } else if (context.provider instanceof WebdriverBrowserProvider) { const browser = context.browser - await browser.$(selector).moveTo(options) + await browser.$(selector).moveTo(options as any) } else { throw new TypeError(`Provider "${context.provider.name}" does not support hover`)