webdriverio: Hovering functionality is not working for safari

Discussed in https://github.com/webdriverio/webdriverio/discussions/9567

<div type='discussions-op-text'>

Originally posted by UsmanGhani-Emumba January 10, 2023 I am trying to hover over a card on safari but it is not functioning properly. The snippet of code is attached as a reference below,

let element: any = await $(selector)
await element.waitForExist()
let location = await browser.execute((arg)=> {arg.getBoundingClientRect()},element)
await element.scrollIntoView({block:'center', inline 'center'})
await element.moveTo({xOffset: Math.floor(location['height'] / 2)})
</div>

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (3 by maintainers)

Most upvoted comments

Hi @UsmanGhani-Emumba, I had a special test case regarding that snippet, please try just to call actions like this: p.s. Keep in mind that this approach is sensitive to safari browser window focus, so it is better not to move mouse during test runs… p.s.2. check if x and y is not < 0 as well

     .....
                actions: [
                    {
                        type: 'pointerMove',
                        duration: 0,
                        x: x + 1,
                        y,
                    },
                ],
     .....