|
| 1 | +# Development Workflow |
| 2 | + |
| 3 | +<!-- TOC depthFrom:2 --> |
| 4 | + |
| 5 | +- [Development Workflow](#development-workflow) |
| 6 | + - [Running locally](#running-locally) |
| 7 | + - [Prerequisites](#prerequisites) |
| 8 | + - [Clone repository](#clone-repository) |
| 9 | + - [Install dependencies](#install-dependencies) |
| 10 | + - [Run some of the e2e applications e.g. router-tab-view](#run-some-of-the-e2e-applications-eg-router-tab-view) |
| 11 | + - [Running the tests](#running-the-tests) |
| 12 | + - [Testing locally by running e2e tests](#testing-locally-by-running-e2e-tests) |
| 13 | + - [Building Packages](#building-packages) |
| 14 | + |
| 15 | +<!-- /TOC --> |
| 16 | + |
| 17 | +## Running locally |
| 18 | + |
| 19 | +### Prerequisites |
| 20 | + |
| 21 | +Install your native toolchain and NativeScript as described in the docs: |
| 22 | + |
| 23 | +https://docs.nativescript.org/environment-setup.html |
| 24 | + |
| 25 | +### Clone repository |
| 26 | + |
| 27 | +``` |
| 28 | +$ git clone [email protected]:NativeScript/angular.git |
| 29 | +$ cd angular |
| 30 | +``` |
| 31 | + |
| 32 | +### Install dependencies |
| 33 | + |
| 34 | +``` |
| 35 | +$ cd angular |
| 36 | +$ npm clean.all |
| 37 | +``` |
| 38 | + |
| 39 | +### Run some of the e2e applications e.g. router-tab-view |
| 40 | + |
| 41 | +**E2E TESTS STILL NOT IN THIS REPO!** instead use `apps/nativescript-demo-ng` |
| 42 | + |
| 43 | +Install NPM packages (use the local copy of `@nativescript/angular`): |
| 44 | +``` |
| 45 | +$ cd e2e/router-tab-view |
| 46 | +$ npm install |
| 47 | +``` |
| 48 | + |
| 49 | +Start the app: |
| 50 | + |
| 51 | +``` |
| 52 | +$ tns run android |
| 53 | +$ tns run ios |
| 54 | +``` |
| 55 | + |
| 56 | +Make changes to `@nativescript/angular` and see them applied in the running app. |
| 57 | + |
| 58 | +## Running the tests |
| 59 | + |
| 60 | +Install the NPM dependencies: |
| 61 | +``` |
| 62 | +$ cd apps/nativescript-demo-ng |
| 63 | +$ npm install |
| 64 | +``` |
| 65 | + |
| 66 | +Run the tests: |
| 67 | + |
| 68 | +``` |
| 69 | +$ ns test ios |
| 70 | +$ ns test android |
| 71 | +``` |
| 72 | + |
| 73 | +## Testing locally by running e2e tests |
| 74 | + |
| 75 | +**E2E TESTS STILL NOT IN THIS REPO!** |
| 76 | + |
| 77 | +NOTE: The steps below describe how to run `renderer` tests, but the same approach can be used to run `router` or any other `e2e` tests. |
| 78 | + |
| 79 | +1. Navigate to `e2e/renderer` |
| 80 | + ``` bash |
| 81 | + cd e2e/renderer |
| 82 | + ``` |
| 83 | + |
| 84 | +2. Install dependencies. This also installs your local copy of the nativescript-angular plugin. |
| 85 | + ``` bash |
| 86 | + npm install |
| 87 | + ``` |
| 88 | +3. Make sure to have an emulator set up or connect a physical Android/iOS device. |
| 89 | + |
| 90 | +4. Build the app for Android or iOS |
| 91 | + ```bash |
| 92 | + tns run android/ios |
| 93 | + ``` |
| 94 | + |
| 95 | +5. Install [appium](http://appium.io/) globally. |
| 96 | + ``` bash |
| 97 | + npm install -g appium |
| 98 | + ``` |
| 99 | + |
| 100 | +6. Follow the instructions in the [nativescript-dev-appium](https://github.com/nativescript/nativescript-dev-appium#custom-appium-capabilities) plugin to add an appium capability for your device inside `./e2e/renderer/e2e/config/appium.capabilities.json`. |
| 101 | + |
| 102 | +7. Run the automated tests. The value of the `runType` argument should match the name of the capability that you just added. |
| 103 | + ``` bash |
| 104 | + npm run e2e -- --runType capabilityName |
| 105 | + ``` |
| 106 | + |
| 107 | +## Building Packages |
| 108 | + |
| 109 | +1. Build `@nativescript/angular`: |
| 110 | + ``` |
| 111 | + npx nx run angular:build |
| 112 | + ``` |
| 113 | +2. Build `@nativescript/zone-js` |
| 114 | + ``` |
| 115 | + npx nx run zone-js:build |
| 116 | + ``` |
| 117 | +Packages are available in the `dist` folder. |
0 commit comments