Skip to content

Commit bfef92f

Browse files
committed
feat(snippets) : add user actions commands
1 parent 3577688 commit bfef92f

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@
165165

166166
## User Actions
167167

168-
* **doubleClick**(optionalCallback) - **future release**
169-
* **mouseButtonClick**(button, optionalCallback) - **future release**
170-
* **mouseButtonDown**(button, optionalCallback) - **future release**
171-
* **mouseButtonUp**(button, optionalCallback) - **future release**
172-
* **moveTo**(optionalWebElementId, xoffset, yoffset, optionalCallback) - **future release**
168+
* **doubleClick**(optionalCallback)
169+
* **mouseButtonClick**(button, optionalCallback)
170+
* **mouseButtonDown**(button, optionalCallback)
171+
* **mouseButtonUp**(button, optionalCallback)
172+
* **moveTo**(optionalWebElementId, xoffset, yoffset, optionalCallback)
173173

174174
## User Prompts
175175

snippets/nightwatchsnippets.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,31 @@
489489
"body": "cookie(${1:method}, ${2:optionalCallbackOrCookie})",
490490
"description": "Retrieve or delete all cookies visible to the current page or set a cookie"
491491
},
492+
"doubleClick": {
493+
"prefix": "nwdoubleClick",
494+
"body": "doubleClick(${1:optionalCallback})",
495+
"description": "Double-clicks at the current mouse coordinates"
496+
},
497+
"mouseButtonClick": {
498+
"prefix": "nwmouseButtonClick",
499+
"body": "mouseButtonClick(${1:button}, ${2:optionalCallback})",
500+
"description": "Click at the current mouse coordinates"
501+
},
502+
"mouseButtonDown": {
503+
"prefix": "nwmouseButtonDown",
504+
"body": "mouseButtonDown(${1:button}, ${2:optionalCallback})",
505+
"description": "Click and hold the left mouse button"
506+
},
507+
"mouseButtonUp": {
508+
"prefix": "nwmouseButtonUp",
509+
"body": "mouseButtonUp(${1:button}, ${2:optionalCallback})",
510+
"description": "Releases the mouse button previously held"
511+
},
512+
"moveTo": {
513+
"prefix": "nwmoveTo",
514+
"body": "moveTo(${1:optionalWebElementId}, ${2:xoffset}, ${3:yoffset}, ${4:optionalCallback})",
515+
"description": "Move the mouse by an offset of the specified Web Element ID or relative to the current mouse cursor"
516+
},
492517
"pause": {
493518
"prefix": "nwpause",
494519
"body": "pause(${1:2111ms}, ${2:optionalCallback})",

0 commit comments

Comments
 (0)