diff --git a/src/actions/clearHover.ts b/src/actions/clearHover.ts new file mode 100644 index 00000000..b0425f37 --- /dev/null +++ b/src/actions/clearHover.ts @@ -0,0 +1,17 @@ +import {LogEventType} from '../constants/internal'; +import {step} from '../step'; +import {getPlaywrightPage} from '../useContext'; + +/** + * Clears hover from all elements. + */ +export const clearHover = (): Promise => + step( + 'Clear hover from all elements', + async () => { + const page = getPlaywrightPage(); + + await page.mouse.move(0, 0); + }, + {type: LogEventType.Action}, + ); diff --git a/src/actions/index.ts b/src/actions/index.ts index ea0d0091..a98a3d7c 100644 --- a/src/actions/index.ts +++ b/src/actions/index.ts @@ -7,6 +7,7 @@ export { export {blur} from './blur'; export {check} from './check'; export {clearCookies} from './clearCookies'; +export {clearHover} from './clearHover'; export {clearInput} from './clearInput'; export {click} from './click'; export {dispatchEvent} from './dispatchEvent';