NativeScript / nativescript-cli

Command-line interface for building NativeScript apps
https://www.npmjs.com/package/nativescript
Apache License 2.0
1.04k stars 195 forks source link

Add ability to test UI widgets #2774

Open dtopuzov opened 7 years ago

dtopuzov commented 7 years ago

From @PeterStaev on April 23, 2016 9:57

From what I see currently it is not possible to test UI widgets. I tried to parse a widget with builder.parse or just create a new object inside the test and set up properties/bindings but both approaches do not initialize the widget fully (i.e. on android the _createUI function is not called, on iOS onLoaded event is never fired). Would be great if we can add tests for UI widgets (especially for people developing UI plugins :))

Copied from original issue: NativeScript/nativescript-unit-test-runner#9

rosen-vladimirov commented 5 years ago

One idea to implement this - allow navigation from unit test to actual page from the application. This way the page will be loaded and you'll be able to run unit tests for its code behind. In case you need e2e ui tests, you can check this article