Closed tinbka closed 1 year ago
You didn't provide code sample so:
It started working as expected in a few tries. I'm not sure what was actually a culprit. I ended up wrapping it in a Page fn like this:
click: async function(locString, ...locTimeout) {
const loc = this.locator(locString, ...locTimeout);
await this.cursor.actions.click({ target: await loc.boundingBox(), waitBeforeClick: [100, 1000] });
return loc;
},
passing it boundingBox
as a target because this way it would allow using sophisticated playwright locators like 'internal:text="sign in"i'
As i mentoned, when it moves directly to target it's in error mode, make sure you correctly handled promises.
This part doesn't look correctly for me { target: await loc.boundingBox()
. might be better to handle it before passing as arg.
Hey there @reaz1995, thanks for the development effort first of all.
Isn't the cursor on the Page supposed to move with a relatively slow speed with a curve path, and slow down before it reaches the target, as a human would do? When I execute
page.cursor.actions.move(locatorName)
I don't see a trajectory at all, I just see the cursor immediately teleporting to the selected element as if my screen is a touch device rather than a desktop with a mouse and a human just tapped it in the right place with a finger.Do I need to set an additional option to
move
or something?