click.js 706 B

1234567891011121314151617181920212223242526272829303132333435
  1. 'use strict';
  2. async function click(element) {
  3. const pointerIn = [];
  4. if (!this.config.skipHover) {
  5. pointerIn.push({
  6. target: element
  7. });
  8. }
  9. pointerIn.push({
  10. keys: '[MouseLeft]',
  11. target: element
  12. });
  13. return this.pointer(pointerIn);
  14. }
  15. async function dblClick(element) {
  16. return this.pointer([
  17. {
  18. target: element
  19. },
  20. '[MouseLeft][MouseLeft]'
  21. ]);
  22. }
  23. async function tripleClick(element) {
  24. return this.pointer([
  25. {
  26. target: element
  27. },
  28. '[MouseLeft][MouseLeft][MouseLeft]'
  29. ]);
  30. }
  31. exports.click = click;
  32. exports.dblClick = dblClick;
  33. exports.tripleClick = tripleClick;