Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 999232e

Browse files
authored
refactor: get app directory from CLI (#459)
* refactor: get app directory from CLI * test: refactor to use NativeScriptCommonModule instead of NativeScriptModule * fix: return right value from shouldSnapshot * fix: get project data safely * refactor: get projectDir directly from projectData * refactor: export APP_DIR constant from projectHelpers * fix: default value for args for safeGet function * test: set single appium configuration file for all demo apps * tests: fix appium capabilities * chore: fix typo by e2e script
1 parent efaafc6 commit 999232e

26 files changed

+345
-133
lines changed

demo/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
node_modules
22
platforms
3+
testapp
4+
*-report.*
5+
36
hooks
47
report
58

demo/AngularApp/app/ninjas/details/ninja.module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { NativeScriptCommonModule } from "nativescript-angular/common";
12
import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
2-
import { NativeScriptModule } from "nativescript-angular/nativescript.module";
33
import { NativeScriptRouterModule } from "nativescript-angular/router";
44

55
import { NinjaComponent } from "./ninja.component";
@@ -8,9 +8,9 @@ import { routes } from "./ninja.routes";
88
@NgModule({
99
schemas: [NO_ERRORS_SCHEMA],
1010
imports: [
11-
NativeScriptModule,
1211
NativeScriptRouterModule,
13-
NativeScriptRouterModule.forChild(routes)
12+
NativeScriptRouterModule.forChild(routes),
13+
NativeScriptCommonModule,
1414
],
1515
declarations: [NinjaComponent]
1616
})

demo/AngularApp/app/ninjas/ninjas.module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { NativeScriptCommonModule } from "nativescript-angular/common";
12
import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
2-
import { NativeScriptModule } from "nativescript-angular/nativescript.module";
33
import { NativeScriptRouterModule } from "nativescript-angular/router";
44

55
import { NinjasComponent } from "./ninjas.component";
@@ -8,9 +8,9 @@ import { routes } from "./ninjas.routes";
88
@NgModule({
99
schemas: [NO_ERRORS_SCHEMA],
1010
imports: [
11-
NativeScriptModule,
1211
NativeScriptRouterModule,
13-
NativeScriptRouterModule.forChild(routes)
12+
NativeScriptRouterModule.forChild(routes),
13+
NativeScriptCommonModule,
1414
],
1515
declarations: [NinjasComponent]
1616
})

demo/AngularApp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"build-ios-bundle": "npm run ns-bundle --ios --build-app",
6969
"publish-ios-bundle": "npm run ns-bundle --ios --publish-app",
7070
"generate-android-snapshot": "generate-android-snapshot --targetArchs arm,arm64,ia32 --install",
71-
"e2e": "tsc -p e2e && mocha --opts ./e2e/config/mocha.opts",
71+
"e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json",
7272
"compile-tests": "tsc -p e2e --watch"
7373
}
7474
}

demo/JavaScriptApp/e2e/config/mocha.opts

Lines changed: 0 additions & 4 deletions
This file was deleted.

demo/JavaScriptApp/package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
"css-loader": "~0.28.7",
2525
"extract-text-webpack-plugin": "~3.0.0",
2626
"lazy": "1.0.11",
27+
"mocha": "~3.5.0",
28+
"mocha-junit-reporter": "^1.13.0",
29+
"mocha-multi": "^0.11.0",
2730
"nativescript-dev-appium": "next",
2831
"nativescript-dev-sass": "^1.3.5",
2932
"nativescript-dev-webpack": "file:../..",
@@ -32,9 +35,9 @@
3235
"raw-loader": "~0.5.1",
3336
"resolve-url-loader": "~2.1.0",
3437
"sass-loader": "^6.0.6",
35-
"webpack": "~3.8.1",
36-
"webpack-bundle-analyzer": "^2.8.2",
37-
"webpack-sources": "~1.0.1"
38+
"webpack": "~3.10.0",
39+
"webpack-bundle-analyzer": "^2.9.1",
40+
"webpack-sources": "^1.1.0"
3841
},
3942
"scripts": {
4043
"ns-bundle": "ns-bundle",
@@ -44,6 +47,6 @@
4447
"build-ios-bundle": "npm run ns-bundle --ios --build-app",
4548
"publish-ios-bundle": "npm run ns-bundle --ios --publish-app",
4649
"generate-android-snapshot": "generate-android-snapshot --targetArchs arm,arm64,ia32 --install",
47-
"e2e": "mocha --opts ./e2e/config/mocha.opts"
50+
"e2e": "mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json"
4851
}
49-
}
52+
}

demo/TypeScriptApp/e2e/config/mocha.opts

Lines changed: 0 additions & 4 deletions
This file was deleted.

demo/TypeScriptApp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"build-ios-bundle": "npm run ns-bundle --ios --build-app",
5454
"publish-ios-bundle": "npm run ns-bundle --ios --publish-app",
5555
"generate-android-snapshot": "generate-android-snapshot --targetArchs arm,arm64,ia32 --install",
56-
"e2e": "tsc -p e2e && mocha --opts ./e2e/config/mocha.opts",
56+
"e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json",
5757
"compile-tests": "tsc -p e2e --watch"
5858
}
5959
}

demo/AngularApp/e2e/config/appium.capabilities.json renamed to demo/config/appium.capabilities.json

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@
7171
"fullReset": false,
7272
"app": ""
7373
},
74+
"android27": {
75+
"platformName": "Android",
76+
"platformVersion": "27",
77+
"deviceName": "Emulator-Api27-Google",
78+
"avd": "Emulator-Api27-Google",
79+
"lt": 60000,
80+
"appActivity": "com.tns.NativeScriptActivity",
81+
"newCommandTimeout": 720,
82+
"noReset": true,
83+
"fullReset": false,
84+
"app": ""
85+
},
7486
"sim.iPhone7.iOS100": {
7587
"platformName": "iOS",
7688
"platformVersion": "10.0",
@@ -79,6 +91,14 @@
7991
"fullReset": false,
8092
"app": ""
8193
},
94+
"sim.iPhone7.iOS110": {
95+
"platformName": "iOS",
96+
"platformVersion": "11.2",
97+
"deviceName": "iPhone 7 110",
98+
"noReset": true,
99+
"fullReset": false,
100+
"app": ""
101+
},
82102
"sim.iPhone8.iOS110": {
83103
"platformName": "iOS",
84104
"platformVersion": "11.2",
@@ -90,17 +110,17 @@
90110
"sim.iPhoneX.iOS110": {
91111
"platformName": "iOS",
92112
"platformVersion": "11.2",
93-
"deviceName": "iPhone X",
113+
"deviceName": "iPhone X 110",
94114
"noReset": true,
95115
"fullReset": false,
96116
"app": ""
97117
},
98118
"sim.iPhoneX.iOS111": {
99119
"platformName": "iOS",
100120
"platformVersion": "11.1",
101-
"deviceName": "iPhone X",
121+
"deviceName": "iPhone X 111",
102122
"noReset": true,
103123
"fullReset": false,
104124
"app": ""
105125
}
106-
}
126+
}
File renamed without changes.

0 commit comments

Comments
 (0)