@@ -259,6 +259,22 @@ export const userEvent: {
259
259
* @see {@link https://testing-library.com/docs/user-event/convenience/#tab } testing-library API
260
260
*/
261
261
tab: (options ? : UserEventTabOptions ) => Promise <void >
262
+ /**
263
+ * Hovers over an element. Uses provider's API under the hood.
264
+ * @see {@link https://playwright.dev/docs/api/class-locator#locator-hover } Playwright API
265
+ * @see {@link https://webdriver.io/docs/api/element/moveTo/ } WebdriverIO API
266
+ * @see {@link https://testing-library.com/docs/user-event/convenience/#hover } testing-library API
267
+ */
268
+ hover: (element : Element , options ? : UserEventHoverOptions ) => Promise <void >
269
+ /**
270
+ * Moves cursor position to the body element. Uses provider's API under the hood.
271
+ * By default, the cursor position is in the center (in webdriverio) or in some visible place (in playwright)
272
+ * of the body element, so if the current element is already there, this will have no effect.
273
+ * @see {@link https://playwright.dev/docs/api/class-locator#locator-hover } Playwright API
274
+ * @see {@link https://webdriver.io/docs/api/element/moveTo/ } WebdriverIO API
275
+ * @see {@link https://testing-library.com/docs/user-event/convenience/#hover } testing-library API
276
+ */
277
+ unhover: (element : Element , options ? : UserEventHoverOptions ) => Promise <void >
262
278
/**
263
279
* Fills an input element with text. This will remove any existing text in the input before typing the new text.
264
280
* Uses provider's API under the hood.
@@ -271,7 +287,7 @@ export const userEvent: {
271
287
* @see {@link https://webdriver.io/docs/api/element/setValue } WebdriverIO API
272
288
* @see {@link https://testing-library.com/docs/user-event/utility/#type } testing-library API
273
289
*/
274
- fill: (element : Element , text : string ) => Promise <void >
290
+ fill: (element : Element , text : string , options ? : UserEventFillOptions ) => Promise <void >
275
291
}
276
292
277
293
/**
@@ -415,7 +431,7 @@ export const myCommand = defineCommand(async (ctx, arg1, arg2) => {
415
431
```
416
432
417
433
::: tip
418
- If you are using TypeScript, don't forget to add ` @vitest/browser/providers/playwright ` to your ` tsconfig ` "compilerOptions.types" field to get autocompletion:
434
+ If you are using TypeScript, don't forget to add ` @vitest/browser/providers/playwright ` to your ` tsconfig ` "compilerOptions.types" field to get autocompletion in the config and on ` userEvent ` and ` page ` options :
419
435
420
436
``` json
421
437
{
0 commit comments