Skip to content

Commit 5b0405b

Browse files
committed
feat(snippets) : add screen capture commands
1 parent b273e6c commit 5b0405b

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@
180180

181181
## Screen Capture
182182

183-
* **saveScreenshot**(fileName, optionalCallback) - **future release**
184-
* **screenshot**(log_screenshot_data, callback) - **future release**
183+
* **saveScreenshot**(fileName, optionalCallback)
184+
* **screenshot**(log_screenshot_data, callback)
185185

186186
## Mobile Related
187187

snippets/nightwatchsnippets.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,16 @@
534534
"body": "setAlertText(${1:value}, ${2:optionalCallback})",
535535
"description": "Sends keystrokes to a JavaScript prompt() dialog"
536536
},
537+
"saveScreenshot": {
538+
"prefix": "nwsaveScreenshot",
539+
"body": "saveScreenshot(${1:fileName}, ${2:optionalCallback})",
540+
"description": "Take a screenshot of the current page and saves it as the given filename"
541+
},
542+
"screenshot": {
543+
"prefix": "nwScreenshot",
544+
"body": "screenshot(${1:log_screenshot_data}, ${2:callback})",
545+
"description": "Take a screenshot of the current page"
546+
},
537547
"pause": {
538548
"prefix": "nwpause",
539549
"body": "pause(${1:2111ms}, ${2:optionalCallback})",
@@ -553,10 +563,5 @@
553563
"prefix": "nwuseXpath",
554564
"body": "useXpath(${1:optionalCallback})",
555565
"description": "useXpath(optionalCallback)"
556-
},
557-
"saveScreenshot": {
558-
"prefix": "nwsaveScreenshot",
559-
"body": "saveScreenshot(${1:fileName}, ${2:optionalCallback})",
560-
"description": "saveScreenshot(fileName, optionalCallback)"
561566
}
562567
}

0 commit comments

Comments
 (0)