diff --git a/CHANGELOG.md b/CHANGELOG.md index ddd0fa0..0d77533 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [0.2.0] - 11-11-2018 (DD-MM-YYYY) +### Update +- add client commands and assertions + ## [0.1.1] - 10-11-2018 (DD-MM-YYYY) ### Update - fix package.json with keywords diff --git a/README.md b/README.md index ea9bc16..c2e31a7 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,68 @@ -# vscode-nightwatchjs-snippets -NightwatchJS code snippets for Visual Studio Code +# NightwatchJS code snippets for Visual Studio Code + +[![Version](https://vsmarketplacebadge.apphb.com/version/Raju.vscode-nightwatchjs-snippets.svg)](https://marketplace.visualstudio.com/items?itemName=Raju.vscode-nightwatchjs-snippets) +[![Installs](https://vsmarketplacebadge.apphb.com/installs/Raju.vscode-nightwatchjs-snippets.svg)](https://marketplace.visualstudio.com/items?itemName=Raju.vscode-nightwatchjs-snippets) +[![Ratings](https://vsmarketplacebadge.apphb.com/rating/Raju.vscode-nightwatchjs-snippets.svg)](https://marketplace.visualstudio.com/items?itemName=Raju.vscode-nightwatchjs-snippets) + +## The below commands are supported in this version + +* **attributeContains**(selector, attribute, expected, optionalMessage) +* **attributeEquals**(selector, attribute, expected, optionalMessage) +* **containsText**(selector, expectedText, optionalMessage) +* **cssClassNotPresent**(selector, className, optionalMessage) +* **cssClassPresent**(selector, className, optionalMessage) +* **cssProperty**(selector, cssProperty, expected, optionalMessage) +* **elementNotPresent**(selector, optionalMessage) +* **elementPresent**(selector, optionalMessage) +* **hidden**(selector, optionalMessage) +* **title**(expected, optionalMessage) +* **titleContains**(expected, optionalMessage) +* **urlContains**(expected, optionalMessage) +* **urlEquals**(expected, optionalMessage) +* **value**(expected, optionalMessage) +* **valueContains**(selector, expected, optionalMessage) +* **visible**(selector, optionalMessage) + +* **waitForElementNotPresent**(selector, time) +* **waitForElementNotVisible**(selector, time) +* **waitForElementPresent**(selector, time) +* **waitForElementVisible**(selector, time) + +* **click**(selector, optionalCallback) +* **clearValue**(selector, optionalCallback) +* **getAttribute**(selector, attribute, callback) +* **getCssProperty**(selector, cssProperty, callback) +* **getElementSize**(selector, callback) +* **getLocation**(selector, callback) +* **getLocationInView**(selector, callback) +* **getTagName**(selector, callback) +* **getText**(selector, callback) +* **getValue**(selector, callback) +* **isVisible**(selector, callback) +* **moveToElement**(selector, xoffset, yoffset, optionalCallback) +* **setValue**(selector, inputValue, optionalCallback) +* **submitForm**(selector, optionalCallback) + +* **end**(optionalCallback) +* **pause**(1000ms, optionalCallback) +* **perform**(optionalCallback) +* **useCss**(optionalCallback) +* **useXpath**(optionalCallback) +* **switchWindow**(handleOrName, optionalCallback) +* **resizeWindow**(width, height, optionalCallback) +* **setWindowPosition**(offsetX, offsetY, optionalCallback) +* **maximizeWindow**(optionalCallback) +* **saveScreenshot**(fileName, optionalCallback) +* **getTitle**(callback) +* **closeWindow**(optionalCallback) +* **init**(URL, optionalCallback) +* **urlHash**(hash, optionalCallback) +* **getCookies**(callback) +* **getCookie**(cookieName, callback) +* **setCookie**(cookie object, optionalCallback) +* **deleteCookie**(cookieName, callback) +* **deleteCookies**(optionalCallback) +* **injectScript**(scriptUrl, id, optionalCallback) +* **getLogTypes**(callback) +* **getLog**(typeString, callback) +* **isLogAvailable**(typeString, callback) \ No newline at end of file diff --git a/package.json b/package.json index 2eef28c..ca12320 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "vscode-nightwatchjs-snippets", - "version": "0.1.1", + "version": "0.2.0", "description": "NightwatchJS code snippets for Visual Studio Code", - "displayName": "NightwatchJS snippets for VS Code", + "displayName": "NightwatchJS snippets", "publisher": "Raju", "keywords": [ "nightwatchjs", diff --git a/snippets/nightwatchsnippets.json b/snippets/nightwatchsnippets.json index a15bbdf..45d9c1b 100644 --- a/snippets/nightwatchsnippets.json +++ b/snippets/nightwatchsnippets.json @@ -1,14 +1,287 @@ { - "clickWithCallback": { - "prefix": "ckc", - "body": "click(${1:selector}, ${2:callback})$3", - "description": "click(selector,callback)" - }, - - "click": { - "prefix": "ck", - "body": "click(${1:selector})$2", - "description": "click(selector)" - } - + "end": { + "prefix": "end", + "body": "end(${0:optionalCallback})", + "description": "end(optionalCallback)" + }, + "pause": { + "prefix": "pause", + "body": "pause(${0:1000ms}, ${1:optionalCallback})", + "description": "pause(timems, optionalCallback)" + }, + "perform": { + "prefix": "per", + "body": "perform(${0:optionalCallback})", + "description": "perform(optionalCallback)" + }, + "useCss": { + "prefix": "usec", + "body": "useCss(${0:optionalCallback})", + "description": "useCss(optionalCallback" + }, + "useXpath": { + "prefix": "usex", + "body": "useXpath(${0:optionalCallback})", + "description": "useXpath(optionalCallback)" + }, + "switchWindow": { + "prefix": "swiw", + "body": "switchWindow(${0:handleOrName}, ${1:optionalCallback})", + "description": "switchWindow(handleOrName, optionalCallback)" + }, + "resizeWindow": { + "prefix": "resw", + "body": "resizeWindow(${0:width}, ${1:height}, ${2:optionalCallback})", + "description": "resizeWindow(width, height, optionalCallback)" + }, + "setWindowPosition": { + "prefix": "setw", + "body": "setWindowPosition(${0:offsetX}, ${1:offsetY}, ${2:optionalCallback})", + "description": "setWindowPosition(offsetX, offsetY, optionalCallback)" + }, + "maximizeWindow": { + "prefix": "maxw", + "body": "maximizeWindow(${0:optionalCallback})", + "description": "maximizeWindow(optionalCallback)" + }, + "saveScreenshot": { + "prefix": "saves", + "body": "saveScreenshot(${0:fileName}, ${1:optionalCallback})", + "description": "saveScreenshot(fileName, optionalCallback)" + }, + "getTitle": { + "prefix": "gett", + "body": "getTitle(${0:callback})", + "description": "getTitle(callback)" + }, + "closeWindow": { + "prefix": "clow", + "body": "closeWindow(${0:optionalCallback})", + "description": "closeWindow(optionalCallback)" + }, + "init": { + "prefix": "in", + "body": "init(${0:URL}, ${1:optionalCallback})", + "description": "init(URL, optionalCallback)" + }, + "urlHash": { + "prefix": "urlh", + "body": "urlHash(${0:hash}, ${1:optionalCallback})", + "description": "urlHash(hash, optionalCallback)" + }, + "getCookies": { + "prefix": "getcs", + "body": "getCookies(${0:callback})", + "description": "getCookies(callback)" + }, + "getCookie": { + "prefix": "getc", + "body": "getCookie(${0:cookieName}, ${1:callback})", + "description": "getCookie(cookieName, callback)" + }, + "setCookie": { + "prefix": "setc", + "body": "setCookie(${0:cookieObject}, ${1:optionalCallback})", + "description": "setCookie(cookieObject, optionalCallback)" + }, + "deleteCookie": { + "prefix": "delc", + "body": "deleteCookie(${0:cookieName}, ${1:callback})", + "description": "deleteCookie(cookieName, callback)" + }, + "deleteCookies": { + "prefix": "delcs", + "body": "deleteCookies(${0:optionalCallback})", + "description": "deleteCookies(optionalCallback)" + }, + "injectScript": { + "prefix": "injs", + "body": "injectScript(${0:scriptUrl}, ${1:id}, ${2:optionalCallback})", + "description": "injectScript(scriptUrl, id, optionalCallback)" + }, + "getLogTypes": { + "prefix": "getlt", + "body": "getLogTypes(${0:callback})", + "description": "getLogTypes(callback)" + }, + "getLog": { + "prefix": "getl", + "body": "getLog(${0:typeString}, ${1:callback})", + "description": "getLog(typeString, callback)" + }, + "isLogAvailable": { + "prefix": "isla", + "body": "isLogAvailable(${0:typeString}, ${1:callback})", + "description": "isLogAvailable(typeString, callback)" + }, + "click": { + "prefix": "cli", + "body": "click(${0:selector}, ${1:optionalCallback})", + "description": "click(selector, optionalCallback)" + }, + "clearValue": { + "prefix": "clev", + "body": "clearValue(${0:selector}, ${1:optionalCallback})", + "description": "clearValue(selector, optionalCallback)" + }, + "getAttribute": { + "prefix": "geta", + "body": "getAttribute(${0:selector}, ${1:attribute}, ${2:callback})", + "description": "getAttribute(selector, attribute, callback)" + }, + "getCssProperty": { + "prefix": "getcp", + "body": "getCssProperty(${0:selector}, ${1:cssProperty}, ${2:callback})", + "description": "getCssProperty(selector, cssProperty, callback)" + }, + "getElementSize": { + "prefix": "getes", + "body": "getElementSize(${0:selector}, ${1:callback})", + "description": "getElementSize(selector, callback)" + }, + "getLocation": { + "prefix": "getl", + "body": "getLocation(${0:selector}, ${1:callback})", + "description": "getLocation(selector, callback)" + }, + "getLocationInView": { + "prefix": "getlv", + "body": "getLocationInView(${0:selector}, ${1:callback})", + "description": "getLocationInView(selector, callback)" + }, + "getTagName": { + "prefix": "getta", + "body": "getTagName(${0:selector}, ${1:callback})", + "description": "getTagName(selector, callback)" + }, + "getText": { + "prefix": "gett", + "body": "getText(${0:selector}, ${1:callback})", + "description": "getText(selector, callback)" + }, + "getValue": { + "prefix": "getv", + "body": "getValue(${0:selector}, ${1:callback})", + "description": "getValue(selector, callback)" + }, + "isVisible": { + "prefix": "isv", + "body": "isVisible(${0:selector}, ${1:callback})", + "description": "isVisible(selector, callback)" + }, + "moveToElement": { + "prefix": "movte", + "body": "moveToElement(${0:selector}, ${1:xoffset}, ${2:yoffset}, ${3:optionalCallback})", + "description": "moveToElement(selector, xoffset, yoffset, optionalCallback)" + }, + "setValue": { + "prefix": "setv", + "body": "setValue(${0:selector}, ${1:inputValue}, ${2:optionalCallback})", + "description": "setValue(selector, inputValue, optionalCallback)" + }, + "submitForm": { + "prefix": "subf", + "body": "submitForm(${0:selector}, ${1:optionalCallback})", + "description": "submitForm(selector, optionalCallback)" + }, + "attributeContains": { + "prefix": "attc", + "body": "attributeContains(${0:selector}, ${1:attribute}, ${2:expected}, ${3:optionalMessage})", + "description": "attributeContains(selector, attribute, expected, optionalMessage)" + }, + "attributeEquals": { + "prefix": "atte", + "body": "attributeEquals(${0:selector}, ${1:attribute}, ${2:expected}, ${3:optionalMessage})", + "description": "attributeEquals(selector, attribute, expected, optionalMessage)" + }, + "containsText": { + "prefix": "contt", + "body": "containsText(${0:selector}, ${1:expectedText}, ${2:optionalMessage})", + "description": "containsText(selector, expectedText, optionalMessage)" + }, + "cssClassNotPresent": { + "prefix": "csscnp", + "body": "cssClassNotPresent(${0:selector}, ${1:className}, ${2:optionalMessage})", + "description": "cssClassNotPresent(selector, className, optionalMessage)" + }, + "cssClassPresent": { + "prefix": "csscp", + "body": "cssClassPresent(${0:selector}, ${1:className}, ${2:optionalMessage})", + "description": "cssClassPresent(selector, className, optionalMessage)" + }, + "cssProperty": { + "prefix": "cssp", + "body": "cssProperty(${0:selector}, ${1:cssProperty}, ${2:expected}, ${3:optionalMessage})", + "description": "cssProperty(selector, cssProperty, expected, optionalMessage)" + }, + "elementNotPresent": { + "prefix": "elemnp", + "body": "elementNotPresent(${0:selector}, ${1:optionalMessage})", + "description": "elementNotPresent(selector, optionalMessage)" + }, + "elementPresent": { + "prefix": "elemp", + "body": "elementPresent(${0:selector}, ${1:optionalMessage})", + "description": "elementPresent(selector, optionalMessage)" + }, + "hidden": { + "prefix": "hid", + "body": "hidden(${0:selector}, ${1:optionalMessage})", + "description": "hidden(selector, optionalMessage)" + }, + "title": { + "prefix": "titl", + "body": "title(${0:expected}, ${1:optionalMessage})", + "description": "title(expected, optionalMessage)" + }, + "titleContains": { + "prefix": "titlec", + "body": "titleContains(${0:expected}, ${1:optionalMessage})", + "description": "titleContains(expected, optionalMessage)" + }, + "urlContains": { + "prefix": "urlc", + "body": "urlContains(${0:expected}, ${1:optionalMessage})", + "description": "urlContains(expected, optionalMessage)" + }, + "urlEquals": { + "prefix": "urle", + "body": "urlEquals(${0:expected}, ${1:optionalMessage})", + "description": "urlEquals(expected, optionalMessage)" + }, + "value": { + "prefix": "val", + "body": "value(${0:expected}, ${1:optionalMessage})", + "description": "value(expected, optionalMessage)" + }, + "valueContains": { + "prefix": "valueco", + "body": "valueContains(${0:selector}, ${1:expected}, ${2:optionalMessage})", + "description": "valueContains(selector, expected, optionalMessage)" + }, + "visible": { + "prefix": "visi", + "body": "visible(${0:selector}, ${1:optionalMessage})", + "description": "visible(selector, optionalMessage)" + }, + "waitForElementNotPresent": { + "prefix": "waitenp", + "body": "waitForElementNotPresent(${0:selector}, ${1:time})", + "description": "waitForElementNotPresent(selector, time)" + }, + "waitForElementNotVisible": { + "prefix": "waitenv", + "body": "waitForElementNotVisible(${0:selector}, ${1:time})", + "description": "waitForElementNotVisible(selector, time)" + }, + "waitForElementPresent": { + "prefix": "waitep", + "body": "waitForElementPresent(${0:selector}, ${1:time})", + "description": "waitForElementPresent(selector, time)" + }, +"waitForElementVisible": { + "prefix": "waitev", + "body": "waitForElementVisible(${0:selector}, ${1:time})", + "description": "waitForElementVisible(selector, time)" + } } \ No newline at end of file