Skip to content

Commit e1eea8e

Browse files
manoldonevVasil Chimev
authored and
Vasil Chimev
committed
test(e2e): add modal-navigation app (NativeScript#5393)
* chore(apps): add modal-navigation-app for ui testing * test(e2e): add modal-navigation app * test(apps): remove modal-navigation-app The app has been moved to `e2e/modal-navigation`. * chore: include e2e folder to npm scripts * docs: include e2e folder to DevelopmentWorkflow.md * chore(e2e): update .gitignore * fix(e2e): relative paths * chore(e2e): update package.json * test(e2e): add change root view to modal-navigation * test(e2e): set androidTabsPosition to botton * chore(e2e): add VSCode launch.json config * docs(e2e): delete LICENSE and README.md files * refactor(e2e): rename modal-tab-page to modal-tab-root * test(e2e): update iOS launch screen
1 parent 2edef3d commit e1eea8e

File tree

86 files changed

+1083
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1083
-8
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ apps/lib/
5151
apps/hooks/
5252
apps/node_modules/
5353

54+
e2e/**/platforms
55+
5456
package-lock.json
5557

5658
.nsbuildinfo

DevelopmentWorkflow.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Development Workflow
66
The repository contains several packages and apps:
77
- `tns-core-modules` - The core NativeScript TypeScript modules used to develop NativeScript apps.
88
- `apps` - UI app used for manual testing and automation.
9+
- `e2e` - applications and *e2e* tests.
910
- `tests` - Unit tests app for the `tns-core-modules`.
1011
- `tns-platform-declarations` - TypeScript definitions for Android and iOS native APIs.
1112

@@ -18,6 +19,9 @@ Managing dependencies:
1819
- `apps` depends on:
1920
- `tns-platform-declarations`
2021
- `tns-core-modules`
22+
- `e2e` depends on:
23+
- `tns-platform-declarations`
24+
- `tns-core-modules`
2125
- `tests` depends on:
2226
- `tns-platform-declarations`
2327
- `tns-core-modules`
@@ -26,22 +30,27 @@ Managing dependencies:
2630
this dependency contains native code and is rarely modified so for now it remains outside this repo.
2731

2832
## Initial Setup
33+
2934
Clone (or fork/clone) the repo:
35+
3036
```bash
3137
git clone https://github.com/NativeScript/NativeScript.git
3238
```
3339

3440
Install devDependencies:
41+
3542
```bash
3643
npm install
3744
```
3845

39-
Run setup script. This will [`npm link`](https://docs.npmjs.com/cli/link) the `tns-core-modules` and `tns-core-modules-declarations` dependencies inside the `tests` and `apps` projects.
46+
Run `setup` script. This will [`npm link`](https://docs.npmjs.com/cli/link) the `tns-core-modules` and `tns-core-modules-declarations` dependencies inside the `tests`, `apps` and `e2e` projects.
47+
4048
```bash
4149
npm run setup
4250
```
4351

4452
## TypeScript
53+
4554
The following commands are commonly used to compile the `tns-core-modules`:
4655
```bash
4756
# Full tsc with type checking ~22.2s.
@@ -55,18 +64,22 @@ tsc --skipLibCheck -w
5564
```
5665

5766
The modules have `typescript` as a devDependency so you should also be able to use the locally installed TypeScript compiler from node_modules:
67+
5868
```bash
5969
./node_modules/.bin/tsc
6070
```
6171

62-
You can compile the TypeScript files in the `tns-core-modules`, `tns-platform-declarations`, `apps` and `tests` at once at the root of the repo:
72+
You can compile the TypeScript files in the `tns-core-modules`, `tns-platform-declarations`, `apps`, `e2e` and `tests` at once at the root of the repo:
73+
6374
```bash
6475
npm run tsc
6576
```
6677

6778
## Running Unit Tests
79+
6880
The test app is an ordinary NativeScript app that logs the test results as it go.
6981
After the [initial setup](#initial-setup) you can run the tests with:
82+
7083
```bash
7184
# Make sure TypeScript is transpiled
7285
tsc
@@ -91,6 +104,7 @@ tns run android --path apps
91104
```
92105

93106
## Running Another App
107+
94108
The [initial setup](#initial-setup) will `npm-link` the `tns-core-modules` globally. You can use it in any local project:
95109

96110
```bash
@@ -101,25 +115,33 @@ npm link tns-core-modules
101115
tns run ios
102116
tns run android
103117
```
104-
>Note: You still have to rebuild the TypeScript if you have made changes in the code of the core-modules.
118+
119+
> Note: You still have to rebuild the TypeScript if you have made changes in the code of the core-modules.
105120
106121

107122
## Platform declarations
108123
To update the platform declarations (the ios.d.ts-es) you can run:
124+
109125
```
110126
npm install
111127
npm run dev-declarations
112128
```
129+
113130
This script will update the iOS declarations. Android tools are not integrated yet.
114131
The declarations are generated from the test app and will include the native code from tns-core-modules-widgets.
115132

116133
# Documentation API reference
134+
117135
The following will build the API reference pages in `bin/dist/apiref`:
136+
118137
```
119138
npm run typedoc
120139
```
140+
121141
If you want to improve on the documentation you can also build and start up dev web server:
142+
122143
```
123144
npm run dev-typedoc
124145
```
146+
125147
The terminal will point the address you can open in your web browsed.

apps/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"nativescript": {
77
"id": "org.nativescript.apps",
88
"tns-ios": {
9-
"version": "3.2.0"
9+
"version": "3.4.1"
1010
},
1111
"tns-android": {
12-
"version": "3.2.0"
12+
"version": "3.4.1"
1313
}
1414
},
1515
"dependencies": {
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
8+
{
9+
"name": "Launch on iOS",
10+
"type": "nativescript",
11+
"request": "launch",
12+
"platform": "ios",
13+
"appRoot": "${workspaceRoot}",
14+
"sourceMaps": true,
15+
"stopOnEntry": true,
16+
"tnsArgs": [
17+
"--syncAllFiles"
18+
],
19+
"watch": true
20+
},
21+
{
22+
"name": "Attach on iOS",
23+
"type": "nativescript",
24+
"request": "attach",
25+
"platform": "ios",
26+
"appRoot": "${workspaceRoot}",
27+
"sourceMaps": true,
28+
"stopOnEntry": true,
29+
"tnsArgs": [
30+
"--syncAllFiles"
31+
],
32+
"watch": false
33+
},
34+
{
35+
"name": "Launch on Android",
36+
"type": "nativescript",
37+
"request": "launch",
38+
"platform": "android",
39+
"appRoot": "${workspaceRoot}",
40+
"sourceMaps": true,
41+
"stopOnEntry": true,
42+
"tnsArgs": [
43+
"--syncAllFiles"
44+
],
45+
"watch": true
46+
},
47+
{
48+
"name": "Attach on Android",
49+
"type": "nativescript",
50+
"request": "attach",
51+
"platform": "android",
52+
"appRoot": "${workspaceRoot}",
53+
"sourceMaps": true,
54+
"stopOnEntry": true,
55+
"tnsArgs": [
56+
"--syncAllFiles"
57+
],
58+
"watch": false
59+
}
60+
]
61+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="__PACKAGE__"
4+
android:versionCode="1"
5+
android:versionName="1.0">
6+
7+
<supports-screens
8+
android:smallScreens="true"
9+
android:normalScreens="true"
10+
android:largeScreens="true"
11+
android:xlargeScreens="true"/>
12+
13+
<uses-sdk
14+
android:minSdkVersion="17"
15+
android:targetSdkVersion="__APILEVEL__"/>
16+
17+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
18+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
19+
<uses-permission android:name="android.permission.INTERNET"/>
20+
21+
<application
22+
android:name="com.tns.NativeScriptApplication"
23+
android:allowBackup="true"
24+
android:icon="@drawable/icon"
25+
android:label="@string/app_name"
26+
android:theme="@style/AppTheme">
27+
28+
<activity
29+
android:name="com.tns.NativeScriptActivity"
30+
android:label="@string/title_activity_kimera"
31+
android:configChanges="keyboardHidden|orientation|screenSize"
32+
android:theme="@style/LaunchScreenTheme">
33+
34+
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
35+
36+
<intent-filter>
37+
<action android:name="android.intent.action.MAIN" />
38+
<category android:name="android.intent.category.LAUNCHER" />
39+
</intent-filter>
40+
</activity>
41+
<activity android:name="com.tns.ErrorReportActivity"/>
42+
</application>
43+
</manifest>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Add your native dependencies here:
2+
3+
// Uncomment to add recyclerview-v7 dependency
4+
//dependencies {
5+
// compile 'com.android.support:recyclerview-v7:+'
6+
//}
7+
8+
android {
9+
defaultConfig {
10+
generatedDensities = []
11+
applicationId = "org.nativescript.modalnavigation"
12+
}
13+
aaptOptions {
14+
additionalParameters "--no-version-vectors"
15+
}
16+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="fill">
2+
<item>
3+
<bitmap android:gravity="fill" android:src="@drawable/background" />
4+
</item>
5+
<item>
6+
<bitmap android:gravity="center" android:src="@drawable/logo" />
7+
</item>
8+
</layer-list>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="ns_accent">#3d5afe</color>
4+
</resources>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
4+
<!-- Application theme -->
5+
<style name="AppTheme" parent="AppThemeBase">
6+
<item name="android:datePickerStyle">@style/SpinnerDatePicker</item>
7+
<item name="android:timePickerStyle">@style/SpinnerTimePicker</item>
8+
</style>
9+
10+
<!-- Default style for DatePicker - in spinner mode -->
11+
<style name="SpinnerDatePicker" parent="android:Widget.Material.Light.DatePicker">
12+
<item name="android:datePickerMode">spinner</item>
13+
</style>
14+
15+
<!-- Default style for TimePicker - in spinner mode -->
16+
<style name="SpinnerTimePicker" parent="android:Widget.Material.Light.TimePicker">
17+
<item name="android:timePickerMode">spinner</item>
18+
</style>
19+
20+
<style name="NativeScriptToolbarStyle" parent="NativeScriptToolbarStyleBase">
21+
<item name="android:elevation">4dp</item>
22+
</style>
23+
</resources>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="ns_primary">#F5F5F5</color>
4+
<color name="ns_primaryDark">#757575</color>
5+
<color name="ns_accent">#33B5E5</color>
6+
<color name="ns_blue">#272734</color>
7+
</resources>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<!-- theme to use FOR launch screen-->
5+
<style name="LaunchScreenThemeBase" parent="Theme.AppCompat.Light.NoActionBar">
6+
<item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>
7+
8+
<item name="colorPrimary">@color/ns_primary</item>
9+
<item name="colorPrimaryDark">@color/ns_primaryDark</item>
10+
<item name="colorAccent">@color/ns_accent</item>
11+
12+
<item name="android:windowBackground">@drawable/splash_screen</item>
13+
14+
<item name="android:windowActionBarOverlay">true</item>
15+
<item name="android:windowTranslucentStatus">true</item>
16+
17+
</style>
18+
19+
<style name="LaunchScreenTheme" parent="LaunchScreenThemeBase">
20+
</style>
21+
22+
<!-- theme to use AFTER launch screen is loaded-->
23+
<style name="AppThemeBase" parent="Theme.AppCompat.Light.NoActionBar">
24+
<item name="toolbarStyle">@style/NativeScriptToolbarStyle</item>
25+
26+
<item name="colorPrimary">@color/ns_primary</item>
27+
<item name="colorPrimaryDark">@color/ns_primaryDark</item>
28+
<item name="colorAccent">@color/ns_accent</item>
29+
30+
</style>
31+
32+
<style name="AppTheme" parent="AppThemeBase">
33+
</style>
34+
35+
<!-- theme for action-bar -->
36+
<style name="NativeScriptToolbarStyleBase" parent="Widget.AppCompat.Toolbar">
37+
<item name="android:background">@color/ns_primary</item>
38+
<item name="theme">@style/ThemeOverlay.AppCompat.ActionBar</item>
39+
<item name="popupTheme">@style/ThemeOverlay.AppCompat</item>
40+
41+
</style>
42+
43+
<style name="NativeScriptToolbarStyle" parent="NativeScriptToolbarStyleBase">
44+
</style>
45+
</resources>

0 commit comments

Comments
 (0)