How it works...

The arguments for the moveToElement function are the following:

  • selector: We used tag name as a selector
  • tag/selector: We looked for the button tag; had we used another selector here, we would have put a different format
  • xoffset: This is where the virtual mouse will be positioned in x coordinates; for us, 0 was okay as, even on the edge of a button, clicking is valid
  • yoffset: This is similar to the preceding argument, but on the y-axis

There is a range of commands that, after having been brought to the right position, can release events. We used doubleClick, but there are others as well.

Get Vue.js 2 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.