NativeScript / nativescript-dev-appium

A package to help with writing and executing e2e Appium tests in NativeScript apps
Apache License 2.0
70 stars 27 forks source link

Is it possible to make this driver support Jest for NativeScript-Vue users? #283

Open redelman431 opened 4 years ago

redelman431 commented 4 years ago

Is your feature request related to a problem? Please describe.

While I am aware that Mocha, Qunit, and Jasmine are what is described to be the recommended test runners in NativeScript-Angular. With NativeScript-Vue, it appears that the community has not fully agreed on a [proper test setup](https://github.com/nativescript-vue/nativescript-vue/issues/224) or runner. So far the NativeScript-Vue community have agreed to make Jest the [standard test runner](https://github.com/nativescript-vue/nativescript-vue/pull/486) for unit and integration testing so utilities such as Vue Test Utils can be used. However, it appears that it is still not possible to run Jest reliably with nativescript-dev-appium as it crashes with a [reserved name error](https://github.com/appium/appium/issues/10237) in the dependency [cloudhead/vargs](https://github.com/cloudhead/vargs) which has not been maintained for 10 years. Having to use another test runner for e2e and Jest for everything else is a problem as it is not best practice to mix test runners. **Describe the solution you'd like**

I know similar write once mobile frameworks such as React Native are able to use Jest as an Appium test runner through a babel preset and just using the standard wd driver. So I was wondering if it would be possible to make this driver work for Jest so the NativeScript-Vue users can use the same test runner throughout all stages of testing. Whether it would be possible through a new babel preset or replacing cloudhead/vargs with the new mike-lang fork of vargs, or even just creating a separate driver or driver-extension for NativeScript-Vue. Otherwise if changes need to be made to other dependencies, perform a pull request. If it is not possible to create such a feature feel free to inform about the limitations and what alternatives to consider.

Describe alternatives you've considered

Alternatives considered have been to run Vue Test Utils with mocha-webpack which has been unsuccessful in a NativeScript environment, just do manual Vue component testing with other runners which can make tests more tedious in the long run, or just run Jest and other test runners in tandem and block jest from any e2e directories which is quite ugly.

Additional context