Testing NativeScript app with Appium
Asked 07 September, 2021
Viewed 2.7K times
  • 61
Votes

I am learning NativeScript. I am trying to write some automated tests with Jasmine. From my understanding, I can use Appium with Jasmine to run automated tests in the emulator. At this time, I've added the appium-gulp-plugins to my package.son file. I also have a basic JavaScript file with a single test. That file looks like this:

describe('MyApp', function() {
  describe('Login', function() {
    it('should successfuly login', function() {
      // set username field value
      // set password field value
      // click "login" button.
      // get response.
      expect(true).toBe(true);
    });           
  });        
});

I have two challenges:

  1. How do I interact with the NativeScript view from the test?
  2. How do I actually run the tests? As it is right now, its just straight up Jasmine, so I can do the following:

    gulp.src('./path/to/tests.js').pipe(jasmine());
    

However, with Appium in the mix, I'm not sure how to integrate it as part of running my tests.

2 Answer