Skip to content

Commit 5e0e644

Browse files
committed
feat(snippets) : add mobile realted commands
1 parent 5b0405b commit 5e0e644

File tree

2 files changed

+35
-10
lines changed

2 files changed

+35
-10
lines changed

README.md

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

186186
## Mobile Related
187187

188-
* **getOrientation**(callback) - **future release**
189-
* **setOrientation**(orientation, optionalCallback) - **future release**
190-
* **contexts**(callback) - **future release**
191-
* **currentContext**(callback) - **future release**
192-
* **setContext**(context, optionalCallback) - **future release**
188+
* **getOrientation**(callback)
189+
* **setOrientation**(orientation, optionalCallback)
190+
* **contexts**(callback)
191+
* **currentContext**(callback)
192+
* **setContext**(context, optionalCallback)
193193

194194
## Utilities-Debugging
195195

snippets/nightwatchsnippets.json

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -544,16 +544,36 @@
544544
"body": "screenshot(${1:log_screenshot_data}, ${2:callback})",
545545
"description": "Take a screenshot of the current page"
546546
},
547+
"getOrientation": {
548+
"prefix": "nwgetOrientation",
549+
"body": "getOrientation(${1:callback})",
550+
"description": "Get the current browser orientation"
551+
},
552+
"setOrientation": {
553+
"prefix": "nwsetOrientation",
554+
"body": "setOrientation(${1:orientation}, ${2:optionalCallback})",
555+
"description": "Sets the browser orientation"
556+
},
557+
"contexts": {
558+
"prefix": "nwcontexts",
559+
"body": "contexts(${1:callback})",
560+
"description": "Get a list of the available contexts"
561+
},
562+
"currentContext": {
563+
"prefix": "nwcurrentContext",
564+
"body": "currentContext(${1:callback})",
565+
"description": "Get current context"
566+
},
567+
"setContext": {
568+
"prefix": "nwsetContext",
569+
"body": "setContext(${1:context}, ${2:optionalCallback})",
570+
"description": "Sets the context"
571+
},
547572
"pause": {
548573
"prefix": "nwpause",
549574
"body": "pause(${1:2111ms}, ${2:optionalCallback})",
550575
"description": "pause(timeInMs, optionalCallback)"
551576
},
552-
"perform": {
553-
"prefix": "nwperform",
554-
"body": "perform(${1:optionalCallback})",
555-
"description": "perform(optionalCallback)"
556-
},
557577
"useCss": {
558578
"prefix": "nwuseCss",
559579
"body": "useCss(${1:optionalCallback})",
@@ -563,5 +583,10 @@
563583
"prefix": "nwuseXpath",
564584
"body": "useXpath(${1:optionalCallback})",
565585
"description": "useXpath(optionalCallback)"
586+
},
587+
"perform": {
588+
"prefix": "nwperform",
589+
"body": "perform(${1:optionalCallback})",
590+
"description": "perform(optionalCallback)"
566591
}
567592
}

0 commit comments

Comments
 (0)