More Appium testing

I wanted to include one more test (not used in this application) that I have written in the past for a different project since this will give you an idea of just how powerful Appium can be:

it("should type in an element", function (done) {  driver  .elementByXPath('//' + nsAppium.getXPathElement("EditText") + "[@text='Enter your name']")   .sendKeys('Testing')  .text()  .then(function (v) {     if ('Testing' !== v) {        done(new Error("Value in name field does not match"));     } else {        done();     }   }, done); });});

The first thing you might note is that I did not return the promise chain. That is because this example shows how to use the asynchronous support of it. For an async support, you can use a promise or make the function coming ...

Get NativeScript for Angular Mobile Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.