Skip to content

Instantly share code, notes, and snippets.

@klamping
Created November 9, 2015 18:05
Show Gist options
  • Select an option

  • Save klamping/16e7ad6c0bd72ffd45e5 to your computer and use it in GitHub Desktop.

Select an option

Save klamping/16e7ad6c0bd72ffd45e5 to your computer and use it in GitHub Desktop.
Template String Examples
https://www.npmjs.com/package/es6-template-strings
userCity:{name: "UserCity", selector:"//input[@ng-model='${selector1}']/${selector2}", isTextEntry:true},
browser.addCommand(commandPrePend + "_" + commandEntry.name + "_setValue" , function(textValue, selectors) {
var selector = templatE(commandEntry.selector, selectors);
return this
.messageLog("Setting ", commandEntry.name, " to ", textValue)
.setValue(selector, textValue);
});
// End user runs:
.profile_UserCity_setValue(city, {
selector1: "selector1",
selector2: "selector2"
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment