Skip to content

Commit f034db2

Browse files
committed
feat(snippets) : add reamining navigation commands
1 parent f203502 commit f034db2

File tree

2 files changed

+45
-20
lines changed

2 files changed

+45
-20
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@
132132
* **init**(optionalURL, optionalCallback)
133133
* **getTitle**(callback)
134134
* **urlHash**(hash, optionalCallback)
135-
* **url**(optionalURL, optionalCallback) - **future release**
136-
* **back**(optionalCallback) - **future release**
137-
* **forward**(optionalCallback) - **future release**
138-
* **refresh**(optionalCallback) - **future release**
139-
* **title**(callback) - **future release**
135+
* **url**(optionalURL, optionalCallback)
136+
* **back**(optionalCallback)
137+
* **forward**(optionalCallback)
138+
* **refresh**(optionalCallback)
139+
* **title**(callback)
140140

141141
## Window Related
142142

snippets/nightwatchsnippets.json

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,46 @@
354354
"body": "sessionLogTypes(${1:callback})",
355355
"description": "Gets an array of strings for which log types are available"
356356
},
357+
"init": {
358+
"prefix": "nwinit",
359+
"body": "init(${1:optionalURL}, ${2:optionalCallback})",
360+
"description": "Performs a call to .url() with passing the value of launch_url field from the settings file"
361+
},
362+
"getTitle": {
363+
"prefix": "nwgetTitle",
364+
"body": "getTitle(${1:callback})",
365+
"description": "Returns the title of the current page. Uses title protocol command"
366+
},
367+
"urlHash": {
368+
"prefix": "nwurlHash",
369+
"body": "urlHash(${1:hash}, ${2:optionalCallback})",
370+
"description": "Convenience command that adds the specified hash"
371+
},
372+
"url": {
373+
"prefix": "nwurl",
374+
"body": "url(${1:optionalURL}, ${2:optionalCallback})",
375+
"description": "Retrieve the URL of the current page or navigate to a new URL"
376+
},
377+
"back": {
378+
"prefix": "nwback",
379+
"body": "back(${1:optionalCallback})",
380+
"description": "Navigate backwards in the browser history, if possible"
381+
},
382+
"forward": {
383+
"prefix": "nwforward",
384+
"body": "forward(${1:optionalCallback})",
385+
"description": "Navigate forwards in the browser history, if possible"
386+
},
387+
"refresh": {
388+
"prefix": "nwrefresh",
389+
"body": "refresh(${1:optionalCallback})",
390+
"description": "Refresh the current page"
391+
},
392+
"titleNavigation": {
393+
"prefix": "nwtitle",
394+
"body": "title(${1:callback})",
395+
"description": "Get the current page title"
396+
},
357397
"pause": {
358398
"prefix": "nwpause",
359399
"body": "pause(${1:2111ms}, ${2:optionalCallback})",
@@ -399,26 +439,11 @@
399439
"body": "saveScreenshot(${1:fileName}, ${2:optionalCallback})",
400440
"description": "saveScreenshot(fileName, optionalCallback)"
401441
},
402-
"getTitle": {
403-
"prefix": "nwgetTitle",
404-
"body": "getTitle(${1:callback})",
405-
"description": "getTitle(callback)"
406-
},
407442
"closeWindow": {
408443
"prefix": "nwcloseWindow",
409444
"body": "closeWindow(${1:optionalCallback})",
410445
"description": "closeWindow(optionalCallback)"
411446
},
412-
"init": {
413-
"prefix": "nwinit",
414-
"body": "init(${1:URL}, ${2:optionalCallback})",
415-
"description": "init(URL, optionalCallback)"
416-
},
417-
"urlHash": {
418-
"prefix": "nwurlHash",
419-
"body": "urlHash(${1:hash}, ${2:optionalCallback})",
420-
"description": "urlHash(hash, optionalCallback)"
421-
},
422447
"getCookies": {
423448
"prefix": "nwgetCookies",
424449
"body": "getCookies(${1:callback})",

0 commit comments

Comments
 (0)