Uncategorized

Classes in JS – ES 6

Posted on

a simple example of class class Car { constructor({title}) { this.title = title; } drive() { return ‘driveeee…’; }}const car = new Car({title: ‘Toyota’});console.log(car.drive());console.log(car.title);class Toyota extends Car { constructor(options) { super(options); this.color = options.color; } honk() { return ‘beeeep’; }}const toyota = new Toyota({color: ‘red’, title: ‘wwrangler’});console.log(toyota.honk());console.log(toyota);

Javascript

Destructuring

Posted on

A simple example to get started var expense = { type : ‘Travel’, amount: ‘1800 NZD’};// var type = expense.type;// var amount = expense.amount;//console.log(type , amount);// a better way of doingconst {type, amount } = expense;//const {amount} = expense;console.log(type , amount); Another example  var savedFile = { extension: ‘jpeg’, name : ‘ES 6’, size : […]

Javascript

template string / template literals ES 6 – Javascript

Posted on

From var to let and const.  //Const – the initial value won’t change.// Let – variable value will change Template string //The normal way of printing a stringconsole.log(“the year is ” + new Date().getFullYear());//Using template string//Can put any valid javascript expression.console.log(`the year is ${new Date().getFullYear()}`); Fat Arrow Functions //Error functionsconst add = function(a,b){ return a […]

Uncategorized

MOBILE TEST PYRAMID OF INTEGRATION TESTING

Posted on

Repost from Dave Haeffner – Elemental Selenium   NOTE: This is a guest post from Kwo Ding. You can follow him on Twitter here and LinkedIn here. You can also see a recording of him delivering this material at SauceCon (link). Introduction Mobile testing involves more complexity when you compare it to web UI testing. A few examples […]

Automation

How to get the path of your Solution file in C#.net

Posted on

The following string will return the location of your solution path irrespective of the build with Debug/release/x64/x86. private static string AssemblyDirectory { get { var codeBase = Assembly.GetExecutingAssembly().CodeBase; var uri = new UriBuilder(codeBase); var path = Uri.UnescapeDataString(uri.Path); path = Path.GetDirectoryName(path); path = path.Replace(“\\Tests\\bin\\Release”, “”); // Change it to the folder that you want. path = […]