click.js 645 B

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